@l3mpire/ui 2.21.1 → 2.23.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/USAGE.md +43 -0
- package/dist/index.d.mts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +329 -145
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +317 -133
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5217,7 +5217,7 @@ var FilterChipSegment = React36.forwardRef(
|
|
|
5217
5217
|
),
|
|
5218
5218
|
...props,
|
|
5219
5219
|
children: [
|
|
5220
|
-
adornment && segmentType === "value" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("
|
|
5220
|
+
adornment && segmentType === "value" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "shrink-0 inline-flex items-center justify-center leading-none", children: adornment }),
|
|
5221
5221
|
icon && segmentType === "property" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5222
5222
|
import_icons23.Icon,
|
|
5223
5223
|
{
|
|
@@ -5322,6 +5322,23 @@ var FilterChip = React37.forwardRef(
|
|
|
5322
5322
|
FilterChip.displayName = "FilterChip";
|
|
5323
5323
|
|
|
5324
5324
|
// src/components/ui/filter/utils.ts
|
|
5325
|
+
function resolveEnumOption(opt) {
|
|
5326
|
+
if (typeof opt === "string") return { value: opt, label: opt };
|
|
5327
|
+
return {
|
|
5328
|
+
value: opt.value,
|
|
5329
|
+
label: opt.label ?? opt.value,
|
|
5330
|
+
icon: opt.icon,
|
|
5331
|
+
intent: opt.intent
|
|
5332
|
+
};
|
|
5333
|
+
}
|
|
5334
|
+
function findEnumOption(value, options) {
|
|
5335
|
+
if (!options) return void 0;
|
|
5336
|
+
for (const opt of options) {
|
|
5337
|
+
const r = resolveEnumOption(opt);
|
|
5338
|
+
if (r.value === value) return r;
|
|
5339
|
+
}
|
|
5340
|
+
return void 0;
|
|
5341
|
+
}
|
|
5325
5342
|
var OPERATORS_BY_TYPE = {
|
|
5326
5343
|
text: [
|
|
5327
5344
|
"contains",
|
|
@@ -5397,7 +5414,7 @@ function getValueInputType(type, operator) {
|
|
|
5397
5414
|
return ["is any of", "is none of"].includes(operator) ? "MultiRelationPicker" : "RelationPicker";
|
|
5398
5415
|
return null;
|
|
5399
5416
|
}
|
|
5400
|
-
function formatFilterValue(value, dynamicOptions, full) {
|
|
5417
|
+
function formatFilterValue(value, dynamicOptions, full, options) {
|
|
5401
5418
|
if (value == null) return void 0;
|
|
5402
5419
|
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
5403
5420
|
if (value instanceof Date) {
|
|
@@ -5417,18 +5434,19 @@ function formatFilterValue(value, dynamicOptions, full) {
|
|
|
5417
5434
|
return `${fmt(value[0])} \u2013 ${value[1] instanceof Date ? fmt(value[1]) : "\u2026"}`;
|
|
5418
5435
|
}
|
|
5419
5436
|
if (full) {
|
|
5420
|
-
return value.map((v) =>
|
|
5437
|
+
return value.map((v) => resolveLabel(String(v), dynamicOptions, options)).join(", ");
|
|
5421
5438
|
}
|
|
5422
|
-
|
|
5423
|
-
return resolved;
|
|
5439
|
+
return resolveLabel(String(value[0]), dynamicOptions, options);
|
|
5424
5440
|
}
|
|
5425
|
-
return
|
|
5441
|
+
return resolveLabel(String(value), dynamicOptions, options);
|
|
5426
5442
|
}
|
|
5427
|
-
function
|
|
5443
|
+
function resolveLabel(raw, dynamicOptions, options) {
|
|
5428
5444
|
if (dynamicOptions) {
|
|
5429
|
-
const
|
|
5430
|
-
if (
|
|
5445
|
+
const dyn = dynamicOptions.find((o) => o.value === raw);
|
|
5446
|
+
if (dyn) return dyn.label;
|
|
5431
5447
|
}
|
|
5448
|
+
const enumOpt = findEnumOption(raw, options);
|
|
5449
|
+
if (enumOpt) return enumOpt.label;
|
|
5432
5450
|
return raw;
|
|
5433
5451
|
}
|
|
5434
5452
|
function getBadgeCount(value) {
|
|
@@ -6672,7 +6690,41 @@ var PresetTagsValueInput = ({
|
|
|
6672
6690
|
PresetTagsValueInput.displayName = "PresetTagsValueInput";
|
|
6673
6691
|
|
|
6674
6692
|
// src/components/ui/filter/value-inputs/select-value-input.tsx
|
|
6693
|
+
var import_icons29 = require("@l3mpire/icons");
|
|
6675
6694
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6695
|
+
var intentDotClass = {
|
|
6696
|
+
primary: "bg-primary",
|
|
6697
|
+
success: "bg-success",
|
|
6698
|
+
warning: "bg-warning",
|
|
6699
|
+
critical: "bg-destructive",
|
|
6700
|
+
neutral: "bg-muted-foreground"
|
|
6701
|
+
};
|
|
6702
|
+
var IntentDot = ({ intent }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6703
|
+
"span",
|
|
6704
|
+
{
|
|
6705
|
+
className: cn(
|
|
6706
|
+
"shrink-0 size-2 rounded-full",
|
|
6707
|
+
intentDotClass[intent]
|
|
6708
|
+
),
|
|
6709
|
+
"aria-hidden": true
|
|
6710
|
+
}
|
|
6711
|
+
);
|
|
6712
|
+
var OptionLeading = ({ option }) => {
|
|
6713
|
+
if (option.icon) {
|
|
6714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6715
|
+
import_icons29.Icon,
|
|
6716
|
+
{
|
|
6717
|
+
icon: option.icon,
|
|
6718
|
+
size: "sm",
|
|
6719
|
+
className: "shrink-0 text-dropdown-item-icon"
|
|
6720
|
+
}
|
|
6721
|
+
);
|
|
6722
|
+
}
|
|
6723
|
+
if (option.intent) {
|
|
6724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(IntentDot, { intent: option.intent });
|
|
6725
|
+
}
|
|
6726
|
+
return null;
|
|
6727
|
+
};
|
|
6676
6728
|
var DynamicOptionRow = ({
|
|
6677
6729
|
option,
|
|
6678
6730
|
selected,
|
|
@@ -6745,20 +6797,26 @@ var SingleSelectValueInput = ({
|
|
|
6745
6797
|
},
|
|
6746
6798
|
opt.value
|
|
6747
6799
|
)),
|
|
6748
|
-
options.map((
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6800
|
+
options.map((rawOpt) => {
|
|
6801
|
+
const opt = resolveEnumOption(rawOpt);
|
|
6802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6803
|
+
"button",
|
|
6804
|
+
{
|
|
6805
|
+
type: "button",
|
|
6806
|
+
onClick: () => pick(opt.value),
|
|
6807
|
+
className: cn(
|
|
6808
|
+
"flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
|
|
6809
|
+
"hover:bg-dropdown-item-hover",
|
|
6810
|
+
value === opt.value && "bg-dropdown-item-hover"
|
|
6811
|
+
),
|
|
6812
|
+
children: [
|
|
6813
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(OptionLeading, { option: opt }),
|
|
6814
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground truncate", children: opt.label })
|
|
6815
|
+
]
|
|
6816
|
+
},
|
|
6817
|
+
opt.value
|
|
6818
|
+
);
|
|
6819
|
+
})
|
|
6762
6820
|
]
|
|
6763
6821
|
}
|
|
6764
6822
|
);
|
|
@@ -6789,13 +6847,14 @@ var MultiSelectValueInput = ({
|
|
|
6789
6847
|
},
|
|
6790
6848
|
opt.value
|
|
6791
6849
|
)),
|
|
6792
|
-
options.map((
|
|
6793
|
-
const
|
|
6850
|
+
options.map((rawOpt) => {
|
|
6851
|
+
const opt = resolveEnumOption(rawOpt);
|
|
6852
|
+
const isSelected = selected.includes(opt.value);
|
|
6794
6853
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6795
6854
|
"button",
|
|
6796
6855
|
{
|
|
6797
6856
|
type: "button",
|
|
6798
|
-
onClick: () => toggle(opt),
|
|
6857
|
+
onClick: () => toggle(opt.value),
|
|
6799
6858
|
className: cn(
|
|
6800
6859
|
"flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
|
|
6801
6860
|
"hover:bg-dropdown-item-hover"
|
|
@@ -6805,7 +6864,7 @@ var MultiSelectValueInput = ({
|
|
|
6805
6864
|
"span",
|
|
6806
6865
|
{
|
|
6807
6866
|
className: cn(
|
|
6808
|
-
"flex items-center justify-center size-4 rounded-xs border transition-colors",
|
|
6867
|
+
"flex items-center justify-center size-4 rounded-xs border transition-colors shrink-0",
|
|
6809
6868
|
isSelected ? "bg-primary border-primary" : "border-input bg-background"
|
|
6810
6869
|
),
|
|
6811
6870
|
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -6820,10 +6879,11 @@ var MultiSelectValueInput = ({
|
|
|
6820
6879
|
) })
|
|
6821
6880
|
}
|
|
6822
6881
|
),
|
|
6823
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6882
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(OptionLeading, { option: opt }),
|
|
6883
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground truncate", children: opt.label })
|
|
6824
6884
|
]
|
|
6825
6885
|
},
|
|
6826
|
-
opt
|
|
6886
|
+
opt.value
|
|
6827
6887
|
);
|
|
6828
6888
|
})
|
|
6829
6889
|
] }),
|
|
@@ -6930,9 +6990,9 @@ ValueInput.displayName = "ValueInput";
|
|
|
6930
6990
|
// src/components/ui/filter/property-selector.tsx
|
|
6931
6991
|
var React44 = __toESM(require("react"));
|
|
6932
6992
|
var PopoverPrimitive6 = __toESM(require("@radix-ui/react-popover"));
|
|
6933
|
-
var
|
|
6993
|
+
var import_icons30 = require("@l3mpire/icons");
|
|
6934
6994
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6935
|
-
var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6995
|
+
var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "shrink-0 flex flex-col", children: [
|
|
6936
6996
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-px bg-dropdown-border mx-xs" }),
|
|
6937
6997
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6938
6998
|
"button",
|
|
@@ -6943,9 +7003,9 @@ var AdvancedFilterFooter = ({ onClick, count }) => /* @__PURE__ */ (0, import_js
|
|
|
6943
7003
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
6944
7004
|
children: [
|
|
6945
7005
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6946
|
-
|
|
7006
|
+
import_icons30.Icon,
|
|
6947
7007
|
{
|
|
6948
|
-
icon:
|
|
7008
|
+
icon: import_icons30.faFilterOutline,
|
|
6949
7009
|
size: "sm",
|
|
6950
7010
|
className: "shrink-0 text-dropdown-item-icon"
|
|
6951
7011
|
}
|
|
@@ -6983,9 +7043,21 @@ var PropertySelector = ({
|
|
|
6983
7043
|
setSearch("");
|
|
6984
7044
|
}
|
|
6985
7045
|
}, [open]);
|
|
7046
|
+
const pinnedGroupIds = React44.useMemo(() => {
|
|
7047
|
+
const set = /* @__PURE__ */ new Set();
|
|
7048
|
+
for (const p of properties) {
|
|
7049
|
+
if (p.groupPinned) set.add(p.group);
|
|
7050
|
+
}
|
|
7051
|
+
return set;
|
|
7052
|
+
}, [properties]);
|
|
7053
|
+
const pinnedProperties = React44.useMemo(
|
|
7054
|
+
() => properties.filter((p) => pinnedGroupIds.has(p.group)),
|
|
7055
|
+
[properties, pinnedGroupIds]
|
|
7056
|
+
);
|
|
6986
7057
|
const groups = React44.useMemo(() => {
|
|
6987
7058
|
const map = /* @__PURE__ */ new Map();
|
|
6988
7059
|
for (const prop of properties) {
|
|
7060
|
+
if (pinnedGroupIds.has(prop.group)) continue;
|
|
6989
7061
|
const existing = map.get(prop.group);
|
|
6990
7062
|
if (existing) {
|
|
6991
7063
|
existing.count++;
|
|
@@ -6999,12 +7071,14 @@ var PropertySelector = ({
|
|
|
6999
7071
|
}
|
|
7000
7072
|
}
|
|
7001
7073
|
return Array.from(map.values());
|
|
7002
|
-
}, [properties]);
|
|
7003
|
-
const
|
|
7004
|
-
if (!search || activeGroup) return
|
|
7074
|
+
}, [properties, pinnedGroupIds]);
|
|
7075
|
+
const filteredPinnedProperties = React44.useMemo(() => {
|
|
7076
|
+
if (!search || activeGroup) return pinnedProperties;
|
|
7005
7077
|
const lower = search.toLowerCase();
|
|
7006
|
-
return
|
|
7007
|
-
|
|
7078
|
+
return pinnedProperties.filter(
|
|
7079
|
+
(p) => p.label.toLowerCase().includes(lower)
|
|
7080
|
+
);
|
|
7081
|
+
}, [pinnedProperties, search, activeGroup]);
|
|
7008
7082
|
const filteredGroups = React44.useMemo(() => {
|
|
7009
7083
|
if (!search || activeGroup) return groups;
|
|
7010
7084
|
const lower = search.toLowerCase();
|
|
@@ -7022,7 +7096,13 @@ var PropertySelector = ({
|
|
|
7022
7096
|
return groupProps.filter((p) => p.label.toLowerCase().includes(lower));
|
|
7023
7097
|
}, [properties, activeGroup, search]);
|
|
7024
7098
|
const activeGroupInfo = groups.find((g) => g.group === activeGroup);
|
|
7025
|
-
const
|
|
7099
|
+
const nonPinnedSearchResults = React44.useMemo(() => {
|
|
7100
|
+
if (!search || activeGroup) return [];
|
|
7101
|
+
const lower = search.toLowerCase();
|
|
7102
|
+
return properties.filter(
|
|
7103
|
+
(p) => !pinnedGroupIds.has(p.group) && p.label.toLowerCase().includes(lower)
|
|
7104
|
+
);
|
|
7105
|
+
}, [properties, search, activeGroup, pinnedGroupIds]);
|
|
7026
7106
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(PopoverPrimitive6.Root, { open, onOpenChange, children: [
|
|
7027
7107
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverPrimitive6.Trigger, { asChild: true, children }),
|
|
7028
7108
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverPrimitive6.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
@@ -7032,22 +7112,22 @@ var PropertySelector = ({
|
|
|
7032
7112
|
align: "start",
|
|
7033
7113
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7034
7114
|
className: cn(
|
|
7035
|
-
"z-50 flex flex-col gap-xs overflow-
|
|
7115
|
+
"z-50 flex flex-col gap-xs overflow-hidden p-xs",
|
|
7036
7116
|
"bg-dropdown-bg border border-dropdown-border rounded-md shadow-lg",
|
|
7037
7117
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
7038
7118
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
7039
7119
|
"data-[side=bottom]:slide-in-from-top-2",
|
|
7040
|
-
"min-w-[230px]"
|
|
7120
|
+
"min-w-[230px] max-h-[360px]"
|
|
7041
7121
|
),
|
|
7042
7122
|
children: [
|
|
7043
7123
|
activeGroup === null ? (
|
|
7044
|
-
/* ── Level 1: Search + Categories
|
|
7045
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-xs", children: [
|
|
7046
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-base px-md py-base border border-input rounded-md", children: [
|
|
7124
|
+
/* ── Level 1: Search + (pinned props) + Categories ──────── */
|
|
7125
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-xs flex-1 min-h-0", children: [
|
|
7126
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "shrink-0 flex items-center gap-base px-md py-base border border-input rounded-md", children: [
|
|
7047
7127
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7048
|
-
|
|
7128
|
+
import_icons30.Icon,
|
|
7049
7129
|
{
|
|
7050
|
-
icon:
|
|
7130
|
+
icon: import_icons30.faMagnifyingGlassOutline,
|
|
7051
7131
|
size: "sm",
|
|
7052
7132
|
className: "shrink-0 text-muted-foreground"
|
|
7053
7133
|
}
|
|
@@ -7064,9 +7144,8 @@ var PropertySelector = ({
|
|
|
7064
7144
|
}
|
|
7065
7145
|
)
|
|
7066
7146
|
] }),
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex flex-col max-h-[300px] overflow-y-auto", children: globalSearchResults.map((prop) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
7147
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col flex-1 min-h-0 overflow-y-auto", children: [
|
|
7148
|
+
filteredPinnedProperties.map((prop) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
7070
7149
|
"button",
|
|
7071
7150
|
{
|
|
7072
7151
|
type: "button",
|
|
@@ -7077,22 +7156,46 @@ var PropertySelector = ({
|
|
|
7077
7156
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7078
7157
|
children: [
|
|
7079
7158
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7080
|
-
|
|
7159
|
+
import_icons30.Icon,
|
|
7081
7160
|
{
|
|
7082
7161
|
icon: prop.icon,
|
|
7083
7162
|
size: "sm",
|
|
7084
7163
|
className: "shrink-0 text-dropdown-item-icon"
|
|
7085
7164
|
}
|
|
7086
7165
|
),
|
|
7087
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-dropdown-item-text text-left truncate", children: prop.label })
|
|
7088
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs font-regular leading-xs text-muted-foreground", children: prop.groupLabel })
|
|
7166
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-dropdown-item-text text-left truncate", children: prop.label })
|
|
7089
7167
|
]
|
|
7090
7168
|
},
|
|
7091
7169
|
prop.id
|
|
7092
|
-
))
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7170
|
+
)),
|
|
7171
|
+
search ? (
|
|
7172
|
+
/* ── Flat matches across non-pinned groups ────────── */
|
|
7173
|
+
nonPinnedSearchResults.map((prop) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
7174
|
+
"button",
|
|
7175
|
+
{
|
|
7176
|
+
type: "button",
|
|
7177
|
+
onClick: () => {
|
|
7178
|
+
onSelect(prop);
|
|
7179
|
+
onOpenChange?.(false);
|
|
7180
|
+
},
|
|
7181
|
+
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7182
|
+
children: [
|
|
7183
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7184
|
+
import_icons30.Icon,
|
|
7185
|
+
{
|
|
7186
|
+
icon: prop.icon,
|
|
7187
|
+
size: "sm",
|
|
7188
|
+
className: "shrink-0 text-dropdown-item-icon"
|
|
7189
|
+
}
|
|
7190
|
+
),
|
|
7191
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-dropdown-item-text text-left truncate", children: prop.label }),
|
|
7192
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs font-regular leading-xs text-muted-foreground", children: prop.groupLabel })
|
|
7193
|
+
]
|
|
7194
|
+
},
|
|
7195
|
+
prop.id
|
|
7196
|
+
))
|
|
7197
|
+
) : (
|
|
7198
|
+
/* ── Category list ────────────────────────────────── */
|
|
7096
7199
|
filteredGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
7097
7200
|
"button",
|
|
7098
7201
|
{
|
|
@@ -7104,7 +7207,7 @@ var PropertySelector = ({
|
|
|
7104
7207
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7105
7208
|
children: [
|
|
7106
7209
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7107
|
-
|
|
7210
|
+
import_icons30.Icon,
|
|
7108
7211
|
{
|
|
7109
7212
|
icon: g.groupIcon,
|
|
7110
7213
|
size: "sm",
|
|
@@ -7114,9 +7217,9 @@ var PropertySelector = ({
|
|
|
7114
7217
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex-1 text-sm font-regular leading-sm text-dropdown-item-text text-left truncate", children: g.groupLabel }),
|
|
7115
7218
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs font-medium leading-xs text-muted-foreground", children: g.count }),
|
|
7116
7219
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7117
|
-
|
|
7220
|
+
import_icons30.Icon,
|
|
7118
7221
|
{
|
|
7119
|
-
icon:
|
|
7222
|
+
icon: import_icons30.faChevronRightOutline,
|
|
7120
7223
|
size: "xs",
|
|
7121
7224
|
className: "shrink-0 text-dropdown-item-icon"
|
|
7122
7225
|
}
|
|
@@ -7124,14 +7227,14 @@ var PropertySelector = ({
|
|
|
7124
7227
|
]
|
|
7125
7228
|
},
|
|
7126
7229
|
g.group
|
|
7127
|
-
))
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
)
|
|
7230
|
+
))
|
|
7231
|
+
),
|
|
7232
|
+
filteredPinnedProperties.length === 0 && (search ? nonPinnedSearchResults.length === 0 : filteredGroups.length === 0) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "p-base text-sm text-muted-foreground", children: "No results" })
|
|
7233
|
+
] })
|
|
7131
7234
|
] })
|
|
7132
7235
|
) : (
|
|
7133
7236
|
/* ── Level 2: Properties ─────────────────────────────────── */
|
|
7134
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-xs", children: [
|
|
7237
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-xs flex-1 min-h-0", children: [
|
|
7135
7238
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
7136
7239
|
"button",
|
|
7137
7240
|
{
|
|
@@ -7140,12 +7243,12 @@ var PropertySelector = ({
|
|
|
7140
7243
|
setActiveGroup(null);
|
|
7141
7244
|
setSearch("");
|
|
7142
7245
|
},
|
|
7143
|
-
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7246
|
+
className: "shrink-0 flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7144
7247
|
children: [
|
|
7145
7248
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7146
|
-
|
|
7249
|
+
import_icons30.Icon,
|
|
7147
7250
|
{
|
|
7148
|
-
icon:
|
|
7251
|
+
icon: import_icons30.faChevronLeftOutline,
|
|
7149
7252
|
size: "sm",
|
|
7150
7253
|
className: "shrink-0 text-dropdown-item-icon"
|
|
7151
7254
|
}
|
|
@@ -7154,11 +7257,11 @@ var PropertySelector = ({
|
|
|
7154
7257
|
]
|
|
7155
7258
|
}
|
|
7156
7259
|
),
|
|
7157
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-base px-md py-base border border-input rounded-md", children: [
|
|
7260
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "shrink-0 flex items-center gap-base px-md py-base border border-input rounded-md", children: [
|
|
7158
7261
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7159
|
-
|
|
7262
|
+
import_icons30.Icon,
|
|
7160
7263
|
{
|
|
7161
|
-
icon:
|
|
7264
|
+
icon: import_icons30.faMagnifyingGlassOutline,
|
|
7162
7265
|
size: "sm",
|
|
7163
7266
|
className: "shrink-0 text-muted-foreground"
|
|
7164
7267
|
}
|
|
@@ -7175,7 +7278,7 @@ var PropertySelector = ({
|
|
|
7175
7278
|
}
|
|
7176
7279
|
)
|
|
7177
7280
|
] }),
|
|
7178
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col
|
|
7281
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col flex-1 min-h-0 overflow-y-auto", children: [
|
|
7179
7282
|
filteredProperties.map((prop) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
7180
7283
|
"button",
|
|
7181
7284
|
{
|
|
@@ -7187,7 +7290,7 @@ var PropertySelector = ({
|
|
|
7187
7290
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7188
7291
|
children: [
|
|
7189
7292
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7190
|
-
|
|
7293
|
+
import_icons30.Icon,
|
|
7191
7294
|
{
|
|
7192
7295
|
icon: prop.icon,
|
|
7193
7296
|
size: "sm",
|
|
@@ -7219,7 +7322,7 @@ PropertySelector.displayName = "PropertySelector";
|
|
|
7219
7322
|
|
|
7220
7323
|
// src/components/ui/filter/kebab-menu.tsx
|
|
7221
7324
|
var PopoverPrimitive7 = __toESM(require("@radix-ui/react-popover"));
|
|
7222
|
-
var
|
|
7325
|
+
var import_icons31 = require("@l3mpire/icons");
|
|
7223
7326
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
7224
7327
|
var KebabMenu = ({
|
|
7225
7328
|
onConvertToAdvanced,
|
|
@@ -7255,9 +7358,9 @@ var KebabMenu = ({
|
|
|
7255
7358
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7256
7359
|
children: [
|
|
7257
7360
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7258
|
-
|
|
7361
|
+
import_icons31.Icon,
|
|
7259
7362
|
{
|
|
7260
|
-
icon:
|
|
7363
|
+
icon: import_icons31.faArrowRightOutline,
|
|
7261
7364
|
size: "sm",
|
|
7262
7365
|
className: "shrink-0 text-dropdown-item-icon"
|
|
7263
7366
|
}
|
|
@@ -7278,9 +7381,9 @@ var KebabMenu = ({
|
|
|
7278
7381
|
className: "flex items-center gap-base p-base rounded-base cursor-pointer transition-colors hover:bg-dropdown-item-hover",
|
|
7279
7382
|
children: [
|
|
7280
7383
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7281
|
-
|
|
7384
|
+
import_icons31.Icon,
|
|
7282
7385
|
{
|
|
7283
|
-
icon:
|
|
7386
|
+
icon: import_icons31.faTrashOutline,
|
|
7284
7387
|
size: "sm",
|
|
7285
7388
|
className: "shrink-0 text-destructive"
|
|
7286
7389
|
}
|
|
@@ -7298,7 +7401,7 @@ KebabMenu.displayName = "KebabMenu";
|
|
|
7298
7401
|
// src/components/ui/filter/filter-editor.tsx
|
|
7299
7402
|
var React45 = __toESM(require("react"));
|
|
7300
7403
|
var PopoverPrimitive8 = __toESM(require("@radix-ui/react-popover"));
|
|
7301
|
-
var
|
|
7404
|
+
var import_icons32 = require("@l3mpire/icons");
|
|
7302
7405
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7303
7406
|
var FilterEditor = ({
|
|
7304
7407
|
propertyDef,
|
|
@@ -7362,7 +7465,7 @@ var FilterEditor = ({
|
|
|
7362
7465
|
children: [
|
|
7363
7466
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-base px-base pt-base pb-xs border-b border-border", children: [
|
|
7364
7467
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7365
|
-
|
|
7468
|
+
import_icons32.Icon,
|
|
7366
7469
|
{
|
|
7367
7470
|
icon: propertyDef.icon,
|
|
7368
7471
|
size: "sm",
|
|
@@ -7412,6 +7515,7 @@ FilterEditor.displayName = "FilterEditor";
|
|
|
7412
7515
|
// src/components/ui/filter/interactive-filter-chip.tsx
|
|
7413
7516
|
var React46 = __toESM(require("react"));
|
|
7414
7517
|
var PopoverPrimitive9 = __toESM(require("@radix-ui/react-popover"));
|
|
7518
|
+
var import_icons33 = require("@l3mpire/icons");
|
|
7415
7519
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
7416
7520
|
var SegmentPopover = ({
|
|
7417
7521
|
open,
|
|
@@ -7490,9 +7594,31 @@ var InteractiveFilterChip = ({
|
|
|
7490
7594
|
setValueOpen(false);
|
|
7491
7595
|
};
|
|
7492
7596
|
const hasOperator = !!condition.operator;
|
|
7493
|
-
const displayValue = formatFilterValue(
|
|
7597
|
+
const displayValue = formatFilterValue(
|
|
7598
|
+
condition.value,
|
|
7599
|
+
propertyDef.dynamicOptions,
|
|
7600
|
+
false,
|
|
7601
|
+
propertyDef.options
|
|
7602
|
+
);
|
|
7494
7603
|
const hasValue = hasOperator && displayValue != null;
|
|
7495
7604
|
const badgeCount = getBadgeCount(condition.value);
|
|
7605
|
+
const valueLeading = React46.useMemo(() => {
|
|
7606
|
+
const v = condition.value;
|
|
7607
|
+
const raw = typeof v === "string" ? v : Array.isArray(v) && typeof v[0] === "string" ? v[0] : null;
|
|
7608
|
+
if (!raw) return null;
|
|
7609
|
+
const opt = findEnumOption(raw, propertyDef.options);
|
|
7610
|
+
if (opt?.icon) {
|
|
7611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7612
|
+
import_icons33.Icon,
|
|
7613
|
+
{
|
|
7614
|
+
icon: opt.icon,
|
|
7615
|
+
size: "sm",
|
|
7616
|
+
className: "shrink-0 text-filter-chip-segment-icon"
|
|
7617
|
+
}
|
|
7618
|
+
);
|
|
7619
|
+
}
|
|
7620
|
+
return null;
|
|
7621
|
+
}, [condition.value, propertyDef.options]);
|
|
7496
7622
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
7497
7623
|
"div",
|
|
7498
7624
|
{
|
|
@@ -7573,6 +7699,7 @@ var InteractiveFilterChip = ({
|
|
|
7573
7699
|
hasBorder: true,
|
|
7574
7700
|
label: hasValue ? displayValue : "Enter value",
|
|
7575
7701
|
badgeCount,
|
|
7702
|
+
adornment: hasValue ? valueLeading : void 0,
|
|
7576
7703
|
onClick: () => setValueOpen(true)
|
|
7577
7704
|
}
|
|
7578
7705
|
) }),
|
|
@@ -7627,11 +7754,11 @@ InteractiveFilterChip.displayName = "InteractiveFilterChip";
|
|
|
7627
7754
|
|
|
7628
7755
|
// src/components/ui/filter/filter-system.tsx
|
|
7629
7756
|
var React54 = __toESM(require("react"));
|
|
7630
|
-
var
|
|
7757
|
+
var import_icons40 = require("@l3mpire/icons");
|
|
7631
7758
|
|
|
7632
7759
|
// src/components/ui/filter/advanced-chip.tsx
|
|
7633
7760
|
var React47 = __toESM(require("react"));
|
|
7634
|
-
var
|
|
7761
|
+
var import_icons34 = require("@l3mpire/icons");
|
|
7635
7762
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7636
7763
|
var btnBase = [
|
|
7637
7764
|
"flex items-center justify-center",
|
|
@@ -7657,9 +7784,9 @@ var AdvancedChip = React47.forwardRef(
|
|
|
7657
7784
|
...props,
|
|
7658
7785
|
children: [
|
|
7659
7786
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7660
|
-
|
|
7787
|
+
import_icons34.Icon,
|
|
7661
7788
|
{
|
|
7662
|
-
icon:
|
|
7789
|
+
icon: import_icons34.faFilterOutline,
|
|
7663
7790
|
size: "sm",
|
|
7664
7791
|
className: "shrink-0 text-foreground"
|
|
7665
7792
|
}
|
|
@@ -7683,7 +7810,7 @@ var AdvancedChip = React47.forwardRef(
|
|
|
7683
7810
|
"rounded-r-md -ml-px"
|
|
7684
7811
|
),
|
|
7685
7812
|
"aria-label": "Clear all advanced filters",
|
|
7686
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons34.Icon, { icon: import_icons34.faXmarkOutline, size: "sm", className: "text-foreground" })
|
|
7687
7814
|
}
|
|
7688
7815
|
)
|
|
7689
7816
|
] })
|
|
@@ -7693,18 +7820,18 @@ AdvancedChip.displayName = "AdvancedChip";
|
|
|
7693
7820
|
// src/components/ui/filter/advanced-popover.tsx
|
|
7694
7821
|
var React51 = __toESM(require("react"));
|
|
7695
7822
|
var PopoverPrimitive12 = __toESM(require("@radix-ui/react-popover"));
|
|
7696
|
-
var
|
|
7823
|
+
var import_icons38 = require("@l3mpire/icons");
|
|
7697
7824
|
|
|
7698
7825
|
// src/components/ui/filter/advanced-row.tsx
|
|
7699
7826
|
var React49 = __toESM(require("react"));
|
|
7700
7827
|
var PopoverPrimitive11 = __toESM(require("@radix-ui/react-popover"));
|
|
7701
7828
|
var TooltipPrimitive4 = __toESM(require("@radix-ui/react-tooltip"));
|
|
7702
|
-
var
|
|
7829
|
+
var import_icons36 = require("@l3mpire/icons");
|
|
7703
7830
|
|
|
7704
7831
|
// src/components/ui/filter/filter-node-actions.tsx
|
|
7705
7832
|
var React48 = __toESM(require("react"));
|
|
7706
7833
|
var PopoverPrimitive10 = __toESM(require("@radix-ui/react-popover"));
|
|
7707
|
-
var
|
|
7834
|
+
var import_icons35 = require("@l3mpire/icons");
|
|
7708
7835
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7709
7836
|
var FilterNodeActions = ({
|
|
7710
7837
|
nodeType,
|
|
@@ -7716,17 +7843,17 @@ var FilterNodeActions = ({
|
|
|
7716
7843
|
const items = [
|
|
7717
7844
|
{
|
|
7718
7845
|
label: "Duplicate",
|
|
7719
|
-
icon:
|
|
7846
|
+
icon: import_icons35.faCopyOutline,
|
|
7720
7847
|
action: onDuplicate
|
|
7721
7848
|
},
|
|
7722
7849
|
{
|
|
7723
7850
|
label: nodeType === "condition" ? "Turn into group" : "Turn into filter",
|
|
7724
|
-
icon: nodeType === "condition" ?
|
|
7851
|
+
icon: nodeType === "condition" ? import_icons35.faFolderOutline : import_icons35.faFilterOutline,
|
|
7725
7852
|
action: onConvert
|
|
7726
7853
|
},
|
|
7727
7854
|
{
|
|
7728
7855
|
label: "Delete",
|
|
7729
|
-
icon:
|
|
7856
|
+
icon: import_icons35.faTrashOutline,
|
|
7730
7857
|
action: onDelete,
|
|
7731
7858
|
destructive: true
|
|
7732
7859
|
}
|
|
@@ -7739,9 +7866,9 @@ var FilterNodeActions = ({
|
|
|
7739
7866
|
className: "shrink-0 flex items-center justify-center p-sm rounded-md cursor-pointer transition-colors hover:bg-accent",
|
|
7740
7867
|
"aria-label": "More actions",
|
|
7741
7868
|
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7742
|
-
|
|
7869
|
+
import_icons35.Icon,
|
|
7743
7870
|
{
|
|
7744
|
-
icon:
|
|
7871
|
+
icon: import_icons35.faEllipsisOutline,
|
|
7745
7872
|
size: "sm",
|
|
7746
7873
|
className: "text-foreground"
|
|
7747
7874
|
}
|
|
@@ -7775,7 +7902,7 @@ var FilterNodeActions = ({
|
|
|
7775
7902
|
),
|
|
7776
7903
|
children: [
|
|
7777
7904
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7778
|
-
|
|
7905
|
+
import_icons35.Icon,
|
|
7779
7906
|
{
|
|
7780
7907
|
icon: item.icon,
|
|
7781
7908
|
size: "sm",
|
|
@@ -7830,6 +7957,19 @@ var AdvancedRow = ({
|
|
|
7830
7957
|
const [operatorOpen, setOperatorOpen] = React49.useState(false);
|
|
7831
7958
|
const [propertyOpen, setPropertyOpen] = React49.useState(false);
|
|
7832
7959
|
const [valueOpen, setValueOpen] = React49.useState(false);
|
|
7960
|
+
const { pinnedProperties, unpinnedProperties } = React49.useMemo(() => {
|
|
7961
|
+
const pinnedGroups = /* @__PURE__ */ new Set();
|
|
7962
|
+
for (const p of properties) {
|
|
7963
|
+
if (p.groupPinned) pinnedGroups.add(p.group);
|
|
7964
|
+
}
|
|
7965
|
+
const pinned = [];
|
|
7966
|
+
const unpinned = [];
|
|
7967
|
+
for (const p of properties) {
|
|
7968
|
+
if (pinnedGroups.has(p.group)) pinned.push(p);
|
|
7969
|
+
else unpinned.push(p);
|
|
7970
|
+
}
|
|
7971
|
+
return { pinnedProperties: pinned, unpinnedProperties: unpinned };
|
|
7972
|
+
}, [properties]);
|
|
7833
7973
|
const handleOperatorSelect = (op) => {
|
|
7834
7974
|
if (isNoValueOperator(op)) {
|
|
7835
7975
|
onUpdate({ ...condition, operator: op, value: null });
|
|
@@ -7842,7 +7982,18 @@ var AdvancedRow = ({
|
|
|
7842
7982
|
const handleValueChange = (val) => {
|
|
7843
7983
|
onUpdate({ ...condition, value: val });
|
|
7844
7984
|
};
|
|
7845
|
-
const displayValue = formatFilterValue(
|
|
7985
|
+
const displayValue = formatFilterValue(
|
|
7986
|
+
condition.value,
|
|
7987
|
+
propertyDef.dynamicOptions,
|
|
7988
|
+
false,
|
|
7989
|
+
propertyDef.options
|
|
7990
|
+
);
|
|
7991
|
+
const valueLeadingIcon = React49.useMemo(() => {
|
|
7992
|
+
const v = condition.value;
|
|
7993
|
+
const raw = typeof v === "string" ? v : Array.isArray(v) && typeof v[0] === "string" ? v[0] : null;
|
|
7994
|
+
if (!raw) return null;
|
|
7995
|
+
return findEnumOption(raw, propertyDef.options)?.icon ?? null;
|
|
7996
|
+
}, [condition.value, propertyDef.options]);
|
|
7846
7997
|
const badgeCount = getBadgeCount(condition.value);
|
|
7847
7998
|
const hasValue = displayValue != null;
|
|
7848
7999
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-base w-full min-w-0", children: [
|
|
@@ -7862,11 +8013,11 @@ var AdvancedRow = ({
|
|
|
7862
8013
|
] }) }) }),
|
|
7863
8014
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PopoverPrimitive11.Root, { open: propertyOpen, onOpenChange: setPropertyOpen, children: [
|
|
7864
8015
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
|
|
7865
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8016
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: propertyDef.icon, size: "sm", className: "shrink-0 text-muted-foreground" }),
|
|
7866
8017
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground whitespace-nowrap truncate", children: propertyDef.label }),
|
|
7867
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8018
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: import_icons36.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
|
|
7868
8019
|
] }) }),
|
|
7869
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.
|
|
8020
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
7870
8021
|
PopoverPrimitive11.Content,
|
|
7871
8022
|
{
|
|
7872
8023
|
sideOffset: 4,
|
|
@@ -7878,33 +8029,56 @@ var AdvancedRow = ({
|
|
|
7878
8029
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
7879
8030
|
"min-w-[200px]"
|
|
7880
8031
|
),
|
|
7881
|
-
children:
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
8032
|
+
children: [
|
|
8033
|
+
pinnedProperties.map((p) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8034
|
+
"button",
|
|
8035
|
+
{
|
|
8036
|
+
type: "button",
|
|
8037
|
+
onClick: () => {
|
|
8038
|
+
onPropertyChange(p);
|
|
8039
|
+
setPropertyOpen(false);
|
|
8040
|
+
},
|
|
8041
|
+
className: cn(
|
|
8042
|
+
"flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
|
|
8043
|
+
"hover:bg-dropdown-item-hover",
|
|
8044
|
+
p.id === condition.propertyId && "bg-dropdown-item-hover"
|
|
8045
|
+
),
|
|
8046
|
+
children: [
|
|
8047
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-dropdown-item-icon" }),
|
|
8048
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-dropdown-item-text truncate", children: p.label })
|
|
8049
|
+
]
|
|
7888
8050
|
},
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
8051
|
+
p.id
|
|
8052
|
+
)),
|
|
8053
|
+
unpinnedProperties.map((p) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8054
|
+
"button",
|
|
8055
|
+
{
|
|
8056
|
+
type: "button",
|
|
8057
|
+
onClick: () => {
|
|
8058
|
+
onPropertyChange(p);
|
|
8059
|
+
setPropertyOpen(false);
|
|
8060
|
+
},
|
|
8061
|
+
className: cn(
|
|
8062
|
+
"flex items-center gap-base p-base rounded-base cursor-pointer transition-colors text-left",
|
|
8063
|
+
"hover:bg-dropdown-item-hover",
|
|
8064
|
+
p.id === condition.propertyId && "bg-dropdown-item-hover"
|
|
8065
|
+
),
|
|
8066
|
+
children: [
|
|
8067
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: p.icon, size: "sm", className: "shrink-0 text-dropdown-item-icon" }),
|
|
8068
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-dropdown-item-text truncate", children: p.label }),
|
|
8069
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ml-auto text-xs font-regular leading-xs text-muted-foreground", children: p.groupLabel })
|
|
8070
|
+
]
|
|
8071
|
+
},
|
|
8072
|
+
p.id
|
|
8073
|
+
))
|
|
8074
|
+
]
|
|
7901
8075
|
}
|
|
7902
8076
|
) })
|
|
7903
8077
|
] }),
|
|
7904
8078
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PopoverPrimitive11.Root, { open: operatorOpen, onOpenChange: setOperatorOpen, children: [
|
|
7905
8079
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("button", { type: "button", className: cn(selectBtnStyle, "min-w-0"), children: [
|
|
7906
8080
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm font-regular leading-sm text-foreground whitespace-nowrap truncate text-left", children: condition.operator ?? "Select" }),
|
|
7907
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8081
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons36.Icon, { icon: import_icons36.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
|
|
7908
8082
|
] }) }),
|
|
7909
8083
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7910
8084
|
PopoverPrimitive11.Content,
|
|
@@ -7965,21 +8139,31 @@ var AdvancedRow = ({
|
|
|
7965
8139
|
type: "button",
|
|
7966
8140
|
className: cn(selectBtnStyle, "flex-1 min-w-[80px] justify-between overflow-hidden"),
|
|
7967
8141
|
children: [
|
|
7968
|
-
multiTags && multiTags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ValueTagRow, { tags: multiTags }) : /* @__PURE__ */ (0, import_jsx_runtime56.
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
8142
|
+
multiTags && multiTags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ValueTagRow, { tags: multiTags }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
8143
|
+
valueLeadingIcon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8144
|
+
import_icons36.Icon,
|
|
8145
|
+
{
|
|
8146
|
+
icon: valueLeadingIcon,
|
|
8147
|
+
size: "sm",
|
|
8148
|
+
className: "shrink-0 text-foreground"
|
|
8149
|
+
}
|
|
8150
|
+
),
|
|
8151
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8152
|
+
"span",
|
|
8153
|
+
{
|
|
8154
|
+
className: cn(
|
|
8155
|
+
"text-sm font-regular leading-sm whitespace-nowrap truncate text-left",
|
|
8156
|
+
hasValue ? "text-foreground" : "text-muted-foreground"
|
|
8157
|
+
),
|
|
8158
|
+
title: hasValue ? displayValue : void 0,
|
|
8159
|
+
children: hasValue ? displayValue : "Select a value"
|
|
8160
|
+
}
|
|
8161
|
+
)
|
|
8162
|
+
] }),
|
|
7979
8163
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7980
|
-
|
|
8164
|
+
import_icons36.Icon,
|
|
7981
8165
|
{
|
|
7982
|
-
icon:
|
|
8166
|
+
icon: import_icons36.faChevronDownOutline,
|
|
7983
8167
|
size: "xs",
|
|
7984
8168
|
className: "shrink-0 text-foreground"
|
|
7985
8169
|
}
|
|
@@ -8108,7 +8292,7 @@ function ValueTagRow({ tags }) {
|
|
|
8108
8292
|
// src/components/ui/filter/advanced-group.tsx
|
|
8109
8293
|
var React50 = __toESM(require("react"));
|
|
8110
8294
|
var TooltipPrimitive5 = __toESM(require("@radix-ui/react-tooltip"));
|
|
8111
|
-
var
|
|
8295
|
+
var import_icons37 = require("@l3mpire/icons");
|
|
8112
8296
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8113
8297
|
var AdvancedGroup = ({
|
|
8114
8298
|
connector,
|
|
@@ -8154,7 +8338,7 @@ var AdvancedGroup = ({
|
|
|
8154
8338
|
type: "button",
|
|
8155
8339
|
className: "flex items-center gap-sm px-base py-sm text-sm font-medium leading-sm text-muted-foreground cursor-pointer transition-colors rounded-md hover:bg-accent hover:text-foreground w-fit",
|
|
8156
8340
|
children: [
|
|
8157
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8341
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons37.Icon, { icon: import_icons37.faPlusOutline, size: "sm" }),
|
|
8158
8342
|
"Add filter"
|
|
8159
8343
|
]
|
|
8160
8344
|
}
|
|
@@ -8371,7 +8555,7 @@ var AdvancedPopover = ({
|
|
|
8371
8555
|
open: addSelectorOpen,
|
|
8372
8556
|
onOpenChange: setAddSelectorOpen,
|
|
8373
8557
|
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("button", { type: "button", className: cn(ghostBtn, "text-foreground"), children: [
|
|
8374
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8558
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-foreground" }),
|
|
8375
8559
|
"Add filter"
|
|
8376
8560
|
] })
|
|
8377
8561
|
}
|
|
@@ -8383,7 +8567,7 @@ var AdvancedPopover = ({
|
|
|
8383
8567
|
onClick: handleAddGroup,
|
|
8384
8568
|
className: cn(ghostBtn, "text-foreground"),
|
|
8385
8569
|
children: [
|
|
8386
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8570
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons38.Icon, { icon: import_icons38.faPlusOutline, size: "sm", className: "text-foreground" }),
|
|
8387
8571
|
"Add filters group"
|
|
8388
8572
|
]
|
|
8389
8573
|
}
|
|
@@ -8396,7 +8580,7 @@ var AdvancedPopover = ({
|
|
|
8396
8580
|
onClick: handleClearAll,
|
|
8397
8581
|
className: cn(ghostBtn, "text-destructive"),
|
|
8398
8582
|
children: [
|
|
8399
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8583
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons38.Icon, { icon: import_icons38.faXmarkOutline, size: "sm", className: "text-destructive" }),
|
|
8400
8584
|
"Clear filters"
|
|
8401
8585
|
]
|
|
8402
8586
|
}
|
|
@@ -8447,9 +8631,9 @@ var DraftRow = ({
|
|
|
8447
8631
|
children: [
|
|
8448
8632
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-sm font-regular leading-sm text-muted-foreground whitespace-nowrap", children: "Select property" }),
|
|
8449
8633
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8450
|
-
|
|
8634
|
+
import_icons38.Icon,
|
|
8451
8635
|
{
|
|
8452
|
-
icon:
|
|
8636
|
+
icon: import_icons38.faChevronDownOutline,
|
|
8453
8637
|
size: "xs",
|
|
8454
8638
|
className: "shrink-0 text-foreground"
|
|
8455
8639
|
}
|
|
@@ -8466,7 +8650,7 @@ var DraftRow = ({
|
|
|
8466
8650
|
var React52 = __toESM(require("react"));
|
|
8467
8651
|
var PopoverPrimitive13 = __toESM(require("@radix-ui/react-popover"));
|
|
8468
8652
|
var TooltipPrimitive6 = __toESM(require("@radix-ui/react-tooltip"));
|
|
8469
|
-
var
|
|
8653
|
+
var import_icons39 = require("@l3mpire/icons");
|
|
8470
8654
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8471
8655
|
var ghostBtn2 = [
|
|
8472
8656
|
"flex items-center gap-sm px-base py-sm",
|
|
@@ -8640,7 +8824,7 @@ var SummaryChip = ({
|
|
|
8640
8824
|
className
|
|
8641
8825
|
),
|
|
8642
8826
|
children: [
|
|
8643
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8827
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faFilterOutline, size: "sm", className: "shrink-0 text-foreground" }),
|
|
8644
8828
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-foreground", children: "Filters" }),
|
|
8645
8829
|
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "flex items-center p-2xs rounded-xs bg-filter-chip-badge-bg", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-[10px] font-medium leading-2xs text-filter-chip-badge-text", children: count }) })
|
|
8646
8830
|
]
|
|
@@ -8696,13 +8880,13 @@ var SummaryChip = ({
|
|
|
8696
8880
|
open: addSelectorOpen,
|
|
8697
8881
|
onOpenChange: setAddSelectorOpen,
|
|
8698
8882
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("button", { type: "button", className: cn(ghostBtn2, "text-foreground"), children: [
|
|
8699
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8883
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faPlusOutline, size: "sm", className: "text-foreground" }),
|
|
8700
8884
|
"Add filter"
|
|
8701
8885
|
] })
|
|
8702
8886
|
}
|
|
8703
8887
|
),
|
|
8704
8888
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("button", { type: "button", onClick: handleAddGroup, className: cn(ghostBtn2, "text-foreground"), children: [
|
|
8705
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8889
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faPlusOutline, size: "sm", className: "text-foreground" }),
|
|
8706
8890
|
"Add filters group"
|
|
8707
8891
|
] })
|
|
8708
8892
|
] }),
|
|
@@ -8716,7 +8900,7 @@ var SummaryChip = ({
|
|
|
8716
8900
|
},
|
|
8717
8901
|
className: cn(ghostBtn2, "text-destructive"),
|
|
8718
8902
|
children: [
|
|
8719
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8903
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faXmarkOutline, size: "sm", className: "text-destructive" }),
|
|
8720
8904
|
"Clear filters"
|
|
8721
8905
|
]
|
|
8722
8906
|
}
|
|
@@ -8753,7 +8937,7 @@ var DraftRow2 = ({ properties, onSelect, open: openProp, onOpenChange }) => {
|
|
|
8753
8937
|
),
|
|
8754
8938
|
children: [
|
|
8755
8939
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-sm font-regular leading-sm text-muted-foreground whitespace-nowrap", children: "Select property" }),
|
|
8756
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8940
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons39.Icon, { icon: import_icons39.faChevronDownOutline, size: "xs", className: "shrink-0 text-foreground" })
|
|
8757
8941
|
]
|
|
8758
8942
|
}
|
|
8759
8943
|
) })
|
|
@@ -8981,7 +9165,7 @@ var FilterSystem = ({
|
|
|
8981
9165
|
{
|
|
8982
9166
|
type: "button",
|
|
8983
9167
|
className: "shrink-0 inline-flex items-center justify-center size-8 rounded-md border border-btn-outlined-neutral-border-default bg-gradient-to-t from-btn-outlined-neutral-bg-default from-[10%] to-btn-outlined-neutral-bg-gradient-to-default shadow-sm cursor-pointer transition-colors hover:from-btn-outlined-neutral-bg-hover hover:to-btn-outlined-neutral-bg-gradient-to-hover",
|
|
8984
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_icons40.Icon, { icon: import_icons40.faPlusOutline, size: "sm", className: "text-foreground" })
|
|
8985
9169
|
}
|
|
8986
9170
|
) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FilterBarButton, {})
|
|
8987
9171
|
}
|