@commercetools-uikit/filters 20.2.2 → 20.3.0
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.
|
@@ -244,8 +244,8 @@ const TriggerButton = /*#__PURE__*/react$1.forwardRef(function TriggerButton(pro
|
|
|
244
244
|
css: [triggerWrapper, isDisabled && disabled, "" , "" ],
|
|
245
245
|
children: [jsxRuntime.jsxs("label", {
|
|
246
246
|
css: label,
|
|
247
|
-
htmlFor:
|
|
248
|
-
id:
|
|
247
|
+
htmlFor: "".concat(filterKey, "-menu-trigger"),
|
|
248
|
+
id: "".concat(filterKey, "-menu-label"),
|
|
249
249
|
children: [label$1, ":", operatorLabel && jsxRuntime.jsx("span", {
|
|
250
250
|
css: operatorContainer,
|
|
251
251
|
children: operatorLabel
|
|
@@ -253,7 +253,7 @@ const TriggerButton = /*#__PURE__*/react$1.forwardRef(function TriggerButton(pro
|
|
|
253
253
|
}), filtersApplied && jsxRuntime.jsxs("ul", {
|
|
254
254
|
ref: setContainerRef,
|
|
255
255
|
css: valuesContainer,
|
|
256
|
-
"aria-label":
|
|
256
|
+
"aria-label": "".concat(filterKey, " selected values"),
|
|
257
257
|
"aria-live": "polite",
|
|
258
258
|
children: [_mapInstanceProperty__default["default"](values).call(values, value => jsxRuntime.jsx(Chip, {
|
|
259
259
|
label: value.label,
|
|
@@ -263,20 +263,20 @@ const TriggerButton = /*#__PURE__*/react$1.forwardRef(function TriggerButton(pro
|
|
|
263
263
|
css: badgeContainer,
|
|
264
264
|
children: jsxRuntime.jsx(Badge, {
|
|
265
265
|
id: "ui-kit-filter-trigger-overflow-count-badge",
|
|
266
|
-
label:
|
|
266
|
+
label: "+".concat(overflowCount),
|
|
267
267
|
isDisabled: isDisabled
|
|
268
268
|
})
|
|
269
269
|
})]
|
|
270
270
|
}), !filtersApplied && jsxRuntime.jsx(icons.CaretDownIcon, {
|
|
271
|
-
"aria-label":
|
|
271
|
+
"aria-label": "toggle filter menu icon",
|
|
272
272
|
size: "small",
|
|
273
273
|
color: "neutral60"
|
|
274
274
|
}), jsxRuntime.jsx("button", _objectSpread(_objectSpread({
|
|
275
275
|
css: [mainActionButton, "" , "" ],
|
|
276
276
|
ref: ref,
|
|
277
|
-
id:
|
|
277
|
+
id: "".concat(filterKey, "-menu-trigger"),
|
|
278
278
|
"aria-disabled": isDisabled,
|
|
279
|
-
"aria-labelledby":
|
|
279
|
+
"aria-labelledby": "".concat(filterKey, "-menu-label")
|
|
280
280
|
}, rest), isDisabled && {
|
|
281
281
|
tabIndex: -1,
|
|
282
282
|
disabled: true,
|
|
@@ -286,7 +286,7 @@ const TriggerButton = /*#__PURE__*/react$1.forwardRef(function TriggerButton(pro
|
|
|
286
286
|
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
287
287
|
icon: jsxRuntime.jsx(icons.CloseBoldIcon, {}),
|
|
288
288
|
size: "10",
|
|
289
|
-
label:
|
|
289
|
+
label: "remove ".concat(label$1, " filter"),
|
|
290
290
|
isDisabled: props.isDisabled,
|
|
291
291
|
onClick: e => {
|
|
292
292
|
e.stopPropagation();
|
|
@@ -298,7 +298,7 @@ const TriggerButton = /*#__PURE__*/react$1.forwardRef(function TriggerButton(pro
|
|
|
298
298
|
});
|
|
299
299
|
var TriggerButton$1 = TriggerButton;
|
|
300
300
|
|
|
301
|
-
const FOCUSABLE_CSS_SELECTOR =
|
|
301
|
+
const FOCUSABLE_CSS_SELECTOR = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), *[tabindex], *[contenteditable]";
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
304
|
* Find the first focusable element in the given container,
|
|
@@ -331,7 +331,8 @@ function FilterMenu(props) {
|
|
|
331
331
|
return jsxRuntime.jsxs(Popover__namespace.Root, {
|
|
332
332
|
defaultOpen: props.isDisabled ? false : props.defaultOpen,
|
|
333
333
|
onOpenChange: open => {
|
|
334
|
-
|
|
334
|
+
var _props$appliedFilterV;
|
|
335
|
+
if (!open && !((_props$appliedFilterV = props.appliedFilterValues) !== null && _props$appliedFilterV !== void 0 && _props$appliedFilterV.length) && !props.isPersistent && props.onRemoveRequest) {
|
|
335
336
|
props.onRemoveRequest();
|
|
336
337
|
}
|
|
337
338
|
},
|
|
@@ -418,10 +419,6 @@ function getFilterOptions(filters, filterGroups) {
|
|
|
418
419
|
return [formattedOption, ...filterOptions];
|
|
419
420
|
}, filterOptions);
|
|
420
421
|
}
|
|
421
|
-
var _ref9 = {
|
|
422
|
-
name: "1lv1yo7",
|
|
423
|
-
styles: "display:inline-flex"
|
|
424
|
-
} ;
|
|
425
422
|
function Filters(_ref) {
|
|
426
423
|
var _context, _context2;
|
|
427
424
|
let appliedFilters = _ref.appliedFilters,
|
|
@@ -516,7 +513,7 @@ function Filters(_ref) {
|
|
|
516
513
|
alignItems: "center",
|
|
517
514
|
children: [jsxRuntime.jsx("div", {
|
|
518
515
|
css: /*#__PURE__*/react.css({
|
|
519
|
-
maxWidth:
|
|
516
|
+
maxWidth: "".concat(designSystem.designTokens.constraint16)
|
|
520
517
|
}, "" , "" ),
|
|
521
518
|
children: renderSearchComponent
|
|
522
519
|
}), jsxRuntime.jsxs(Spacings__default["default"].Inline, {
|
|
@@ -528,7 +525,7 @@ function Filters(_ref) {
|
|
|
528
525
|
onClick: handleFiltersClick
|
|
529
526
|
}), appliedFilters.length > 0 && !showFilterControls && jsxRuntime.jsx(Badge, {
|
|
530
527
|
id: 'uikit-filters-selected-filter-count',
|
|
531
|
-
label:
|
|
528
|
+
label: "".concat(appliedFilters.length)
|
|
532
529
|
})]
|
|
533
530
|
})]
|
|
534
531
|
}), jsxRuntime.jsx("hr", {
|
|
@@ -570,18 +567,15 @@ function Filters(_ref) {
|
|
|
570
567
|
}), jsxRuntime.jsxs(Popover__namespace.Root, {
|
|
571
568
|
children: [jsxRuntime.jsx(Popover__namespace.Trigger, {
|
|
572
569
|
asChild: true,
|
|
573
|
-
children: jsxRuntime.jsx("
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
if (onAddFilterRequest) {
|
|
580
|
-
onAddFilterRequest(e);
|
|
581
|
-
}
|
|
582
|
-
setShowFilterControls(true);
|
|
570
|
+
children: jsxRuntime.jsx(FlatButton__default["default"], {
|
|
571
|
+
label: intl.formatMessage(messages.addFilterButtonLabel),
|
|
572
|
+
icon: jsxRuntime.jsx(icons.PlusBoldIcon, {}),
|
|
573
|
+
onClick: e => {
|
|
574
|
+
if (onAddFilterRequest) {
|
|
575
|
+
onAddFilterRequest(e);
|
|
583
576
|
}
|
|
584
|
-
|
|
577
|
+
setShowFilterControls(true);
|
|
578
|
+
}
|
|
585
579
|
})
|
|
586
580
|
}), jsxRuntime.jsx(Popover__namespace.Portal, {
|
|
587
581
|
children: jsxRuntime.jsx(Popover__namespace.Content, {
|
|
@@ -630,7 +624,7 @@ function Filters(_ref) {
|
|
|
630
624
|
Filters.displayName = 'Filters';
|
|
631
625
|
|
|
632
626
|
// NOTE: This string will be replaced on build time with the package version.
|
|
633
|
-
var version = "20.
|
|
627
|
+
var version = "20.3.0";
|
|
634
628
|
|
|
635
629
|
exports["default"] = Filters;
|
|
636
630
|
exports.version = version;
|