@middag-io/react 0.4.1 → 0.5.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/dist-lib/ConditionTreeBlock-Brab4Yig.js +83 -0
- package/dist-lib/FlowEditorBlock-BKwzEVAe.js +7770 -0
- package/dist-lib/FormBuilderBlock-Dsg3PFQL.js +2735 -0
- package/dist-lib/{MarkdownContent-B-Gd9918.js → MarkdownContent-CEXn51dl.js} +33 -32
- package/dist-lib/SentenceBuilderBlock-C7pY8tTB.js +92 -0
- package/dist-lib/app/ContractPage.d.ts +6 -7
- package/dist-lib/app/ContractPage.d.ts.map +1 -1
- package/dist-lib/app/bootstrap.d.ts +1 -1
- package/dist-lib/app/register-defaults.d.ts +6 -1
- package/dist-lib/app/register-defaults.d.ts.map +1 -1
- package/dist-lib/app/registries.d.ts +1 -1
- package/dist-lib/assets/lottie/index.d.ts +1 -1
- package/dist-lib/base/blocks/ActionGridBlock.d.ts +2 -2
- package/dist-lib/base/blocks/ActivityTimelineBlock.d.ts +2 -2
- package/dist-lib/base/blocks/CardGridBlock.d.ts +2 -2
- package/dist-lib/base/blocks/ConditionTreeBlock.d.ts +2 -2
- package/dist-lib/base/blocks/DenseTableBlock.d.ts +2 -2
- package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DetailPanelBlock.d.ts +2 -2
- package/dist-lib/base/blocks/EmptyStateBlock.d.ts +2 -2
- package/dist-lib/base/blocks/FlowEditorBlock.d.ts +2 -2
- package/dist-lib/base/blocks/FormBuilderBlock.d.ts +2 -2
- package/dist-lib/base/blocks/FormPanelBlock.d.ts +2 -2
- package/dist-lib/base/blocks/LinkListBlock.d.ts +2 -2
- package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts +2 -2
- package/dist-lib/base/blocks/MetricCardBlock.d.ts +2 -2
- package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts +2 -2
- package/dist-lib/base/blocks/StatusStripBlock.d.ts +2 -2
- package/dist-lib/base/blocks/TabbedPanelBlock.d.ts +2 -2
- package/dist-lib/base/layout/DashboardLayout.d.ts +1 -1
- package/dist-lib/base/layout/MasterDetailLayout.d.ts +1 -1
- package/dist-lib/base/layout/SplitLayout.d.ts +1 -1
- package/dist-lib/base/layout/StackLayout.d.ts +1 -1
- package/dist-lib/base/layout/WizardLayout.d.ts +1 -1
- package/dist-lib/base/partials/DataTable/types.d.ts +3 -3
- package/dist-lib/base/shell/AdminShell.d.ts +1 -1
- package/dist-lib/base/shell/ProductShell.d.ts +1 -1
- package/dist-lib/base/shell/partials/HelpContext.d.ts +1 -1
- package/dist-lib/base/shell/partials/InspectorContext.d.ts +1 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts +1 -1
- package/dist-lib/base/shell/partials/PageFilterTabs.d.ts +1 -1
- package/dist-lib/base/shell/partials/PageHeader.d.ts +1 -1
- package/dist-lib/base/theme/useHostTheme.d.ts +1 -1
- package/dist-lib/base/utils/conditions.d.ts +1 -1
- package/dist-lib/chunk-DeC0fbbY.js +22 -0
- package/dist-lib/components/reui/alert-dialog.d.ts +1 -1
- package/dist-lib/components/reui/sidebar.d.ts +4 -4
- package/dist-lib/contracts/block-data.d.ts +2 -2
- package/dist-lib/contracts/page-contract-schema.d.ts +72 -0
- package/dist-lib/contracts/page-contract-schema.d.ts.map +1 -0
- package/dist-lib/contracts/page-contract.d.ts +3 -3
- package/dist-lib/contracts/page-contract.d.ts.map +1 -1
- package/dist-lib/contracts/shared-props.d.ts +2 -1
- package/dist-lib/contracts/shared-props.d.ts.map +1 -1
- package/dist-lib/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist-lib/hooks/use-file-upload.d.ts +1 -1
- package/dist-lib/index.d.ts +13 -11
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/{index.min-CS28Xi5j.js → index.min-BVLV21vp.js} +483 -504
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +16591 -24295
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/base/blocks/ConditionTreeBlock.tsx
|
|
3
|
+
function n({ logic: t }) {
|
|
4
|
+
return /* @__PURE__ */ e("span", {
|
|
5
|
+
className: t === "and" ? "text-primary inline-flex items-center rounded bg-[oklch(0.93_0.04_264)] px-2 py-0.5 text-xs font-bold uppercase" : "inline-flex items-center rounded bg-[oklch(0.95_0.04_75)] px-2 py-0.5 text-xs font-bold text-[oklch(0.55_0.16_75)] uppercase",
|
|
6
|
+
children: t
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function r({ rule: n }) {
|
|
10
|
+
return /* @__PURE__ */ t("div", {
|
|
11
|
+
className: "bg-background flex items-center gap-2 rounded-md p-2",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ e("span", {
|
|
14
|
+
className: "border-border bg-muted/50 inline-flex items-center rounded border px-2 py-1 text-sm font-medium",
|
|
15
|
+
children: n.field
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ e("span", {
|
|
18
|
+
className: "text-muted-foreground text-sm",
|
|
19
|
+
children: n.operator
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ e("span", {
|
|
22
|
+
className: "border-border bg-muted/50 inline-flex items-center rounded border px-2 py-1 text-sm font-medium",
|
|
23
|
+
children: n.value
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ e("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
className: "text-muted-foreground hover:text-destructive ml-auto flex h-6 w-6 items-center justify-center rounded text-sm transition-colors",
|
|
28
|
+
tabIndex: -1,
|
|
29
|
+
"aria-label": "Remover regra",
|
|
30
|
+
children: "×"
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function i({ group: a, depth: o }) {
|
|
36
|
+
return /* @__PURE__ */ t("div", {
|
|
37
|
+
className: "bg-muted/30 space-y-2 rounded-lg border p-3",
|
|
38
|
+
style: o > 0 ? { marginLeft: `${o * 16}px` } : void 0,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ t("div", {
|
|
41
|
+
className: "flex items-center gap-2",
|
|
42
|
+
children: [/* @__PURE__ */ e(n, { logic: a.logic }), o > 0 && /* @__PURE__ */ e("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
className: "text-muted-foreground hover:text-destructive ml-auto flex h-6 w-6 items-center justify-center rounded text-sm transition-colors",
|
|
45
|
+
tabIndex: -1,
|
|
46
|
+
"aria-label": "Remover grupo",
|
|
47
|
+
children: "×"
|
|
48
|
+
})]
|
|
49
|
+
}),
|
|
50
|
+
a.rules.map((t) => /* @__PURE__ */ e(r, { rule: t }, t.id)),
|
|
51
|
+
a.groups.map((t) => /* @__PURE__ */ e(i, {
|
|
52
|
+
group: t,
|
|
53
|
+
depth: o + 1
|
|
54
|
+
}, t.id)),
|
|
55
|
+
/* @__PURE__ */ t("div", {
|
|
56
|
+
className: "flex items-center gap-2 pt-1",
|
|
57
|
+
children: [/* @__PURE__ */ e("button", {
|
|
58
|
+
type: "button",
|
|
59
|
+
className: "text-muted-foreground hover:border-primary hover:text-primary rounded-md border border-dashed px-3 py-1 text-xs transition-colors",
|
|
60
|
+
tabIndex: -1,
|
|
61
|
+
children: "+ Adicionar regra"
|
|
62
|
+
}), /* @__PURE__ */ e("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
className: "text-muted-foreground hover:border-primary hover:text-primary rounded-md border border-dashed px-3 py-1 text-xs transition-colors",
|
|
65
|
+
tabIndex: -1,
|
|
66
|
+
children: "+ Adicionar grupo"
|
|
67
|
+
})]
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function a({ block: t }) {
|
|
73
|
+
let { data: n } = t;
|
|
74
|
+
return /* @__PURE__ */ e("div", {
|
|
75
|
+
className: "space-y-3",
|
|
76
|
+
children: /* @__PURE__ */ e(i, {
|
|
77
|
+
group: n.root,
|
|
78
|
+
depth: 0
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { a as ConditionTreeBlock };
|