@middag-io/react 0.17.0 → 0.19.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/LICENSE +202 -0
- package/README.md +12 -1
- package/dist-lib/{MarkdownContent-B8cmBIKa.js → MarkdownContent-NiKKjJ9H.js} +4827 -1570
- package/dist-lib/app/ContractPage.d.ts +1 -1
- package/dist-lib/app/ContractPage.d.ts.map +1 -1
- package/dist-lib/app/HostSlot.d.ts +2 -2
- package/dist-lib/app/providers/locales/pt-BR.d.ts +1 -1
- package/dist-lib/app/register-defaults.d.ts +6 -6
- package/dist-lib/app/register-defaults.d.ts.map +1 -1
- package/dist-lib/app/registries.d.ts +4 -4
- package/dist-lib/app/registries.d.ts.map +1 -1
- package/dist-lib/base/blocks/ActionGridBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DetailPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/hooks/usePolling.d.ts.map +1 -1
- package/dist-lib/base/layout/DashboardLayout.d.ts.map +1 -1
- package/dist-lib/base/partials/ActionBar/index.d.ts.map +1 -1
- package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
- package/dist-lib/base/partials/index.d.ts +17 -0
- package/dist-lib/base/partials/index.d.ts.map +1 -0
- package/dist-lib/base/shell/ImmersiveShell.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/InspectorContext.d.ts +2 -15
- package/dist-lib/base/shell/partials/InspectorContext.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts +5 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
- package/dist-lib/components/reui/accordion.d.ts +8 -0
- package/dist-lib/components/reui/accordion.d.ts.map +1 -0
- package/dist-lib/components/reui/alert-dialog.d.ts +19 -0
- package/dist-lib/components/reui/alert-dialog.d.ts.map +1 -0
- package/dist-lib/components/reui/alert.d.ts +1 -1
- package/dist-lib/components/reui/aspect-ratio.d.ts +4 -0
- package/dist-lib/components/reui/aspect-ratio.d.ts.map +1 -0
- package/dist-lib/components/reui/autocomplete.d.ts +41 -0
- package/dist-lib/components/reui/autocomplete.d.ts.map +1 -0
- package/dist-lib/components/reui/badge.d.ts +1 -1
- package/dist-lib/components/reui/breadcrumb.d.ts +12 -0
- package/dist-lib/components/reui/breadcrumb.d.ts.map +1 -0
- package/dist-lib/components/reui/button-group.d.ts +12 -0
- package/dist-lib/components/reui/button-group.d.ts.map +1 -0
- package/dist-lib/components/reui/button.d.ts +1 -1
- package/dist-lib/components/reui/carousel.d.ts +20 -0
- package/dist-lib/components/reui/carousel.d.ts.map +1 -0
- package/dist-lib/components/reui/collapsible.d.ts +6 -0
- package/dist-lib/components/reui/collapsible.d.ts.map +1 -0
- package/dist-lib/components/reui/command.d.ts +19 -0
- package/dist-lib/components/reui/command.d.ts.map +1 -0
- package/dist-lib/components/reui/context-menu.d.ts +26 -0
- package/dist-lib/components/reui/context-menu.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.d.ts +15 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.d.ts +15 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.d.ts +8 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.d.ts +20 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.d.ts +11 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +12 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.d.ts +8 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts +28 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.d.ts +98 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid/data-grid.d.ts +94 -0
- package/dist-lib/components/reui/data-grid/data-grid.d.ts.map +1 -0
- package/dist-lib/components/reui/data-grid-pagination.d.ts +20 -0
- package/dist-lib/components/reui/data-grid-pagination.d.ts.map +1 -0
- package/dist-lib/components/reui/drawer.d.ts +14 -0
- package/dist-lib/components/reui/drawer.d.ts.map +1 -0
- package/dist-lib/components/reui/empty.d.ts +12 -0
- package/dist-lib/components/reui/empty.d.ts.map +1 -0
- package/dist-lib/components/reui/field.d.ts +25 -0
- package/dist-lib/components/reui/field.d.ts.map +1 -0
- package/dist-lib/components/reui/filters.d.ts +165 -0
- package/dist-lib/components/reui/filters.d.ts.map +1 -0
- package/dist-lib/components/reui/frame.d.ts +1 -1
- package/dist-lib/components/reui/hover-card.d.ts +7 -0
- package/dist-lib/components/reui/hover-card.d.ts.map +1 -0
- package/dist-lib/components/reui/icon-placeholder.d.ts +18 -0
- package/dist-lib/components/reui/icon-placeholder.d.ts.map +1 -0
- package/dist-lib/components/reui/input-otp.d.ts +12 -0
- package/dist-lib/components/reui/input-otp.d.ts.map +1 -0
- package/dist-lib/components/reui/item.d.ts +24 -0
- package/dist-lib/components/reui/item.d.ts.map +1 -0
- package/dist-lib/components/reui/kbd.d.ts +4 -0
- package/dist-lib/components/reui/kbd.d.ts.map +1 -0
- package/dist-lib/components/reui/menubar.d.ts +27 -0
- package/dist-lib/components/reui/menubar.d.ts.map +1 -0
- package/dist-lib/components/reui/native-select.d.ts +8 -0
- package/dist-lib/components/reui/native-select.d.ts.map +1 -0
- package/dist-lib/components/reui/navigation-menu.d.ts +15 -0
- package/dist-lib/components/reui/navigation-menu.d.ts.map +1 -0
- package/dist-lib/components/reui/pagination.d.ts +14 -0
- package/dist-lib/components/reui/pagination.d.ts.map +1 -0
- package/dist-lib/components/reui/progress.d.ts +5 -0
- package/dist-lib/components/reui/progress.d.ts.map +1 -0
- package/dist-lib/components/reui/resizable.d.ts +8 -0
- package/dist-lib/components/reui/resizable.d.ts.map +1 -0
- package/dist-lib/components/reui/scrollspy.d.ts +15 -0
- package/dist-lib/components/reui/scrollspy.d.ts.map +1 -0
- package/dist-lib/components/reui/slider.d.ts +5 -0
- package/dist-lib/components/reui/slider.d.ts.map +1 -0
- package/dist-lib/components/reui/sortable.d.ts +39 -0
- package/dist-lib/components/reui/sortable.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.d.ts +4 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/gemini.d.ts +4 -0
- package/dist-lib/components/reui/svgs/gemini.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/openai.d.ts +4 -0
- package/dist-lib/components/reui/svgs/openai.d.ts.map +1 -0
- package/dist-lib/components/reui/svgs/openaiDark.d.ts +4 -0
- package/dist-lib/components/reui/svgs/openaiDark.d.ts.map +1 -0
- package/dist-lib/components/reui/table.d.ts +11 -0
- package/dist-lib/components/reui/table.d.ts.map +1 -0
- package/dist-lib/components/reui/timeline.d.ts +26 -0
- package/dist-lib/components/reui/timeline.d.ts.map +1 -0
- package/dist-lib/components/reui/toggle-group.d.ts +10 -0
- package/dist-lib/components/reui/toggle-group.d.ts.map +1 -0
- package/dist-lib/components/reui/toggle.d.ts +10 -0
- package/dist-lib/components/reui/toggle.d.ts.map +1 -0
- package/dist-lib/components/reui/tree.d.ts +24 -0
- package/dist-lib/components/reui/tree.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/actions.d.ts +32 -31
- package/dist-lib/contracts/block-data/actions.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/data-display.d.ts +0 -25
- package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/form.d.ts +0 -15
- package/dist-lib/contracts/block-data/form.d.ts.map +1 -1
- package/dist-lib/contracts/block-data/interactive.d.ts +11 -114
- package/dist-lib/contracts/block-data/interactive.d.ts.map +1 -1
- package/dist-lib/contracts/generated/contract-schema.d.ts +182 -0
- package/dist-lib/contracts/generated/contract-schema.d.ts.map +1 -0
- package/dist-lib/contracts/generated/contract-types.d.ts +278 -0
- package/dist-lib/contracts/generated/contract-types.d.ts.map +1 -0
- package/dist-lib/contracts/generated/index.d.ts +16 -0
- package/dist-lib/contracts/generated/index.d.ts.map +1 -0
- package/dist-lib/contracts/page-contract-schema.d.ts +81 -33
- package/dist-lib/contracts/page-contract-schema.d.ts.map +1 -1
- package/dist-lib/contracts/page-contract.d.ts +26 -168
- package/dist-lib/contracts/page-contract.d.ts.map +1 -1
- package/dist-lib/index.d.ts +4 -14
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/lib/actions/resolve-action-target.d.ts +76 -0
- package/dist-lib/lib/actions/resolve-action-target.d.ts.map +1 -0
- package/dist-lib/lib/i18n/render-label.d.ts +31 -0
- package/dist-lib/lib/i18n/render-label.d.ts.map +1 -0
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +23533 -7121
- package/package.json +9 -10
- package/dist-lib/ChartPanelBlock-OZix9y7T.js +0 -18005
- package/dist-lib/ConditionTreeBlock-DqxfYryz.js +0 -86
- package/dist-lib/DateField-DjYSg_p7.js +0 -121
- package/dist-lib/DateRangeField-iAVBZVzE.js +0 -663
- package/dist-lib/DocumentField-y8OETxf6.js +0 -221
- package/dist-lib/FlowEditorBlock-CGCowCIL.js +0 -7180
- package/dist-lib/FormBuilderBlock-CRAV0oSH.js +0 -240
- package/dist-lib/FormPanelBlock-BTcXUBcZ.js +0 -8827
- package/dist-lib/FormPanelBlock-D6ashc8j.js +0 -2
- package/dist-lib/HugeiconsIcon-Bh8XgTFo.js +0 -1346
- package/dist-lib/KanbanBoardBlock-CiQWT6Us.js +0 -399
- package/dist-lib/PhoneField-Wu-d01cw.js +0 -18585
- package/dist-lib/SentenceBuilderBlock-DJ2yPhKB.js +0 -91
- package/dist-lib/badge-AMZPvmLD.js +0 -63
- package/dist-lib/base/blocks/ChartPanelBlock.d.ts +0 -11
- package/dist-lib/base/blocks/ChartPanelBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/ConditionTreeBlock.d.ts +0 -13
- package/dist-lib/base/blocks/ConditionTreeBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/FlowEditorBlock.d.ts +0 -15
- package/dist-lib/base/blocks/FlowEditorBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/FormBuilderBlock.d.ts +0 -17
- package/dist-lib/base/blocks/FormBuilderBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/FormPanelBlock.d.ts +0 -18
- package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/KanbanBoardBlock.d.ts +0 -11
- package/dist-lib/base/blocks/KanbanBoardBlock.d.ts.map +0 -1
- package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts +0 -15
- package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts.map +0 -1
- package/dist-lib/base/form/form-schema-builder.d.ts +0 -27
- package/dist-lib/base/form/form-schema-builder.d.ts.map +0 -1
- package/dist-lib/base/shell/ProductShell.d.ts +0 -34
- package/dist-lib/base/shell/ProductShell.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/AdminTabBar.d.ts +0 -12
- package/dist-lib/base/shell/partials/AdminTabBar.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/AppearanceToggle.d.ts +0 -8
- package/dist-lib/base/shell/partials/AppearanceToggle.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/BoostSearchBar.d.ts +0 -32
- package/dist-lib/base/shell/partials/BoostSearchBar.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/CommandPalette.d.ts +0 -24
- package/dist-lib/base/shell/partials/CommandPalette.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/HelpContext.d.ts +0 -15
- package/dist-lib/base/shell/partials/HelpContext.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/HelpPanel.d.ts +0 -15
- package/dist-lib/base/shell/partials/HelpPanel.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/InlineInspector.d.ts +0 -16
- package/dist-lib/base/shell/partials/InlineInspector.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/PageFilterTabs.d.ts +0 -22
- package/dist-lib/base/shell/partials/PageFilterTabs.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/PageHeader.d.ts +0 -22
- package/dist-lib/base/shell/partials/PageHeader.d.ts.map +0 -1
- package/dist-lib/base/shell/partials/SidebarNav.d.ts +0 -17
- package/dist-lib/base/shell/partials/SidebarNav.d.ts.map +0 -1
- package/dist-lib/button-D5Y6A1RJ.js +0 -242
- package/dist-lib/calendar-bwe48kor.js +0 -4503
- package/dist-lib/chevron-right-C6BILigO.js +0 -7
- package/dist-lib/chunk-DeC0fbbY.js +0 -22
- package/dist-lib/combobox-BDHFCl2n.js +0 -5303
- package/dist-lib/dist-BpzJKgoL.js +0 -1196
- package/dist-lib/dist-DkjgjvZx.js +0 -123
- package/dist-lib/dist-FCfSQ65-.js +0 -15
- package/dist-lib/dist-a1sZXfE3.js +0 -54
- package/dist-lib/dist-igfsCvSN.js +0 -235
- package/dist-lib/document-validation-DOLZeicu.js +0 -1249
- package/dist-lib/floating-ui.react-dom-62M1nRNP.js +0 -1089
- package/dist-lib/i18n-BMTYOmLT.js +0 -329
- package/dist-lib/input-DzdJK5AV.js +0 -14
- package/dist-lib/popover-DmaFo0PE.js +0 -242
- package/dist-lib/scroll-area-f_LkBXTB.js +0 -557
- package/dist-lib/skeleton-DzfTvSIA.js +0 -12
- package/dist-lib/sortable.esm-BjkovHTt.js +0 -2499
- package/dist-lib/use-mobile-BADA7dx5.js +0 -205
- package/dist-lib/utils-CpaZ5_iF.js +0 -1692
- package/dist-lib/value-Cs0MHQBZ.js +0 -413
- package/dist-lib/with-selector-t6tzmyqE.js +0 -185
- /package/dist-lib/{dist-Dg5ozU8m.js → dist-CK9PErDU.js} +0 -0
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./i18n-BMTYOmLT.js";
|
|
2
|
-
import { _ as t, a as n, c as r, h as i, l as a, n as o, o as s, p as c, s as l, t as u, u as d, v as f } from "./sortable.esm-BjkovHTt.js";
|
|
3
|
-
import { useCallback as p, useState as m } from "react";
|
|
4
|
-
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
-
//#region node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js
|
|
6
|
-
var _ = (e) => {
|
|
7
|
-
let { transform: t } = e;
|
|
8
|
-
return {
|
|
9
|
-
...t,
|
|
10
|
-
x: 0
|
|
11
|
-
};
|
|
12
|
-
}, v = {
|
|
13
|
-
text: "Aa",
|
|
14
|
-
textarea: "≡",
|
|
15
|
-
select: "▾",
|
|
16
|
-
checkbox: "☑",
|
|
17
|
-
date: "📅",
|
|
18
|
-
file: "📎",
|
|
19
|
-
rating: "★",
|
|
20
|
-
email: "@",
|
|
21
|
-
number: "#"
|
|
22
|
-
};
|
|
23
|
-
function y(e) {
|
|
24
|
-
return v[e] ?? "?";
|
|
25
|
-
}
|
|
26
|
-
function b({ field: t, onRemove: n }) {
|
|
27
|
-
let { t: r } = e(), { attributes: i, listeners: a, setNodeRef: o, transform: c, transition: l, isDragging: u } = s({ id: t.id });
|
|
28
|
-
return /* @__PURE__ */ g("div", {
|
|
29
|
-
ref: o,
|
|
30
|
-
style: {
|
|
31
|
-
transform: c ? `translate3d(${String(c.x)}px, ${String(c.y)}px, 0)` : void 0,
|
|
32
|
-
transition: l ?? void 0,
|
|
33
|
-
opacity: u ? .4 : 1
|
|
34
|
-
},
|
|
35
|
-
className: `flex items-center gap-3 rounded-md border p-3 ${u ? "border-accent bg-background shadow-md" : "border-border bg-background"}`,
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ h("button", {
|
|
38
|
-
type: "button",
|
|
39
|
-
className: "text-muted-foreground flex-none cursor-grab text-base leading-none select-none",
|
|
40
|
-
"aria-label": r("middag.ui.form_builder.drag_field"),
|
|
41
|
-
...i,
|
|
42
|
-
...a,
|
|
43
|
-
children: "⠇"
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ h("span", {
|
|
46
|
-
className: "bg-muted flex h-8 w-8 flex-none items-center justify-center rounded text-sm",
|
|
47
|
-
children: y(t.type)
|
|
48
|
-
}),
|
|
49
|
-
/* @__PURE__ */ g("div", {
|
|
50
|
-
className: "min-w-0 flex-1",
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ h("span", {
|
|
53
|
-
className: "text-foreground truncate text-sm font-medium",
|
|
54
|
-
children: t.label
|
|
55
|
-
}),
|
|
56
|
-
t.required && /* @__PURE__ */ h("span", {
|
|
57
|
-
className: "text-destructive ml-0.5 text-sm",
|
|
58
|
-
"aria-label": r("middag.ui.form.required_label"),
|
|
59
|
-
children: "*"
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ h("span", {
|
|
62
|
-
className: "text-muted-foreground ml-2 text-xs",
|
|
63
|
-
children: t.type
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
}),
|
|
67
|
-
/* @__PURE__ */ h("button", {
|
|
68
|
-
type: "button",
|
|
69
|
-
onClick: () => {
|
|
70
|
-
n(t.id);
|
|
71
|
-
},
|
|
72
|
-
className: "text-muted-foreground hover:text-destructive flex h-6 w-6 flex-none items-center justify-center rounded text-sm transition-colors",
|
|
73
|
-
"aria-label": r("middag.ui.form_builder.remove_field"),
|
|
74
|
-
children: "×"
|
|
75
|
-
})
|
|
76
|
-
]
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function x({ field: e }) {
|
|
80
|
-
return /* @__PURE__ */ g("div", {
|
|
81
|
-
className: "border-accent bg-background flex items-center gap-3 rounded-md border p-3 shadow-md",
|
|
82
|
-
children: [
|
|
83
|
-
/* @__PURE__ */ h("span", {
|
|
84
|
-
className: "text-muted-foreground flex-none text-base leading-none select-none",
|
|
85
|
-
children: "⠇"
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ h("span", {
|
|
88
|
-
className: "bg-muted flex h-8 w-8 flex-none items-center justify-center rounded text-sm",
|
|
89
|
-
children: y(e.type)
|
|
90
|
-
}),
|
|
91
|
-
/* @__PURE__ */ g("div", {
|
|
92
|
-
className: "min-w-0 flex-1",
|
|
93
|
-
children: [/* @__PURE__ */ h("span", {
|
|
94
|
-
className: "text-foreground text-sm font-medium",
|
|
95
|
-
children: e.label
|
|
96
|
-
}), e.required && /* @__PURE__ */ h("span", {
|
|
97
|
-
className: "text-destructive ml-0.5 text-sm",
|
|
98
|
-
children: "*"
|
|
99
|
-
})]
|
|
100
|
-
})
|
|
101
|
-
]
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
function S({ field: e }) {
|
|
105
|
-
let t = /* @__PURE__ */ g("label", {
|
|
106
|
-
className: "text-foreground mb-1 block text-xs font-medium",
|
|
107
|
-
children: [e.label, e.required && /* @__PURE__ */ h("span", {
|
|
108
|
-
className: "text-destructive ml-0.5",
|
|
109
|
-
children: "*"
|
|
110
|
-
})]
|
|
111
|
-
});
|
|
112
|
-
switch (e.type) {
|
|
113
|
-
case "textarea": return /* @__PURE__ */ g("div", { children: [t, /* @__PURE__ */ h("div", { className: "border-border bg-background h-16 rounded-md border px-2 py-1 text-xs" })] });
|
|
114
|
-
case "select": return /* @__PURE__ */ g("div", { children: [t, /* @__PURE__ */ g("div", {
|
|
115
|
-
className: "border-border bg-background text-muted-foreground flex items-center justify-between rounded-md border px-2 py-1.5 text-xs",
|
|
116
|
-
children: [/* @__PURE__ */ h("span", { children: "Selecione..." }), /* @__PURE__ */ h("span", {
|
|
117
|
-
className: "text-[10px]",
|
|
118
|
-
children: "▾"
|
|
119
|
-
})]
|
|
120
|
-
})] });
|
|
121
|
-
case "checkbox": return /* @__PURE__ */ g("div", {
|
|
122
|
-
className: "flex items-center gap-2",
|
|
123
|
-
children: [/* @__PURE__ */ h("div", { className: "border-border h-4 w-4 rounded border" }), /* @__PURE__ */ h("span", {
|
|
124
|
-
className: "text-foreground text-xs",
|
|
125
|
-
children: e.label
|
|
126
|
-
})]
|
|
127
|
-
});
|
|
128
|
-
case "rating": return /* @__PURE__ */ g("div", { children: [t, /* @__PURE__ */ h("div", {
|
|
129
|
-
className: "flex gap-1",
|
|
130
|
-
children: [
|
|
131
|
-
1,
|
|
132
|
-
2,
|
|
133
|
-
3,
|
|
134
|
-
4,
|
|
135
|
-
5
|
|
136
|
-
].map((e) => /* @__PURE__ */ h("span", {
|
|
137
|
-
className: "text-muted-foreground/40 text-sm",
|
|
138
|
-
children: "★"
|
|
139
|
-
}, e))
|
|
140
|
-
})] });
|
|
141
|
-
case "file": return /* @__PURE__ */ g("div", { children: [t, /* @__PURE__ */ h("div", {
|
|
142
|
-
className: "border-border text-muted-foreground flex items-center justify-center rounded-md border border-dashed px-2 py-3 text-xs",
|
|
143
|
-
children: "Clique ou arraste um arquivo"
|
|
144
|
-
})] });
|
|
145
|
-
default: return /* @__PURE__ */ g("div", { children: [t, /* @__PURE__ */ h("div", {
|
|
146
|
-
className: "border-border bg-background rounded-md border px-2 py-1.5 text-xs",
|
|
147
|
-
children: e.placeholder ? /* @__PURE__ */ h("span", {
|
|
148
|
-
className: "text-muted-foreground",
|
|
149
|
-
children: e.placeholder
|
|
150
|
-
}) : /* @__PURE__ */ h("span", { children: "\xA0" })
|
|
151
|
-
})] });
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
function C({ block: s }) {
|
|
155
|
-
let { t: v } = e(), { data: y } = s, [C, w] = m(y.fields), [T, E] = m(null), D = f(t(c, { activationConstraint: { distance: 5 } }), t(d, { coordinateGetter: n })), O = p((e) => {
|
|
156
|
-
E(String(e.active.id));
|
|
157
|
-
}, []), k = p((e) => {
|
|
158
|
-
E(null);
|
|
159
|
-
let { active: t, over: n } = e;
|
|
160
|
-
n && t.id !== n.id && w((e) => o(e, e.findIndex((e) => e.id === t.id), e.findIndex((e) => e.id === n.id)));
|
|
161
|
-
}, []), A = p((e) => {
|
|
162
|
-
w((t) => t.filter((t) => t.id !== e));
|
|
163
|
-
}, []), j = T ? C.find((e) => e.id === T) : null;
|
|
164
|
-
return /* @__PURE__ */ g("div", {
|
|
165
|
-
className: "flex min-h-[400px] gap-4",
|
|
166
|
-
children: [
|
|
167
|
-
/* @__PURE__ */ g("div", {
|
|
168
|
-
className: "w-[200px] flex-none",
|
|
169
|
-
children: [/* @__PURE__ */ h("h3", {
|
|
170
|
-
className: "text-foreground mb-3 text-sm font-semibold",
|
|
171
|
-
children: "Campos Disponíveis"
|
|
172
|
-
}), /* @__PURE__ */ h("div", {
|
|
173
|
-
className: "grid grid-cols-2 gap-2",
|
|
174
|
-
children: y.availableTypes.map((e) => /* @__PURE__ */ g("div", {
|
|
175
|
-
className: "bg-background hover:border-accent cursor-grab rounded-md border p-2 text-center text-xs transition-colors",
|
|
176
|
-
children: [/* @__PURE__ */ h("div", {
|
|
177
|
-
className: "mb-1 text-base leading-none",
|
|
178
|
-
children: e.icon
|
|
179
|
-
}), /* @__PURE__ */ h("span", {
|
|
180
|
-
className: "text-foreground",
|
|
181
|
-
children: e.label
|
|
182
|
-
})]
|
|
183
|
-
}, e.type))
|
|
184
|
-
})]
|
|
185
|
-
}),
|
|
186
|
-
/* @__PURE__ */ g("div", {
|
|
187
|
-
className: "min-w-0 flex-1",
|
|
188
|
-
children: [/* @__PURE__ */ g("div", {
|
|
189
|
-
className: "mb-3 flex items-center justify-between",
|
|
190
|
-
children: [/* @__PURE__ */ h("h3", {
|
|
191
|
-
className: "text-foreground text-sm font-semibold",
|
|
192
|
-
children: "Campos do Formulário"
|
|
193
|
-
}), /* @__PURE__ */ g("span", {
|
|
194
|
-
className: "text-muted-foreground text-xs",
|
|
195
|
-
children: [
|
|
196
|
-
C.length,
|
|
197
|
-
" ",
|
|
198
|
-
C.length === 1 ? "campo" : "campos"
|
|
199
|
-
]
|
|
200
|
-
})]
|
|
201
|
-
}), /* @__PURE__ */ g(r, {
|
|
202
|
-
sensors: D,
|
|
203
|
-
collisionDetection: i,
|
|
204
|
-
modifiers: [_],
|
|
205
|
-
onDragStart: O,
|
|
206
|
-
onDragEnd: k,
|
|
207
|
-
children: [/* @__PURE__ */ h(u, {
|
|
208
|
-
items: C.map((e) => e.id),
|
|
209
|
-
strategy: l,
|
|
210
|
-
children: C.length > 0 ? /* @__PURE__ */ h("div", {
|
|
211
|
-
className: "space-y-2",
|
|
212
|
-
children: C.map((e) => /* @__PURE__ */ h(b, {
|
|
213
|
-
field: e,
|
|
214
|
-
onRemove: A
|
|
215
|
-
}, e.id))
|
|
216
|
-
}) : /* @__PURE__ */ h("div", {
|
|
217
|
-
className: "border-border text-muted-foreground flex min-h-[200px] items-center justify-center rounded-lg border border-dashed text-sm",
|
|
218
|
-
children: v("middag.ui.form_builder.drop_hint")
|
|
219
|
-
})
|
|
220
|
-
}), /* @__PURE__ */ h(a, { children: j ? /* @__PURE__ */ h(x, { field: j }) : null })]
|
|
221
|
-
})]
|
|
222
|
-
}),
|
|
223
|
-
/* @__PURE__ */ g("div", {
|
|
224
|
-
className: "w-[280px] flex-none",
|
|
225
|
-
children: [/* @__PURE__ */ h("h3", {
|
|
226
|
-
className: "text-foreground mb-3 text-sm font-semibold",
|
|
227
|
-
children: v("middag.ui.form_builder.preview")
|
|
228
|
-
}), /* @__PURE__ */ h("div", {
|
|
229
|
-
className: "bg-muted/30 space-y-3 rounded-lg border p-4",
|
|
230
|
-
children: C.length > 0 ? C.map((e) => /* @__PURE__ */ h(S, { field: e }, e.id)) : /* @__PURE__ */ h("p", {
|
|
231
|
-
className: "text-muted-foreground text-center text-xs",
|
|
232
|
-
children: v("middag.ui.form_builder.no_fields")
|
|
233
|
-
})
|
|
234
|
-
})]
|
|
235
|
-
})
|
|
236
|
-
]
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
//#endregion
|
|
240
|
-
export { C as FormBuilderBlock };
|