@panneau/core 4.1.1 → 5.0.0-alpha.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 +83 -0
- package/dist/definition/abilities.d.ts +21 -0
- package/dist/definition/abilities.d.ts.map +1 -0
- package/dist/definition/abilities.js +47 -0
- package/dist/definition/abilities.js.map +1 -0
- package/dist/definition/form.d.ts +31 -0
- package/dist/definition/form.d.ts.map +1 -0
- package/dist/definition/form.js +54 -0
- package/dist/definition/form.js.map +1 -0
- package/dist/definition/list.d.ts +44 -0
- package/dist/definition/list.d.ts.map +1 -0
- package/dist/definition/list.js +70 -0
- package/dist/definition/list.js.map +1 -0
- package/dist/definition/resource.d.ts +21 -0
- package/dist/definition/resource.d.ts.map +1 -0
- package/dist/definition/resource.js +24 -0
- package/dist/definition/resource.js.map +1 -0
- package/dist/form/form.d.ts +148 -0
- package/dist/form/form.d.ts.map +1 -0
- package/dist/form/form.js +239 -0
- package/dist/form/form.js.map +1 -0
- package/dist/form/messages.d.ts +7 -0
- package/dist/form/messages.d.ts.map +1 -0
- package/dist/form/messages.js +25 -0
- package/dist/form/messages.js.map +1 -0
- package/dist/form/problem.d.ts +16 -0
- package/dist/form/problem.d.ts.map +1 -0
- package/dist/form/problem.js +34 -0
- package/dist/form/problem.js.map +1 -0
- package/dist/form/selectors.d.ts +16 -0
- package/dist/form/selectors.d.ts.map +1 -0
- package/dist/form/selectors.js +27 -0
- package/dist/form/selectors.js.map +1 -0
- package/dist/form/store.d.ts +19 -0
- package/dist/form/store.d.ts.map +1 -0
- package/dist/form/store.js +29 -0
- package/dist/form/store.js.map +1 -0
- package/dist/index.d.ts +17 -692
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -536
- package/dist/list/list.d.ts +68 -0
- package/dist/list/list.d.ts.map +1 -0
- package/dist/list/list.js +191 -0
- package/dist/list/list.js.map +1 -0
- package/dist/list/router.d.ts +26 -0
- package/dist/list/router.d.ts.map +1 -0
- package/dist/list/router.js +54 -0
- package/dist/list/router.js.map +1 -0
- package/dist/plugins.d.ts +73 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +54 -0
- package/dist/plugins.js.map +1 -0
- package/dist/react/provider.d.ts +38 -0
- package/dist/react/provider.d.ts.map +1 -0
- package/dist/react/provider.js +63 -0
- package/dist/react/provider.js.map +1 -0
- package/dist/react/useForm.d.ts +26 -0
- package/dist/react/useForm.d.ts.map +1 -0
- package/dist/react/useForm.js +115 -0
- package/dist/react/useForm.js.map +1 -0
- package/dist/react/useList.d.ts +11 -0
- package/dist/react/useList.d.ts.map +1 -0
- package/dist/react/useList.js +47 -0
- package/dist/react/useList.js.map +1 -0
- package/dist/values.d.ts +12 -0
- package/dist/values.d.ts.map +1 -0
- package/dist/values.js +44 -0
- package/dist/values.js.map +1 -0
- package/package.json +19 -81
- package/dist/contexts.d.ts +0 -667
- package/dist/contexts.js +0 -1772
- package/dist/hooks.d.ts +0 -512
- package/dist/hooks.js +0 -2146
- package/dist/utils.d.ts +0 -457
- package/dist/utils.js +0 -557
package/dist/utils.d.ts
DELETED
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
export { kebabCase as dashCase, pascalCase, snakeCase } from 'change-case';
|
|
2
|
-
import { ElementType, ComponentProps, ReactNode, MouseEvent, ReactElement, ForwardedRef } from 'react';
|
|
3
|
-
import { FormattedMessage, MessageDescriptor } from 'react-intl';
|
|
4
|
-
|
|
5
|
-
interface CheckClickableOptions {
|
|
6
|
-
maxParentDistance?: number;
|
|
7
|
-
tags?: string[];
|
|
8
|
-
}
|
|
9
|
-
interface ElementLike {
|
|
10
|
-
tagName?: string | null;
|
|
11
|
-
parentNode?: ElementLike | null;
|
|
12
|
-
dataset?: Record<string, unknown>;
|
|
13
|
-
}
|
|
14
|
-
declare function checkClickable(el: ElementLike | null, options?: CheckClickableOptions, parentDistance?: number): boolean;
|
|
15
|
-
|
|
16
|
-
declare function convertStyleToString(style: Record<string, unknown> | null): string;
|
|
17
|
-
|
|
18
|
-
declare function createNullableOnChange<T = unknown>(onChange?: ((value: T | null) => void) | null): (newValue: T) => void;
|
|
19
|
-
|
|
20
|
-
interface EventsManager {
|
|
21
|
-
subscribe: (event: string, callback: (...args: unknown[]) => void) => void;
|
|
22
|
-
unsubscribe: (event: string, callback: (...args: unknown[]) => void) => void;
|
|
23
|
-
}
|
|
24
|
-
declare function createUseEvent(eventsManager: EventsManager | null): (event: string, callback: (...args: unknown[]) => void, enabled?: boolean) => void;
|
|
25
|
-
|
|
26
|
-
/*! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
27
|
-
declare function copyToClipboard(text: string): Promise<void>;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Core UI Types
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Internationalization message definition
|
|
35
|
-
*/
|
|
36
|
-
type Message = MessageDescriptor;
|
|
37
|
-
/**
|
|
38
|
-
* Values that can be interpolated in an internationalization message
|
|
39
|
-
* (the `values` prop of FormattedMessage)
|
|
40
|
-
*/
|
|
41
|
-
type MessageValues = NonNullable<ComponentProps<typeof FormattedMessage>['values']>;
|
|
42
|
-
type MessageValue = MessageValues[string];
|
|
43
|
-
/**
|
|
44
|
-
* Label can be either a message object or any React node
|
|
45
|
-
*/
|
|
46
|
-
type Label = Message | ReactNode;
|
|
47
|
-
/**
|
|
48
|
-
* Map of components, can be nested by namespace (ex: { fields: { text: TextField } })
|
|
49
|
-
*/
|
|
50
|
-
interface ComponentsMap {
|
|
51
|
-
[name: string]: ElementType | ComponentsMap;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Menu item definition
|
|
55
|
-
*/
|
|
56
|
-
interface MenuItem {
|
|
57
|
-
id?: number | string;
|
|
58
|
-
label?: Label;
|
|
59
|
-
url?: string;
|
|
60
|
-
href?: string | null;
|
|
61
|
-
external?: boolean;
|
|
62
|
-
active?: boolean;
|
|
63
|
-
type?: string;
|
|
64
|
-
component?: string;
|
|
65
|
-
className?: string | null;
|
|
66
|
-
linkClassName?: string | null;
|
|
67
|
-
onClick?: ((e: MouseEvent) => void) | null;
|
|
68
|
-
items?: MenuItem[] | null;
|
|
69
|
-
dropdown?: MenuItem[] | null;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Form control size
|
|
73
|
-
*/
|
|
74
|
-
type ControlSize = 'lg' | 'sm' | null;
|
|
75
|
-
/**
|
|
76
|
-
* Generic item (base interface for data items)
|
|
77
|
-
*/
|
|
78
|
-
interface Item {
|
|
79
|
-
id: string;
|
|
80
|
-
[key: string]: unknown;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Generic definition
|
|
84
|
-
*/
|
|
85
|
-
interface Definition {
|
|
86
|
-
id: string;
|
|
87
|
-
component?: string | ElementType;
|
|
88
|
-
[key: string]: unknown;
|
|
89
|
-
}
|
|
90
|
-
interface RouteDefinition {
|
|
91
|
-
path?: string;
|
|
92
|
-
route?: string;
|
|
93
|
-
component: string | ElementType;
|
|
94
|
-
[key: string]: unknown;
|
|
95
|
-
}
|
|
96
|
-
interface PageDefinition {
|
|
97
|
-
component: string | ElementType;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Form Types
|
|
102
|
-
* TypeScript interfaces for form-related components
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Select option (more flexible than FieldOption)
|
|
107
|
-
*/
|
|
108
|
-
type SelectOption = string | number | {
|
|
109
|
-
value?: unknown;
|
|
110
|
-
label?: Label | string;
|
|
111
|
-
} | Record<string, unknown>;
|
|
112
|
-
/**
|
|
113
|
-
* Field definition
|
|
114
|
-
*/
|
|
115
|
-
interface Field {
|
|
116
|
-
name?: string;
|
|
117
|
-
type?: string;
|
|
118
|
-
label?: Label;
|
|
119
|
-
component?: string;
|
|
120
|
-
size?: ControlSize;
|
|
121
|
-
[key: string]: unknown;
|
|
122
|
-
}
|
|
123
|
-
interface FieldDefinition$1 extends Omit<Field, 'component'>, Definition {
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Form definition
|
|
127
|
-
*/
|
|
128
|
-
interface Form {
|
|
129
|
-
title?: ReactNode;
|
|
130
|
-
fields?: Field[];
|
|
131
|
-
method?: string | null;
|
|
132
|
-
action?: string | null;
|
|
133
|
-
submitButtonLabel?: Label | null;
|
|
134
|
-
[key: string]: unknown;
|
|
135
|
-
}
|
|
136
|
-
interface FormDefinition extends Form, Definition {
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Resource Types
|
|
141
|
-
* TypeScript interfaces for resources, items, users, media, and other entities
|
|
142
|
-
*/
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Table column definition
|
|
146
|
-
*/
|
|
147
|
-
type TableColumn = string | Column;
|
|
148
|
-
interface Column extends Record<string, unknown> {
|
|
149
|
-
id?: string | null;
|
|
150
|
-
name?: string | null;
|
|
151
|
-
label?: unknown;
|
|
152
|
-
path?: string;
|
|
153
|
-
valueKey?: string;
|
|
154
|
-
component?: string | ElementType | null;
|
|
155
|
-
field?: Field | string | null;
|
|
156
|
-
actions?: ActionDefinition[] | null;
|
|
157
|
-
}
|
|
158
|
-
interface Action {
|
|
159
|
-
id?: string;
|
|
160
|
-
component?: string;
|
|
161
|
-
label?: string | null;
|
|
162
|
-
icon?: string | null;
|
|
163
|
-
href?: string | null;
|
|
164
|
-
external?: boolean;
|
|
165
|
-
theme?: string;
|
|
166
|
-
target?: string;
|
|
167
|
-
onClick?: (() => void) | null;
|
|
168
|
-
endpoint?: string | null;
|
|
169
|
-
withoutConfirmation?: boolean;
|
|
170
|
-
[key: string]: unknown;
|
|
171
|
-
}
|
|
172
|
-
type ActionDefinition = string | Action;
|
|
173
|
-
interface ResourceIntlValues {
|
|
174
|
-
a_singular?: string;
|
|
175
|
-
a_plural?: string;
|
|
176
|
-
[key: string]: MessageValue;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Internationalization configuration
|
|
180
|
-
*/
|
|
181
|
-
interface ResourceIntl {
|
|
182
|
-
messages?: Record<string, string>;
|
|
183
|
-
values?: ResourceIntlValues;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Resource definition
|
|
187
|
-
*/
|
|
188
|
-
interface ResourceIndex {
|
|
189
|
-
filters?: Filter[];
|
|
190
|
-
columns?: TableColumn[];
|
|
191
|
-
actions?: ActionDefinition[];
|
|
192
|
-
fields?: Field[];
|
|
193
|
-
[key: string]: unknown;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Overrides of the built-in resource pages, ex: `{ show: { component: 'my-page' } }`.
|
|
197
|
-
* Used on a resource (`resource.pages`) and on the panneau definition (`definition.pages`),
|
|
198
|
-
* the resource taking precedence.
|
|
199
|
-
*/
|
|
200
|
-
interface ResourcePages {
|
|
201
|
-
index?: PageDefinition;
|
|
202
|
-
show?: PageDefinition;
|
|
203
|
-
create?: PageDefinition;
|
|
204
|
-
edit?: PageDefinition;
|
|
205
|
-
delete?: PageDefinition;
|
|
206
|
-
duplicate?: PageDefinition;
|
|
207
|
-
/** @deprecated Legacy resource keys, use `index`, `show`, `create`, etc. */
|
|
208
|
-
resourceIndexPage?: PageDefinition;
|
|
209
|
-
resourceShowPage?: PageDefinition;
|
|
210
|
-
resourceCreatePage?: PageDefinition;
|
|
211
|
-
resourceEditPage?: PageDefinition;
|
|
212
|
-
resourceDeletePage?: PageDefinition;
|
|
213
|
-
resourceDuplicatePage?: PageDefinition;
|
|
214
|
-
/** @deprecated Legacy panneau keys, use `index`, `show`, `create`, etc. */
|
|
215
|
-
indexPage?: PageDefinition;
|
|
216
|
-
showPage?: PageDefinition;
|
|
217
|
-
createPage?: PageDefinition;
|
|
218
|
-
editPage?: PageDefinition;
|
|
219
|
-
deletePage?: PageDefinition;
|
|
220
|
-
duplicatePage?: PageDefinition;
|
|
221
|
-
[key: string]: PageDefinition | undefined;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Form definition of a resource (the id is optional, the form is identified by its key)
|
|
225
|
-
*/
|
|
226
|
-
interface ResourceForm extends Form {
|
|
227
|
-
id?: string;
|
|
228
|
-
component?: string | ElementType;
|
|
229
|
-
}
|
|
230
|
-
interface ResourceForms {
|
|
231
|
-
default?: ResourceForm | null;
|
|
232
|
-
create?: ResourceForm | null;
|
|
233
|
-
edit?: ResourceForm | null;
|
|
234
|
-
delete?: ResourceForm | null;
|
|
235
|
-
duplicate?: ResourceForm | null;
|
|
236
|
-
modal?: ResourceForm | null;
|
|
237
|
-
[key: string]: ResourceForm | null | undefined;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Resource type (sub-type of a resource, ex: page types)
|
|
241
|
-
*/
|
|
242
|
-
interface ResourceType {
|
|
243
|
-
id?: string;
|
|
244
|
-
name?: string;
|
|
245
|
-
fields?: Field[];
|
|
246
|
-
settings?: {
|
|
247
|
-
canCreate?: boolean;
|
|
248
|
-
[key: string]: unknown;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
interface Resource {
|
|
252
|
-
id: string;
|
|
253
|
-
name: string;
|
|
254
|
-
intl?: ResourceIntl;
|
|
255
|
-
fields?: Field[];
|
|
256
|
-
index?: ResourceIndex;
|
|
257
|
-
forms?: ResourceForms;
|
|
258
|
-
settings?: Record<string, unknown>;
|
|
259
|
-
extraRoutes?: RouteDefinition[];
|
|
260
|
-
pages?: ResourcePages;
|
|
261
|
-
types?: ResourceType[];
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Filter definition
|
|
265
|
-
*/
|
|
266
|
-
interface Filter {
|
|
267
|
-
id?: string;
|
|
268
|
-
component?: string;
|
|
269
|
-
[key: string]: unknown;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Panneau Definition Types
|
|
274
|
-
* TypeScript interfaces for main Panneau configuration and definitions
|
|
275
|
-
*/
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Panneau route configuration
|
|
279
|
-
*/
|
|
280
|
-
interface Routes {
|
|
281
|
-
'resources.index'?: RouteDefinition | string;
|
|
282
|
-
'resources.create'?: RouteDefinition | string;
|
|
283
|
-
'resources.store'?: RouteDefinition | string;
|
|
284
|
-
'resources.show'?: RouteDefinition | string;
|
|
285
|
-
'resources.edit'?: RouteDefinition | string;
|
|
286
|
-
'resources.update'?: RouteDefinition | string;
|
|
287
|
-
'resources.delete'?: RouteDefinition | string;
|
|
288
|
-
'resources.destroy'?: RouteDefinition | string;
|
|
289
|
-
'resources.duplicate'?: RouteDefinition | string;
|
|
290
|
-
'resources.clone'?: RouteDefinition | string;
|
|
291
|
-
'resources.restore'?: RouteDefinition | string;
|
|
292
|
-
[key: string]: RouteDefinition | string;
|
|
293
|
-
}
|
|
294
|
-
interface PanneauTheme {
|
|
295
|
-
colorScheme?: string | null;
|
|
296
|
-
[key: string]: unknown;
|
|
297
|
-
}
|
|
298
|
-
interface PanneauComponents {
|
|
299
|
-
[key: string]: string | {
|
|
300
|
-
component: string;
|
|
301
|
-
[key: string]: unknown;
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
interface PanneauIntlValues {
|
|
305
|
-
[key: string]: string;
|
|
306
|
-
}
|
|
307
|
-
interface PanneauIntl {
|
|
308
|
-
locale?: string;
|
|
309
|
-
locales?: string[];
|
|
310
|
-
messages?: Record<string, string>;
|
|
311
|
-
/** @deprecated Not used: set the values of each resource in `resources[].intl.values` */
|
|
312
|
-
values?: PanneauIntlValues;
|
|
313
|
-
}
|
|
314
|
-
interface PanneauPages extends ResourcePages {
|
|
315
|
-
home?: PageDefinition;
|
|
316
|
-
login?: PageDefinition;
|
|
317
|
-
account?: PageDefinition;
|
|
318
|
-
error?: PageDefinition;
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Menu item in a Panneau menu: a menu item definition or a special item id
|
|
322
|
-
* (ex: 'resources', 'account', 'separator')
|
|
323
|
-
*/
|
|
324
|
-
type PanneauMenuItem = MenuItem | string;
|
|
325
|
-
interface PanneauMenus {
|
|
326
|
-
main?: PanneauMenuItem[] | null;
|
|
327
|
-
guest?: PanneauMenuItem[] | null;
|
|
328
|
-
[key: string]: PanneauMenuItem[] | null | undefined;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Links shown on the login page: `true` for the default url, or the url of the page
|
|
332
|
-
*/
|
|
333
|
-
interface PanneauAuth {
|
|
334
|
-
/** "Forgot your password?" link (default url: /forgot-password) */
|
|
335
|
-
forgotPassword?: boolean | string;
|
|
336
|
-
/** "Create account" link (default url: /register) */
|
|
337
|
-
register?: boolean | string;
|
|
338
|
-
[key: string]: unknown;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Panneau definition (main configuration)
|
|
342
|
-
*/
|
|
343
|
-
interface PanneauDefinition {
|
|
344
|
-
name?: string;
|
|
345
|
-
resources?: Resource[];
|
|
346
|
-
routes?: Routes;
|
|
347
|
-
pages?: PanneauPages;
|
|
348
|
-
intl?: PanneauIntl;
|
|
349
|
-
theme?: PanneauTheme;
|
|
350
|
-
/** @deprecated Not used: give the custom components to the `components` prop of the container */
|
|
351
|
-
components?: PanneauComponents;
|
|
352
|
-
settings?: Record<string, unknown>;
|
|
353
|
-
forms?: FormDefinition[];
|
|
354
|
-
fields?: FieldDefinition$1[];
|
|
355
|
-
menus?: PanneauMenus;
|
|
356
|
-
auth?: PanneauAuth;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
declare function flattenComponents(components: ComponentsMap | null, prefix?: string | null): Record<string, ElementType> | null;
|
|
360
|
-
|
|
361
|
-
declare function formatDuration(timeInSeconds: number | string): string;
|
|
362
|
-
|
|
363
|
-
declare function getColumnsWithFields(resource: Resource, columns: TableColumn[] | null): Column[];
|
|
364
|
-
|
|
365
|
-
interface ComponentResult {
|
|
366
|
-
name: string | ElementType | null;
|
|
367
|
-
props: Record<string, unknown> | null;
|
|
368
|
-
}
|
|
369
|
-
declare function getComponent(component: string | {
|
|
370
|
-
component: string | ElementType;
|
|
371
|
-
[key: string]: unknown;
|
|
372
|
-
}): ComponentResult;
|
|
373
|
-
|
|
374
|
-
declare function getComponentFromName(name?: string | ElementType | null, components?: Record<string, ElementType> | null, defaultComponent?: ElementType | string | null): ElementType | null;
|
|
375
|
-
|
|
376
|
-
declare function getDefinitionFromId<T extends Definition = Definition>(id?: string | null, items?: T[] | null, defaultObject?: T | null): T | null;
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Returns a message for each key of the definition that is not supported anymore,
|
|
380
|
-
* with the key to use instead. Without it, these keys would be silently ignored.
|
|
381
|
-
*/
|
|
382
|
-
declare function getDefinitionWarnings(definition: PanneauDefinition | null): string[];
|
|
383
|
-
|
|
384
|
-
interface ComponentWithName {
|
|
385
|
-
displayName?: string | null;
|
|
386
|
-
name?: string | null;
|
|
387
|
-
}
|
|
388
|
-
declare function getDisplayName({ displayName, name }: ComponentWithName): string;
|
|
389
|
-
|
|
390
|
-
interface FieldWithSubFields$1 extends Field {
|
|
391
|
-
fields?: FieldWithSubFields$1[];
|
|
392
|
-
}
|
|
393
|
-
declare function getFieldByName(fields: FieldWithSubFields$1[], name: string | null): FieldWithSubFields$1 | null;
|
|
394
|
-
|
|
395
|
-
interface FieldDefinition {
|
|
396
|
-
fields?: Field[] | null;
|
|
397
|
-
settings?: Field[] | null;
|
|
398
|
-
itemsField?: Field | null;
|
|
399
|
-
}
|
|
400
|
-
interface FieldManager {
|
|
401
|
-
getDefinition: (type: string) => FieldDefinition;
|
|
402
|
-
}
|
|
403
|
-
interface FieldWithSubFields extends Field {
|
|
404
|
-
type?: string | null;
|
|
405
|
-
fields?: Field[] | null;
|
|
406
|
-
field?: Field | null;
|
|
407
|
-
settings?: Field[] | null;
|
|
408
|
-
itemsField?: Field | null;
|
|
409
|
-
listItems?: boolean;
|
|
410
|
-
}
|
|
411
|
-
declare function getFieldFromPath(path: string | string[], fields: Field[], fieldManager: FieldManager): FieldWithSubFields | null;
|
|
412
|
-
|
|
413
|
-
declare function getFileName(url?: string | null): string | null;
|
|
414
|
-
|
|
415
|
-
declare function getPathValue(it: unknown, path: string | string[]): unknown;
|
|
416
|
-
|
|
417
|
-
interface FormattedOption {
|
|
418
|
-
value: unknown;
|
|
419
|
-
label: string | ReactElement;
|
|
420
|
-
}
|
|
421
|
-
declare function getSelectOptions(options: SelectOption[]): FormattedOption[];
|
|
422
|
-
|
|
423
|
-
declare function isMessage(message: unknown): message is Message;
|
|
424
|
-
|
|
425
|
-
declare function loadPackage<T = unknown>(name: string, loader: () => Promise<T>): Promise<T>;
|
|
426
|
-
|
|
427
|
-
declare function mergeRefs<T>(...refs: Array<ForwardedRef<T> | null | undefined>): (value: T | null) => void;
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Parse a date-only value as a local date, ignoring its timezone.
|
|
431
|
-
*
|
|
432
|
-
* A date stored at midnight represents a calendar day, not an instant: converting it to the
|
|
433
|
-
* browser timezone would show the previous day west of the server timezone (ex: a date saved as
|
|
434
|
-
* 2026-10-01 00:00 UTC is 2026-09-30 20:00 in Montreal). Returns null when the value has a time,
|
|
435
|
-
* so the caller can parse it as an instant.
|
|
436
|
-
*/
|
|
437
|
-
declare function parseDateOnly(value: string | null | undefined): Date | null;
|
|
438
|
-
|
|
439
|
-
declare function toggleSelectedItem(items: Item[] | null, item: Item, { multiple: multipleSelection }?: {
|
|
440
|
-
multiple?: boolean;
|
|
441
|
-
}): Item[] | null;
|
|
442
|
-
declare function selectItems(items: Item[] | null, itemsToSelect: Item[]): Item[] | null;
|
|
443
|
-
declare function unselectItems(items: Item[] | null, itemsToUnselect: Item[]): Item[] | null;
|
|
444
|
-
|
|
445
|
-
type Value = Record<string, unknown> | unknown[] | null;
|
|
446
|
-
declare function setValue(value: Value, keyParts: string[], fieldValue: unknown): Value;
|
|
447
|
-
|
|
448
|
-
declare function slug(str: string, separator?: string | null): string;
|
|
449
|
-
|
|
450
|
-
interface FieldWithValidation extends Field {
|
|
451
|
-
type?: string;
|
|
452
|
-
fields?: FieldWithValidation[];
|
|
453
|
-
required?: boolean;
|
|
454
|
-
}
|
|
455
|
-
declare function validateFields(fields: FieldWithValidation[], value: Record<string, unknown> | null): boolean;
|
|
456
|
-
|
|
457
|
-
export { checkClickable, convertStyleToString, copyToClipboard, createNullableOnChange, createUseEvent, flattenComponents, formatDuration, getColumnsWithFields, getComponent, getComponentFromName, getDefinitionFromId, getDefinitionWarnings, getDisplayName, getFieldByName, getFieldFromPath, getFileName, getPathValue, getSelectOptions, isMessage, loadPackage, mergeRefs, parseDateOnly, selectItems, setValue as setFieldValue, slug, toggleSelectedItem, unselectItems, validateFields };
|