@databrainhq/plugin 0.8.11 → 0.8.12
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.es.js +56 -32
- package/dist/index.umd.js +63 -63
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -7464,6 +7464,7 @@ const useExternalMetric = ({
|
|
|
7464
7464
|
createdBy: clientId || "external user",
|
|
7465
7465
|
clientId,
|
|
7466
7466
|
isCreatedByClient: !!clientId,
|
|
7467
|
+
resizeAttributes: metric == null ? void 0 : metric.resizeAttributes,
|
|
7467
7468
|
externalDashboardMetrics: {
|
|
7468
7469
|
data: dashboardIds.map((externalDashboardId) => ({
|
|
7469
7470
|
externalDashboardId
|
|
@@ -86273,7 +86274,7 @@ const menuContainer$1 = "_menuContainer_1ecv1_13";
|
|
|
86273
86274
|
const buttonText = "_buttonText_1ecv1_19";
|
|
86274
86275
|
const buttonIcon = "_buttonIcon_1ecv1_25";
|
|
86275
86276
|
const filterName = "_filterName_1ecv1_31";
|
|
86276
|
-
const filterDropdown$
|
|
86277
|
+
const filterDropdown$2 = "_filterDropdown_1ecv1_37";
|
|
86277
86278
|
var styles$n = {
|
|
86278
86279
|
button: button$5,
|
|
86279
86280
|
menu: menu$3,
|
|
@@ -86281,7 +86282,7 @@ var styles$n = {
|
|
|
86281
86282
|
buttonText,
|
|
86282
86283
|
buttonIcon,
|
|
86283
86284
|
filterName,
|
|
86284
|
-
filterDropdown: filterDropdown$
|
|
86285
|
+
filterDropdown: filterDropdown$2
|
|
86285
86286
|
};
|
|
86286
86287
|
const container$a = "_container_1qflp_1";
|
|
86287
86288
|
const popover$1 = "_popover_1qflp_9";
|
|
@@ -86387,8 +86388,8 @@ const FilterField = ({
|
|
|
86387
86388
|
tableName
|
|
86388
86389
|
}) => {
|
|
86389
86390
|
const [operator, setOperator] = useState({
|
|
86390
|
-
value: "",
|
|
86391
|
-
label: ""
|
|
86391
|
+
value: "=",
|
|
86392
|
+
label: "Equal to (=)"
|
|
86392
86393
|
});
|
|
86393
86394
|
const [option2, setOption] = useState({
|
|
86394
86395
|
value: "",
|
|
@@ -86493,20 +86494,21 @@ const FilterField = ({
|
|
|
86493
86494
|
})
|
|
86494
86495
|
});
|
|
86495
86496
|
};
|
|
86496
|
-
const container$9 = "
|
|
86497
|
-
const form$1 = "
|
|
86498
|
-
const filterHeader = "
|
|
86499
|
-
const titleContent = "
|
|
86500
|
-
const title = "
|
|
86501
|
-
const buttons = "
|
|
86502
|
-
const apply = "
|
|
86503
|
-
const applyIcon = "
|
|
86504
|
-
const reset = "
|
|
86505
|
-
const filterFields = "
|
|
86506
|
-
const
|
|
86507
|
-
const
|
|
86508
|
-
const
|
|
86509
|
-
const
|
|
86497
|
+
const container$9 = "_container_1cs1m_1";
|
|
86498
|
+
const form$1 = "_form_1cs1m_7";
|
|
86499
|
+
const filterHeader = "_filterHeader_1cs1m_13";
|
|
86500
|
+
const titleContent = "_titleContent_1cs1m_19";
|
|
86501
|
+
const title = "_title_1cs1m_19";
|
|
86502
|
+
const buttons = "_buttons_1cs1m_31";
|
|
86503
|
+
const apply = "_apply_1cs1m_37";
|
|
86504
|
+
const applyIcon = "_applyIcon_1cs1m_43";
|
|
86505
|
+
const reset = "_reset_1cs1m_49";
|
|
86506
|
+
const filterFields = "_filterFields_1cs1m_55";
|
|
86507
|
+
const filterDropdown$1 = "_filterDropdown_1cs1m_61";
|
|
86508
|
+
const filters = "_filters_1cs1m_67";
|
|
86509
|
+
const filterItem = "_filterItem_1cs1m_73";
|
|
86510
|
+
const filterItemOperator = "_filterItemOperator_1cs1m_79";
|
|
86511
|
+
const remove = "_remove_1cs1m_85";
|
|
86510
86512
|
var styles$l = {
|
|
86511
86513
|
container: container$9,
|
|
86512
86514
|
form: form$1,
|
|
@@ -86518,6 +86520,7 @@ var styles$l = {
|
|
|
86518
86520
|
applyIcon,
|
|
86519
86521
|
reset,
|
|
86520
86522
|
filterFields,
|
|
86523
|
+
filterDropdown: filterDropdown$1,
|
|
86521
86524
|
filters,
|
|
86522
86525
|
filterItem,
|
|
86523
86526
|
filterItemOperator,
|
|
@@ -86578,6 +86581,14 @@ const GlobalFilters = ({
|
|
|
86578
86581
|
filters: filterColumns
|
|
86579
86582
|
});
|
|
86580
86583
|
};
|
|
86584
|
+
const getSelectedOption = useCallback((col) => {
|
|
86585
|
+
var _a2;
|
|
86586
|
+
const colValue = ((_a2 = appliedfilters.find((filter2) => filter2.column === col)) == null ? void 0 : _a2.value) || "";
|
|
86587
|
+
return {
|
|
86588
|
+
label: colValue,
|
|
86589
|
+
value: colValue
|
|
86590
|
+
};
|
|
86591
|
+
}, [appliedfilters]);
|
|
86581
86592
|
return /* @__PURE__ */ jsx(Fragment, {
|
|
86582
86593
|
children: /* @__PURE__ */ jsxs("div", {
|
|
86583
86594
|
className: styles$l.container,
|
|
@@ -86617,20 +86628,33 @@ const GlobalFilters = ({
|
|
|
86617
86628
|
})]
|
|
86618
86629
|
}), /* @__PURE__ */ jsx("div", {
|
|
86619
86630
|
className: styles$l.filterFields,
|
|
86620
|
-
children: filters2[0].columns.map((col) => /* @__PURE__ */ jsx(
|
|
86621
|
-
|
|
86622
|
-
|
|
86623
|
-
|
|
86624
|
-
|
|
86625
|
-
|
|
86626
|
-
|
|
86627
|
-
|
|
86628
|
-
|
|
86629
|
-
|
|
86630
|
-
|
|
86631
|
-
|
|
86632
|
-
|
|
86633
|
-
|
|
86631
|
+
children: filters2[0].columns.map((col) => /* @__PURE__ */ jsx("div", {
|
|
86632
|
+
className: styles$l.filterDropdown,
|
|
86633
|
+
children: /* @__PURE__ */ jsx(FilterDropDown, {
|
|
86634
|
+
filter: {
|
|
86635
|
+
tableName: filters2[0].tableName,
|
|
86636
|
+
columnName: col.name
|
|
86637
|
+
},
|
|
86638
|
+
companyId,
|
|
86639
|
+
selectedOption: getSelectedOption(col.name),
|
|
86640
|
+
autoSelected: false,
|
|
86641
|
+
onChange: (option2) => setAppliedFilters((prev) => {
|
|
86642
|
+
const field2 = {
|
|
86643
|
+
column: col.name,
|
|
86644
|
+
operator: "=",
|
|
86645
|
+
value: option2.value
|
|
86646
|
+
};
|
|
86647
|
+
const index2 = prev.findIndex((f2) => f2.column === col.name);
|
|
86648
|
+
if (index2 === -1)
|
|
86649
|
+
return [...prev, field2];
|
|
86650
|
+
const updated = [...prev];
|
|
86651
|
+
updated[index2] = field2;
|
|
86652
|
+
return updated;
|
|
86653
|
+
}),
|
|
86654
|
+
labelDesign: "client",
|
|
86655
|
+
isSearchEnabled: true
|
|
86656
|
+
})
|
|
86657
|
+
}))
|
|
86634
86658
|
})]
|
|
86635
86659
|
}), appliedfilters.length ? /* @__PURE__ */ jsx("ul", {
|
|
86636
86660
|
className: styles$l.filters,
|