@middag-io/react 0.12.0 → 0.14.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/README.md +14 -14
- package/dist-lib/ChartPanelBlock-DIb2mv9F.js +18005 -0
- package/dist-lib/{ConditionTreeBlock-BkbUNS1M.js → ConditionTreeBlock-C54B_GOo.js} +1 -1
- package/dist-lib/DateField-CA-O-Fpw.js +121 -0
- package/dist-lib/DateRangeField-vXr5VVQz.js +663 -0
- package/dist-lib/DocumentField-I92arMqr.js +221 -0
- package/dist-lib/{FlowEditorBlock-CHodeGBw.js → FlowEditorBlock-CaR42_-b.js} +2063 -2653
- package/dist-lib/FormBuilderBlock-B_LPQ4oN.js +240 -0
- package/dist-lib/FormPanelBlock-BE89P5Vj.js +8827 -0
- package/dist-lib/FormPanelBlock-Bn_z6669.js +2 -0
- package/dist-lib/{index.min-BoVYs6GD.js → HugeiconsIcon-C_2Bj2NI.js} +147 -1809
- package/dist-lib/KanbanBoardBlock-rySahBrC.js +399 -0
- package/dist-lib/{MarkdownContent-gyfg0PWC.js → MarkdownContent-DVCptbxx.js} +14 -12
- package/dist-lib/PhoneField-BXhvQbTx.js +18585 -0
- package/dist-lib/{SentenceBuilderBlock-DWpf9_O-.js → SentenceBuilderBlock-Wf5YMSPg.js} +1 -1
- package/dist-lib/app/ContractPage.d.ts +1 -1
- package/dist-lib/app/ContractPage.d.ts.map +1 -1
- package/dist-lib/app/EntityRoutes.d.ts +1 -1
- package/dist-lib/app/EntityRoutes.d.ts.map +1 -1
- package/dist-lib/app/HostSlot.d.ts +68 -0
- package/dist-lib/app/HostSlot.d.ts.map +1 -0
- package/dist-lib/app/LazyBlock.d.ts +1 -1
- package/dist-lib/app/LazyBlock.d.ts.map +1 -1
- package/dist-lib/app/bootstrap.d.ts.map +1 -1
- package/dist-lib/app/providers/auth.d.ts +2 -2
- package/dist-lib/app/providers/auth.d.ts.map +1 -1
- package/dist-lib/app/providers/error-reporter.d.ts.map +1 -1
- package/dist-lib/app/providers/flash.d.ts.map +1 -1
- package/dist-lib/app/providers/i18n-defaults.d.ts.map +1 -1
- package/dist-lib/app/providers/i18n.d.ts +1 -1
- package/dist-lib/app/providers/i18n.d.ts.map +1 -1
- package/dist-lib/app/providers/index.d.ts +15 -0
- package/dist-lib/app/providers/index.d.ts.map +1 -0
- package/dist-lib/app/providers/locales/pt-BR.d.ts.map +1 -1
- package/dist-lib/app/providers/progress.d.ts.map +1 -1
- package/dist-lib/app/providers/scope.d.ts.map +1 -1
- package/dist-lib/app/register-defaults.d.ts +4 -3
- package/dist-lib/app/register-defaults.d.ts.map +1 -1
- package/dist-lib/app/registries.d.ts.map +1 -1
- package/dist-lib/assets/lottie/index.d.ts.map +1 -1
- package/dist-lib/badge-CEJlJgBY.js +63 -0
- package/dist-lib/base/blocks/ActionGridBlock.d.ts +1 -1
- package/dist-lib/base/blocks/ActionGridBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/ActivityTimelineBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/CardGridBlock.d.ts +1 -1
- package/dist-lib/base/blocks/CardGridBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/ChartPanelBlock.d.ts +11 -0
- package/dist-lib/base/blocks/ChartPanelBlock.d.ts.map +1 -0
- package/dist-lib/base/blocks/ConditionTreeBlock.d.ts +1 -1
- package/dist-lib/base/blocks/ConditionTreeBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DenseTableBlock.d.ts +1 -1
- package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/DetailPanelBlock.d.ts +1 -1
- package/dist-lib/base/blocks/DetailPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/EmptyStateBlock.d.ts +1 -1
- package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/FlowEditorBlock.d.ts +1 -1
- package/dist-lib/base/blocks/FlowEditorBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/FormBuilderBlock.d.ts +1 -1
- package/dist-lib/base/blocks/FormBuilderBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/FormPanelBlock.d.ts +8 -3
- package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/KanbanBoardBlock.d.ts +11 -0
- package/dist-lib/base/blocks/KanbanBoardBlock.d.ts.map +1 -0
- package/dist-lib/base/blocks/LinkListBlock.d.ts +1 -1
- package/dist-lib/base/blocks/LinkListBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts +1 -1
- package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/MetricCardBlock.d.ts +1 -1
- package/dist-lib/base/blocks/MetricCardBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/StatusStripBlock.d.ts +1 -1
- package/dist-lib/base/blocks/StatusStripBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/TabbedPanelBlock.d.ts +1 -1
- package/dist-lib/base/blocks/TabbedPanelBlock.d.ts.map +1 -1
- package/dist-lib/base/blocks/WorkflowProgressBlock.d.ts.map +1 -1
- package/dist-lib/base/form/FormField.d.ts +6 -20
- package/dist-lib/base/form/FormField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/CheckboxField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/ColorField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/CurrencyField.d.ts +2 -2
- package/dist-lib/base/form/fields/CurrencyField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/DateField.d.ts +21 -0
- package/dist-lib/base/form/fields/DateField.d.ts.map +1 -0
- package/dist-lib/base/form/fields/DateRangeField.d.ts +21 -0
- package/dist-lib/base/form/fields/DateRangeField.d.ts.map +1 -0
- package/dist-lib/base/form/fields/DocumentField.d.ts +19 -6
- package/dist-lib/base/form/fields/DocumentField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/EntityPickerField.d.ts +19 -9
- package/dist-lib/base/form/fields/EntityPickerField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/FileUploadField.d.ts +22 -0
- package/dist-lib/base/form/fields/FileUploadField.d.ts.map +1 -0
- package/dist-lib/base/form/fields/MultiSelectField.d.ts +5 -5
- package/dist-lib/base/form/fields/MultiSelectField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/NumberField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/PasswordField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/PhoneField.d.ts +8 -4
- package/dist-lib/base/form/fields/PhoneField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/RadioField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/RatingField.d.ts +17 -0
- package/dist-lib/base/form/fields/RatingField.d.ts.map +1 -0
- package/dist-lib/base/form/fields/SelectField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/SlugField.d.ts +2 -2
- package/dist-lib/base/form/fields/SlugField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/StaticField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/SwitchField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/TagsField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/TextField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/TextareaField.d.ts.map +1 -1
- package/dist-lib/base/form/fields/document-validation.d.ts +25 -5
- package/dist-lib/base/form/fields/document-validation.d.ts.map +1 -1
- package/dist-lib/base/form/fields/field-registry.d.ts +38 -0
- package/dist-lib/base/form/fields/field-registry.d.ts.map +1 -0
- package/dist-lib/base/form/fields/register-default-fields.d.ts +13 -0
- package/dist-lib/base/form/fields/register-default-fields.d.ts.map +1 -0
- package/dist-lib/base/form/form-schema-builder.d.ts +27 -0
- package/dist-lib/base/form/form-schema-builder.d.ts.map +1 -0
- package/dist-lib/base/form/form-utils.d.ts +14 -0
- package/dist-lib/base/form/form-utils.d.ts.map +1 -0
- package/dist-lib/base/hooks/usePolling.d.ts.map +1 -1
- package/dist-lib/base/layout/BlockRegion.d.ts +18 -0
- package/dist-lib/base/layout/BlockRegion.d.ts.map +1 -0
- package/dist-lib/base/layout/DashboardLayout.d.ts +5 -2
- package/dist-lib/base/layout/DashboardLayout.d.ts.map +1 -1
- package/dist-lib/base/layout/SidebarLayout.d.ts +16 -0
- package/dist-lib/base/layout/SidebarLayout.d.ts.map +1 -0
- package/dist-lib/base/layout/StackLayout.d.ts +4 -4
- package/dist-lib/base/layout/StackLayout.d.ts.map +1 -1
- package/dist-lib/base/layout/WizardLayout.d.ts +2 -2
- package/dist-lib/base/layout/WizardLayout.d.ts.map +1 -1
- package/dist-lib/base/partials/ActionBar/index.d.ts +4 -12
- package/dist-lib/base/partials/ActionBar/index.d.ts.map +1 -1
- package/dist-lib/base/partials/ConfirmationDialog/index.d.ts.map +1 -1
- package/dist-lib/base/partials/DataTable/cell-registry.d.ts +35 -0
- package/dist-lib/base/partials/DataTable/cell-registry.d.ts.map +1 -0
- package/dist-lib/base/partials/DataTable/cell-renderers.d.ts +14 -10
- package/dist-lib/base/partials/DataTable/cell-renderers.d.ts.map +1 -1
- package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
- package/dist-lib/base/partials/DataTable/register-default-cells.d.ts +9 -0
- package/dist-lib/base/partials/DataTable/register-default-cells.d.ts.map +1 -0
- package/dist-lib/base/partials/DataTable/types.d.ts +4 -4
- package/dist-lib/base/partials/DataTable/types.d.ts.map +1 -1
- package/dist-lib/base/partials/DetailSection/index.d.ts +1 -1
- package/dist-lib/base/partials/DetailSection/index.d.ts.map +1 -1
- package/dist-lib/base/partials/EmptyPlaceholder/index.d.ts.map +1 -1
- package/dist-lib/base/partials/FilterBar/index.d.ts.map +1 -1
- package/dist-lib/base/partials/FormSection/index.d.ts.map +1 -1
- package/dist-lib/base/partials/LogViewer/JsonBlock.d.ts +1 -1
- package/dist-lib/base/partials/LogViewer/JsonBlock.d.ts.map +1 -1
- package/dist-lib/base/partials/LogViewer/LogEntry.d.ts.map +1 -1
- package/dist-lib/base/partials/LogViewer/LogViewerToolbar.d.ts.map +1 -1
- package/dist-lib/base/partials/LogViewer/index.d.ts.map +1 -1
- package/dist-lib/base/partials/LogViewer/types.d.ts.map +1 -1
- package/dist-lib/base/partials/MarkdownContent/index.d.ts.map +1 -1
- package/dist-lib/base/partials/StatRow/index.d.ts.map +1 -1
- package/dist-lib/base/partials/StatusBar/index.d.ts +1 -1
- package/dist-lib/base/partials/StatusBar/index.d.ts.map +1 -1
- package/dist-lib/base/partials/StatusIndicator/index.d.ts.map +1 -1
- package/dist-lib/base/partials/StepIndicator/index.d.ts +3 -1
- package/dist-lib/base/partials/StepIndicator/index.d.ts.map +1 -1
- package/dist-lib/base/partials/TimelineList/index.d.ts.map +1 -1
- package/dist-lib/base/shell/ImmersiveShell.d.ts +14 -0
- package/dist-lib/base/shell/ImmersiveShell.d.ts.map +1 -0
- package/dist-lib/base/shell/ProductShell.d.ts +17 -5
- package/dist-lib/base/shell/ProductShell.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/AdminTabBar.d.ts +12 -0
- package/dist-lib/base/shell/partials/AdminTabBar.d.ts.map +1 -0
- package/dist-lib/base/shell/partials/AppearanceToggle.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/BoostSearchBar.d.ts +32 -0
- package/dist-lib/base/shell/partials/BoostSearchBar.d.ts.map +1 -0
- package/dist-lib/base/shell/partials/CommandPalette.d.ts +1 -1
- package/dist-lib/base/shell/partials/CommandPalette.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/HelpContext.d.ts +1 -1
- package/dist-lib/base/shell/partials/HelpContext.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/HelpPanel.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/InlineInspector.d.ts +3 -2
- package/dist-lib/base/shell/partials/InlineInspector.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/InspectorContext.d.ts +14 -3
- package/dist-lib/base/shell/partials/InspectorContext.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/InspectorPanel.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/NavErrorBoundary.d.ts +1 -1
- package/dist-lib/base/shell/partials/NavErrorBoundary.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/OverlayScreen.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts +1 -1
- package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/PageFilterTabs.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/PageHeader.d.ts +1 -1
- package/dist-lib/base/shell/partials/PageHeader.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/SidebarNav.d.ts +4 -4
- package/dist-lib/base/shell/partials/SidebarNav.d.ts.map +1 -1
- package/dist-lib/base/theme/appearance.d.ts.map +1 -1
- package/dist-lib/base/theme/host-layout-detector.d.ts.map +1 -1
- package/dist-lib/base/theme/host-theme-detector.d.ts.map +1 -1
- package/dist-lib/base/theme/theme-context.d.ts +61 -0
- package/dist-lib/base/theme/theme-context.d.ts.map +1 -0
- package/dist-lib/base/theme/useHostTheme.d.ts.map +1 -1
- package/dist-lib/base/utils/conditions.d.ts.map +1 -1
- package/dist-lib/base/utils/icon-registry.d.ts +27 -0
- package/dist-lib/base/utils/icon-registry.d.ts.map +1 -0
- package/dist-lib/base/utils/icons.d.ts +1 -1
- package/dist-lib/base/utils/icons.d.ts.map +1 -1
- package/dist-lib/base/utils/interpolate.d.ts.map +1 -1
- package/dist-lib/base/utils/register-default-icons.d.ts +11 -0
- package/dist-lib/base/utils/register-default-icons.d.ts.map +1 -0
- package/dist-lib/base/utils/storage.d.ts +34 -0
- package/dist-lib/base/utils/storage.d.ts.map +1 -0
- package/dist-lib/button-DY_CinAY.js +242 -0
- package/dist-lib/calendar-Dw-fH9qs.js +4505 -0
- package/dist-lib/combobox-DdpNpq0T.js +5303 -0
- package/dist-lib/components/reui/alert.d.ts +1 -1
- package/dist-lib/components/reui/avatar.d.ts +12 -0
- package/dist-lib/components/reui/avatar.d.ts.map +1 -0
- package/dist-lib/components/reui/badge.d.ts +1 -1
- package/dist-lib/components/reui/button.d.ts +1 -1
- package/dist-lib/components/reui/calendar.d.ts +9 -0
- package/dist-lib/components/reui/calendar.d.ts.map +1 -0
- package/dist-lib/components/reui/chart.d.ts +45 -0
- package/dist-lib/components/reui/chart.d.ts.map +1 -0
- package/dist-lib/components/reui/combobox.d.ts +25 -0
- package/dist-lib/components/reui/combobox.d.ts.map +1 -0
- package/dist-lib/components/reui/date-selector.d.ts +129 -0
- package/dist-lib/components/reui/date-selector.d.ts.map +1 -0
- package/dist-lib/components/reui/frame.d.ts +1 -1
- package/dist-lib/components/reui/input-group.d.ts +17 -0
- package/dist-lib/components/reui/input-group.d.ts.map +1 -0
- package/dist-lib/components/reui/kanban.d.ts +60 -0
- package/dist-lib/components/reui/kanban.d.ts.map +1 -0
- package/dist-lib/components/reui/phone-input.d.ts +12 -0
- package/dist-lib/components/reui/phone-input.d.ts.map +1 -0
- package/dist-lib/components/reui/rating.d.ts +32 -0
- package/dist-lib/components/reui/rating.d.ts.map +1 -0
- package/dist-lib/components/reui/scroll-area.d.ts +6 -0
- package/dist-lib/components/reui/scroll-area.d.ts.map +1 -0
- package/dist-lib/components/reui/stepper.d.ts +62 -0
- package/dist-lib/components/reui/stepper.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/actions.d.ts +57 -0
- package/dist-lib/contracts/block-data/actions.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/data-display.d.ts +235 -0
- package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/form.d.ts +234 -0
- package/dist-lib/contracts/block-data/form.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/index.d.ts +15 -0
- package/dist-lib/contracts/block-data/index.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/interactive.d.ts +140 -0
- package/dist-lib/contracts/block-data/interactive.d.ts.map +1 -0
- package/dist-lib/contracts/block-data/shared.d.ts +47 -0
- package/dist-lib/contracts/block-data/shared.d.ts.map +1 -0
- package/dist-lib/contracts/navigation.d.ts +1 -59
- package/dist-lib/contracts/navigation.d.ts.map +1 -1
- package/dist-lib/contracts/page-contract-schema.d.ts.map +1 -1
- package/dist-lib/contracts/page-contract.d.ts +55 -15
- package/dist-lib/contracts/page-contract.d.ts.map +1 -1
- package/dist-lib/contracts/shared-props.d.ts +2 -2
- package/dist-lib/contracts/shared-props.d.ts.map +1 -1
- package/dist-lib/dist-3F0-lo64.js +15 -0
- package/dist-lib/dist-BN2kCxhw.js +1196 -0
- package/dist-lib/dist-BVqmxsUH.js +123 -0
- package/dist-lib/dist-C3iVHwGr.js +235 -0
- package/dist-lib/dist-DSWRN9XQ.js +54 -0
- package/dist-lib/document-validation-C5Yr5Kkc.js +1249 -0
- package/dist-lib/floating-ui.react-dom-kYEBCgAT.js +1089 -0
- package/dist-lib/{i18n-BUNFYM_z.js → i18n-CP5eDOjK.js} +113 -0
- package/dist-lib/index.d.ts +16 -10
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/input-DovH16Rh.js +14 -0
- package/dist-lib/lib/hooks/use-file-upload.d.ts.map +1 -1
- package/dist-lib/lib/utils.d.ts.map +1 -1
- package/dist-lib/lottie/index.ts +8 -40
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +7508 -31147
- package/dist-lib/popover-DeghPbgu.js +242 -0
- package/dist-lib/scroll-area-CDaBiyoP.js +557 -0
- package/dist-lib/skeleton-UFUcHob_.js +12 -0
- package/dist-lib/{FormBuilderBlock-C6AX-Eg0.js → sortable.esm-0nILrm98.js} +745 -982
- package/dist-lib/use-mobile-B2E8cMyY.js +205 -0
- package/dist-lib/utils-DS8lnGJS.js +1692 -0
- package/dist-lib/value-BmOnuKrw.js +413 -0
- package/dist-lib/with-selector-eFb4BYrL.js +185 -0
- package/package.json +8 -1
- package/dist-lib/base/layout/MasterDetailLayout.d.ts +0 -8
- package/dist-lib/base/layout/MasterDetailLayout.d.ts.map +0 -1
- package/dist-lib/base/layout/SplitLayout.d.ts +0 -8
- package/dist-lib/base/layout/SplitLayout.d.ts.map +0 -1
- package/dist-lib/base/shell/AdminShell.d.ts +0 -12
- package/dist-lib/base/shell/AdminShell.d.ts.map +0 -1
- package/dist-lib/base/shell/HostProductShell.d.ts +0 -29
- package/dist-lib/base/shell/HostProductShell.d.ts.map +0 -1
- package/dist-lib/components/reui/alert-dialog.d.ts +0 -19
- package/dist-lib/components/reui/alert-dialog.d.ts.map +0 -1
- package/dist-lib/contracts/block-data.d.ts +0 -438
- package/dist-lib/contracts/block-data.d.ts.map +0 -1
- package/dist-lib/lib/deprecation.d.ts +0 -10
- package/dist-lib/lib/deprecation.d.ts.map +0 -1
- /package/dist-lib/{dist-BDvVQ5m8.js → dist-CZG8yxiX.js} +0 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { n as e } from "./i18n-CP5eDOjK.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-0nILrm98.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 };
|