@wealthx/shadcn 1.5.3 → 1.5.5
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/.turbo/turbo-build.log +120 -120
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-G2EWIP2N.mjs → chunk-CKPEFZNH.mjs} +96 -158
- package/dist/{chunk-PX4M67XQ.mjs → chunk-HXU5JGLQ.mjs} +4 -2
- package/dist/{chunk-CUSHAIUL.mjs → chunk-QBPNYXTI.mjs} +2 -1
- package/dist/components/ui/contact-alert-dialog/index.js +95 -157
- package/dist/components/ui/contact-alert-dialog/index.mjs +1 -1
- package/dist/components/ui/csv-import-modal.js +2 -1
- package/dist/components/ui/csv-import-modal.mjs +1 -1
- package/dist/components/ui/file-preview-dialog.js +4 -2
- package/dist/components/ui/file-preview-dialog.mjs +1 -1
- package/dist/index.js +101 -160
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/components/ui/contact-alert-dialog/builder-ui.tsx +25 -19
- package/src/components/ui/contact-alert-dialog/config.ts +47 -112
- package/src/components/ui/contact-alert-dialog/contact-alert-dialog.tsx +10 -2
- package/src/components/ui/contact-alert-dialog/types.ts +8 -4
- package/src/components/ui/contact-alert-dialog/utils.ts +0 -4
- package/src/components/ui/csv-import-modal.tsx +4 -1
- package/src/components/ui/file-preview-dialog.tsx +43 -32
|
@@ -669,46 +669,38 @@ var AlertSharingType = /* @__PURE__ */ ((AlertSharingType2) => {
|
|
|
669
669
|
|
|
670
670
|
// src/components/ui/contact-alert-dialog/config.ts
|
|
671
671
|
var import_ui = require("@react-awesome-query-builder/ui");
|
|
672
|
+
var NUMERIC_OPERATORS_DEFAULT = [
|
|
673
|
+
"equal",
|
|
674
|
+
"less",
|
|
675
|
+
"less_or_equal",
|
|
676
|
+
"greater",
|
|
677
|
+
"greater_or_equal"
|
|
678
|
+
];
|
|
672
679
|
var ALERT_QUERY_FIELDS = [
|
|
673
680
|
{
|
|
674
681
|
key: "userMetric.max_loan_amount",
|
|
675
682
|
label: "Borrowing Capacity",
|
|
676
683
|
type: "number",
|
|
677
684
|
unit: "dollar",
|
|
678
|
-
operators:
|
|
679
|
-
|
|
680
|
-
"less",
|
|
681
|
-
"less_or_equal",
|
|
682
|
-
"greater",
|
|
683
|
-
"greater_or_equal",
|
|
684
|
-
"between"
|
|
685
|
-
]
|
|
685
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
686
|
+
min: 0
|
|
686
687
|
},
|
|
687
688
|
{
|
|
688
689
|
key: "userMetric.debt_outstanding",
|
|
689
690
|
label: "Outstanding Debt",
|
|
690
691
|
type: "number",
|
|
691
692
|
unit: "dollar",
|
|
692
|
-
operators:
|
|
693
|
-
|
|
694
|
-
"less",
|
|
695
|
-
"less_or_equal",
|
|
696
|
-
"greater",
|
|
697
|
-
"greater_or_equal"
|
|
698
|
-
]
|
|
693
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
694
|
+
min: 0
|
|
699
695
|
},
|
|
700
696
|
{
|
|
701
697
|
key: "userMetric.lvr",
|
|
702
698
|
label: "Current LVR",
|
|
703
699
|
type: "number",
|
|
704
700
|
unit: "percent",
|
|
705
|
-
operators:
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
"less_or_equal",
|
|
709
|
-
"greater",
|
|
710
|
-
"greater_or_equal"
|
|
711
|
-
]
|
|
701
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
702
|
+
min: 0,
|
|
703
|
+
max: 100
|
|
712
704
|
},
|
|
713
705
|
{
|
|
714
706
|
key: "userMetric.has_met_buying_goal",
|
|
@@ -720,116 +712,76 @@ var ALERT_QUERY_FIELDS = [
|
|
|
720
712
|
label: "Excess Monthly Surplus",
|
|
721
713
|
type: "number",
|
|
722
714
|
unit: "dollar",
|
|
723
|
-
operators:
|
|
724
|
-
|
|
725
|
-
"less",
|
|
726
|
-
"less_or_equal",
|
|
727
|
-
"greater",
|
|
728
|
-
"greater_or_equal"
|
|
729
|
-
]
|
|
715
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
716
|
+
min: 0
|
|
730
717
|
},
|
|
731
718
|
{
|
|
732
719
|
key: "userMetric.equity",
|
|
733
720
|
label: "Equity Amount",
|
|
734
721
|
type: "number",
|
|
735
722
|
unit: "dollar",
|
|
736
|
-
operators:
|
|
737
|
-
|
|
738
|
-
"less",
|
|
739
|
-
"less_or_equal",
|
|
740
|
-
"greater",
|
|
741
|
-
"greater_or_equal"
|
|
742
|
-
]
|
|
723
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
724
|
+
min: 0
|
|
743
725
|
},
|
|
744
726
|
{
|
|
745
727
|
key: "userMetric.max_debt_interest_rate",
|
|
746
728
|
label: "Max Debt Interest Rate",
|
|
747
729
|
type: "number",
|
|
748
730
|
unit: "percent",
|
|
749
|
-
operators:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
"less_or_equal",
|
|
753
|
-
"greater",
|
|
754
|
-
"greater_or_equal"
|
|
755
|
-
]
|
|
731
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
732
|
+
min: 0,
|
|
733
|
+
max: 100
|
|
756
734
|
},
|
|
757
735
|
{
|
|
758
736
|
key: "userMetric.min_debt_interest_rate",
|
|
759
737
|
label: "Min Debt Interest Rate",
|
|
760
738
|
type: "number",
|
|
761
739
|
unit: "percent",
|
|
762
|
-
operators:
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
"less_or_equal",
|
|
766
|
-
"greater",
|
|
767
|
-
"greater_or_equal"
|
|
768
|
-
]
|
|
740
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
741
|
+
min: 0,
|
|
742
|
+
max: 100
|
|
769
743
|
}
|
|
770
744
|
];
|
|
771
|
-
var ALL_NUMERIC_OPERATORS =
|
|
772
|
-
"equal",
|
|
773
|
-
"not_equal",
|
|
774
|
-
"less",
|
|
775
|
-
"less_or_equal",
|
|
776
|
-
"greater",
|
|
777
|
-
"greater_or_equal",
|
|
778
|
-
"between"
|
|
779
|
-
];
|
|
745
|
+
var ALL_NUMERIC_OPERATORS = NUMERIC_OPERATORS_DEFAULT;
|
|
780
746
|
var BOOLEAN_OPERATORS = ["equal"];
|
|
781
747
|
var OPERATOR_LABELS = {
|
|
782
748
|
equal: "=",
|
|
783
|
-
not_equal: "\u2260",
|
|
784
749
|
less: "<",
|
|
785
750
|
less_or_equal: "\u2264",
|
|
786
751
|
greater: ">",
|
|
787
|
-
greater_or_equal: "\u2265"
|
|
788
|
-
between: "between"
|
|
752
|
+
greater_or_equal: "\u2265"
|
|
789
753
|
};
|
|
790
754
|
var SEVERITY_LABELS = {
|
|
791
|
-
|
|
755
|
+
HEALTHY: "Healthy",
|
|
792
756
|
WATCH: "Watch",
|
|
793
757
|
NEED_ACTION: "Need Action"
|
|
794
758
|
};
|
|
795
759
|
var QB_CONFIG = __spreadProps(__spreadValues({}, import_ui.BasicConfig), {
|
|
760
|
+
settings: __spreadProps(__spreadValues({}, import_ui.BasicConfig.settings), {
|
|
761
|
+
maxNesting: 3,
|
|
762
|
+
maxNumberOfRules: 5
|
|
763
|
+
}),
|
|
796
764
|
fields: {
|
|
797
765
|
"userMetric.max_loan_amount": {
|
|
798
766
|
label: "Borrowing Capacity",
|
|
799
767
|
type: "number",
|
|
800
|
-
operators:
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
"less_or_equal",
|
|
804
|
-
"greater",
|
|
805
|
-
"greater_or_equal",
|
|
806
|
-
"between"
|
|
807
|
-
],
|
|
808
|
-
valueSources: ["value"]
|
|
768
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
769
|
+
valueSources: ["value"],
|
|
770
|
+
fieldSettings: { min: 0 }
|
|
809
771
|
},
|
|
810
772
|
"userMetric.debt_outstanding": {
|
|
811
773
|
label: "Outstanding Debt",
|
|
812
774
|
type: "number",
|
|
813
|
-
operators:
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
"less_or_equal",
|
|
817
|
-
"greater",
|
|
818
|
-
"greater_or_equal"
|
|
819
|
-
],
|
|
820
|
-
valueSources: ["value"]
|
|
775
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
776
|
+
valueSources: ["value"],
|
|
777
|
+
fieldSettings: { min: 0 }
|
|
821
778
|
},
|
|
822
779
|
"userMetric.lvr": {
|
|
823
780
|
label: "Current LVR",
|
|
824
781
|
type: "number",
|
|
825
|
-
operators:
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
"less_or_equal",
|
|
829
|
-
"greater",
|
|
830
|
-
"greater_or_equal"
|
|
831
|
-
],
|
|
832
|
-
valueSources: ["value"]
|
|
782
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
783
|
+
valueSources: ["value"],
|
|
784
|
+
fieldSettings: { min: 0, max: 100 }
|
|
833
785
|
},
|
|
834
786
|
"userMetric.has_met_buying_goal": {
|
|
835
787
|
label: "Has Met Buying Goal",
|
|
@@ -840,50 +792,30 @@ var QB_CONFIG = __spreadProps(__spreadValues({}, import_ui.BasicConfig), {
|
|
|
840
792
|
"userMetric.excess_monthly_surplus": {
|
|
841
793
|
label: "Excess Monthly Surplus",
|
|
842
794
|
type: "number",
|
|
843
|
-
operators:
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
"less_or_equal",
|
|
847
|
-
"greater",
|
|
848
|
-
"greater_or_equal"
|
|
849
|
-
],
|
|
850
|
-
valueSources: ["value"]
|
|
795
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
796
|
+
valueSources: ["value"],
|
|
797
|
+
fieldSettings: { min: 0 }
|
|
851
798
|
},
|
|
852
799
|
"userMetric.equity": {
|
|
853
800
|
label: "Equity Amount",
|
|
854
801
|
type: "number",
|
|
855
|
-
operators:
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
"less_or_equal",
|
|
859
|
-
"greater",
|
|
860
|
-
"greater_or_equal"
|
|
861
|
-
],
|
|
862
|
-
valueSources: ["value"]
|
|
802
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
803
|
+
valueSources: ["value"],
|
|
804
|
+
fieldSettings: { min: 0 }
|
|
863
805
|
},
|
|
864
806
|
"userMetric.max_debt_interest_rate": {
|
|
865
807
|
label: "Max Debt Interest Rate",
|
|
866
808
|
type: "number",
|
|
867
|
-
operators:
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
"less_or_equal",
|
|
871
|
-
"greater",
|
|
872
|
-
"greater_or_equal"
|
|
873
|
-
],
|
|
874
|
-
valueSources: ["value"]
|
|
809
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
810
|
+
valueSources: ["value"],
|
|
811
|
+
fieldSettings: { min: 0, max: 100 }
|
|
875
812
|
},
|
|
876
813
|
"userMetric.min_debt_interest_rate": {
|
|
877
814
|
label: "Min Debt Interest Rate",
|
|
878
815
|
type: "number",
|
|
879
|
-
operators:
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
"less_or_equal",
|
|
883
|
-
"greater",
|
|
884
|
-
"greater_or_equal"
|
|
885
|
-
],
|
|
886
|
-
valueSources: ["value"]
|
|
816
|
+
operators: NUMERIC_OPERATORS_DEFAULT,
|
|
817
|
+
valueSources: ["value"],
|
|
818
|
+
fieldSettings: { min: 0, max: 100 }
|
|
887
819
|
}
|
|
888
820
|
}
|
|
889
821
|
});
|
|
@@ -934,14 +866,13 @@ function parseCommas(display) {
|
|
|
934
866
|
return display.replace(/[^\d.]/g, "").replace(/(\..*)\./g, "$1");
|
|
935
867
|
}
|
|
936
868
|
function ruleSummary(ruleProps, fields) {
|
|
937
|
-
var _a, _b, _c, _d, _e
|
|
869
|
+
var _a, _b, _c, _d, _e;
|
|
938
870
|
const field = (_a = ruleProps == null ? void 0 : ruleProps.field) != null ? _a : "";
|
|
939
871
|
const operator = (_b = ruleProps == null ? void 0 : ruleProps.operator) != null ? _b : "equal";
|
|
940
872
|
const value0 = (_c = ruleProps == null ? void 0 : ruleProps.value) == null ? void 0 : _c[0];
|
|
941
|
-
const value1 = (_d = ruleProps == null ? void 0 : ruleProps.value) == null ? void 0 : _d[1];
|
|
942
873
|
const fieldDef = fields.find((f) => f.key === field);
|
|
943
|
-
const fieldLabel = (
|
|
944
|
-
const opLabel = (
|
|
874
|
+
const fieldLabel = (_d = fieldDef == null ? void 0 : fieldDef.label) != null ? _d : field;
|
|
875
|
+
const opLabel = (_e = OPERATOR_LABELS[operator]) != null ? _e : operator;
|
|
945
876
|
const formatVal = (v) => {
|
|
946
877
|
if (v === null || v === void 0) return "\u2026";
|
|
947
878
|
if ((fieldDef == null ? void 0 : fieldDef.type) === "boolean") return v ? "Yes" : "No";
|
|
@@ -952,9 +883,6 @@ function ruleSummary(ruleProps, fields) {
|
|
|
952
883
|
if ((fieldDef == null ? void 0 : fieldDef.unit) === "percent") return `${n}%`;
|
|
953
884
|
return String(v);
|
|
954
885
|
};
|
|
955
|
-
if (operator === "between") {
|
|
956
|
-
return `${fieldLabel} between ${formatVal(value0)} and ${formatVal(value1)}`;
|
|
957
|
-
}
|
|
958
886
|
return `${fieldLabel} ${opLabel} ${formatVal(value0)}`;
|
|
959
887
|
}
|
|
960
888
|
function checkGroupValid(children) {
|
|
@@ -1286,8 +1214,22 @@ function ValueInput({
|
|
|
1286
1214
|
value,
|
|
1287
1215
|
onChange,
|
|
1288
1216
|
unit,
|
|
1217
|
+
min,
|
|
1218
|
+
max,
|
|
1289
1219
|
placeholder = "0"
|
|
1290
1220
|
}) {
|
|
1221
|
+
function handleChange(raw) {
|
|
1222
|
+
const parsed = parseCommas(raw);
|
|
1223
|
+
if (parsed === "") {
|
|
1224
|
+
onChange("");
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
const n = parseFloat(parsed);
|
|
1228
|
+
if (Number.isNaN(n)) return;
|
|
1229
|
+
if (min !== void 0 && n < min) return;
|
|
1230
|
+
if (max !== void 0 && n > max) return;
|
|
1231
|
+
onChange(parsed);
|
|
1232
|
+
}
|
|
1291
1233
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(InputGroup, { className: "w-36", children: [
|
|
1292
1234
|
unit === "dollar" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InputGroupText, { children: "$" }) }),
|
|
1293
1235
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
@@ -1296,7 +1238,7 @@ function ValueInput({
|
|
|
1296
1238
|
type: "text",
|
|
1297
1239
|
inputMode: "numeric",
|
|
1298
1240
|
value: formatWithCommas(value),
|
|
1299
|
-
onChange: (e) =>
|
|
1241
|
+
onChange: (e) => handleChange(e.target.value),
|
|
1300
1242
|
placeholder
|
|
1301
1243
|
}
|
|
1302
1244
|
),
|
|
@@ -1311,14 +1253,13 @@ function RuleEditorFields({
|
|
|
1311
1253
|
longestFieldLabel,
|
|
1312
1254
|
longestOperatorLabel
|
|
1313
1255
|
}) {
|
|
1314
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
1256
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1315
1257
|
const field = (_c = (_b = ruleProps == null ? void 0 : ruleProps.field) != null ? _b : (_a = fields[0]) == null ? void 0 : _a.key) != null ? _c : "";
|
|
1316
1258
|
const operator = (_d = ruleProps == null ? void 0 : ruleProps.operator) != null ? _d : "greater_or_equal";
|
|
1317
1259
|
const value0 = (_e = ruleProps == null ? void 0 : ruleProps.value) == null ? void 0 : _e[0];
|
|
1318
|
-
const
|
|
1319
|
-
const fieldDef = (_g = fields.find((f) => f.key === field)) != null ? _g : fields[0];
|
|
1260
|
+
const fieldDef = (_f = fields.find((f) => f.key === field)) != null ? _f : fields[0];
|
|
1320
1261
|
const isBooleanField = (fieldDef == null ? void 0 : fieldDef.type) === "boolean";
|
|
1321
|
-
const availableOperators = isBooleanField ? BOOLEAN_OPERATORS : (
|
|
1262
|
+
const availableOperators = isBooleanField ? BOOLEAN_OPERATORS : (_g = fieldDef == null ? void 0 : fieldDef.operators) != null ? _g : ALL_NUMERIC_OPERATORS;
|
|
1322
1263
|
function handleFieldChange(key) {
|
|
1323
1264
|
actions.setField(path, key);
|
|
1324
1265
|
}
|
|
@@ -1347,7 +1288,7 @@ function RuleEditorFields({
|
|
|
1347
1288
|
value: field,
|
|
1348
1289
|
onValueChange: (v) => handleFieldChange(v),
|
|
1349
1290
|
children: [
|
|
1350
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectTrigger, { size: "sm", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectValue, { children: (
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectTrigger, { size: "sm", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectValue, { children: (_i = (_h = fields.find((f) => f.key === field)) == null ? void 0 : _h.label) != null ? _i : field }) }),
|
|
1351
1292
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectContent, { children: fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectItem, { value: f.key, children: f.label }, f.key)) })
|
|
1352
1293
|
]
|
|
1353
1294
|
}
|
|
@@ -1358,7 +1299,7 @@ function RuleEditorFields({
|
|
|
1358
1299
|
value: operator,
|
|
1359
1300
|
onValueChange: (v) => handleOperatorChange(v),
|
|
1360
1301
|
children: [
|
|
1361
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectTrigger, { size: "sm", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectValue, { children: (
|
|
1302
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectTrigger, { size: "sm", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectValue, { children: (_j = OPERATOR_LABELS[operator]) != null ? _j : operator }) }),
|
|
1362
1303
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectContent, { children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectItem, { value: op, children: OPERATOR_LABELS[op] }, op)) })
|
|
1363
1304
|
]
|
|
1364
1305
|
}
|
|
@@ -1376,27 +1317,16 @@ function RuleEditorFields({
|
|
|
1376
1317
|
] })
|
|
1377
1318
|
]
|
|
1378
1319
|
}
|
|
1379
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime14.
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-xs text-muted-foreground", children: "and" }),
|
|
1390
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1391
|
-
ValueInput,
|
|
1392
|
-
{
|
|
1393
|
-
value: valStr(value1),
|
|
1394
|
-
onChange: (v) => handleValueChange(1, v),
|
|
1395
|
-
unit: fieldDef == null ? void 0 : fieldDef.unit
|
|
1396
|
-
}
|
|
1397
|
-
)
|
|
1398
|
-
] })
|
|
1399
|
-
] })
|
|
1320
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1321
|
+
ValueInput,
|
|
1322
|
+
{
|
|
1323
|
+
value: valStr(value0),
|
|
1324
|
+
onChange: (v) => handleValueChange(0, v),
|
|
1325
|
+
unit: fieldDef == null ? void 0 : fieldDef.unit,
|
|
1326
|
+
min: fieldDef == null ? void 0 : fieldDef.min,
|
|
1327
|
+
max: fieldDef == null ? void 0 : fieldDef.max
|
|
1328
|
+
}
|
|
1329
|
+
)
|
|
1400
1330
|
] });
|
|
1401
1331
|
}
|
|
1402
1332
|
function RuleAccordionItem({
|
|
@@ -1738,6 +1668,7 @@ function ContactAlertDialog({
|
|
|
1738
1668
|
isCompanyAdmin = false,
|
|
1739
1669
|
initialShareAcrossCompany = false,
|
|
1740
1670
|
onSave,
|
|
1671
|
+
onError,
|
|
1741
1672
|
isLoading = false,
|
|
1742
1673
|
className
|
|
1743
1674
|
}) {
|
|
@@ -1761,10 +1692,17 @@ function ContactAlertDialog({
|
|
|
1761
1692
|
const canSave = name.trim().length > 0 && hasValidRule && !isLoading;
|
|
1762
1693
|
function handleSave() {
|
|
1763
1694
|
if (!canSave) return;
|
|
1695
|
+
let filterSegment;
|
|
1696
|
+
try {
|
|
1697
|
+
filterSegment = import_ui4.Utils.sanitizeTree(tree, QB_CONFIG).fixedTree;
|
|
1698
|
+
} catch (e) {
|
|
1699
|
+
onError == null ? void 0 : onError(e instanceof Error ? e : new Error(String(e)));
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1764
1702
|
onSave({
|
|
1765
1703
|
name: name.trim(),
|
|
1766
1704
|
severity,
|
|
1767
|
-
filterSegment
|
|
1705
|
+
filterSegment,
|
|
1768
1706
|
sharingType: shareAcrossCompany ? "COMPANY" /* COMPANY */ : "PRIVATE" /* PRIVATE */
|
|
1769
1707
|
});
|
|
1770
1708
|
}
|
|
@@ -1780,7 +1718,7 @@ function ContactAlertDialog({
|
|
|
1780
1718
|
size: "sm",
|
|
1781
1719
|
value: severity,
|
|
1782
1720
|
onValueChange: (v) => v && setSeverity(v),
|
|
1783
|
-
children: ["NEED_ACTION", "WATCH", "
|
|
1721
|
+
children: ["NEED_ACTION", "WATCH", "HEALTHY"].map((s) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ToggleGroupItem, { value: s, children: SEVERITY_LABELS[s] }, s))
|
|
1784
1722
|
}
|
|
1785
1723
|
)
|
|
1786
1724
|
] }),
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ContactAlertDialog,
|
|
5
5
|
ContactAlertQueryBuilder,
|
|
6
6
|
createAlertTree
|
|
7
|
-
} from "../../../chunk-
|
|
7
|
+
} from "../../../chunk-CKPEFZNH.mjs";
|
|
8
8
|
import "../../../chunk-7YI3HEBH.mjs";
|
|
9
9
|
import "../../../chunk-MUV4EGDW.mjs";
|
|
10
10
|
import "../../../chunk-IKXYTCSB.mjs";
|
|
@@ -502,6 +502,7 @@ function CsvImportModal({
|
|
|
502
502
|
onFileClear,
|
|
503
503
|
onNext,
|
|
504
504
|
onDownloadTemplate,
|
|
505
|
+
uploadDescription,
|
|
505
506
|
isLoading = false,
|
|
506
507
|
className
|
|
507
508
|
}) {
|
|
@@ -535,7 +536,7 @@ function CsvImportModal({
|
|
|
535
536
|
{
|
|
536
537
|
size: "lg",
|
|
537
538
|
label: "Drag & drop or click to upload",
|
|
538
|
-
description: "Supports .csv files only. Max 10 MB.",
|
|
539
|
+
description: uploadDescription != null ? uploadDescription : "Supports .csv files only. Max 10 MB.",
|
|
539
540
|
accept: ".csv",
|
|
540
541
|
onFileChange: (file) => file && (onFileSelect == null ? void 0 : onFileSelect(file))
|
|
541
542
|
}
|
|
@@ -840,6 +840,7 @@ function FilePreviewDialog({
|
|
|
840
840
|
staffOptions,
|
|
841
841
|
selectedStaffId,
|
|
842
842
|
onStaffSelect,
|
|
843
|
+
staffSelector,
|
|
843
844
|
className
|
|
844
845
|
}) {
|
|
845
846
|
const [page, setPage] = React3.useState(0);
|
|
@@ -850,7 +851,8 @@ function FilePreviewDialog({
|
|
|
850
851
|
const pagedRows = rows.slice(page * pageSize, (page + 1) * pageSize);
|
|
851
852
|
const pageStart = page * pageSize;
|
|
852
853
|
const isImporting = state === "importing";
|
|
853
|
-
const
|
|
854
|
+
const hasBuiltInStaffSelector = !!staffOptions && staffOptions.length > 0;
|
|
855
|
+
const hasStaffSelector = !!staffSelector || hasBuiltInStaffSelector;
|
|
854
856
|
const canImport = state === "preview" && rows.length > 0 && (!hasStaffSelector || !!selectedStaffId);
|
|
855
857
|
const successCount = rows.filter((r) => r._status === "success").length;
|
|
856
858
|
const failedCount = rows.filter((r) => r._status === "failed").length;
|
|
@@ -887,7 +889,7 @@ function FilePreviewDialog({
|
|
|
887
889
|
}
|
|
888
890
|
),
|
|
889
891
|
state === "preview" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
890
|
-
|
|
892
|
+
staffSelector ? staffSelector : hasBuiltInStaffSelector && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
891
893
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "text-label-medium text-foreground", children: [
|
|
892
894
|
"Assign staff",
|
|
893
895
|
" ",
|