@synopackageland/ui 0.4.2 → 0.5.4
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 +21 -0
- package/dist/components/advanced-panel/AdvancePanelColumns.vue.d.ts +19 -0
- package/dist/components/advanced-panel/AdvancePanelForm.vue.d.ts +21 -0
- package/dist/components/advanced-panel/AdvancePanelGrid.vue.d.ts +44 -0
- package/dist/components/advanced-panel/types.d.ts +50 -0
- package/dist/components/app/app-action-bar/AppActionBar.vue.d.ts +13 -3
- package/dist/components/app/app-layout/AppLayout.vue.d.ts +1 -1
- package/dist/components/app/app-sidebar/AppSidebar.vue.d.ts +12 -13
- package/dist/components/app/app-sidebar/AppSidebarItems.vue.d.ts +17 -0
- package/dist/components/app/app-sidebar/types.d.ts +16 -0
- package/dist/components/app/section-tabs/SectionTabs.vue.d.ts +11 -1
- package/dist/components/composite/about-dialog/AboutDialog.vue.d.ts +78 -0
- package/dist/components/composite/about-dialog/types.d.ts +6 -0
- package/dist/components/composite/callout/Callout.vue.d.ts +12 -2
- package/dist/components/composite/config-provider/ConfigProvider.vue.d.ts +19 -0
- package/dist/components/composite/copy-cut-field/CopyCutField.vue.d.ts +44 -0
- package/dist/components/composite/data-grid/DataGrid.vue.d.ts +150 -25
- package/dist/components/composite/data-grid/labels.d.ts +15 -1
- package/dist/components/composite/data-view/DataView.vue.d.ts +54 -0
- package/dist/components/composite/footbar/Footbar.vue.d.ts +13 -0
- package/dist/components/composite/footbar/FootbarButtons.vue.d.ts +13 -0
- package/dist/components/composite/footbar/types.d.ts +32 -0
- package/dist/components/composite/form/Form.vue.d.ts +49 -0
- package/dist/components/composite/form/FormItem.vue.d.ts +132 -0
- package/dist/components/composite/form/context.d.ts +61 -0
- package/dist/components/composite/form/rules.d.ts +17 -0
- package/dist/components/composite/form/types.d.ts +50 -0
- package/dist/components/composite/message-box/MessageBox.vue.d.ts +34 -0
- package/dist/components/composite/message-box/MessageBoxProvider.vue.d.ts +13 -0
- package/dist/components/composite/message-box/controller.d.ts +20 -0
- package/dist/components/composite/message-box/types.d.ts +97 -0
- package/dist/components/composite/overflow-list/OverflowList.vue.d.ts +40 -0
- package/dist/components/composite/overflow-list/OverflowListItem.vue.d.ts +18 -0
- package/dist/components/composite/overflow-toolbar/OverflowToolbar.vue.d.ts +46 -0
- package/dist/components/composite/overflow-toolbar/overflow.d.ts +25 -0
- package/dist/components/composite/overflow-toolbar/types.d.ts +27 -0
- package/dist/components/composite/settings-section/SettingsSection.vue.d.ts +18 -3
- package/dist/components/composite/tree-view/TreeView.vue.d.ts +64 -12
- package/dist/components/composite/tree-view/treeUtils.d.ts +15 -0
- package/dist/components/composite/tree-view/types.d.ts +38 -0
- package/dist/components/composite/virtual-list/VirtualList.vue.d.ts +44 -0
- package/dist/components/composite/wizard/Wizard.vue.d.ts +68 -0
- package/dist/components/composite/wizard/WizardStep.vue.d.ts +20 -0
- package/dist/components/composite/wizard/types.d.ts +32 -0
- package/dist/components/composite/wizard/wizardContext.d.ts +17 -0
- package/dist/components/containers/card/Card.vue.d.ts +42 -0
- package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +79 -0
- package/dist/components/containers/fieldset/Fieldset.vue.d.ts +58 -0
- package/dist/components/containers/highlight-box/HighlightBox.vue.d.ts +23 -0
- package/dist/components/containers/panel/Panel.vue.d.ts +59 -0
- package/dist/components/feedback/info-mask/InfoMask.vue.d.ts +22 -0
- package/dist/components/feedback/info-tip/InfoTip.vue.d.ts +53 -0
- package/dist/components/feedback/notification/Notification.vue.d.ts +50 -0
- package/dist/components/feedback/notification/NotificationProvider.vue.d.ts +36 -0
- package/dist/components/feedback/notification/notification.d.ts +45 -0
- package/dist/components/feedback/validation-popup/ValidationPopup.vue.d.ts +41 -0
- package/dist/components/primitives/affix/Affix.vue.d.ts +40 -0
- package/dist/components/primitives/affix/affixPosition.d.ts +35 -0
- package/dist/components/primitives/breadcrumb/Breadcrumb.vue.d.ts +38 -0
- package/dist/components/primitives/breadcrumb/BreadcrumbCrumb.vue.d.ts +13 -0
- package/dist/components/primitives/breadcrumb/collapse.d.ts +25 -0
- package/dist/components/primitives/breadcrumb/types.d.ts +14 -0
- package/dist/components/primitives/color-picker/ColorPicker.vue.d.ts +70 -0
- package/dist/components/primitives/color-picker/palette.d.ts +2 -0
- package/dist/components/primitives/combobox/Combobox.vue.d.ts +33 -0
- package/dist/components/primitives/date-picker/DatePicker.vue.d.ts +39 -1
- package/dist/components/primitives/date-picker/dateTime.d.ts +44 -0
- package/dist/components/primitives/dialog/Dialog.vue.d.ts +6 -3
- package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +18 -13
- package/dist/components/primitives/dropdown-menu/DropdownMenuItems.vue.d.ts +20 -0
- package/dist/components/primitives/dropdown-menu/types.d.ts +38 -0
- package/dist/components/primitives/ghost/Ghost.vue.d.ts +30 -0
- package/dist/components/primitives/icon/Icon.vue.d.ts +40 -0
- package/dist/components/primitives/icon/icon.d.ts +19 -0
- package/dist/components/primitives/icon/iconRegistry.d.ts +9 -0
- package/dist/components/primitives/icon/useIconButton.d.ts +30 -0
- package/dist/components/primitives/input/Input.vue.d.ts +6 -0
- package/dist/components/primitives/input/Textarea.vue.d.ts +6 -0
- package/dist/components/primitives/input-steppers/InputSteppers.vue.d.ts +60 -0
- package/dist/components/primitives/layout/Col.vue.d.ts +24 -0
- package/dist/components/primitives/layout/Grid.vue.d.ts +35 -0
- package/dist/components/primitives/layout/Row.vue.d.ts +23 -0
- package/dist/components/primitives/layout/breakpoints.d.ts +24 -0
- package/dist/components/primitives/layout/context.d.ts +22 -0
- package/dist/components/primitives/layout/gap.d.ts +12 -0
- package/dist/components/primitives/multiple-select/MultipleSelect.vue.d.ts +32 -0
- package/dist/components/primitives/pagination/Pagination.vue.d.ts +111 -0
- package/dist/components/primitives/pagination/labels.d.ts +18 -0
- package/dist/components/primitives/pagination/model.d.ts +13 -0
- package/dist/components/primitives/progress/Progress.vue.d.ts +2 -0
- package/dist/components/primitives/rich-text/RichText.vue.d.ts +57 -0
- package/dist/components/primitives/rich-text/parseRichText.d.ts +31 -0
- package/dist/components/primitives/schedule-table/ScheduleTable.vue.d.ts +65 -0
- package/dist/components/primitives/schedule-table/schedule.d.ts +55 -0
- package/dist/components/primitives/scrollbar/Scrollbar.vue.d.ts +110 -0
- package/dist/components/primitives/scrollbar/types.d.ts +10 -0
- package/dist/components/primitives/segment-control/SegmentControl.vue.d.ts +32 -0
- package/dist/components/primitives/segment-control/SegmentItem.vue.d.ts +32 -0
- package/dist/components/primitives/segment-control/context.d.ts +19 -0
- package/dist/components/primitives/select/Select.vue.d.ts +15 -1
- package/dist/components/primitives/select/internal/ComboboxField.vue.d.ts +46 -0
- package/dist/components/primitives/select/internal/SelectTag.vue.d.ts +15 -0
- package/dist/components/primitives/select/internal/options.d.ts +17 -0
- package/dist/components/primitives/select/internal/types.d.ts +43 -0
- package/dist/components/primitives/select/internal/useSelectSearch.d.ts +20 -0
- package/dist/components/primitives/sheet/Sheet.vue.d.ts +3 -3
- package/dist/components/primitives/skeleton/Skeleton.vue.d.ts +1 -1
- package/dist/components/primitives/slider/Slider.vue.d.ts +56 -0
- package/dist/components/primitives/space/Space.vue.d.ts +27 -0
- package/dist/components/primitives/space/space.d.ts +10 -0
- package/dist/components/primitives/superbox-select/SuperboxSelect.vue.d.ts +33 -0
- package/dist/components/primitives/tag/Tag.vue.d.ts +59 -0
- package/dist/components/primitives/toggle-button/ToggleButton.vue.d.ts +43 -0
- package/dist/components/primitives/toggle-button/ToggleButtonGroup.vue.d.ts +38 -0
- package/dist/components/primitives/toggle-button/toggleButton.d.ts +9 -0
- package/dist/components/primitives/tooltip/Tooltip.vue.d.ts +3 -0
- package/dist/components/primitives/typography/TypoA.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoBlockquote.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoCode.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoDivider.vue.d.ts +3 -0
- package/dist/components/primitives/typography/TypoHeader.vue.d.ts +32 -0
- package/dist/components/primitives/typography/TypoHr.vue.d.ts +3 -0
- package/dist/components/primitives/typography/TypoLi.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoList.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoP.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoTable.vue.d.ts +13 -0
- package/dist/components/primitives/typography/TypoText.vue.d.ts +26 -0
- package/dist/components/primitives/typography/TypoTip.vue.d.ts +21 -0
- package/dist/components/primitives/typography/typography.d.ts +12 -0
- package/dist/composables/configCascade.d.ts +42 -0
- package/dist/composables/tabIndicator.d.ts +18 -0
- package/dist/index.d.ts +122 -2
- package/dist/index.js +22765 -10938
- package/dist/lib/controllable.d.ts +19 -0
- package/dist/lib/numberField.d.ts +24 -0
- package/dist/lib/overflow.d.ts +13 -0
- package/dist/reka-runtime.json +5 -3
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/app-local-modal.md +9 -1
- package/package.json +1 -1
|
@@ -13,10 +13,85 @@ export type DataGridColumn = {
|
|
|
13
13
|
sortable?: boolean;
|
|
14
14
|
/** Overrides the grid's `resizable` for this column. */
|
|
15
15
|
resizable?: boolean;
|
|
16
|
+
/** Cell slots of an editable column get `editing`, `startEdit`, `stopEdit` and `update`. */
|
|
17
|
+
editable?: boolean;
|
|
16
18
|
compare?: (a: unknown, b: unknown, rowA: Record<string, unknown>, rowB: Record<string, unknown>) => number;
|
|
17
19
|
};
|
|
18
20
|
export type DataGridColumnWidths = Record<string, number>;
|
|
19
|
-
export type
|
|
21
|
+
export type DataGridGroup = {
|
|
22
|
+
/** Row field whose value identifies the group. */
|
|
23
|
+
field: string;
|
|
24
|
+
/** Group header text; defaults to the field value. */
|
|
25
|
+
label?: (value: unknown, rows: Record<string, unknown>[]) => string;
|
|
26
|
+
/** Groups start expanded unless this is `false`. */
|
|
27
|
+
defaultExpanded?: boolean;
|
|
28
|
+
/** Group order; defaults to the order groups first appear in the sorted rows. */
|
|
29
|
+
compare?: (a: unknown, b: unknown) => number;
|
|
30
|
+
};
|
|
31
|
+
export type DataGridExpandable = {
|
|
32
|
+
/** `row` toggles on double click as well; `cell` needs the chevron button only. */
|
|
33
|
+
type?: 'row' | 'cell';
|
|
34
|
+
/** Slot name of the expanded content; defaults to `expand`. */
|
|
35
|
+
slot?: string;
|
|
36
|
+
};
|
|
37
|
+
export type DataGridDraggable = {
|
|
38
|
+
/** Column key that shows the drag handle; without it a trailing handle column is added. */
|
|
39
|
+
pivotColumn?: string;
|
|
40
|
+
/** Reject drops that would leave the source group. */
|
|
41
|
+
withinGroup?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type DataGridReorder = {
|
|
44
|
+
rows: Record<string, unknown>[];
|
|
45
|
+
key: string;
|
|
46
|
+
from: number;
|
|
47
|
+
to: number;
|
|
48
|
+
};
|
|
49
|
+
export type DataGridCellUpdate = {
|
|
50
|
+
row: Record<string, unknown>;
|
|
51
|
+
column: DataGridColumn;
|
|
52
|
+
key: string;
|
|
53
|
+
value: unknown;
|
|
54
|
+
previous: unknown;
|
|
55
|
+
};
|
|
56
|
+
export type DataGridAdapter = {
|
|
57
|
+
expandRow: (key: string) => void;
|
|
58
|
+
collapseRow: (key: string) => void;
|
|
59
|
+
expandAllRows: () => void;
|
|
60
|
+
collapseAllRows: () => void;
|
|
61
|
+
expandAllGroups: () => void;
|
|
62
|
+
collapseAllGroups: () => void;
|
|
63
|
+
moveRowUp: (row: Record<string, unknown>) => void;
|
|
64
|
+
moveRowDown: (row: Record<string, unknown>) => void;
|
|
65
|
+
};
|
|
66
|
+
export type DataGridCellSlotProps = {
|
|
67
|
+
row: Record<string, unknown>;
|
|
68
|
+
value: unknown;
|
|
69
|
+
column: DataGridColumn;
|
|
70
|
+
index: number;
|
|
71
|
+
expanded: boolean;
|
|
72
|
+
editing: boolean;
|
|
73
|
+
startEdit: () => void;
|
|
74
|
+
stopEdit: () => void;
|
|
75
|
+
toggleExpand: () => void;
|
|
76
|
+
update: (value: unknown) => void;
|
|
77
|
+
};
|
|
78
|
+
export type DataGridGroupSlotProps = {
|
|
79
|
+
group: string;
|
|
80
|
+
label: string;
|
|
81
|
+
rows: Record<string, unknown>[];
|
|
82
|
+
category: {
|
|
83
|
+
key: string;
|
|
84
|
+
keys: string[];
|
|
85
|
+
};
|
|
86
|
+
expanded: boolean;
|
|
87
|
+
toggle: () => void;
|
|
88
|
+
};
|
|
89
|
+
export type DataGridExpandSlotProps = {
|
|
90
|
+
row: Record<string, unknown>;
|
|
91
|
+
index: number;
|
|
92
|
+
};
|
|
93
|
+
export type { DataGridLabels } from './labels';
|
|
94
|
+
export type { ResolvedDataGridLabels } from './labels';
|
|
20
95
|
type __VLS_Props = {
|
|
21
96
|
columns: DataGridColumn[];
|
|
22
97
|
rows: Record<string, unknown>[];
|
|
@@ -50,71 +125,121 @@ type __VLS_Props = {
|
|
|
50
125
|
labels?: Partial<DataGridLabels>;
|
|
51
126
|
/** @deprecated Use `labels.empty`. */
|
|
52
127
|
emptyText?: string;
|
|
128
|
+
/** Split the visible rows into collapsible groups keyed by a row field. */
|
|
129
|
+
group?: DataGridGroup | null;
|
|
130
|
+
/** Show a per-row disclosure with the `expand` slot (or `expandable.slot`). */
|
|
131
|
+
expandable?: DataGridExpandable | null;
|
|
132
|
+
/** Bind to control which rows are expanded; leave unset and the grid tracks them. */
|
|
133
|
+
expandedKeys?: string[];
|
|
134
|
+
defaultExpandedKeys?: string[];
|
|
135
|
+
/** Row reordering with drag and drop plus keyboard support. */
|
|
136
|
+
draggable?: boolean | DataGridDraggable;
|
|
53
137
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
[K in NonNullable<typeof __VLS_15>]?: (props: typeof __VLS_16) => any;
|
|
68
|
-
} & {
|
|
69
|
-
[K in NonNullable<typeof __VLS_38>]?: (props: typeof __VLS_39) => any;
|
|
70
|
-
} & {
|
|
71
|
-
empty?: (props: typeof __VLS_28) => any;
|
|
72
|
-
} & {
|
|
73
|
-
footer?: (props: typeof __VLS_41) => any;
|
|
138
|
+
type __VLS_Slots = {
|
|
139
|
+
empty?: (props: Record<string, never>) => unknown;
|
|
140
|
+
'group-title'?: (props: DataGridGroupSlotProps) => unknown;
|
|
141
|
+
footer?: (props: {
|
|
142
|
+
total: number;
|
|
143
|
+
page: number;
|
|
144
|
+
pageCount: number;
|
|
145
|
+
}) => unknown;
|
|
146
|
+
expand?: (props: DataGridExpandSlotProps) => unknown;
|
|
147
|
+
[name: `header-${string}`]: (props: {
|
|
148
|
+
column: DataGridColumn;
|
|
149
|
+
}) => unknown;
|
|
150
|
+
[name: `cell-${string}`]: (props: DataGridCellSlotProps) => unknown;
|
|
74
151
|
};
|
|
75
|
-
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
152
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
153
|
+
expandRow: (key: string) => void;
|
|
154
|
+
collapseRow: (key: string) => void;
|
|
155
|
+
expandAllRows: () => void;
|
|
156
|
+
collapseAllRows: () => void;
|
|
157
|
+
expandAllGroups: () => void;
|
|
158
|
+
collapseAllGroups: () => void;
|
|
159
|
+
moveRowUp: (row: Record<string, unknown>) => void;
|
|
160
|
+
moveRowDown: (row: Record<string, unknown>) => void;
|
|
161
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
76
162
|
refresh: () => any;
|
|
77
163
|
"update:sort": (value: DataGridSort | null) => any;
|
|
78
164
|
"update:selectedKeys": (value: string[]) => any;
|
|
79
165
|
"update:page": (value: number) => any;
|
|
80
166
|
"update:columnWidths": (value: DataGridColumnWidths) => any;
|
|
167
|
+
"update:rows": (value: Record<string, unknown>[]) => any;
|
|
168
|
+
"update:expandedKeys": (value: string[]) => any;
|
|
81
169
|
columnResize: (value: {
|
|
82
170
|
key: string;
|
|
83
171
|
width: number;
|
|
84
172
|
}) => any;
|
|
85
173
|
rowClick: (row: Record<string, unknown>) => any;
|
|
86
174
|
rowDblclick: (row: Record<string, unknown>) => any;
|
|
175
|
+
rowExpand: (key: string) => any;
|
|
176
|
+
rowCollapse: (key: string) => any;
|
|
177
|
+
groupToggle: (groupKey: string, expanded: boolean) => any;
|
|
178
|
+
reorder: (value: DataGridReorder) => any;
|
|
179
|
+
cellEditStart: (value: {
|
|
180
|
+
row: Record<string, unknown>;
|
|
181
|
+
column: DataGridColumn;
|
|
182
|
+
key: string;
|
|
183
|
+
}) => any;
|
|
184
|
+
cellEditEnd: (value: {
|
|
185
|
+
row: Record<string, unknown>;
|
|
186
|
+
column: DataGridColumn;
|
|
187
|
+
key: string;
|
|
188
|
+
}) => any;
|
|
189
|
+
cellUpdate: (value: DataGridCellUpdate) => any;
|
|
87
190
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
88
191
|
onRefresh?: (() => any) | undefined;
|
|
89
192
|
"onUpdate:sort"?: ((value: DataGridSort | null) => any) | undefined;
|
|
90
193
|
"onUpdate:selectedKeys"?: ((value: string[]) => any) | undefined;
|
|
91
194
|
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
92
195
|
"onUpdate:columnWidths"?: ((value: DataGridColumnWidths) => any) | undefined;
|
|
196
|
+
"onUpdate:rows"?: ((value: Record<string, unknown>[]) => any) | undefined;
|
|
197
|
+
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
93
198
|
onColumnResize?: ((value: {
|
|
94
199
|
key: string;
|
|
95
200
|
width: number;
|
|
96
201
|
}) => any) | undefined;
|
|
97
202
|
onRowClick?: ((row: Record<string, unknown>) => any) | undefined;
|
|
98
203
|
onRowDblclick?: ((row: Record<string, unknown>) => any) | undefined;
|
|
204
|
+
onRowExpand?: ((key: string) => any) | undefined;
|
|
205
|
+
onRowCollapse?: ((key: string) => any) | undefined;
|
|
206
|
+
onGroupToggle?: ((groupKey: string, expanded: boolean) => any) | undefined;
|
|
207
|
+
onReorder?: ((value: DataGridReorder) => any) | undefined;
|
|
208
|
+
onCellEditStart?: ((value: {
|
|
209
|
+
row: Record<string, unknown>;
|
|
210
|
+
column: DataGridColumn;
|
|
211
|
+
key: string;
|
|
212
|
+
}) => any) | undefined;
|
|
213
|
+
onCellEditEnd?: ((value: {
|
|
214
|
+
row: Record<string, unknown>;
|
|
215
|
+
column: DataGridColumn;
|
|
216
|
+
key: string;
|
|
217
|
+
}) => any) | undefined;
|
|
218
|
+
onCellUpdate?: ((value: DataGridCellUpdate) => any) | undefined;
|
|
99
219
|
}>, {
|
|
100
220
|
footer: boolean;
|
|
101
221
|
sort: DataGridSort | null;
|
|
102
222
|
loading: boolean;
|
|
223
|
+
group: DataGridGroup | null;
|
|
224
|
+
loadingText: string;
|
|
225
|
+
page: number;
|
|
226
|
+
pageSize: number;
|
|
103
227
|
rowKey: string;
|
|
104
228
|
defaultSort: DataGridSort | null;
|
|
105
229
|
selectedKeys: string[];
|
|
106
230
|
selectable: boolean;
|
|
107
231
|
selectOnRowClick: boolean;
|
|
108
|
-
page: number;
|
|
109
|
-
pageSize: number;
|
|
110
232
|
localSort: boolean;
|
|
111
233
|
localPagination: boolean;
|
|
112
|
-
loadingText: string;
|
|
113
234
|
loadingRows: number;
|
|
114
235
|
stickyHeader: boolean;
|
|
115
236
|
resizable: boolean;
|
|
116
237
|
refreshable: boolean;
|
|
117
238
|
refreshing: boolean;
|
|
239
|
+
expandable: DataGridExpandable | null;
|
|
240
|
+
expandedKeys: string[];
|
|
241
|
+
defaultExpandedKeys: string[];
|
|
242
|
+
draggable: boolean | DataGridDraggable;
|
|
118
243
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
119
244
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
120
245
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text overrides for the grid chrome. The three row-operation labels were added
|
|
3
|
+
* after the first release and stay optional so an existing external
|
|
4
|
+
* `DataGridLabels` object literal keeps compiling; the grid merges the defaults in.
|
|
5
|
+
*/
|
|
1
6
|
export type DataGridLabels = {
|
|
2
7
|
empty: string;
|
|
3
8
|
items: (count: number) => string;
|
|
@@ -8,5 +13,14 @@ export type DataGridLabels = {
|
|
|
8
13
|
selectAll: string;
|
|
9
14
|
selectRow: (key: string) => string;
|
|
10
15
|
resizeColumn: (label: string) => string;
|
|
16
|
+
expandRow?: (key: string) => string;
|
|
17
|
+
collapseRow?: (key: string) => string;
|
|
18
|
+
reorderRow?: (key: string) => string;
|
|
11
19
|
};
|
|
12
|
-
|
|
20
|
+
/** `DataGridLabels` after the defaults were merged in: every label is present. */
|
|
21
|
+
export type ResolvedDataGridLabels = DataGridLabels & {
|
|
22
|
+
expandRow: (key: string) => string;
|
|
23
|
+
collapseRow: (key: string) => string;
|
|
24
|
+
reorderRow: (key: string) => string;
|
|
25
|
+
};
|
|
26
|
+
export declare const defaultDataGridLabels: ResolvedDataGridLabels;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<{
|
|
3
|
+
items?: T[];
|
|
4
|
+
idProperty?: string;
|
|
5
|
+
singleSelect?: boolean;
|
|
6
|
+
scrollbar?: Record<string, unknown>;
|
|
7
|
+
defaultSelected?: boolean | number[];
|
|
8
|
+
focusInner?: boolean;
|
|
9
|
+
} & {
|
|
10
|
+
onContextmenu?: ((item: T, index: number, event: MouseEvent) => any) | undefined;
|
|
11
|
+
onSelectionchange?: ((selectedIndexes: number | number[]) => any) | undefined;
|
|
12
|
+
"onSelected-change"?: ((selectedItems: (string | number)[]) => any) | undefined;
|
|
13
|
+
onRowclear?: (() => any) | undefined;
|
|
14
|
+
}> & (typeof globalThis extends {
|
|
15
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
16
|
+
} ? P : {});
|
|
17
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
18
|
+
clearSelectedRows: () => void;
|
|
19
|
+
ensureItemVisible: (item: T) => boolean;
|
|
20
|
+
clickItem: (event: MouseEvent | KeyboardEvent, index: number, item: T) => void;
|
|
21
|
+
focusItem: (itemId: string | number) => boolean;
|
|
22
|
+
selectRange: (beginIndex: number, endIndex: number, options?: {
|
|
23
|
+
keepSelection?: boolean;
|
|
24
|
+
}) => boolean;
|
|
25
|
+
clearSelection: () => void;
|
|
26
|
+
}>) => void;
|
|
27
|
+
attrs: any;
|
|
28
|
+
slots: {
|
|
29
|
+
'outer-spin'?: (props: {}) => any;
|
|
30
|
+
} & {
|
|
31
|
+
before?: (props: {}) => any;
|
|
32
|
+
} & {
|
|
33
|
+
item?: (props: {
|
|
34
|
+
item: T;
|
|
35
|
+
index: number;
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
selected: boolean;
|
|
38
|
+
}) => any;
|
|
39
|
+
} & {
|
|
40
|
+
after?: (props: {}) => any;
|
|
41
|
+
} & {
|
|
42
|
+
'inner-spin'?: (props: {}) => any;
|
|
43
|
+
};
|
|
44
|
+
emit: ((evt: "contextmenu", item: T, index: number, event: MouseEvent) => void) & ((evt: "selectionchange", selectedIndexes: number | number[]) => void) & ((evt: "selected-change", selectedItems: (string | number)[]) => void) & ((evt: "rowclear") => void);
|
|
45
|
+
}>) => import('vue').VNode & {
|
|
46
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
47
|
+
};
|
|
48
|
+
declare const _default: typeof __VLS_export;
|
|
49
|
+
export default _default;
|
|
50
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
51
|
+
[K in keyof T]: T[K];
|
|
52
|
+
} : {
|
|
53
|
+
[K in keyof T as K]: T[K];
|
|
54
|
+
}) & {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FootbarButton } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
buttons?: FootbarButton[];
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
"click-button": (button: FootbarButton, event: MouseEvent) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
"onClick-button"?: ((button: FootbarButton, event: MouseEvent) => any) | undefined;
|
|
9
|
+
}>, {
|
|
10
|
+
buttons: FootbarButton[];
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FootbarButton } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
buttons?: FootbarButton[];
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
"click-button": (button: FootbarButton, event: MouseEvent) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
"onClick-button"?: ((button: FootbarButton, event: MouseEvent) => any) | undefined;
|
|
9
|
+
}>, {
|
|
10
|
+
buttons: FootbarButton[];
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export type FootbarButtonRegion = 'left' | 'center' | 'right';
|
|
3
|
+
export type FootbarButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
4
|
+
export type FootbarButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
/**
|
|
6
|
+
* Button description consumed by Footbar, AppActionBar and Panel's `fbar`.
|
|
7
|
+
*
|
|
8
|
+
* Rendering order is `region` first, then `order` (ascending), then the array
|
|
9
|
+
* position as a tie breaker — the array order alone never decides placement.
|
|
10
|
+
* A button without visible `text` is not rendered, so an icon-only action has
|
|
11
|
+
* to keep a readable label in `text`.
|
|
12
|
+
*/
|
|
13
|
+
export type FootbarButton = {
|
|
14
|
+
id: string;
|
|
15
|
+
text: string;
|
|
16
|
+
region?: FootbarButtonRegion;
|
|
17
|
+
order?: number;
|
|
18
|
+
variant?: FootbarButtonVariant;
|
|
19
|
+
size?: FootbarButtonSize;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
icon?: Component;
|
|
22
|
+
onClick?: (event: MouseEvent) => void;
|
|
23
|
+
};
|
|
24
|
+
export type FootbarGroups = {
|
|
25
|
+
left: FootbarButton[];
|
|
26
|
+
center: FootbarButton[];
|
|
27
|
+
right: FootbarButton[];
|
|
28
|
+
};
|
|
29
|
+
/** Visible buttons in render order: region is not part of it, `order` and input index are. */
|
|
30
|
+
export declare function sortFootbarButtons(buttons: FootbarButton[]): FootbarButton[];
|
|
31
|
+
/** Visible buttons grouped by region, each group already in render order. */
|
|
32
|
+
export declare function groupFootbarButtons(buttons: FootbarButton[]): FootbarGroups;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FormFieldHandle } from './context';
|
|
2
|
+
import { FormDirection, FormRules, FormSpacing, FormValidatedResult, ValidateMessageDisplayMode, ValidateTrigger } from './types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** Rules keyed by `FormItem`'s `prop`; async-validator syntax. */
|
|
5
|
+
rules?: FormRules;
|
|
6
|
+
/** `'horizontal'` puts the label beside the control, `'vertical'` above it. */
|
|
7
|
+
direction?: FormDirection;
|
|
8
|
+
/** Gap between items; `'auto'` uses `dense` (horizontal) or `regular` (vertical). */
|
|
9
|
+
spacing?: FormSpacing;
|
|
10
|
+
/** Default message placement; a FormItem can override it. */
|
|
11
|
+
validateMessageDisplayMode?: ValidateMessageDisplayMode;
|
|
12
|
+
};
|
|
13
|
+
/** Validates every field; resolves `true` only when all of them pass. */
|
|
14
|
+
declare function validate(trigger?: ValidateTrigger | null, options?: {
|
|
15
|
+
autoScroll?: boolean;
|
|
16
|
+
}): Promise<boolean>;
|
|
17
|
+
/** Validates one field by its `prop`; unknown props resolve `true`. */
|
|
18
|
+
declare function validateField(prop: string): Promise<boolean>;
|
|
19
|
+
/** Clears validation state and messages; field values stay untouched unless a FormItem declares `initialValue`. */
|
|
20
|
+
declare function resetFields(): void;
|
|
21
|
+
/** Makes the current values the new dirty baseline. */
|
|
22
|
+
declare function commit(): void;
|
|
23
|
+
declare function isDirty(): boolean;
|
|
24
|
+
declare var __VLS_1: {};
|
|
25
|
+
type __VLS_Slots = {} & {
|
|
26
|
+
default?: (props: typeof __VLS_1) => any;
|
|
27
|
+
};
|
|
28
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
29
|
+
fields: import('vue').ShallowReactive<FormFieldHandle[]>;
|
|
30
|
+
validate: typeof validate;
|
|
31
|
+
validateField: typeof validateField;
|
|
32
|
+
resetFields: typeof resetFields;
|
|
33
|
+
commit: typeof commit;
|
|
34
|
+
isDirty: typeof isDirty;
|
|
35
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
36
|
+
submit: (event: Event) => any;
|
|
37
|
+
validated: (result: FormValidatedResult) => any;
|
|
38
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
39
|
+
onSubmit?: ((event: Event) => any) | undefined;
|
|
40
|
+
onValidated?: ((result: FormValidatedResult) => any) | undefined;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { FormFieldContext } from './context';
|
|
2
|
+
import { FormItemValidateMessageDisplayMode, FormRule, ValidateStatus, ValidateTrigger } from './types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** Controlled field value; when `undefined` the value is reported by the control. */
|
|
5
|
+
modelValue?: unknown;
|
|
6
|
+
/** Key into the form's `rules`, and the identity used by `validateField()`. */
|
|
7
|
+
prop?: string;
|
|
8
|
+
/** Label text; `false` hides the label area entirely. */
|
|
9
|
+
label?: string | false;
|
|
10
|
+
/** Persistent description under the control. */
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Message shown while the field is valid; a validation error replaces it. */
|
|
13
|
+
help?: string;
|
|
14
|
+
/** Rules for this field, running before the rules the form declares for `prop`. */
|
|
15
|
+
rules?: FormRule | FormRule[];
|
|
16
|
+
/** Marks the field required for screen readers; it does not add a `required` rule. */
|
|
17
|
+
requiredMark?: boolean;
|
|
18
|
+
/** Dims the label. */
|
|
19
|
+
disableLabel?: boolean;
|
|
20
|
+
/** Dims the description. */
|
|
21
|
+
disableDescription?: boolean;
|
|
22
|
+
/** Dims the control area without disabling anything. */
|
|
23
|
+
disableControl?: boolean;
|
|
24
|
+
/** Skips all validation for this field. */
|
|
25
|
+
disableValidation?: boolean;
|
|
26
|
+
/** Validates the field even while its control reports itself disabled. */
|
|
27
|
+
validateDisabledField?: boolean;
|
|
28
|
+
/** Runs validation but never renders its message. */
|
|
29
|
+
hideValidateMessage?: boolean;
|
|
30
|
+
/** Does not apply the `has-error` status class to the item. */
|
|
31
|
+
hideValidateStatusCls?: boolean;
|
|
32
|
+
/** Reports the control's disabled state; a control can also report it through `useFormField()`. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Manual status; overrides the status produced by validation. */
|
|
35
|
+
validateStatus?: ValidateStatus;
|
|
36
|
+
/** `'form'` inherits the enclosing form's display mode. */
|
|
37
|
+
validateMessageDisplayMode?: FormItemValidateMessageDisplayMode;
|
|
38
|
+
/** Trigger assumed by rules that do not declare one. */
|
|
39
|
+
defaultValidateTrigger?: ValidateTrigger;
|
|
40
|
+
/** Validates once on mount. */
|
|
41
|
+
immediateValidate?: boolean;
|
|
42
|
+
/** The slot content is plain text, not a control. */
|
|
43
|
+
textOnly?: boolean;
|
|
44
|
+
/** Indentation level (multiples of 28px) or any CSS length. */
|
|
45
|
+
indent?: string | number;
|
|
46
|
+
/** Width of the label column in the horizontal layout. */
|
|
47
|
+
labelWidth?: string;
|
|
48
|
+
/** Value restored by `resetFields()`; also the initial dirty baseline. */
|
|
49
|
+
initialValue?: unknown;
|
|
50
|
+
};
|
|
51
|
+
declare function setFieldValue(next: unknown): void;
|
|
52
|
+
declare function setInitValue(next: unknown): void;
|
|
53
|
+
declare function commit(): void;
|
|
54
|
+
declare function validate(trigger?: ValidateTrigger | null): Promise<boolean>;
|
|
55
|
+
declare function showPopup(message?: string): void;
|
|
56
|
+
declare function hidePopup(): void;
|
|
57
|
+
/** Marks the field invalid from the outside; `ValidationPopup` and manual checks use this. */
|
|
58
|
+
declare function setInvalid(message: string, state?: ValidateStatus): void;
|
|
59
|
+
declare function resetInvalid(): void;
|
|
60
|
+
declare function setDisabled(next: boolean): void;
|
|
61
|
+
declare function resetField(): void;
|
|
62
|
+
declare function ensureVisible(): void;
|
|
63
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {
|
|
64
|
+
field: FormFieldContext;
|
|
65
|
+
}, __VLS_7: {
|
|
66
|
+
classes: {
|
|
67
|
+
afterItem: string;
|
|
68
|
+
};
|
|
69
|
+
}, __VLS_9: {}, __VLS_11: {
|
|
70
|
+
field: FormFieldContext;
|
|
71
|
+
};
|
|
72
|
+
type __VLS_Slots = {} & {
|
|
73
|
+
label?: (props: typeof __VLS_1) => any;
|
|
74
|
+
} & {
|
|
75
|
+
before?: (props: typeof __VLS_3) => any;
|
|
76
|
+
} & {
|
|
77
|
+
default?: (props: typeof __VLS_5) => any;
|
|
78
|
+
} & {
|
|
79
|
+
after?: (props: typeof __VLS_7) => any;
|
|
80
|
+
} & {
|
|
81
|
+
description?: (props: typeof __VLS_9) => any;
|
|
82
|
+
} & {
|
|
83
|
+
status?: (props: typeof __VLS_11) => any;
|
|
84
|
+
};
|
|
85
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
86
|
+
validate: typeof validate;
|
|
87
|
+
resetField: typeof resetField;
|
|
88
|
+
commit: typeof commit;
|
|
89
|
+
isDirty: import('vue').ComputedRef<boolean>;
|
|
90
|
+
setInvalid: typeof setInvalid;
|
|
91
|
+
resetInvalid: typeof resetInvalid;
|
|
92
|
+
showPopup: typeof showPopup;
|
|
93
|
+
hidePopup: typeof hidePopup;
|
|
94
|
+
setFieldValue: typeof setFieldValue;
|
|
95
|
+
setInitValue: typeof setInitValue;
|
|
96
|
+
setFieldDisabled: typeof setDisabled;
|
|
97
|
+
ensureVisible: typeof ensureVisible;
|
|
98
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
99
|
+
"update:modelValue": (value: unknown) => any;
|
|
100
|
+
validating: () => any;
|
|
101
|
+
validated: (result: {
|
|
102
|
+
message: string;
|
|
103
|
+
status: ValidateStatus;
|
|
104
|
+
}) => any;
|
|
105
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
106
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
107
|
+
onValidating?: (() => any) | undefined;
|
|
108
|
+
onValidated?: ((result: {
|
|
109
|
+
message: string;
|
|
110
|
+
status: ValidateStatus;
|
|
111
|
+
}) => any) | undefined;
|
|
112
|
+
}>, {
|
|
113
|
+
disabled: boolean;
|
|
114
|
+
requiredMark: boolean;
|
|
115
|
+
disableLabel: boolean;
|
|
116
|
+
disableDescription: boolean;
|
|
117
|
+
disableControl: boolean;
|
|
118
|
+
disableValidation: boolean;
|
|
119
|
+
validateDisabledField: boolean;
|
|
120
|
+
hideValidateMessage: boolean;
|
|
121
|
+
hideValidateStatusCls: boolean;
|
|
122
|
+
immediateValidate: boolean;
|
|
123
|
+
textOnly: boolean;
|
|
124
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
125
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
126
|
+
declare const _default: typeof __VLS_export;
|
|
127
|
+
export default _default;
|
|
128
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
129
|
+
new (): {
|
|
130
|
+
$slots: S;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
import { FormRules, FormDirection, FormSpacing, ValidateMessageDisplayMode, ValidateStatus, ValidateTrigger } from './types';
|
|
3
|
+
export declare const FORM_CONTEXT_KEY: InjectionKey<FormContext>;
|
|
4
|
+
export declare const FORM_FIELD_KEY: InjectionKey<FormFieldContext>;
|
|
5
|
+
/** What Form exposes to its FormItems. Values are unwrapped (the provided object is reactive). */
|
|
6
|
+
export type FormContext = {
|
|
7
|
+
rules: FormRules;
|
|
8
|
+
direction: FormDirection;
|
|
9
|
+
spacing: FormSpacing;
|
|
10
|
+
validateMessageDisplayMode: ValidateMessageDisplayMode;
|
|
11
|
+
registerField: (field: FormFieldHandle) => void;
|
|
12
|
+
unregisterField: (field: FormFieldHandle) => void;
|
|
13
|
+
};
|
|
14
|
+
/** One registered FormItem, as used by `Form.validate()` / `resetFields()` / `commit()`. */
|
|
15
|
+
export type FormFieldHandle = {
|
|
16
|
+
prop: string;
|
|
17
|
+
/** Runs this field's rules; resolves with the first error message, or `null` when valid. */
|
|
18
|
+
validate: (trigger?: ValidateTrigger | null) => Promise<string | null>;
|
|
19
|
+
resetField: () => void;
|
|
20
|
+
commit: () => void;
|
|
21
|
+
isDirty: () => boolean;
|
|
22
|
+
/** Scrolls the field into view; used by `Form.validate()` for the first invalid field. */
|
|
23
|
+
ensureVisible: () => void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Field state published by FormItem to its default slot (as the `field` slot
|
|
27
|
+
* prop) and to `useFormField()` consumers. It is reactive, so a control can
|
|
28
|
+
* read `field.invalid`, `field.status` and `field.message` directly.
|
|
29
|
+
*/
|
|
30
|
+
export type FormFieldContext = {
|
|
31
|
+
controlId: string;
|
|
32
|
+
descriptionId: string | undefined;
|
|
33
|
+
messageId: string | undefined;
|
|
34
|
+
/** Value for `aria-describedby`, covering the rendered description and message. */
|
|
35
|
+
describedBy: string | undefined;
|
|
36
|
+
/** True when the item is marked required (`requiredMark`), for `aria-required`. */
|
|
37
|
+
required: boolean;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
invalid: boolean;
|
|
40
|
+
status: ValidateStatus;
|
|
41
|
+
/** Current help or validation message; empty when the field has nothing to say. */
|
|
42
|
+
message: string;
|
|
43
|
+
validate: (trigger?: ValidateTrigger | null) => Promise<boolean>;
|
|
44
|
+
/** Opens the floating message (popup display mode) with an optional message. */
|
|
45
|
+
showPopup: (message?: string) => void;
|
|
46
|
+
hidePopup: () => void;
|
|
47
|
+
/** Reports the control's value; used for uncontrolled usage and dirty checks. */
|
|
48
|
+
setValue: (value: unknown) => void;
|
|
49
|
+
/** Reports the control's own disabled state so the label and description dim. */
|
|
50
|
+
setDisabled: (disabled: boolean) => void;
|
|
51
|
+
/** Runs the `blur` trigger of this field's rules. */
|
|
52
|
+
onBlur: () => void;
|
|
53
|
+
/** Runs the `change` trigger of this field's rules. */
|
|
54
|
+
onChange: () => void;
|
|
55
|
+
/** `id`, `aria-*` and trigger listeners to spread on the control. */
|
|
56
|
+
controlProps: Record<string, unknown>;
|
|
57
|
+
};
|
|
58
|
+
/** The enclosing form, or `null` when the item is used standalone. */
|
|
59
|
+
export declare function useFormContext(): FormContext | null;
|
|
60
|
+
/** The enclosing form item of a control, or `null` outside a FormItem. */
|
|
61
|
+
export declare function useFormField(): FormFieldContext | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormRule, FormRuleType, ValidateTrigger } from './types';
|
|
2
|
+
export type ValidateRulesOptions = {
|
|
3
|
+
/** `null` runs every rule regardless of its `trigger`; `undefined` also runs every rule. */
|
|
4
|
+
trigger?: ValidateTrigger | null;
|
|
5
|
+
/** Trigger assumed by rules that do not declare one. Defaults to `'blur'`. */
|
|
6
|
+
defaultTrigger?: ValidateTrigger;
|
|
7
|
+
};
|
|
8
|
+
/** A rule, or a shorthand list of rules, as one array. */
|
|
9
|
+
export declare function normalizeRules(rules: FormRule | FormRule[] | null | undefined): FormRule[];
|
|
10
|
+
/**
|
|
11
|
+
* `null`/`undefined` are empty, so is a whitespace-only string (async-validator's
|
|
12
|
+
* `whitespace: true` default) and an empty array. `false` and `0` are values, so
|
|
13
|
+
* a boolean field that must be turned on needs a `validator`, not `required`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isEmptyValue(value: unknown, type?: FormRuleType): boolean;
|
|
16
|
+
/** Runs `rules` against `value` and resolves with the first error message, or `null`. */
|
|
17
|
+
export declare function validateWithRules(value: unknown, rules: FormRule | FormRule[] | null | undefined, options?: ValidateRulesOptions): Promise<string | null>;
|