@flytedan/flytebot-design-system 0.67.3 → 0.67.4
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/dist/index.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3847,8 +3847,8 @@ function splitForMiddleEllipsis(text) {
|
|
|
3847
3847
|
if (chars.length <= TAIL_CHARS) return { head: text, tail: "" };
|
|
3848
3848
|
return { head: chars.slice(0, -TAIL_CHARS).join(""), tail: chars.slice(-TAIL_CHARS).join("") };
|
|
3849
3849
|
}
|
|
3850
|
-
function MiddleEllipsis({ text }) {
|
|
3851
|
-
const { head, tail } = splitForMiddleEllipsis(text);
|
|
3850
|
+
function MiddleEllipsis({ text, middle = true }) {
|
|
3851
|
+
const { head, tail } = middle ? splitForMiddleEllipsis(text) : { head: text, tail: "" };
|
|
3852
3852
|
return /* @__PURE__ */ jsxs40("span", { className: "fd-mid-ellipsis", children: [
|
|
3853
3853
|
/* @__PURE__ */ jsx49("span", { className: "fd-mid-ellipsis-head", children: head }),
|
|
3854
3854
|
tail ? /* @__PURE__ */ jsx49("span", { className: "fd-mid-ellipsis-tail", children: tail }) : null
|
|
@@ -3985,6 +3985,9 @@ function assertValidFieldDefinition(field) {
|
|
|
3985
3985
|
);
|
|
3986
3986
|
}
|
|
3987
3987
|
}
|
|
3988
|
+
function joinsLabels(field, value) {
|
|
3989
|
+
return field.type === "multiSelect" && value?.values.length === 2;
|
|
3990
|
+
}
|
|
3988
3991
|
function chipLabel(field, value) {
|
|
3989
3992
|
switch (field.type) {
|
|
3990
3993
|
case "text":
|
|
@@ -4739,7 +4742,7 @@ function FilterBar({ fields = [], filters, onFilterChange, onFilterRemove, align
|
|
|
4739
4742
|
const valueText = set ? chipLabel(field, value) : "";
|
|
4740
4743
|
const chipText = set ? field.label + ": " + valueText : field.label;
|
|
4741
4744
|
const paintedText = field.icon && set ? valueText : chipText;
|
|
4742
|
-
const chip = /* @__PURE__ */ jsx50(Tag, { icon: field.icon, selected: true, onClick: toggleOrClose, onRemove: remove, title: chipText, "aria-label": chipText, children: /* @__PURE__ */ jsx50(MiddleEllipsis, { text: paintedText }) });
|
|
4745
|
+
const chip = /* @__PURE__ */ jsx50(Tag, { icon: field.icon, selected: true, onClick: toggleOrClose, onRemove: remove, title: chipText, "aria-label": chipText, children: /* @__PURE__ */ jsx50(MiddleEllipsis, { text: paintedText, middle: !joinsLabels(field, value) }) });
|
|
4743
4746
|
if (field.type === "text") {
|
|
4744
4747
|
return /* @__PURE__ */ jsx50("span", { className: "fd-filterbar-chip", children: chip }, field.key);
|
|
4745
4748
|
}
|