@drivenets/design-system 0.1.0 → 0.2.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.
- package/CHANGELOG.md +10 -0
- package/dist/components/ds-avatar/ds-avatar.cjs +98 -0
- package/dist/components/ds-avatar/ds-avatar.d.cts +12 -0
- package/dist/components/ds-avatar/ds-avatar.d.cts.map +1 -0
- package/dist/components/ds-avatar/ds-avatar.d.ts +12 -0
- package/dist/components/ds-avatar/ds-avatar.d.ts.map +1 -0
- package/dist/components/ds-avatar/ds-avatar.js +97 -0
- package/dist/components/ds-avatar/ds-avatar.js.map +1 -0
- package/dist/components/ds-avatar/ds-avatar.module.cjs +17 -0
- package/dist/components/ds-avatar/ds-avatar.module.js +17 -0
- package/dist/components/ds-avatar/ds-avatar.module.js.map +1 -0
- package/dist/components/ds-avatar/ds-avatar.types.d.cts +44 -0
- package/dist/components/ds-avatar/ds-avatar.types.d.cts.map +1 -0
- package/dist/components/ds-avatar/ds-avatar.types.d.ts +44 -0
- package/dist/components/ds-avatar/ds-avatar.types.d.ts.map +1 -0
- package/dist/components/ds-avatar/index.cjs +1 -0
- package/dist/components/ds-avatar/index.d.ts +2 -0
- package/dist/components/ds-avatar/index.js +1 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.cjs +93 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.d.cts +12 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.d.cts.map +1 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.d.ts +12 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.d.ts.map +1 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.js +92 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.js.map +1 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.module.cjs +19 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.module.js +19 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.module.js.map +1 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.types.d.cts +31 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.types.d.cts.map +1 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.types.d.ts +32 -0
- package/dist/components/ds-avatar-group/ds-avatar-group.types.d.ts.map +1 -0
- package/dist/components/ds-avatar-group/index.cjs +1 -0
- package/dist/components/ds-avatar-group/index.d.ts +2 -0
- package/dist/components/ds-avatar-group/index.js +1 -0
- package/dist/components/ds-button/ds-button.d.ts +2 -2
- package/dist/components/ds-button/ds-button.d.ts.map +1 -1
- package/dist/components/ds-chip/ds-chip.cjs +2 -1
- package/dist/components/ds-chip/ds-chip.d.cts +2 -1
- package/dist/components/ds-chip/ds-chip.d.cts.map +1 -1
- package/dist/components/ds-chip/ds-chip.d.ts +2 -1
- package/dist/components/ds-chip/ds-chip.d.ts.map +1 -1
- package/dist/components/ds-chip/ds-chip.js +2 -1
- package/dist/components/ds-chip/ds-chip.js.map +1 -1
- package/dist/components/ds-chip/ds-chip.types.d.cts +13 -0
- package/dist/components/ds-chip/ds-chip.types.d.cts.map +1 -1
- package/dist/components/ds-chip/ds-chip.types.d.ts +13 -0
- package/dist/components/ds-chip/ds-chip.types.d.ts.map +1 -1
- package/dist/components/ds-chip-group/ds-chip-group.cjs +2 -2
- package/dist/components/ds-chip-group/ds-chip-group.d.cts +2 -2
- package/dist/components/ds-chip-group/ds-chip-group.d.ts +2 -2
- package/dist/components/ds-chip-group/ds-chip-group.js +2 -2
- package/dist/components/ds-chip-group/ds-chip-group.js.map +1 -1
- package/dist/components/ds-chip-group/ds-chip-group.types.d.cts +9 -0
- package/dist/components/ds-chip-group/ds-chip-group.types.d.cts.map +1 -1
- package/dist/components/ds-chip-group/ds-chip-group.types.d.ts +9 -0
- package/dist/components/ds-chip-group/ds-chip-group.types.d.ts.map +1 -1
- package/dist/components/ds-confirmation/ds-confirmation.d.cts +8 -8
- package/dist/components/ds-confirmation/ds-confirmation.d.ts +8 -8
- package/dist/components/ds-date-input/ds-date-input.d.cts +2 -2
- package/dist/components/ds-date-input/ds-date-input.d.cts.map +1 -1
- package/dist/components/ds-date-input/ds-date-input.d.ts +2 -2
- package/dist/components/ds-date-input/ds-date-input.js +2 -2
- package/dist/components/ds-date-input/ds-date-input.js.map +1 -1
- package/dist/components/ds-drawer/ds-drawer.d.cts +9 -9
- package/dist/components/ds-drawer/ds-drawer.d.ts +9 -9
- package/dist/components/ds-drawer/ds-drawer.js +2 -2
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js +3 -3
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js.map +1 -1
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.cts +2 -2
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.ts +2 -2
- package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.cjs +2 -2
- package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.js +2 -2
- package/dist/components/ds-form-control/ds-form-control.d.cts +8 -8
- package/dist/components/ds-modal/ds-modal.d.cts +8 -8
- package/dist/components/ds-panel/ds-panel.d.cts +2 -2
- package/dist/components/ds-panel/ds-panel.d.ts +2 -2
- package/dist/components/ds-select/ds-select.d.cts +2 -2
- package/dist/components/ds-select/ds-select.d.ts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.cts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts.map +1 -1
- package/dist/components/ds-stepper/components/ds-step-content.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-content.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step.d.ts +2 -2
- package/dist/components/ds-stepper/ds-stepper.d.cts +2 -2
- package/dist/components/ds-stepper/ds-stepper.d.ts +2 -2
- package/dist/components/ds-table/ds-table.d.cts +2 -2
- package/dist/components/ds-table/ds-table.d.ts +2 -2
- package/dist/components/ds-tag/ds-tag.cjs +254 -0
- package/dist/components/ds-tag/ds-tag.d.cts +25 -0
- package/dist/components/ds-tag/ds-tag.d.cts.map +1 -0
- package/dist/components/ds-tag/ds-tag.d.ts +25 -0
- package/dist/components/ds-tag/ds-tag.d.ts.map +1 -0
- package/dist/components/ds-tag/ds-tag.js +253 -0
- package/dist/components/ds-tag/ds-tag.js.map +1 -0
- package/dist/components/ds-tag/ds-tag.module.cjs +17 -0
- package/dist/components/ds-tag/ds-tag.module.js +17 -0
- package/dist/components/ds-tag/ds-tag.module.js.map +1 -0
- package/dist/components/ds-tag/ds-tag.types.d.cts +68 -0
- package/dist/components/ds-tag/ds-tag.types.d.cts.map +1 -0
- package/dist/components/ds-tag/ds-tag.types.d.ts +68 -0
- package/dist/components/ds-tag/ds-tag.types.d.ts.map +1 -0
- package/dist/components/ds-tag/index.cjs +1 -0
- package/dist/components/ds-tag/index.d.ts +2 -0
- package/dist/components/ds-tag/index.js +1 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.cjs +325 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.d.cts +24 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.d.cts.map +1 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.d.ts +24 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.d.ts.map +1 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.js +324 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.js.map +1 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.module.cjs +17 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.module.js +17 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.module.js.map +1 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.types.d.cts +71 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.types.d.cts.map +1 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.types.d.ts +72 -0
- package/dist/components/ds-tag-filter/ds-tag-filter.types.d.ts.map +1 -0
- package/dist/components/ds-tag-filter/hooks/use-tag-overflow-calculation.cjs +137 -0
- package/dist/components/ds-tag-filter/hooks/use-tag-overflow-calculation.js +137 -0
- package/dist/components/ds-tag-filter/hooks/use-tag-overflow-calculation.js.map +1 -0
- package/dist/components/ds-tag-filter/index.cjs +1 -0
- package/dist/components/ds-tag-filter/index.d.ts +2 -0
- package/dist/components/ds-tag-filter/index.js +1 -0
- package/dist/components/ds-tag-filter/utils.cjs +54 -0
- package/dist/components/ds-tag-filter/utils.js +52 -0
- package/dist/components/ds-tag-filter/utils.js.map +1 -0
- package/dist/components/ds-text-input/ds-text-input.js +2 -2
- package/dist/components/ds-toggle/ds-toggle.d.cts +2 -2
- package/dist/components/ds-toggle/ds-toggle.d.ts +2 -2
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.cts +5 -5
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.ts +5 -5
- package/dist/index.cjs +14 -2
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +11 -3
- package/dist/index.min.css +1 -1
- package/package.json +6 -2
- package/src/components/ds-avatar/_mixins.scss +45 -0
- package/src/components/ds-avatar/ds-avatar.module.scss +52 -0
- package/src/components/ds-avatar/ds-avatar.tsx +42 -0
- package/src/components/ds-avatar/ds-avatar.types.ts +41 -0
- package/src/components/ds-avatar/index.ts +2 -0
- package/src/components/ds-avatar-group/ds-avatar-group.module.scss +70 -0
- package/src/components/ds-avatar-group/ds-avatar-group.tsx +51 -0
- package/src/components/ds-avatar-group/ds-avatar-group.types.ts +27 -0
- package/src/components/ds-avatar-group/index.ts +2 -0
- package/src/components/ds-chip/ds-chip.tsx +2 -1
- package/src/components/ds-chip/ds-chip.types.tsx +13 -0
- package/src/components/ds-chip/index.tsx +8 -0
- package/src/components/ds-chip-group/ds-chip-group.tsx +2 -2
- package/src/components/ds-chip-group/ds-chip-group.types.ts +8 -0
- package/src/components/ds-chip-group/index.ts +1 -0
- package/src/components/ds-tag/ds-tag.module.scss +112 -0
- package/src/components/ds-tag/ds-tag.tsx +124 -0
- package/src/components/ds-tag/ds-tag.types.tsx +67 -0
- package/src/components/ds-tag/index.tsx +2 -0
- package/src/components/ds-tag-filter/ds-tag-filter.module.scss +72 -0
- package/src/components/ds-tag-filter/ds-tag-filter.tsx +178 -0
- package/src/components/ds-tag-filter/ds-tag-filter.types.ts +68 -0
- package/src/components/ds-tag-filter/hooks/use-tag-overflow-calculation.ts +135 -0
- package/src/components/ds-tag-filter/index.ts +2 -0
- package/src/components/ds-tag-filter/utils.test.ts +401 -0
- package/src/components/ds-tag-filter/utils.ts +65 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_ds_icon = require('../ds-icon/ds-icon.cjs');
|
|
3
|
+
require('../ds-icon/index.cjs');
|
|
4
|
+
const require_ds_typography = require('../ds-typography/ds-typography.cjs');
|
|
5
|
+
require('../ds-typography/index.cjs');
|
|
6
|
+
const require_ds_button = require('../ds-button/ds-button.cjs');
|
|
7
|
+
require('../ds-button/index.cjs');
|
|
8
|
+
const require_ds_tag = require('../ds-tag/ds-tag.cjs');
|
|
9
|
+
require('../ds-tag/index.cjs');
|
|
10
|
+
const require_ds_tag_filter_module = require('./ds-tag-filter.module.cjs');
|
|
11
|
+
const require_use_tag_overflow_calculation = require('./hooks/use-tag-overflow-calculation.cjs');
|
|
12
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
13
|
+
let classnames = require("classnames");
|
|
14
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
|
+
let react = require("react");
|
|
17
|
+
let react_dom = require("react-dom");
|
|
18
|
+
|
|
19
|
+
//#region src/components/ds-tag-filter/ds-tag-filter.tsx
|
|
20
|
+
/**
|
|
21
|
+
* Design system TagFilter component
|
|
22
|
+
*
|
|
23
|
+
* A component for displaying active filters as tags with overflow handling.
|
|
24
|
+
* Shows visible tags in up to 2 rows, with the Expand button to show hidden items.
|
|
25
|
+
*/
|
|
26
|
+
const DsTagFilter = (t0) => {
|
|
27
|
+
const $ = (0, react_compiler_runtime.c)(81);
|
|
28
|
+
const { items, locale: t1, className, style, onClearAll, onItemDelete, onItemSelect, onExpand } = t0;
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[0] !== t1) {
|
|
31
|
+
t2 = t1 === void 0 ? {} : t1;
|
|
32
|
+
$[0] = t1;
|
|
33
|
+
$[1] = t2;
|
|
34
|
+
} else t2 = $[1];
|
|
35
|
+
const locale = t2;
|
|
36
|
+
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
37
|
+
const containerRef = (0, react.useRef)(null);
|
|
38
|
+
const measurementRef = (0, react.useRef)(null);
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[2] !== expanded || $[3] !== items.length) {
|
|
41
|
+
t3 = {
|
|
42
|
+
containerRef,
|
|
43
|
+
measurementRef,
|
|
44
|
+
totalItems: items.length,
|
|
45
|
+
expanded
|
|
46
|
+
};
|
|
47
|
+
$[2] = expanded;
|
|
48
|
+
$[3] = items.length;
|
|
49
|
+
$[4] = t3;
|
|
50
|
+
} else t3 = $[4];
|
|
51
|
+
const { row1TagCount, row2TagCount, hasOverflow } = require_use_tag_overflow_calculation.useTagOverflowCalculation(t3);
|
|
52
|
+
const { label: t4, clearButton: t5, hiddenCountPlural: t6, hiddenCountSingular: t7, collapseTagLabel: t8 } = locale;
|
|
53
|
+
const label = t4 === void 0 ? "Filtered by:" : t4;
|
|
54
|
+
const clearButton = t5 === void 0 ? "Clear all filters" : t5;
|
|
55
|
+
const hiddenCountPlural = t6 === void 0 ? "filters" : t6;
|
|
56
|
+
const hiddenCountSingular = t7 === void 0 ? "filter" : t7;
|
|
57
|
+
const collapseTagLabel = t8 === void 0 ? "Collapse" : t8;
|
|
58
|
+
let measurementContainer;
|
|
59
|
+
let t10;
|
|
60
|
+
let t11;
|
|
61
|
+
let t12;
|
|
62
|
+
let t13;
|
|
63
|
+
let t14;
|
|
64
|
+
let t9;
|
|
65
|
+
if ($[5] !== className || $[6] !== clearButton || $[7] !== collapseTagLabel || $[8] !== expanded || $[9] !== hasOverflow || $[10] !== hiddenCountPlural || $[11] !== hiddenCountSingular || $[12] !== items || $[13] !== label || $[14] !== onClearAll || $[15] !== onExpand || $[16] !== onItemDelete || $[17] !== onItemSelect || $[18] !== row1TagCount || $[19] !== row2TagCount || $[20] !== style) {
|
|
66
|
+
t14 = Symbol.for("react.early_return_sentinel");
|
|
67
|
+
bb0: {
|
|
68
|
+
const row1Tags = items.slice(0, row1TagCount);
|
|
69
|
+
const row2Tags = items.slice(row1TagCount, row1TagCount + row2TagCount);
|
|
70
|
+
let t15$1;
|
|
71
|
+
if ($[28] !== expanded || $[29] !== items || $[30] !== row1TagCount || $[31] !== row2TagCount) {
|
|
72
|
+
t15$1 = expanded ? [] : items.slice(row1TagCount + row2TagCount);
|
|
73
|
+
$[28] = expanded;
|
|
74
|
+
$[29] = items;
|
|
75
|
+
$[30] = row1TagCount;
|
|
76
|
+
$[31] = row2TagCount;
|
|
77
|
+
$[32] = t15$1;
|
|
78
|
+
} else t15$1 = $[32];
|
|
79
|
+
const hiddenTags = t15$1;
|
|
80
|
+
if (items.length === 0) {
|
|
81
|
+
t14 = null;
|
|
82
|
+
break bb0;
|
|
83
|
+
}
|
|
84
|
+
const hiddenCount = hiddenTags.length;
|
|
85
|
+
const hasRow2Content = row2Tags.length > 0 || hasOverflow;
|
|
86
|
+
let t16$1;
|
|
87
|
+
if ($[33] !== onItemDelete || $[34] !== onItemSelect) {
|
|
88
|
+
t16$1 = (item) => {
|
|
89
|
+
return /* @__PURE__ */ (0, react.createElement)(require_ds_tag.default, {
|
|
90
|
+
...item.slotProps?.tag || {},
|
|
91
|
+
key: item.id,
|
|
92
|
+
label: item.label,
|
|
93
|
+
selected: item.selected,
|
|
94
|
+
onClick: onItemSelect ? () => onItemSelect(item) : void 0,
|
|
95
|
+
onDelete: onItemDelete ? () => onItemDelete(item) : void 0
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
$[33] = onItemDelete;
|
|
99
|
+
$[34] = onItemSelect;
|
|
100
|
+
$[35] = t16$1;
|
|
101
|
+
} else t16$1 = $[35];
|
|
102
|
+
const renderTag = t16$1;
|
|
103
|
+
let t17$1;
|
|
104
|
+
if ($[36] !== expanded || $[37] !== onExpand) {
|
|
105
|
+
t17$1 = () => {
|
|
106
|
+
const newExpanded = !expanded;
|
|
107
|
+
setExpanded(newExpanded);
|
|
108
|
+
onExpand?.(newExpanded);
|
|
109
|
+
};
|
|
110
|
+
$[36] = expanded;
|
|
111
|
+
$[37] = onExpand;
|
|
112
|
+
$[38] = t17$1;
|
|
113
|
+
} else t17$1 = $[38];
|
|
114
|
+
const handleExpandToggle = t17$1;
|
|
115
|
+
let t18;
|
|
116
|
+
if ($[39] !== label) {
|
|
117
|
+
t18 = label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
118
|
+
"data-measure-label": "",
|
|
119
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
|
|
120
|
+
variant: "body-sm-reg",
|
|
121
|
+
className: require_ds_tag_filter_module.default.label,
|
|
122
|
+
children: label
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
$[39] = label;
|
|
126
|
+
$[40] = t18;
|
|
127
|
+
} else t18 = $[40];
|
|
128
|
+
let t19;
|
|
129
|
+
if ($[41] !== items || $[42] !== onItemDelete || $[43] !== onItemSelect) {
|
|
130
|
+
let t20$1;
|
|
131
|
+
if ($[45] !== onItemDelete || $[46] !== onItemSelect) {
|
|
132
|
+
t20$1 = (item_0) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_tag.default, {
|
|
133
|
+
"data-measure-tag": "",
|
|
134
|
+
label: item_0.label,
|
|
135
|
+
selected: item_0.selected,
|
|
136
|
+
onClick: onItemSelect ? () => onItemSelect(item_0) : void 0,
|
|
137
|
+
onDelete: onItemDelete ? () => onItemDelete(item_0) : void 0
|
|
138
|
+
}, item_0.id);
|
|
139
|
+
$[45] = onItemDelete;
|
|
140
|
+
$[46] = onItemSelect;
|
|
141
|
+
$[47] = t20$1;
|
|
142
|
+
} else t20$1 = $[47];
|
|
143
|
+
t19 = items.map(t20$1);
|
|
144
|
+
$[41] = items;
|
|
145
|
+
$[42] = onItemDelete;
|
|
146
|
+
$[43] = onItemSelect;
|
|
147
|
+
$[44] = t19;
|
|
148
|
+
} else t19 = $[44];
|
|
149
|
+
let t20;
|
|
150
|
+
if ($[48] !== clearButton || $[49] !== onClearAll) {
|
|
151
|
+
t20 = onClearAll && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ds_button.default, {
|
|
152
|
+
"data-measure-clear": "",
|
|
153
|
+
design: "v1.2",
|
|
154
|
+
buttonType: "tertiary",
|
|
155
|
+
variant: "ghost",
|
|
156
|
+
className: require_ds_tag_filter_module.default.clearButton,
|
|
157
|
+
contentClassName: require_ds_tag_filter_module.default.clearContent,
|
|
158
|
+
size: "small",
|
|
159
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_icon.default, { icon: "close" }), clearButton]
|
|
160
|
+
});
|
|
161
|
+
$[48] = clearButton;
|
|
162
|
+
$[49] = onClearAll;
|
|
163
|
+
$[50] = t20;
|
|
164
|
+
} else t20 = $[50];
|
|
165
|
+
let t21;
|
|
166
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
167
|
+
t21 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_tag.default, {
|
|
168
|
+
"data-measure-expand": "",
|
|
169
|
+
label: "+99 filters",
|
|
170
|
+
className: require_ds_tag_filter_module.default.expandTag
|
|
171
|
+
});
|
|
172
|
+
$[51] = t21;
|
|
173
|
+
} else t21 = $[51];
|
|
174
|
+
let t22;
|
|
175
|
+
if ($[52] !== t18 || $[53] !== t19 || $[54] !== t20) {
|
|
176
|
+
t22 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
177
|
+
ref: measurementRef,
|
|
178
|
+
className: require_ds_tag_filter_module.default.measurementContainer,
|
|
179
|
+
"aria-hidden": "true",
|
|
180
|
+
children: [
|
|
181
|
+
t18,
|
|
182
|
+
t19,
|
|
183
|
+
t20,
|
|
184
|
+
t21
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
$[52] = t18;
|
|
188
|
+
$[53] = t19;
|
|
189
|
+
$[54] = t20;
|
|
190
|
+
$[55] = t22;
|
|
191
|
+
} else t22 = $[55];
|
|
192
|
+
measurementContainer = t22;
|
|
193
|
+
t9 = containerRef;
|
|
194
|
+
const t23 = expanded && require_ds_tag_filter_module.default.expanded;
|
|
195
|
+
if ($[56] !== className || $[57] !== t23) {
|
|
196
|
+
t10 = (0, classnames.default)(require_ds_tag_filter_module.default.container, t23, className);
|
|
197
|
+
$[56] = className;
|
|
198
|
+
$[57] = t23;
|
|
199
|
+
$[58] = t10;
|
|
200
|
+
} else t10 = $[58];
|
|
201
|
+
t11 = style;
|
|
202
|
+
let t24;
|
|
203
|
+
if ($[59] !== label) {
|
|
204
|
+
t24 = label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
|
|
205
|
+
variant: "body-sm-reg",
|
|
206
|
+
className: require_ds_tag_filter_module.default.label,
|
|
207
|
+
children: label
|
|
208
|
+
});
|
|
209
|
+
$[59] = label;
|
|
210
|
+
$[60] = t24;
|
|
211
|
+
} else t24 = $[60];
|
|
212
|
+
let t25;
|
|
213
|
+
if ($[61] !== renderTag) {
|
|
214
|
+
t25 = (item_1) => renderTag(item_1);
|
|
215
|
+
$[61] = renderTag;
|
|
216
|
+
$[62] = t25;
|
|
217
|
+
} else t25 = $[62];
|
|
218
|
+
const t26 = row1Tags.map(t25);
|
|
219
|
+
let t27;
|
|
220
|
+
if ($[63] !== clearButton || $[64] !== onClearAll) {
|
|
221
|
+
t27 = onClearAll && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ds_button.default, {
|
|
222
|
+
design: "v1.2",
|
|
223
|
+
buttonType: "tertiary",
|
|
224
|
+
variant: "ghost",
|
|
225
|
+
className: require_ds_tag_filter_module.default.clearButton,
|
|
226
|
+
contentClassName: require_ds_tag_filter_module.default.clearContent,
|
|
227
|
+
size: "small",
|
|
228
|
+
onClick: onClearAll,
|
|
229
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_icon.default, { icon: "close" }), clearButton]
|
|
230
|
+
});
|
|
231
|
+
$[63] = clearButton;
|
|
232
|
+
$[64] = onClearAll;
|
|
233
|
+
$[65] = t27;
|
|
234
|
+
} else t27 = $[65];
|
|
235
|
+
if ($[66] !== t24 || $[67] !== t26 || $[68] !== t27) {
|
|
236
|
+
t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
237
|
+
className: require_ds_tag_filter_module.default.row1,
|
|
238
|
+
children: [
|
|
239
|
+
t24,
|
|
240
|
+
t26,
|
|
241
|
+
t27
|
|
242
|
+
]
|
|
243
|
+
});
|
|
244
|
+
$[66] = t24;
|
|
245
|
+
$[67] = t26;
|
|
246
|
+
$[68] = t27;
|
|
247
|
+
$[69] = t12;
|
|
248
|
+
} else t12 = $[69];
|
|
249
|
+
t13 = hasRow2Content && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
250
|
+
className: require_ds_tag_filter_module.default.row2,
|
|
251
|
+
children: [row2Tags.map((item_2) => renderTag(item_2)), hasOverflow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_tag.default, {
|
|
252
|
+
label: expanded ? collapseTagLabel : `+${String(hiddenCount)} ${hiddenCount === 1 ? hiddenCountSingular : hiddenCountPlural}`,
|
|
253
|
+
selected: expanded,
|
|
254
|
+
className: require_ds_tag_filter_module.default.expandTag,
|
|
255
|
+
onClick: handleExpandToggle
|
|
256
|
+
})]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
$[5] = className;
|
|
260
|
+
$[6] = clearButton;
|
|
261
|
+
$[7] = collapseTagLabel;
|
|
262
|
+
$[8] = expanded;
|
|
263
|
+
$[9] = hasOverflow;
|
|
264
|
+
$[10] = hiddenCountPlural;
|
|
265
|
+
$[11] = hiddenCountSingular;
|
|
266
|
+
$[12] = items;
|
|
267
|
+
$[13] = label;
|
|
268
|
+
$[14] = onClearAll;
|
|
269
|
+
$[15] = onExpand;
|
|
270
|
+
$[16] = onItemDelete;
|
|
271
|
+
$[17] = onItemSelect;
|
|
272
|
+
$[18] = row1TagCount;
|
|
273
|
+
$[19] = row2TagCount;
|
|
274
|
+
$[20] = style;
|
|
275
|
+
$[21] = measurementContainer;
|
|
276
|
+
$[22] = t10;
|
|
277
|
+
$[23] = t11;
|
|
278
|
+
$[24] = t12;
|
|
279
|
+
$[25] = t13;
|
|
280
|
+
$[26] = t14;
|
|
281
|
+
$[27] = t9;
|
|
282
|
+
} else {
|
|
283
|
+
measurementContainer = $[21];
|
|
284
|
+
t10 = $[22];
|
|
285
|
+
t11 = $[23];
|
|
286
|
+
t12 = $[24];
|
|
287
|
+
t13 = $[25];
|
|
288
|
+
t14 = $[26];
|
|
289
|
+
t9 = $[27];
|
|
290
|
+
}
|
|
291
|
+
if (t14 !== Symbol.for("react.early_return_sentinel")) return t14;
|
|
292
|
+
let t15;
|
|
293
|
+
if ($[70] !== t10 || $[71] !== t11 || $[72] !== t12 || $[73] !== t13 || $[74] !== t9) {
|
|
294
|
+
t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
295
|
+
ref: t9,
|
|
296
|
+
className: t10,
|
|
297
|
+
style: t11,
|
|
298
|
+
children: [t12, t13]
|
|
299
|
+
});
|
|
300
|
+
$[70] = t10;
|
|
301
|
+
$[71] = t11;
|
|
302
|
+
$[72] = t12;
|
|
303
|
+
$[73] = t13;
|
|
304
|
+
$[74] = t9;
|
|
305
|
+
$[75] = t15;
|
|
306
|
+
} else t15 = $[75];
|
|
307
|
+
let t16;
|
|
308
|
+
if ($[76] !== measurementContainer) {
|
|
309
|
+
t16 = (0, react_dom.createPortal)(measurementContainer, document.body);
|
|
310
|
+
$[76] = measurementContainer;
|
|
311
|
+
$[77] = t16;
|
|
312
|
+
} else t16 = $[77];
|
|
313
|
+
let t17;
|
|
314
|
+
if ($[78] !== t15 || $[79] !== t16) {
|
|
315
|
+
t17 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t15, t16] });
|
|
316
|
+
$[78] = t15;
|
|
317
|
+
$[79] = t16;
|
|
318
|
+
$[80] = t17;
|
|
319
|
+
} else t17 = $[80];
|
|
320
|
+
return t17;
|
|
321
|
+
};
|
|
322
|
+
var ds_tag_filter_default = DsTagFilter;
|
|
323
|
+
|
|
324
|
+
//#endregion
|
|
325
|
+
exports.default = ds_tag_filter_default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DsTagFilterProps } from "./ds-tag-filter.types.cjs";
|
|
2
|
+
import * as react_jsx_runtime38 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ds-tag-filter/ds-tag-filter.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Design system TagFilter component
|
|
8
|
+
*
|
|
9
|
+
* A component for displaying active filters as tags with overflow handling.
|
|
10
|
+
* Shows visible tags in up to 2 rows, with the Expand button to show hidden items.
|
|
11
|
+
*/
|
|
12
|
+
declare const DsTagFilter: ({
|
|
13
|
+
items,
|
|
14
|
+
locale,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
onClearAll,
|
|
18
|
+
onItemDelete,
|
|
19
|
+
onItemSelect,
|
|
20
|
+
onExpand
|
|
21
|
+
}: DsTagFilterProps) => react_jsx_runtime38.JSX.Element | null;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { DsTagFilter };
|
|
24
|
+
//# sourceMappingURL=ds-tag-filter.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-tag-filter.d.cts","names":[],"sources":["../../../src/components/ds-tag-filter/ds-tag-filter.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAI6E;;;cAavE,WAAe,EAAA,CAAA;EAAA,KAAA;EAAA,MAAA;EAAA,SAAA;EAAA,KAAA;EAAA,UAAA;EAAA,YAAA;EAAA,YAAA;EAAA;AAAA,CAAA,EASlB,gBATkB,EAAA,GASF,mBAAA,CAAA,GAAA,CAAA,OAAA,GATE,IAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DsTagFilterProps } from "./ds-tag-filter.types.js";
|
|
2
|
+
import * as react_jsx_runtime38 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ds-tag-filter/ds-tag-filter.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Design system TagFilter component
|
|
8
|
+
*
|
|
9
|
+
* A component for displaying active filters as tags with overflow handling.
|
|
10
|
+
* Shows visible tags in up to 2 rows, with the Expand button to show hidden items.
|
|
11
|
+
*/
|
|
12
|
+
declare const DsTagFilter: ({
|
|
13
|
+
items,
|
|
14
|
+
locale,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
onClearAll,
|
|
18
|
+
onItemDelete,
|
|
19
|
+
onItemSelect,
|
|
20
|
+
onExpand
|
|
21
|
+
}: DsTagFilterProps) => react_jsx_runtime38.JSX.Element | null;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { DsTagFilter };
|
|
24
|
+
//# sourceMappingURL=ds-tag-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-tag-filter.d.ts","names":[],"sources":["../../../src/components/ds-tag-filter/ds-tag-filter.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAI6E;;;cAavE,WAAe,EAAA,CAAA;EAAA,KAAA;EAAA,MAAA;EAAA,SAAA;EAAA,KAAA;EAAA,UAAA;EAAA,YAAA;EAAA,YAAA;EAAA;AAAA,CAAA,EASlB,gBATkB,EAAA,GASF,mBAAA,CAAA,GAAA,CAAA,OAAA,GATE,IAAA"}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import ds_icon_default from "../ds-icon/ds-icon.js";
|
|
2
|
+
import "../ds-icon/index.js";
|
|
3
|
+
import ds_typography_default from "../ds-typography/ds-typography.js";
|
|
4
|
+
import "../ds-typography/index.js";
|
|
5
|
+
import ds_button_default from "../ds-button/ds-button.js";
|
|
6
|
+
import "../ds-button/index.js";
|
|
7
|
+
import ds_tag_default from "../ds-tag/ds-tag.js";
|
|
8
|
+
import "../ds-tag/index.js";
|
|
9
|
+
import ds_tag_filter_module_default from "./ds-tag-filter.module.js";
|
|
10
|
+
import { useTagOverflowCalculation } from "./hooks/use-tag-overflow-calculation.js";
|
|
11
|
+
import { c } from "react/compiler-runtime";
|
|
12
|
+
import classNames from "classnames";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { createElement, useRef, useState } from "react";
|
|
15
|
+
import { createPortal } from "react-dom";
|
|
16
|
+
|
|
17
|
+
//#region src/components/ds-tag-filter/ds-tag-filter.tsx
|
|
18
|
+
/**
|
|
19
|
+
* Design system TagFilter component
|
|
20
|
+
*
|
|
21
|
+
* A component for displaying active filters as tags with overflow handling.
|
|
22
|
+
* Shows visible tags in up to 2 rows, with the Expand button to show hidden items.
|
|
23
|
+
*/
|
|
24
|
+
const DsTagFilter = (t0) => {
|
|
25
|
+
const $ = c(81);
|
|
26
|
+
const { items, locale: t1, className, style, onClearAll, onItemDelete, onItemSelect, onExpand } = t0;
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[0] !== t1) {
|
|
29
|
+
t2 = t1 === void 0 ? {} : t1;
|
|
30
|
+
$[0] = t1;
|
|
31
|
+
$[1] = t2;
|
|
32
|
+
} else t2 = $[1];
|
|
33
|
+
const locale = t2;
|
|
34
|
+
const [expanded, setExpanded] = useState(false);
|
|
35
|
+
const containerRef = useRef(null);
|
|
36
|
+
const measurementRef = useRef(null);
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[2] !== expanded || $[3] !== items.length) {
|
|
39
|
+
t3 = {
|
|
40
|
+
containerRef,
|
|
41
|
+
measurementRef,
|
|
42
|
+
totalItems: items.length,
|
|
43
|
+
expanded
|
|
44
|
+
};
|
|
45
|
+
$[2] = expanded;
|
|
46
|
+
$[3] = items.length;
|
|
47
|
+
$[4] = t3;
|
|
48
|
+
} else t3 = $[4];
|
|
49
|
+
const { row1TagCount, row2TagCount, hasOverflow } = useTagOverflowCalculation(t3);
|
|
50
|
+
const { label: t4, clearButton: t5, hiddenCountPlural: t6, hiddenCountSingular: t7, collapseTagLabel: t8 } = locale;
|
|
51
|
+
const label = t4 === void 0 ? "Filtered by:" : t4;
|
|
52
|
+
const clearButton = t5 === void 0 ? "Clear all filters" : t5;
|
|
53
|
+
const hiddenCountPlural = t6 === void 0 ? "filters" : t6;
|
|
54
|
+
const hiddenCountSingular = t7 === void 0 ? "filter" : t7;
|
|
55
|
+
const collapseTagLabel = t8 === void 0 ? "Collapse" : t8;
|
|
56
|
+
let measurementContainer;
|
|
57
|
+
let t10;
|
|
58
|
+
let t11;
|
|
59
|
+
let t12;
|
|
60
|
+
let t13;
|
|
61
|
+
let t14;
|
|
62
|
+
let t9;
|
|
63
|
+
if ($[5] !== className || $[6] !== clearButton || $[7] !== collapseTagLabel || $[8] !== expanded || $[9] !== hasOverflow || $[10] !== hiddenCountPlural || $[11] !== hiddenCountSingular || $[12] !== items || $[13] !== label || $[14] !== onClearAll || $[15] !== onExpand || $[16] !== onItemDelete || $[17] !== onItemSelect || $[18] !== row1TagCount || $[19] !== row2TagCount || $[20] !== style) {
|
|
64
|
+
t14 = Symbol.for("react.early_return_sentinel");
|
|
65
|
+
bb0: {
|
|
66
|
+
const row1Tags = items.slice(0, row1TagCount);
|
|
67
|
+
const row2Tags = items.slice(row1TagCount, row1TagCount + row2TagCount);
|
|
68
|
+
let t15$1;
|
|
69
|
+
if ($[28] !== expanded || $[29] !== items || $[30] !== row1TagCount || $[31] !== row2TagCount) {
|
|
70
|
+
t15$1 = expanded ? [] : items.slice(row1TagCount + row2TagCount);
|
|
71
|
+
$[28] = expanded;
|
|
72
|
+
$[29] = items;
|
|
73
|
+
$[30] = row1TagCount;
|
|
74
|
+
$[31] = row2TagCount;
|
|
75
|
+
$[32] = t15$1;
|
|
76
|
+
} else t15$1 = $[32];
|
|
77
|
+
const hiddenTags = t15$1;
|
|
78
|
+
if (items.length === 0) {
|
|
79
|
+
t14 = null;
|
|
80
|
+
break bb0;
|
|
81
|
+
}
|
|
82
|
+
const hiddenCount = hiddenTags.length;
|
|
83
|
+
const hasRow2Content = row2Tags.length > 0 || hasOverflow;
|
|
84
|
+
let t16$1;
|
|
85
|
+
if ($[33] !== onItemDelete || $[34] !== onItemSelect) {
|
|
86
|
+
t16$1 = (item) => {
|
|
87
|
+
return /* @__PURE__ */ createElement(ds_tag_default, {
|
|
88
|
+
...item.slotProps?.tag || {},
|
|
89
|
+
key: item.id,
|
|
90
|
+
label: item.label,
|
|
91
|
+
selected: item.selected,
|
|
92
|
+
onClick: onItemSelect ? () => onItemSelect(item) : void 0,
|
|
93
|
+
onDelete: onItemDelete ? () => onItemDelete(item) : void 0
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
$[33] = onItemDelete;
|
|
97
|
+
$[34] = onItemSelect;
|
|
98
|
+
$[35] = t16$1;
|
|
99
|
+
} else t16$1 = $[35];
|
|
100
|
+
const renderTag = t16$1;
|
|
101
|
+
let t17$1;
|
|
102
|
+
if ($[36] !== expanded || $[37] !== onExpand) {
|
|
103
|
+
t17$1 = () => {
|
|
104
|
+
const newExpanded = !expanded;
|
|
105
|
+
setExpanded(newExpanded);
|
|
106
|
+
onExpand?.(newExpanded);
|
|
107
|
+
};
|
|
108
|
+
$[36] = expanded;
|
|
109
|
+
$[37] = onExpand;
|
|
110
|
+
$[38] = t17$1;
|
|
111
|
+
} else t17$1 = $[38];
|
|
112
|
+
const handleExpandToggle = t17$1;
|
|
113
|
+
let t18;
|
|
114
|
+
if ($[39] !== label) {
|
|
115
|
+
t18 = label && /* @__PURE__ */ jsx("span", {
|
|
116
|
+
"data-measure-label": "",
|
|
117
|
+
children: /* @__PURE__ */ jsx(ds_typography_default, {
|
|
118
|
+
variant: "body-sm-reg",
|
|
119
|
+
className: ds_tag_filter_module_default.label,
|
|
120
|
+
children: label
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
$[39] = label;
|
|
124
|
+
$[40] = t18;
|
|
125
|
+
} else t18 = $[40];
|
|
126
|
+
let t19;
|
|
127
|
+
if ($[41] !== items || $[42] !== onItemDelete || $[43] !== onItemSelect) {
|
|
128
|
+
let t20$1;
|
|
129
|
+
if ($[45] !== onItemDelete || $[46] !== onItemSelect) {
|
|
130
|
+
t20$1 = (item_0) => /* @__PURE__ */ jsx(ds_tag_default, {
|
|
131
|
+
"data-measure-tag": "",
|
|
132
|
+
label: item_0.label,
|
|
133
|
+
selected: item_0.selected,
|
|
134
|
+
onClick: onItemSelect ? () => onItemSelect(item_0) : void 0,
|
|
135
|
+
onDelete: onItemDelete ? () => onItemDelete(item_0) : void 0
|
|
136
|
+
}, item_0.id);
|
|
137
|
+
$[45] = onItemDelete;
|
|
138
|
+
$[46] = onItemSelect;
|
|
139
|
+
$[47] = t20$1;
|
|
140
|
+
} else t20$1 = $[47];
|
|
141
|
+
t19 = items.map(t20$1);
|
|
142
|
+
$[41] = items;
|
|
143
|
+
$[42] = onItemDelete;
|
|
144
|
+
$[43] = onItemSelect;
|
|
145
|
+
$[44] = t19;
|
|
146
|
+
} else t19 = $[44];
|
|
147
|
+
let t20;
|
|
148
|
+
if ($[48] !== clearButton || $[49] !== onClearAll) {
|
|
149
|
+
t20 = onClearAll && /* @__PURE__ */ jsxs(ds_button_default, {
|
|
150
|
+
"data-measure-clear": "",
|
|
151
|
+
design: "v1.2",
|
|
152
|
+
buttonType: "tertiary",
|
|
153
|
+
variant: "ghost",
|
|
154
|
+
className: ds_tag_filter_module_default.clearButton,
|
|
155
|
+
contentClassName: ds_tag_filter_module_default.clearContent,
|
|
156
|
+
size: "small",
|
|
157
|
+
children: [/* @__PURE__ */ jsx(ds_icon_default, { icon: "close" }), clearButton]
|
|
158
|
+
});
|
|
159
|
+
$[48] = clearButton;
|
|
160
|
+
$[49] = onClearAll;
|
|
161
|
+
$[50] = t20;
|
|
162
|
+
} else t20 = $[50];
|
|
163
|
+
let t21;
|
|
164
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
165
|
+
t21 = /* @__PURE__ */ jsx(ds_tag_default, {
|
|
166
|
+
"data-measure-expand": "",
|
|
167
|
+
label: "+99 filters",
|
|
168
|
+
className: ds_tag_filter_module_default.expandTag
|
|
169
|
+
});
|
|
170
|
+
$[51] = t21;
|
|
171
|
+
} else t21 = $[51];
|
|
172
|
+
let t22;
|
|
173
|
+
if ($[52] !== t18 || $[53] !== t19 || $[54] !== t20) {
|
|
174
|
+
t22 = /* @__PURE__ */ jsxs("div", {
|
|
175
|
+
ref: measurementRef,
|
|
176
|
+
className: ds_tag_filter_module_default.measurementContainer,
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
children: [
|
|
179
|
+
t18,
|
|
180
|
+
t19,
|
|
181
|
+
t20,
|
|
182
|
+
t21
|
|
183
|
+
]
|
|
184
|
+
});
|
|
185
|
+
$[52] = t18;
|
|
186
|
+
$[53] = t19;
|
|
187
|
+
$[54] = t20;
|
|
188
|
+
$[55] = t22;
|
|
189
|
+
} else t22 = $[55];
|
|
190
|
+
measurementContainer = t22;
|
|
191
|
+
t9 = containerRef;
|
|
192
|
+
const t23 = expanded && ds_tag_filter_module_default.expanded;
|
|
193
|
+
if ($[56] !== className || $[57] !== t23) {
|
|
194
|
+
t10 = classNames(ds_tag_filter_module_default.container, t23, className);
|
|
195
|
+
$[56] = className;
|
|
196
|
+
$[57] = t23;
|
|
197
|
+
$[58] = t10;
|
|
198
|
+
} else t10 = $[58];
|
|
199
|
+
t11 = style;
|
|
200
|
+
let t24;
|
|
201
|
+
if ($[59] !== label) {
|
|
202
|
+
t24 = label && /* @__PURE__ */ jsx(ds_typography_default, {
|
|
203
|
+
variant: "body-sm-reg",
|
|
204
|
+
className: ds_tag_filter_module_default.label,
|
|
205
|
+
children: label
|
|
206
|
+
});
|
|
207
|
+
$[59] = label;
|
|
208
|
+
$[60] = t24;
|
|
209
|
+
} else t24 = $[60];
|
|
210
|
+
let t25;
|
|
211
|
+
if ($[61] !== renderTag) {
|
|
212
|
+
t25 = (item_1) => renderTag(item_1);
|
|
213
|
+
$[61] = renderTag;
|
|
214
|
+
$[62] = t25;
|
|
215
|
+
} else t25 = $[62];
|
|
216
|
+
const t26 = row1Tags.map(t25);
|
|
217
|
+
let t27;
|
|
218
|
+
if ($[63] !== clearButton || $[64] !== onClearAll) {
|
|
219
|
+
t27 = onClearAll && /* @__PURE__ */ jsxs(ds_button_default, {
|
|
220
|
+
design: "v1.2",
|
|
221
|
+
buttonType: "tertiary",
|
|
222
|
+
variant: "ghost",
|
|
223
|
+
className: ds_tag_filter_module_default.clearButton,
|
|
224
|
+
contentClassName: ds_tag_filter_module_default.clearContent,
|
|
225
|
+
size: "small",
|
|
226
|
+
onClick: onClearAll,
|
|
227
|
+
children: [/* @__PURE__ */ jsx(ds_icon_default, { icon: "close" }), clearButton]
|
|
228
|
+
});
|
|
229
|
+
$[63] = clearButton;
|
|
230
|
+
$[64] = onClearAll;
|
|
231
|
+
$[65] = t27;
|
|
232
|
+
} else t27 = $[65];
|
|
233
|
+
if ($[66] !== t24 || $[67] !== t26 || $[68] !== t27) {
|
|
234
|
+
t12 = /* @__PURE__ */ jsxs("div", {
|
|
235
|
+
className: ds_tag_filter_module_default.row1,
|
|
236
|
+
children: [
|
|
237
|
+
t24,
|
|
238
|
+
t26,
|
|
239
|
+
t27
|
|
240
|
+
]
|
|
241
|
+
});
|
|
242
|
+
$[66] = t24;
|
|
243
|
+
$[67] = t26;
|
|
244
|
+
$[68] = t27;
|
|
245
|
+
$[69] = t12;
|
|
246
|
+
} else t12 = $[69];
|
|
247
|
+
t13 = hasRow2Content && /* @__PURE__ */ jsxs("div", {
|
|
248
|
+
className: ds_tag_filter_module_default.row2,
|
|
249
|
+
children: [row2Tags.map((item_2) => renderTag(item_2)), hasOverflow && /* @__PURE__ */ jsx(ds_tag_default, {
|
|
250
|
+
label: expanded ? collapseTagLabel : `+${String(hiddenCount)} ${hiddenCount === 1 ? hiddenCountSingular : hiddenCountPlural}`,
|
|
251
|
+
selected: expanded,
|
|
252
|
+
className: ds_tag_filter_module_default.expandTag,
|
|
253
|
+
onClick: handleExpandToggle
|
|
254
|
+
})]
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
$[5] = className;
|
|
258
|
+
$[6] = clearButton;
|
|
259
|
+
$[7] = collapseTagLabel;
|
|
260
|
+
$[8] = expanded;
|
|
261
|
+
$[9] = hasOverflow;
|
|
262
|
+
$[10] = hiddenCountPlural;
|
|
263
|
+
$[11] = hiddenCountSingular;
|
|
264
|
+
$[12] = items;
|
|
265
|
+
$[13] = label;
|
|
266
|
+
$[14] = onClearAll;
|
|
267
|
+
$[15] = onExpand;
|
|
268
|
+
$[16] = onItemDelete;
|
|
269
|
+
$[17] = onItemSelect;
|
|
270
|
+
$[18] = row1TagCount;
|
|
271
|
+
$[19] = row2TagCount;
|
|
272
|
+
$[20] = style;
|
|
273
|
+
$[21] = measurementContainer;
|
|
274
|
+
$[22] = t10;
|
|
275
|
+
$[23] = t11;
|
|
276
|
+
$[24] = t12;
|
|
277
|
+
$[25] = t13;
|
|
278
|
+
$[26] = t14;
|
|
279
|
+
$[27] = t9;
|
|
280
|
+
} else {
|
|
281
|
+
measurementContainer = $[21];
|
|
282
|
+
t10 = $[22];
|
|
283
|
+
t11 = $[23];
|
|
284
|
+
t12 = $[24];
|
|
285
|
+
t13 = $[25];
|
|
286
|
+
t14 = $[26];
|
|
287
|
+
t9 = $[27];
|
|
288
|
+
}
|
|
289
|
+
if (t14 !== Symbol.for("react.early_return_sentinel")) return t14;
|
|
290
|
+
let t15;
|
|
291
|
+
if ($[70] !== t10 || $[71] !== t11 || $[72] !== t12 || $[73] !== t13 || $[74] !== t9) {
|
|
292
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
293
|
+
ref: t9,
|
|
294
|
+
className: t10,
|
|
295
|
+
style: t11,
|
|
296
|
+
children: [t12, t13]
|
|
297
|
+
});
|
|
298
|
+
$[70] = t10;
|
|
299
|
+
$[71] = t11;
|
|
300
|
+
$[72] = t12;
|
|
301
|
+
$[73] = t13;
|
|
302
|
+
$[74] = t9;
|
|
303
|
+
$[75] = t15;
|
|
304
|
+
} else t15 = $[75];
|
|
305
|
+
let t16;
|
|
306
|
+
if ($[76] !== measurementContainer) {
|
|
307
|
+
t16 = createPortal(measurementContainer, document.body);
|
|
308
|
+
$[76] = measurementContainer;
|
|
309
|
+
$[77] = t16;
|
|
310
|
+
} else t16 = $[77];
|
|
311
|
+
let t17;
|
|
312
|
+
if ($[78] !== t15 || $[79] !== t16) {
|
|
313
|
+
t17 = /* @__PURE__ */ jsxs(Fragment, { children: [t15, t16] });
|
|
314
|
+
$[78] = t15;
|
|
315
|
+
$[79] = t16;
|
|
316
|
+
$[80] = t17;
|
|
317
|
+
} else t17 = $[80];
|
|
318
|
+
return t17;
|
|
319
|
+
};
|
|
320
|
+
var ds_tag_filter_default = DsTagFilter;
|
|
321
|
+
|
|
322
|
+
//#endregion
|
|
323
|
+
export { ds_tag_filter_default as default };
|
|
324
|
+
//# sourceMappingURL=ds-tag-filter.js.map
|