@pixpilot/formily-shadcn 1.15.2 → 1.17.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/components/date-picker/DatePicker.d.cts +3 -3
- package/dist/components/date-picker/DatePicker.d.ts +3 -3
- package/dist/components/dialog-item/BaseDialogItem.cjs +114 -0
- package/dist/components/dialog-item/BaseDialogItem.d.cts +56 -0
- package/dist/components/dialog-item/BaseDialogItem.d.ts +56 -0
- package/dist/components/dialog-item/BaseDialogItem.js +109 -0
- package/dist/components/dialog-item/ConnectedDialogItem.cjs +16 -0
- package/dist/components/dialog-item/ConnectedDialogItem.d.cts +15 -0
- package/dist/components/dialog-item/ConnectedDialogItem.d.ts +15 -0
- package/dist/components/dialog-item/ConnectedDialogItem.js +14 -0
- package/dist/components/dialog-item/index.cjs +2 -0
- package/dist/components/dialog-item/index.d.cts +2 -0
- package/dist/components/dialog-item/index.d.ts +2 -0
- package/dist/components/dialog-item/index.js +2 -0
- package/dist/components/dialog-item/mcp.js +127 -0
- package/dist/components/form/Form.d.cts +2 -2
- package/dist/components/form/Form.d.ts +2 -2
- package/dist/components/form-grid/FormGrid.d.cts +2 -2
- package/dist/components/form-grid/FormGrid.d.ts +2 -2
- package/dist/components/form-item/ConnectedFormItem.cjs +2 -34
- package/dist/components/form-item/ConnectedFormItem.d.cts +4 -4
- package/dist/components/form-item/ConnectedFormItem.d.ts +4 -4
- package/dist/components/form-item/ConnectedFormItem.js +3 -34
- package/dist/components/form-item/map-form-item-props.cjs +50 -0
- package/dist/components/form-item/map-form-item-props.js +47 -0
- package/dist/components/object-container/ObjectContainer.cjs +1 -1
- package/dist/components/object-container/ObjectContainer.js +1 -1
- package/dist/components/overlay-common/OverlayFields.cjs +26 -0
- package/dist/components/overlay-common/OverlayFields.d.cts +1 -0
- package/dist/components/overlay-common/OverlayFields.d.ts +1 -0
- package/dist/components/overlay-common/OverlayFields.js +24 -0
- package/dist/components/overlay-common/OverlayTrigger.cjs +27 -0
- package/dist/components/overlay-common/OverlayTrigger.d.cts +15 -0
- package/dist/components/overlay-common/OverlayTrigger.d.ts +15 -0
- package/dist/components/overlay-common/OverlayTrigger.js +23 -0
- package/dist/components/overlay-common/constants.cjs +10 -0
- package/dist/components/overlay-common/constants.js +9 -0
- package/dist/components/overlay-common/index.cjs +5 -0
- package/dist/components/overlay-common/index.d.cts +4 -0
- package/dist/components/overlay-common/index.d.ts +4 -0
- package/dist/components/overlay-common/index.js +5 -0
- package/dist/components/overlay-common/is-empty-field-value.cjs +23 -0
- package/dist/components/overlay-common/is-empty-field-value.js +22 -0
- package/dist/components/overlay-common/overlay-types.d.cts +27 -0
- package/dist/components/overlay-common/overlay-types.d.ts +27 -0
- package/dist/components/overlay-common/use-overlay.cjs +110 -0
- package/dist/components/overlay-common/use-overlay.d.cts +1 -0
- package/dist/components/overlay-common/use-overlay.d.ts +1 -0
- package/dist/components/overlay-common/use-overlay.js +107 -0
- package/dist/components/popover-item/BasePopoverItem.cjs +108 -0
- package/dist/components/popover-item/BasePopoverItem.d.cts +57 -0
- package/dist/components/popover-item/BasePopoverItem.d.ts +57 -0
- package/dist/components/popover-item/BasePopoverItem.js +104 -0
- package/dist/components/popover-item/ConnectedPopoverItem.cjs +16 -0
- package/dist/components/popover-item/ConnectedPopoverItem.d.cts +15 -0
- package/dist/components/popover-item/ConnectedPopoverItem.d.ts +15 -0
- package/dist/components/popover-item/ConnectedPopoverItem.js +14 -0
- package/dist/components/popover-item/index.cjs +2 -0
- package/dist/components/popover-item/index.d.cts +2 -0
- package/dist/components/popover-item/index.d.ts +2 -0
- package/dist/components/popover-item/index.js +2 -0
- package/dist/components/popover-item/mcp.js +127 -0
- package/dist/components/radio/Radio.d.ts +2 -2
- package/dist/components/row/Row.d.ts +2 -2
- package/dist/components/schema-field/schema-field-basics.cjs +8 -2
- package/dist/components/schema-field/schema-field-basics.d.cts +337 -263
- package/dist/components/schema-field/schema-field-basics.d.ts +344 -270
- package/dist/components/schema-field/schema-field-basics.js +8 -2
- package/dist/components/schema-field/schema-field-extended.d.cts +497 -423
- package/dist/components/schema-field/schema-field-extended.d.ts +498 -424
- package/dist/components/schema-field/schema-field.d.cts +431 -357
- package/dist/components/schema-field/schema-field.d.ts +431 -357
- package/dist/generated/mcp-registry.js +56 -52
- package/dist/index.cjs +12 -2
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +9 -3
- package/package.json +5 -5
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { defineProps } from "../../mcp/src/utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/popover-item/mcp.ts
|
|
4
|
+
const meta = {
|
|
5
|
+
name: "PopoverItem",
|
|
6
|
+
category: "Formily",
|
|
7
|
+
description: "A Formily decorator used in place of FormItem (`x-decorator: 'PopoverItem'`). It renders the field's label, description, and validation feedback like FormItem, but puts a trigger button where the input would sit and moves the field's own component into a popover anchored to the button.",
|
|
8
|
+
htmlElement: "div",
|
|
9
|
+
props: defineProps({
|
|
10
|
+
label: "Label content or accessible label for the component.",
|
|
11
|
+
description: "Description content rendered with the component.",
|
|
12
|
+
trigger: {
|
|
13
|
+
description: "Props for the trigger button, e.g. `{ label: 'Write a bio' }`. Without a label it reads `Add <title>` while the field is empty and `Edit <title>` once it holds a value (`item` when the field has no title). Accepts the button's other props too (`icon`, `className`, …). An x-reaction can set this via `decoratorProps.trigger`.",
|
|
14
|
+
defaultValue: "`Add <title>` / `Edit <title>`"
|
|
15
|
+
},
|
|
16
|
+
open: {
|
|
17
|
+
description: "Controlled open state of the popover.",
|
|
18
|
+
type: "boolean"
|
|
19
|
+
},
|
|
20
|
+
defaultOpen: {
|
|
21
|
+
description: "Initial open state when uncontrolled.",
|
|
22
|
+
type: "boolean",
|
|
23
|
+
defaultValue: "false"
|
|
24
|
+
},
|
|
25
|
+
onOpenChange: "Called when the popover open state changes.",
|
|
26
|
+
validateOnClose: {
|
|
27
|
+
description: "When true (default), closing validates the field and keeps the popover open (with a shake) while it is invalid. Set false to always close.",
|
|
28
|
+
type: "boolean",
|
|
29
|
+
defaultValue: "true"
|
|
30
|
+
},
|
|
31
|
+
modal: {
|
|
32
|
+
description: "When true, interaction outside the popover is blocked while it is open.",
|
|
33
|
+
type: "boolean",
|
|
34
|
+
defaultValue: "false"
|
|
35
|
+
},
|
|
36
|
+
popover: "The popover itself: `{ title, description, slots }`, e.g. `{ title: 'Notes', slots: { content: { className: 'w-96' } } }`. Title and description default to the field's label and description; `slots` takes props for `content`, `header`, `title`, `description`, and `body`.",
|
|
37
|
+
slots: "Slot props forwarded to the FormItem parts (label, description, error).",
|
|
38
|
+
descriptionPlacement: "Forwarded to the underlying FormItem.",
|
|
39
|
+
requiredMark: "Forwarded to the underlying FormItem.",
|
|
40
|
+
asterisk: "Forwarded to the underlying FormItem.",
|
|
41
|
+
feedbackStatus: "Forwarded to the underlying FormItem.",
|
|
42
|
+
feedbackText: "Forwarded to the underlying FormItem."
|
|
43
|
+
}),
|
|
44
|
+
examples: [
|
|
45
|
+
{
|
|
46
|
+
title: "Edit a single field in a popover",
|
|
47
|
+
code: `{
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
age: {
|
|
51
|
+
type: 'number',
|
|
52
|
+
title: 'Age',
|
|
53
|
+
description: 'Enter your age in years.',
|
|
54
|
+
default: 25,
|
|
55
|
+
'x-decorator': 'PopoverItem',
|
|
56
|
+
'x-component': 'NumberInput',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
}`
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: "Declarative schema field",
|
|
63
|
+
code: `<SchemaField.String name="bio" title="Bio" x-decorator="PopoverItem" x-component="Textarea" />`
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: "Trigger label driven by an x-reaction",
|
|
67
|
+
code: `{
|
|
68
|
+
type: 'string',
|
|
69
|
+
title: 'Bio',
|
|
70
|
+
'x-decorator': 'PopoverItem',
|
|
71
|
+
'x-component': 'Textarea',
|
|
72
|
+
// Decorator props come from decoratorProps, not componentProps.
|
|
73
|
+
'x-reactions': {
|
|
74
|
+
fulfill: {
|
|
75
|
+
state: {
|
|
76
|
+
decoratorProps: {
|
|
77
|
+
trigger: {
|
|
78
|
+
label: "{{$self.value ? 'Edit bio' : 'Write a bio'}}",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
}`
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "A whole object edited in one popover",
|
|
88
|
+
code: `{
|
|
89
|
+
type: 'object',
|
|
90
|
+
title: 'Profile',
|
|
91
|
+
'x-decorator': 'PopoverItem',
|
|
92
|
+
// type: 'object' resolves to ObjectContainer. Turn off its own label and
|
|
93
|
+
// description — the popover header already shows them — and use the flat
|
|
94
|
+
// variant so the card chrome does not double up inside the popover.
|
|
95
|
+
'x-component-props': { variant: 'flat', label: false, description: false },
|
|
96
|
+
properties: {
|
|
97
|
+
firstName: { type: 'string', title: 'First Name' },
|
|
98
|
+
lastName: { type: 'string', title: 'Last Name', required: true },
|
|
99
|
+
},
|
|
100
|
+
}`
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
notes: [
|
|
104
|
+
"Works on an object too: decorating a `type: object` field puts its whole form in the popover, and closing validates every field inside it, at any depth.",
|
|
105
|
+
"Swap in for FormItem on any field — the field keeps its own `x-component`, so validation, x-reactions, and component props behave exactly as under FormItem.",
|
|
106
|
+
"Edits commit to the form as the user types; there is no draft/Save step.",
|
|
107
|
+
"Closing (Escape or an outside click) validates the field first. An invalid field keeps the popover open and shakes it.",
|
|
108
|
+
"While the popover is closed the input stays mounted in a hidden container, so component state and reactions behave as if it were always rendered.",
|
|
109
|
+
"The trigger renders in an error state, and the label turns red, while the field has a validation error — the message appears under the trigger and inside the popover.",
|
|
110
|
+
"The popover content matches the trigger width by default; override with `popover.slots.content.className`."
|
|
111
|
+
],
|
|
112
|
+
keywords: [
|
|
113
|
+
"formily",
|
|
114
|
+
"decorator",
|
|
115
|
+
"popover",
|
|
116
|
+
"field",
|
|
117
|
+
"form-item"
|
|
118
|
+
],
|
|
119
|
+
related: [
|
|
120
|
+
"FormItem",
|
|
121
|
+
"DialogItem",
|
|
122
|
+
"ObjectContainer"
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
export { meta };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, FC } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { RadioGroup } from "@pixpilot/shadcn";
|
|
4
4
|
|
|
5
5
|
//#region src/components/radio/Radio.d.ts
|
|
@@ -15,7 +15,7 @@ type RadioProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Radio component with options rendering
|
|
17
17
|
*/
|
|
18
|
-
declare function Radio(props: RadioProps):
|
|
18
|
+
declare function Radio(props: RadioProps): react_jsx_runtime0.JSX.Element;
|
|
19
19
|
declare namespace Radio {
|
|
20
20
|
var displayName: string;
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/row/Row.d.ts
|
|
5
5
|
interface IRowProps {
|
|
@@ -36,6 +36,6 @@ interface IRowProps {
|
|
|
36
36
|
declare function Row({
|
|
37
37
|
className,
|
|
38
38
|
children
|
|
39
|
-
}: IRowProps):
|
|
39
|
+
}: IRowProps): react_jsx_runtime2.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { IRowProps, Row };
|
|
@@ -20,10 +20,12 @@ const require_Column = require('../column/Column.cjs');
|
|
|
20
20
|
require('../column/index.cjs');
|
|
21
21
|
const require_DatePicker = require('../date-picker/DatePicker.cjs');
|
|
22
22
|
require('../date-picker/index.cjs');
|
|
23
|
-
const require_FormGrid = require('../form-grid/FormGrid.cjs');
|
|
24
|
-
require('../form-grid/index.cjs');
|
|
25
23
|
const require_ConnectedFormItem = require('../form-item/ConnectedFormItem.cjs');
|
|
26
24
|
require('../form-item/index.cjs');
|
|
25
|
+
const require_ConnectedDialogItem = require('../dialog-item/ConnectedDialogItem.cjs');
|
|
26
|
+
require('../dialog-item/index.cjs');
|
|
27
|
+
const require_FormGrid = require('../form-grid/FormGrid.cjs');
|
|
28
|
+
require('../form-grid/index.cjs');
|
|
27
29
|
const require_IconToggle = require('../icon-toggle/IconToggle.cjs');
|
|
28
30
|
require('../icon-toggle/index.cjs');
|
|
29
31
|
const require_Input = require('../input/Input.cjs');
|
|
@@ -36,6 +38,8 @@ const require_NumberInput = require('../number/NumberInput.cjs');
|
|
|
36
38
|
require('../number/index.cjs');
|
|
37
39
|
const require_ObjectContainer = require('../object-container/ObjectContainer.cjs');
|
|
38
40
|
require('../object-container/index.cjs');
|
|
41
|
+
const require_ConnectedPopoverItem = require('../popover-item/ConnectedPopoverItem.cjs');
|
|
42
|
+
require('../popover-item/index.cjs');
|
|
39
43
|
const require_Radio = require('../radio/Radio.cjs');
|
|
40
44
|
require('../radio/index.cjs');
|
|
41
45
|
const require_Row = require('../row/Row.cjs');
|
|
@@ -100,6 +104,8 @@ const basicComponentRegistry = {
|
|
|
100
104
|
component: require_DatePicker.DatePicker,
|
|
101
105
|
decorator: "FormItem"
|
|
102
106
|
},
|
|
107
|
+
DialogItem: { component: require_ConnectedDialogItem.DialogItem },
|
|
108
|
+
PopoverItem: { component: require_ConnectedPopoverItem.PopoverItem },
|
|
103
109
|
FormGrid: { component: require_FormGrid.FormGrid },
|
|
104
110
|
FormItem: { component: require_ConnectedFormItem.FormItem },
|
|
105
111
|
Hidden: { component: require_Hidden.Hidden },
|