@decisiv/ui-components 2.0.1-alpha.8 → 2.0.1-alpha.82
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/lib/atoms/BaseButton/index.d.ts.map +1 -1
- package/lib/atoms/BaseButton/index.js +1 -1
- package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/index.js +19 -2
- package/lib/atoms/BooleanInput/index.test.js +17 -6
- package/lib/atoms/BooleanInput/types.d.ts +2 -0
- package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
- package/lib/atoms/Calendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/index.js +8 -1
- package/lib/atoms/Calendar/index.test.js +70 -40
- package/lib/atoms/InputField/Containers.d.ts +10 -6
- package/lib/atoms/InputField/Containers.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.js +6 -6
- package/lib/atoms/InputField/InputLabel.d.ts +1 -0
- package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
- package/lib/atoms/InputField/InputLabel.js +2 -1
- package/lib/atoms/InputField/index.d.ts +4 -0
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +18 -7
- package/lib/atoms/InputField/index.test.js +91 -0
- package/lib/atoms/InputField/schema.d.ts.map +1 -1
- package/lib/atoms/InputField/schema.js +1 -0
- package/lib/atoms/OptionsList/Category.d.ts +1 -1
- package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Category.js +4 -2
- package/lib/atoms/OptionsList/Footer.d.ts +8 -0
- package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Footer.js +72 -0
- package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Option.js +8 -5
- package/lib/atoms/OptionsList/index.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.js +43 -16
- package/lib/atoms/OptionsList/index.test.js +107 -11
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +4 -0
- package/lib/atoms/OptionsList/types.d.ts +14 -0
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/atoms/RequiredIcon.d.ts +9 -0
- package/lib/atoms/RequiredIcon.d.ts.map +1 -0
- package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
- package/lib/components/Button/schema.d.ts +6 -1
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +9 -4
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/Checkbox/schema.d.ts.map +1 -1
- package/lib/components/Checkbox/schema.js +2 -0
- package/lib/components/Combobox/Target.d.ts.map +1 -1
- package/lib/components/Combobox/Target.js +45 -14
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +182 -64
- package/lib/components/Combobox/index.test.js +358 -135
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +9 -2
- package/lib/components/Combobox/types.d.ts +12 -3
- package/lib/components/Combobox/types.d.ts.map +1 -1
- package/lib/components/DropdownList/index.d.ts +4 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +76 -11
- package/lib/components/DropdownList/propTypes.d.ts +4 -0
- package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
- package/lib/components/DropdownList/propTypes.js +42 -0
- package/lib/components/DropdownList/schema.d.ts.map +1 -1
- package/lib/components/DropdownList/schema.js +5 -0
- package/lib/components/DropdownList/types.d.ts +4 -1
- package/lib/components/DropdownList/types.d.ts.map +1 -1
- package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
- package/lib/components/Filter/IconWrapper/index.js +35 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
- package/lib/components/Filter/SimplePrimary/index.js +58 -0
- package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
- package/lib/components/Filter/StyledFilter.d.ts +4 -0
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
- package/lib/components/Filter/StyledFilter.js +39 -0
- package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
- package/lib/components/Filter/StyledLabel/index.js +30 -0
- package/lib/components/Filter/index.d.ts +27 -0
- package/lib/components/Filter/index.d.ts.map +1 -0
- package/lib/components/Filter/index.js +95 -0
- package/lib/components/Filter/index.test.js +41 -0
- package/lib/components/Filter/kind.d.ts +6 -0
- package/lib/components/Filter/kind.d.ts.map +1 -0
- package/lib/components/Filter/kind.js +45 -0
- package/lib/components/Filter/schema.d.ts +9 -0
- package/lib/components/Filter/schema.d.ts.map +1 -0
- package/lib/components/Filter/schema.js +32 -0
- package/lib/components/Filter/types.d.ts +17 -0
- package/lib/components/Filter/types.d.ts.map +1 -0
- package/lib/components/Filter/types.js +1 -0
- package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ClickArea.js +2 -2
- package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
- package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
- package/lib/components/LeftNav/Item/types.d.ts +1 -1
- package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
- package/lib/components/LeftNav/index.test.js +13 -3
- package/lib/components/LeftNav/schema.d.ts.map +1 -1
- package/lib/components/LeftNav/schema.js +2 -0
- package/lib/components/LeftNav/types.d.ts +1 -0
- package/lib/components/LeftNav/types.d.ts.map +1 -1
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +3 -1
- package/lib/components/Menu/types.d.ts +2 -0
- package/lib/components/Menu/types.d.ts.map +1 -1
- package/lib/components/Modal/components.d.ts +2 -2
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +5 -5
- package/lib/components/Modal/index.test.js +32 -0
- package/lib/components/Modal/schema.d.ts.map +1 -1
- package/lib/components/Modal/schema.js +2 -2
- package/lib/components/Modal/types.d.ts +2 -2
- package/lib/components/Modal/types.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/components.d.ts +3 -3
- package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/components.js +12 -6
- package/lib/components/Notifications/Notification/index.d.ts +3 -6
- package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/index.js +19 -12
- package/lib/components/Notifications/Notification/index.test.js +38 -19
- package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
- package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
- package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
- package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
- package/lib/components/Notifications/Notifier.test.js +79 -10
- package/lib/components/Notifications/constants.d.ts +2 -0
- package/lib/components/Notifications/constants.d.ts.map +1 -0
- package/lib/components/Notifications/constants.js +16 -0
- package/lib/components/Notifications/schema.d.ts.map +1 -1
- package/lib/components/Notifications/schema.js +2 -1
- package/lib/components/Notifications/useNotifications.d.ts +1 -0
- package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
- package/lib/components/Notifications/useNotifications.js +3 -3
- package/lib/components/Notifications/useNotifications.test.js +7 -4
- package/lib/components/Pagination/Pagination.d.ts +1 -1
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +1 -0
- package/lib/components/Pagination/Pagination.test.js +9 -0
- package/lib/components/Popover/utils.d.ts +1 -1
- package/lib/components/Select/Target.js +1 -1
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js +20 -1
- package/lib/components/Select/index.test.js +31 -9
- package/lib/components/Select/schema.d.ts.map +1 -1
- package/lib/components/Select/schema.js +5 -0
- package/lib/components/Select/types.d.ts +2 -1
- package/lib/components/Select/types.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.js +1 -1
- package/lib/components/SelectDate/index.test.js +71 -51
- package/lib/components/SelectDateRange/index.test.js +78 -58
- package/lib/components/SelectMenu/index.d.ts +5 -0
- package/lib/components/SelectMenu/index.d.ts.map +1 -1
- package/lib/components/SelectMenu/index.js +27 -3
- package/lib/components/SelectMenu/schema.d.ts.map +1 -1
- package/lib/components/SelectMenu/schema.js +4 -0
- package/lib/components/Table/Body.d.ts.map +1 -1
- package/lib/components/Table/Body.js +182 -38
- package/lib/components/Table/Container.d.ts.map +1 -1
- package/lib/components/Table/Container.js +2 -2
- package/lib/components/Table/DataRow.d.ts.map +1 -1
- package/lib/components/Table/DataRow.js +43 -16
- package/lib/components/Table/DraggableWrapper.d.ts +5 -0
- package/lib/components/Table/DraggableWrapper.d.ts.map +1 -0
- package/lib/components/Table/DraggableWrapper.js +38 -0
- package/lib/components/Table/Grip.d.ts +4 -0
- package/lib/components/Table/Grip.d.ts.map +1 -0
- package/lib/components/Table/Grip.js +30 -0
- package/lib/components/Table/Head.d.ts +1 -1
- package/lib/components/Table/Head.d.ts.map +1 -1
- package/lib/components/Table/Head.js +11 -5
- package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/index.js +22 -8
- package/lib/components/Table/HeaderCell/types.d.ts +6 -1
- package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
- package/lib/components/Table/Provider.d.ts +13 -4
- package/lib/components/Table/Provider.d.ts.map +1 -1
- package/lib/components/Table/Provider.js +45 -5
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js +112 -18
- package/lib/components/Table/index.test.js +330 -84
- package/lib/components/Table/schema.columns.d.ts.map +1 -1
- package/lib/components/Table/schema.columns.js +6 -4
- package/lib/components/Table/schema.d.ts.map +1 -1
- package/lib/components/Table/schema.js +8 -6
- package/lib/components/Table/types.d.ts +34 -4
- package/lib/components/Table/types.d.ts.map +1 -1
- package/lib/components/Table/utils.d.ts +2 -8
- package/lib/components/Table/utils.d.ts.map +1 -1
- package/lib/components/Table/utils.js +21 -20
- package/lib/components/Tag/types.d.ts +1 -1
- package/lib/components/Tag/types.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextArea/index.js +1 -0
- package/lib/components/TextArea/index.test.js +5 -0
- package/lib/components/TextField/Input.js +1 -1
- package/lib/components/TextField/index.test.js +5 -0
- package/lib/components/Toggle/index.d.ts.map +1 -1
- package/lib/components/Toggle/index.js +4 -0
- package/lib/components/Toggle/index.test.js +39 -10
- package/lib/components/TopNav/BrandInfo/index.d.ts +2 -1
- package/lib/components/TopNav/BrandInfo/index.d.ts.map +1 -1
- package/lib/components/TopNav/BrandInfo/index.js +9 -1
- package/lib/components/TopNav/BrandInfo/schema.d.ts.map +1 -1
- package/lib/components/TopNav/BrandInfo/schema.js +4 -1
- package/lib/components/TopNav/index.test.js +28 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +9 -0
- package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/index.js +5 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +1 -1
- package/lib/providers/NotificationsProvider/index.d.ts +6 -5
- package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
- package/lib/providers/NotificationsProvider/index.js +47 -28
- package/lib/providers/NotificationsProvider/types.d.ts +4 -1
- package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
- package/lib/utils/joinClassnames.d.ts +3 -0
- package/lib/utils/joinClassnames.d.ts.map +1 -0
- package/lib/utils/joinClassnames.js +26 -0
- package/package.json +4 -2
- package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
- package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
|
@@ -41,6 +41,8 @@ var item0Id = '0';
|
|
|
41
41
|
var item0Label = 'Option 0';
|
|
42
42
|
var item2Id = '2';
|
|
43
43
|
var item2Label = 'Option 2';
|
|
44
|
+
var disabledItemLabel = 'Option 4';
|
|
45
|
+
var disabledItemId = '4';
|
|
44
46
|
var items = [{
|
|
45
47
|
id: item0Id,
|
|
46
48
|
label: item0Label,
|
|
@@ -75,8 +77,8 @@ var items = [{
|
|
|
75
77
|
}, {
|
|
76
78
|
label: 'Category 2',
|
|
77
79
|
items: [{
|
|
78
|
-
id:
|
|
79
|
-
label:
|
|
80
|
+
id: disabledItemId,
|
|
81
|
+
label: disabledItemLabel,
|
|
80
82
|
value: '4',
|
|
81
83
|
disabled: true
|
|
82
84
|
}, {
|
|
@@ -189,15 +191,58 @@ describe('OptionsList', function () {
|
|
|
189
191
|
expect(onChange).toHaveBeenCalledWith(selectedItem.id);
|
|
190
192
|
expect(getByLabelText(selectedItem.label)).toBeChecked();
|
|
191
193
|
});
|
|
194
|
+
describe('selecting disabled element with keyboard', function () {
|
|
195
|
+
it('selects an item with Enter or Space key', function () {
|
|
196
|
+
var onChange = jest.fn();
|
|
197
|
+
var onlyDisabledItems = [{
|
|
198
|
+
id: '2',
|
|
199
|
+
label: 'Option 2',
|
|
200
|
+
value: '2',
|
|
201
|
+
disabled: true
|
|
202
|
+
}, {
|
|
203
|
+
id: disabledItemId,
|
|
204
|
+
label: disabledItemLabel,
|
|
205
|
+
value: '4',
|
|
206
|
+
disabled: true
|
|
207
|
+
}];
|
|
208
|
+
|
|
209
|
+
var _render5 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
210
|
+
items: onlyDisabledItems,
|
|
211
|
+
onChange: onChange
|
|
212
|
+
}))),
|
|
213
|
+
getByLabelText = _render5.getByLabelText,
|
|
214
|
+
container = _render5.container;
|
|
215
|
+
|
|
216
|
+
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
217
|
+
|
|
218
|
+
_react2.fireEvent.keyDown(container, {
|
|
219
|
+
key: 'Tab'
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
_react2.fireEvent.focus(optionsList);
|
|
223
|
+
|
|
224
|
+
_react2.fireEvent.keyDown(optionsList, {
|
|
225
|
+
key: 'ArrowDown'
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
_react2.fireEvent.keyDown(optionsList, {
|
|
229
|
+
key: 'Enter'
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
expect(onChange).not.toHaveBeenCalledWith(disabledItemId);
|
|
233
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
234
|
+
expect(getByLabelText(disabledItemLabel)).not.toBeChecked();
|
|
235
|
+
});
|
|
236
|
+
});
|
|
192
237
|
describe('single selection', function () {
|
|
193
238
|
it('calls onChange with id when item is clicked', function () {
|
|
194
239
|
var onChange = jest.fn();
|
|
195
240
|
|
|
196
|
-
var
|
|
241
|
+
var _render6 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
197
242
|
onChange: onChange
|
|
198
243
|
}))),
|
|
199
|
-
getByText =
|
|
200
|
-
getByLabelText =
|
|
244
|
+
getByText = _render6.getByText,
|
|
245
|
+
getByLabelText = _render6.getByLabelText;
|
|
201
246
|
|
|
202
247
|
var item = items[0];
|
|
203
248
|
|
|
@@ -212,15 +257,33 @@ describe('OptionsList', function () {
|
|
|
212
257
|
|
|
213
258
|
expect(getByLabelText(subItem.label)).toBeChecked();
|
|
214
259
|
});
|
|
260
|
+
describe('disabled element', function () {
|
|
261
|
+
it('does not calls onChange when item is clicked', function () {
|
|
262
|
+
var onChange = jest.fn();
|
|
263
|
+
|
|
264
|
+
var _render7 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
265
|
+
onChange: onChange
|
|
266
|
+
}))),
|
|
267
|
+
getByText = _render7.getByText,
|
|
268
|
+
getByLabelText = _render7.getByLabelText;
|
|
269
|
+
|
|
270
|
+
_react2.fireEvent.click(getByText(disabledItemLabel));
|
|
271
|
+
|
|
272
|
+
expect(onChange).not.toHaveBeenLastCalledWith(disabledItemId);
|
|
273
|
+
expect(onChange).not.toHaveBeenCalled(); // the item shouldn't be marked as selected
|
|
274
|
+
|
|
275
|
+
expect(getByLabelText(disabledItemLabel)).not.toBeChecked();
|
|
276
|
+
});
|
|
277
|
+
});
|
|
215
278
|
describe('controlled', function () {
|
|
216
279
|
it('prefers value over internal', function () {
|
|
217
280
|
var selected = items[1];
|
|
218
281
|
|
|
219
|
-
var
|
|
282
|
+
var _render8 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
220
283
|
selected: selected.id
|
|
221
284
|
}))),
|
|
222
|
-
getByText =
|
|
223
|
-
getByLabelText =
|
|
285
|
+
getByText = _render8.getByText,
|
|
286
|
+
getByLabelText = _render8.getByLabelText;
|
|
224
287
|
|
|
225
288
|
var item = items[0];
|
|
226
289
|
|
|
@@ -235,12 +298,12 @@ describe('OptionsList', function () {
|
|
|
235
298
|
it('calls onChange with array of selected ids when item is clicked', function () {
|
|
236
299
|
var onChange = jest.fn();
|
|
237
300
|
|
|
238
|
-
var
|
|
301
|
+
var _render9 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
239
302
|
onChange: onChange,
|
|
240
303
|
multiple: true
|
|
241
304
|
}))),
|
|
242
|
-
getByText =
|
|
243
|
-
getByLabelText =
|
|
305
|
+
getByText = _render9.getByText,
|
|
306
|
+
getByLabelText = _render9.getByLabelText;
|
|
244
307
|
|
|
245
308
|
var item = items[0];
|
|
246
309
|
|
|
@@ -259,5 +322,38 @@ describe('OptionsList', function () {
|
|
|
259
322
|
|
|
260
323
|
expect(onChange).toHaveBeenLastCalledWith([subItem.id]);
|
|
261
324
|
});
|
|
325
|
+
it('adds a footer with buttons when actions are provided', function () {
|
|
326
|
+
var onClick = jest.fn();
|
|
327
|
+
var actions = [{
|
|
328
|
+
id: '1',
|
|
329
|
+
text: 'apply',
|
|
330
|
+
onClick: onClick
|
|
331
|
+
}, {
|
|
332
|
+
id: '2',
|
|
333
|
+
text: 'cancel',
|
|
334
|
+
kind: 'secondary',
|
|
335
|
+
onClick: onClick
|
|
336
|
+
}, {
|
|
337
|
+
id: '3',
|
|
338
|
+
text: 'clear',
|
|
339
|
+
kind: 'secondary',
|
|
340
|
+
variant: 'ghost',
|
|
341
|
+
paddingLeft: 4,
|
|
342
|
+
onClick: onClick
|
|
343
|
+
}];
|
|
344
|
+
|
|
345
|
+
var _render10 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
346
|
+
actions: actions,
|
|
347
|
+
multiple: true
|
|
348
|
+
}))),
|
|
349
|
+
baseElement = _render10.baseElement,
|
|
350
|
+
getByText = _render10.getByText;
|
|
351
|
+
|
|
352
|
+
actions.forEach(function (_ref5) {
|
|
353
|
+
var label = _ref5.text;
|
|
354
|
+
return expect(getByText(label)).toBeTruthy();
|
|
355
|
+
});
|
|
356
|
+
expect(baseElement).toMatchSnapshot();
|
|
357
|
+
});
|
|
262
358
|
});
|
|
263
359
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA2C,CAAC;AAoExD,eAAe,MAAM,CAAC"}
|
|
@@ -15,6 +15,10 @@ var schema = (0, _reactDesc.describe)({
|
|
|
15
15
|
schema.makePropTypes = function () {
|
|
16
16
|
return {
|
|
17
17
|
defaultSelected: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.string, _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.string)]).description('These IDs will appear as selected the first time the user opens the dropdown.'),
|
|
18
|
+
actions: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object), _reactDesc.PropTypes.shape({
|
|
19
|
+
left: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object),
|
|
20
|
+
right: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object)
|
|
21
|
+
})]).description('A collection of objects, each containing a subset of props valid for a Button component. Check the notes below.'),
|
|
18
22
|
items: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
|
|
19
23
|
decoration: _reactDesc.PropTypes.shape({
|
|
20
24
|
type: _reactDesc.PropTypes.oneOf(['Avatar', 'Badge', 'Icon'])
|
|
@@ -4,6 +4,7 @@ import { IconProps } from '@decisiv/iconix';
|
|
|
4
4
|
import { AvatarProps } from '../../components/Avatar';
|
|
5
5
|
import { BadgeProps } from '../../components/Badge';
|
|
6
6
|
import { DimensionsProps } from '../../modifiers/dimensions';
|
|
7
|
+
import { ButtonProps } from '../../components/Button';
|
|
7
8
|
export declare type OptionAvatarProps = Omit<AvatarProps, 'ref' | 'size'>;
|
|
8
9
|
export declare type OptionBadgeProps = Omit<BadgeProps, 'size' | 'variant'>;
|
|
9
10
|
export declare type InputMethod = 'mouse' | 'keyboard' | undefined;
|
|
@@ -22,12 +23,21 @@ interface IconDecoration {
|
|
|
22
23
|
icon: IconComponent;
|
|
23
24
|
disabled?: boolean;
|
|
24
25
|
}
|
|
26
|
+
export interface ActionProps extends ButtonProps {
|
|
27
|
+
id: string;
|
|
28
|
+
}
|
|
29
|
+
interface SideActionProps {
|
|
30
|
+
left?: ActionProps[];
|
|
31
|
+
right?: ActionProps[];
|
|
32
|
+
}
|
|
33
|
+
export declare type FooterActions = SideActionProps | ActionProps[];
|
|
25
34
|
export declare type Decoration = AvatarDecoration | BadgeDecoration | IconDecoration;
|
|
26
35
|
export interface Category {
|
|
27
36
|
borderRadius?: BorderRadiusProperty<string>;
|
|
28
37
|
id?: string;
|
|
29
38
|
items: Option[];
|
|
30
39
|
label: string;
|
|
40
|
+
showCheckbox?: boolean;
|
|
31
41
|
}
|
|
32
42
|
export declare type CategoryProps = Category;
|
|
33
43
|
export declare type IconComponent = (props: IconProps) => JSX.Element;
|
|
@@ -37,6 +47,8 @@ interface BaseOption {
|
|
|
37
47
|
disabled?: boolean;
|
|
38
48
|
id: string;
|
|
39
49
|
label: string;
|
|
50
|
+
showCheckbox?: boolean;
|
|
51
|
+
meta?: object;
|
|
40
52
|
}
|
|
41
53
|
export interface ItemOption extends BaseOption {
|
|
42
54
|
value?: string;
|
|
@@ -49,6 +61,7 @@ export declare type OptionProps = Option;
|
|
|
49
61
|
export declare type Item = Category | Option;
|
|
50
62
|
export interface OptionsListProps extends OptionsListDimensions {
|
|
51
63
|
items: Item[];
|
|
64
|
+
actions?: FooterActions;
|
|
52
65
|
name?: string;
|
|
53
66
|
multiple?: boolean;
|
|
54
67
|
onChange: (ids: Selection) => void;
|
|
@@ -59,6 +72,7 @@ export interface OptionsListProps extends OptionsListDimensions {
|
|
|
59
72
|
defaultActiveId?: string;
|
|
60
73
|
onChangeActiveItem?: (activeId: string) => void;
|
|
61
74
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
75
|
+
showCheckbox?: boolean;
|
|
62
76
|
tabIndex?: number;
|
|
63
77
|
selectable?: boolean;
|
|
64
78
|
defaultSelected?: Selection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,oBAAY,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC;AAClE,oBAAY,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpE,oBAAY,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAC3D,oBAAY,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAE1C,oBAAY,qBAAqB,GAAG,IAAI,CACtC,eAAe,EACf,UAAU,GAAG,WAAW,GAAG,UAAU,CACtC,CAAC;AAEF,UAAU,gBAAiB,SAAQ,iBAAiB;IAClD,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,eAAgB,SAAQ,gBAAgB;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,oBAAY,aAAa,GAAG,eAAe,GAAG,WAAW,EAAE,CAAC;AAE5D,oBAAY,UAAU,GAAG,gBAAgB,GAAG,eAAe,GAAG,cAAc,CAAC;AAE7E,MAAM,WAAW,QAAQ;IACvB,YAAY,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,oBAAY,aAAa,GAAG,QAAQ,CAAC;AAErC,oBAAY,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAE9D,UAAU,UAAU;IAClB,YAAY,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oBAAY,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAE7C,oBAAY,WAAW,GAAG,MAAM,CAAC;AAEjC,oBAAY,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC,OAAO,CAAC;IAChD,YAAY,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oBAAY,uBAAuB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefForwardingComponent, RefAttributes } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
marginLeft?: string;
|
|
4
|
+
marginTop?: string;
|
|
5
|
+
}
|
|
6
|
+
declare type RequiredIconType = RefForwardingComponent<HTMLDivElement, RefAttributes<HTMLDivElement> & Props>;
|
|
7
|
+
declare const RequiredIcon: RequiredIconType;
|
|
8
|
+
export default RequiredIcon;
|
|
9
|
+
//# sourceMappingURL=RequiredIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequiredIcon.d.ts","sourceRoot":"","sources":["../../src/atoms/RequiredIcon.tsx"],"names":[],"mappings":"AACA,OAAc,EACZ,sBAAsB,EAGtB,aAAa,EACd,MAAM,OAAO,CAAC;AAOf,UAAU,KAAK;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,aAAK,gBAAgB,GAAG,sBAAsB,CAC5C,cAAc,EACd,aAAa,CAAC,cAAc,CAAC,GAAG,KAAK,CACtC,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,gBASnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -21,10 +21,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
21
|
|
|
22
22
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
23
|
|
|
24
|
-
var RequiredIconContainer = _styledComponents.default.
|
|
24
|
+
var RequiredIconContainer = _styledComponents.default.div.withConfig({
|
|
25
25
|
displayName: "RequiredIcon__RequiredIconContainer",
|
|
26
|
-
componentId: "
|
|
27
|
-
})(["margin-left:
|
|
26
|
+
componentId: "sc-18pnvm5-0"
|
|
27
|
+
})(["display:inline;margin-left:", ";margin-top:", ";"], function (props) {
|
|
28
|
+
return props.marginLeft || '3px';
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.marginTop || '0px';
|
|
31
|
+
});
|
|
28
32
|
|
|
29
33
|
var RequiredIcon = (0, _react.forwardRef)(function (props, ref) {
|
|
30
34
|
return _react.default.createElement(RequiredIconContainer, _extends({}, props, {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { Validator } from 'prop-types';
|
|
2
|
+
export declare const makeButtonSchemaPropTypes: (extensions?: {
|
|
3
|
+
[x: string]: Validator<unknown>;
|
|
4
|
+
} | undefined) => {
|
|
5
|
+
[x: string]: Validator<unknown>;
|
|
6
|
+
};
|
|
2
7
|
declare const schema: any;
|
|
3
8
|
export default schema;
|
|
4
9
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Button/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Button/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,eAAO,MAAM,yBAAyB;;;;CAiCpC,CAAC;AAEH,QAAA,MAAM,MAAM,KAAsC,CAAC;AAInD,eAAe,MAAM,CAAC"}
|
|
@@ -7,9 +7,14 @@ exports.default = exports.makeButtonSchemaPropTypes = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _reactDesc = require("react-desc");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
11
|
+
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
|
+
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
|
|
16
|
+
var makeButtonSchemaPropTypes = function makeButtonSchemaPropTypes(extensions) {
|
|
17
|
+
return _objectSpread({
|
|
13
18
|
text: _reactDesc.PropTypes.string.description("The button's text"),
|
|
14
19
|
disabled: _reactDesc.PropTypes.bool.description('Defines if the button will be disabled').defaultValue('false'),
|
|
15
20
|
size: _reactDesc.PropTypes.oneOf(['small', 'medium']).description('Defines the size of the button').defaultValue('medium'),
|
|
@@ -18,7 +23,7 @@ var makeButtonSchemaPropTypes = function makeButtonSchemaPropTypes() {
|
|
|
18
23
|
intent: _reactDesc.PropTypes.oneOf(['success', 'danger']).description('Applies desired hover state of button'),
|
|
19
24
|
kind: _reactDesc.PropTypes.oneOf(['primary', 'secondary']).description('Applies inverted button styles'),
|
|
20
25
|
variant: _reactDesc.PropTypes.oneOf(['normal', 'inverted']).description('Applies secondary button styles')
|
|
21
|
-
};
|
|
26
|
+
}, extensions);
|
|
22
27
|
};
|
|
23
28
|
|
|
24
29
|
exports.makeButtonSchemaPropTypes = makeButtonSchemaPropTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;AAGvE,OAAqB,EACnB,KAAK,IAAI,UAAU,EACnB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAElC,oBAAY,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAQ7C,QAAA,MAAM,eAAe,EAAE,sBAAsB,CAAC,YAAY,EAAE,KAAK,CAEhE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;AAGvE,OAAqB,EACnB,KAAK,IAAI,UAAU,EACnB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAElC,oBAAY,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAQ7C,QAAA,MAAM,eAAe,EAAE,sBAAsB,CAAC,YAAY,EAAE,KAAK,CAEhE,CAAC;AAmBF,eAAe,eAAe,CAAC"}
|
|
@@ -33,13 +33,15 @@ CheckboxWithRef.propTypes = {
|
|
|
33
33
|
label: _propTypes.default.string,
|
|
34
34
|
disabled: _propTypes.default.bool,
|
|
35
35
|
readOnly: _propTypes.default.bool,
|
|
36
|
+
required: _propTypes.default.bool,
|
|
36
37
|
size: _propTypes.default.oneOf(['normal', 'small']),
|
|
37
38
|
status: _propTypes.default.oneOf(['normal', 'warning']),
|
|
38
39
|
warningMessage: _propTypes.default.string
|
|
39
40
|
};
|
|
40
41
|
CheckboxWithRef.defaultProps = {
|
|
41
42
|
size: 'normal',
|
|
42
|
-
status: 'normal'
|
|
43
|
+
status: 'normal',
|
|
44
|
+
required: false
|
|
43
45
|
};
|
|
44
46
|
var _default = CheckboxWithRef;
|
|
45
47
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAwC,CAAC;AA4DrD,eAAe,MAAM,CAAC"}
|
|
@@ -18,6 +18,8 @@ schema.propTypes = {
|
|
|
18
18
|
defaultChecked: _reactDesc.PropTypes.bool.description('Whether or not the checkbox is initially checked. Use if you do not want to manually control the state.').defaultValue('false'),
|
|
19
19
|
disabled: _reactDesc.PropTypes.bool.description('If the checkbox should be disabled and ignore user interactions.').defaultValue('false'),
|
|
20
20
|
readOnly: _reactDesc.PropTypes.bool.description('Ignore user interactions, but still display the label in a readable manner.').defaultValue('false'),
|
|
21
|
+
required: _reactDesc.PropTypes.bool.description('Whether or not the checkbox should be required. Renders an indicator if true.').defaultValue('false'),
|
|
22
|
+
requiredMessage: _reactDesc.PropTypes.string.description('The text to display in the tooltip when hovering over the required icon. It displays "Required" by default').defaultValue('Required'),
|
|
21
23
|
size: _reactDesc.PropTypes.oneOf(['normal', 'small']).description('Controls the size of the checkbox and label.').defaultValue('normal'),
|
|
22
24
|
status: _reactDesc.PropTypes.oneOf(['normal', 'warning']).description('Whether or not to render the warning state.').defaultValue('normal'),
|
|
23
25
|
warningMessage: _reactDesc.PropTypes.string.description('The warning message to display below the checkbox. If provided, the `status` prop is automatically set to `warning`.')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Target.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/Target.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Target.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/Target.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;AAkBvE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiLtC,QAAA,MAAM,aAAa,EAAE,sBAAsB,CACzC,gBAAgB,EAChB,WAAW,CACS,CAAC;AAGvB,eAAe,aAAa,CAAC"}
|
|
@@ -31,6 +31,8 @@ var _Button = _interopRequireDefault(require("../Button"));
|
|
|
31
31
|
|
|
32
32
|
var _Flex = _interopRequireDefault(require("../Flex"));
|
|
33
33
|
|
|
34
|
+
var _Tag = _interopRequireDefault(require("../Tag"));
|
|
35
|
+
|
|
34
36
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
35
37
|
|
|
36
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -44,21 +46,23 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
44
46
|
var TargetContainer = _styledComponents.default.div.withConfig({
|
|
45
47
|
displayName: "Target__TargetContainer",
|
|
46
48
|
componentId: "sc-1obpsql-0"
|
|
47
|
-
})(["align-items:center;display:flex;justify-content:
|
|
49
|
+
})(["align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding-right:15px;", ""], (0, _styleModifiers.when)('hasExpandIndicator', (0, _styledComponents.css)(["padding-right:45px;"])));
|
|
48
50
|
|
|
49
51
|
var Input = _styledComponents.default.input.withConfig({
|
|
50
52
|
displayName: "Target__Input",
|
|
51
53
|
componentId: "sc-1obpsql-1"
|
|
52
|
-
})(["font-family:", ";font-size:", ";font-weight:", ";overflow:visible;&::-moz-focus-inner{border:0;padding:0;margin:0;}background-color:inherit;border:transparent;display:block;line-height:140%;padding:
|
|
54
|
+
})(["font-family:", ";font-size:", ";font-weight:", ";overflow:visible;&::-moz-focus-inner{border:0;padding:0;margin:0;}background-color:inherit;border:transparent;display:block;line-height:140%;padding:0 10px 5px 1px;flex-grow:100;&:active,&:focus{outline:none;}"], _designTokens.typography.typeface.default, (0, _rem.default)(_designTokens.typography.size.alias.default), _designTokens.typography.weight.alias.default);
|
|
53
55
|
|
|
56
|
+
var ClearButtonContainer = (0, _styledComponents.default)(_Flex.default).withConfig({
|
|
57
|
+
displayName: "Target__ClearButtonContainer",
|
|
58
|
+
componentId: "sc-1obpsql-2"
|
|
59
|
+
})(["position:absolute;bottom:0;right:0;padding-bottom:2px;padding-left:10px;padding-right:10px;", ""], (0, _styleModifiers.when)('hasExpandIndicator', (0, _styledComponents.css)(["right:20px;"])));
|
|
54
60
|
var ExpandedIndicatorContainer = (0, _styledComponents.default)(_Flex.default).attrs({
|
|
55
|
-
alignItems: 'center'
|
|
56
|
-
paddingBottom: 0.2,
|
|
57
|
-
paddingRight: 1
|
|
61
|
+
alignItems: 'center'
|
|
58
62
|
}).withConfig({
|
|
59
63
|
displayName: "Target__ExpandedIndicatorContainer",
|
|
60
|
-
componentId: "sc-1obpsql-
|
|
61
|
-
})(["color:", ";&:hover{color:", ";}", ";"], (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _toColorString.default)(_color.default.interaction.indianOcean), (0, _styleModifiers.when)('disabled', (0, _styledComponents.css)(["color:", ";&:hover{color:", ";}"], (0, _toColorString.default)(_color.default.opacity.charcoal40), (0, _toColorString.default)(_color.default.opacity.charcoal40))));
|
|
64
|
+
componentId: "sc-1obpsql-3"
|
|
65
|
+
})(["position:absolute;bottom:2px;right:10px;color:", ";&:hover{color:", ";}", ";"], (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _toColorString.default)(_color.default.interaction.indianOcean), (0, _styleModifiers.when)('disabled', (0, _styledComponents.css)(["color:", ";&:hover{color:", ";}"], (0, _toColorString.default)(_color.default.opacity.charcoal40), (0, _toColorString.default)(_color.default.opacity.charcoal40))));
|
|
62
66
|
|
|
63
67
|
function Target(_ref, ref) {
|
|
64
68
|
var clearButtonLabel = _ref.clearButtonLabel,
|
|
@@ -67,19 +71,46 @@ function Target(_ref, ref) {
|
|
|
67
71
|
inputFieldLabel = _ref.inputFieldLabel,
|
|
68
72
|
isPopoverVisible = _ref.isPopoverVisible,
|
|
69
73
|
onClear = _ref.onClear,
|
|
74
|
+
multiple = _ref.multiple,
|
|
75
|
+
selectedValues = _ref.selectedValues,
|
|
76
|
+
removeSelected = _ref.removeSelected,
|
|
70
77
|
readOnly = _ref.readOnly,
|
|
71
78
|
variant = _ref.variant,
|
|
72
79
|
toggleIsPopoverVisible = _ref.toggleIsPopoverVisible,
|
|
73
|
-
|
|
80
|
+
autoComplete = _ref.autoComplete,
|
|
81
|
+
rest = _objectWithoutProperties(_ref, ["clearButtonLabel", "disabled", "hasClearButton", "inputFieldLabel", "isPopoverVisible", "onClear", "multiple", "selectedValues", "removeSelected", "readOnly", "variant", "toggleIsPopoverVisible", "autoComplete"]);
|
|
74
82
|
|
|
75
83
|
var translate = (0, _useTranslations.default)();
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
var hasExpandIndicator = !readOnly && variant === 'sync';
|
|
85
|
+
return _react.default.createElement(TargetContainer, {
|
|
86
|
+
hasExpandIndicator: hasExpandIndicator
|
|
87
|
+
}, multiple && selectedValues && selectedValues.map(function (_ref2) {
|
|
88
|
+
var id = _ref2.id,
|
|
89
|
+
label = _ref2.label;
|
|
90
|
+
return _react.default.createElement(_Tag.default, {
|
|
91
|
+
key: id,
|
|
92
|
+
text: label,
|
|
93
|
+
style: {
|
|
94
|
+
margin: '2px'
|
|
95
|
+
},
|
|
96
|
+
action: function action(e) {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
e.stopPropagation();
|
|
99
|
+
removeSelected(id);
|
|
100
|
+
},
|
|
101
|
+
color: 'licoriceMousse',
|
|
102
|
+
actionIntent: "danger",
|
|
103
|
+
actionIcon: _Times.default,
|
|
104
|
+
actionAttributes: {
|
|
105
|
+
'aria-label': 'Delete'
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}), _react.default.createElement(Input, _extends({
|
|
109
|
+
autoComplete: autoComplete || 'off',
|
|
78
110
|
disabled: disabled,
|
|
79
111
|
ref: ref
|
|
80
|
-
})), hasClearButton && !readOnly && _react.default.createElement(
|
|
81
|
-
|
|
82
|
-
paddingX: 1
|
|
112
|
+
}, rest)), hasClearButton && !readOnly && _react.default.createElement(ClearButtonContainer, {
|
|
113
|
+
hasExpandIndicator: hasExpandIndicator
|
|
83
114
|
}, _react.default.createElement(_Button.default, {
|
|
84
115
|
"aria-label": translate(clearButtonLabel, 'combobox.clearButtonLabel', {
|
|
85
116
|
label: inputFieldLabel
|
|
@@ -97,7 +128,7 @@ function Target(_ref, ref) {
|
|
|
97
128
|
},
|
|
98
129
|
size: "small",
|
|
99
130
|
variant: "ghost"
|
|
100
|
-
})),
|
|
131
|
+
})), hasExpandIndicator && _react.default.createElement(ExpandedIndicatorContainer, {
|
|
101
132
|
disabled: disabled
|
|
102
133
|
}, _react.default.createElement(_Button.default, {
|
|
103
134
|
variant: "ghost",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/index.tsx"],"names":[],"mappings":"AASA,OAAc,EAGZ,sBAAsB,EAQvB,MAAM,OAAO,CAAC;AA2Bf,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAQ,MAAM,SAAS,CAAC;AAqiBhE,QAAA,MAAM,eAAe,EAAE,sBAAsB,CAC3C,gBAAgB,EAChB,aAAa,CACS,CAAC;AAIzB,eAAe,eAAe,CAAC"}
|