@middag-io/react 0.4.2 → 0.6.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-BGPYAImJ.js +83 -0
- package/dist-lib/FlowEditorBlock-D3nx4re7.js +7770 -0
- package/dist-lib/FormBuilderBlock-b_-QQaKn.js +2735 -0
- package/dist-lib/{MarkdownContent-B-Gd9918.js → MarkdownContent-BgwUdgoN.js} +33 -32
- package/dist-lib/SentenceBuilderBlock-ClWjm0dX.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/LazyBlock.d.ts +28 -0
- package/dist-lib/app/LazyBlock.d.ts.map +1 -0
- package/dist-lib/app/bootstrap.d.ts +1 -1
- package/dist-lib/app/register-defaults.d.ts +10 -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/EmptyStateBlock.d.ts.map +1 -1
- 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/blocks/TabbedPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/WorkflowProgressBlock.d.ts +15 -0
- package/dist-lib/base/blocks/WorkflowProgressBlock.d.ts.map +1 -0
- 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/partials/EmptyPlaceholder/index.d.ts +4 -2
- package/dist-lib/base/partials/EmptyPlaceholder/index.d.ts.map +1 -1
- 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/shell/partials/SidebarNav.d.ts.map +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 +18 -2
- package/dist-lib/contracts/block-data.d.ts.map +1 -1
- package/dist-lib/contracts/navigation.d.ts +2 -0
- package/dist-lib/contracts/navigation.d.ts.map +1 -1
- 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 +13 -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/dist-C3f2_wwS.js +70102 -0
- 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 +34 -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/lib/deprecation.d.ts +1 -1
- package/dist-lib/lottie/calendar/schedule-1.json +1 -0
- package/dist-lib/lottie/calendar/schedule-2.json +1 -0
- package/dist-lib/lottie/celebration/confetti-1.json +1 -0
- package/dist-lib/lottie/celebration/confetti-2.json +1 -0
- package/dist-lib/lottie/celebration/confetti-3.json +1 -0
- package/dist-lib/lottie/cloud/cloud-1.json +1 -0
- package/dist-lib/lottie/cloud/cloud-2.json +1 -0
- package/dist-lib/lottie/connection/network-1.json +1 -0
- package/dist-lib/lottie/connection/network-2.json +1 -0
- package/dist-lib/lottie/connection/network-3.json +1 -0
- package/dist-lib/lottie/dashboard/analytics-1.json +1 -0
- package/dist-lib/lottie/dashboard/analytics-2.json +1 -0
- package/dist-lib/lottie/dashboard/analytics-3.json +1 -0
- package/dist-lib/lottie/email/mail-1.json +1 -0
- package/dist-lib/lottie/email/mail-2.json +1 -0
- package/dist-lib/lottie/email/mail-3.json +1 -0
- package/dist-lib/lottie/empty-state/empty-1.json +1 -0
- package/dist-lib/lottie/empty-state/empty-2.json +1 -0
- package/dist-lib/lottie/empty-state/empty-3.json +1 -0
- package/dist-lib/lottie/error/warning-1.json +1 -0
- package/dist-lib/lottie/error/warning-2.json +1 -0
- package/dist-lib/lottie/error/warning-3.json +1 -0
- package/dist-lib/lottie/index.ts +81 -0
- package/dist-lib/lottie/loading/spinner-1.json +1 -0
- package/dist-lib/lottie/loading/spinner-2.json +1 -0
- package/dist-lib/lottie/loading/spinner-3.json +1 -0
- package/dist-lib/lottie/maintenance/construction-1.json +1 -0
- package/dist-lib/lottie/maintenance/construction-2.json +1 -0
- package/dist-lib/lottie/maintenance/construction-3.json +1 -0
- package/dist-lib/lottie/not-found/404-1.json +1 -0
- package/dist-lib/lottie/not-found/404-2.json +1 -0
- package/dist-lib/lottie/not-found/404-3.json +1 -0
- package/dist-lib/lottie/notification/bell-1.json +1 -0
- package/dist-lib/lottie/notification/bell-2.json +1 -0
- package/dist-lib/lottie/notification/bell-3.json +1 -0
- package/dist-lib/lottie/onboarding/welcome-1.json +1 -0
- package/dist-lib/lottie/onboarding/welcome-2.json +1 -0
- package/dist-lib/lottie/onboarding/welcome-3.json +1 -0
- package/dist-lib/lottie/payment/wallet-1.json +1 -0
- package/dist-lib/lottie/payment/wallet-2.json +1 -0
- package/dist-lib/lottie/payment/wallet-3.json +1 -0
- package/dist-lib/lottie/search/search-1.json +1 -0
- package/dist-lib/lottie/search/search-2.json +1 -0
- package/dist-lib/lottie/search/search-3.json +1 -0
- package/dist-lib/lottie/security/lock-1.json +1 -0
- package/dist-lib/lottie/security/lock-2.json +1 -0
- package/dist-lib/lottie/security/lock-3.json +1 -0
- package/dist-lib/lottie/settings/gear-1.json +1 -0
- package/dist-lib/lottie/settings/gear-2.json +1 -0
- package/dist-lib/lottie/settings/gear-3.json +1 -0
- package/dist-lib/lottie/success/check-1.json +1 -0
- package/dist-lib/lottie/success/check-2.json +1 -0
- package/dist-lib/lottie/success/check-3.json +1 -0
- package/dist-lib/lottie/upload/upload-1.json +1 -0
- package/dist-lib/lottie/upload/upload-2.json +1 -0
- package/dist-lib/lottie/upload/upload-3.json +1 -0
- package/dist-lib/lottie/user/profile-1.json +1 -0
- package/dist-lib/lottie/user/profile-2.json +1 -0
- package/dist-lib/lottie/user/profile-3.json +1 -0
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +16643 -24248
- package/package.json +4 -2
|
@@ -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 };
|