flet-box 1.0.3 → 1.0.5
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 +10 -0
- package/bin/cli.js +15 -0
- package/bin/commands/checkApi.js +761 -0
- package/bin/commands/create.js +77 -5
- package/bin/utils/dtsProps.js +191 -0
- package/bin/utils/moduleExports.js +165 -0
- package/bin/utils/neutralise.js +64 -0
- package/bin/utils/templates.js +366 -27
- package/docs/CONTRIBUTING.md +156 -0
- package/docs/README.md +68 -0
- package/docs/arquitectura.md +164 -0
- package/docs/cli/README.md +542 -0
- package/docs/guides/README.md +33 -0
- package/docs/guides/app-templates.md +197 -0
- package/docs/guides/compatibility.md +95 -0
- package/docs/guides/embedding.md +284 -0
- package/docs/guides/first-app.md +208 -0
- package/docs/guides/frontend-services.md +171 -0
- package/docs/guides/minification-and-protection.md +260 -0
- package/docs/guides/mobile-and-platforms.md +439 -0
- package/docs/guides/online-updates.md +196 -0
- package/docs/guides/router.md +282 -0
- package/docs/guides/state.md +283 -0
- package/docs/guides/syntax-philosophy.md +150 -0
- package/docs/guides/utilities.md +241 -0
- package/docs/guides/widget-structure.md +163 -0
- package/docs/server/README.md +68 -0
- package/docs/server/START_HERE.md +121 -0
- package/docs/server/api.md +225 -0
- package/docs/server/data-services.md +300 -0
- package/docs/server/deployment.md +113 -0
- package/docs/server/security.md +196 -0
- package/docs/services/README.md +79 -0
- package/docs/services/RamStore.md +84 -0
- package/docs/services/Session.md +84 -0
- package/docs/services/Storage.md +88 -0
- package/docs/services/http.md +86 -0
- package/docs/tools/README.md +138 -0
- package/docs/tools/animation.md +87 -0
- package/docs/tools/async-ids-log.md +80 -0
- package/docs/tools/device.md +132 -0
- package/docs/tools/introspection.md +67 -0
- package/docs/tools/lists.md +96 -0
- package/docs/tools/markdown.md +79 -0
- package/docs/tools/reactivity.md +288 -0
- package/docs/tools/state.md +103 -0
- package/docs/tools/styling.md +92 -0
- package/docs/tools/text-and-time.md +89 -0
- package/docs/tools/theme.md +102 -0
- package/docs/tools/validation.md +75 -0
- package/docs/tools/visual-effects.md +84 -0
- package/docs/widget/Accordion.md +144 -0
- package/docs/widget/AdMob.md +144 -0
- package/docs/widget/AdSense.md +133 -0
- package/docs/widget/AdaptiveScaffold.md +105 -0
- package/docs/widget/AlertDialog.md +103 -0
- package/docs/widget/AnimatedBox.md +130 -0
- package/docs/widget/AnimatedText.md +123 -0
- package/docs/widget/AppBar.md +118 -0
- package/docs/widget/Audio.md +135 -0
- package/docs/widget/Avatar.md +119 -0
- package/docs/widget/Badge.md +128 -0
- package/docs/widget/BottomNavigation.md +116 -0
- package/docs/widget/BottomSheet.md +125 -0
- package/docs/widget/Button.md +137 -0
- package/docs/widget/COMMON_PROPS.md +150 -0
- package/docs/widget/Card.md +125 -0
- package/docs/widget/Carousel.md +151 -0
- package/docs/widget/Chart.md +151 -0
- package/docs/widget/Checkbox.md +118 -0
- package/docs/widget/Chip.md +126 -0
- package/docs/widget/CircularBar.md +168 -0
- package/docs/widget/CircularChart.md +164 -0
- package/docs/widget/CodeViewer.md +130 -0
- package/docs/widget/CollapsibleSideBar.md +112 -0
- package/docs/widget/Column.md +129 -0
- package/docs/widget/Container.md +136 -0
- package/docs/widget/DataTable.md +150 -0
- package/docs/widget/Divider.md +109 -0
- package/docs/widget/DraggBox.md +129 -0
- package/docs/widget/Drawer.md +135 -0
- package/docs/widget/DrawerItem.md +98 -0
- package/docs/widget/Dropdown.md +139 -0
- package/docs/widget/DroppBox.md +152 -0
- package/docs/widget/FloatingActionButton.md +120 -0
- package/docs/widget/GridView.md +140 -0
- package/docs/widget/Icon.md +117 -0
- package/docs/widget/Image.md +125 -0
- package/docs/widget/Input.md +151 -0
- package/docs/widget/Inspector.md +92 -0
- package/docs/widget/InstallButton.md +128 -0
- package/docs/widget/ListTile.md +132 -0
- package/docs/widget/ListView.md +138 -0
- package/docs/widget/Markdown.md +175 -0
- package/docs/widget/MatrixRain.md +122 -0
- package/docs/widget/Modal.md +129 -0
- package/docs/widget/Pagination.md +135 -0
- package/docs/widget/ParallaxBox.md +128 -0
- package/docs/widget/ProgressBar.md +130 -0
- package/docs/widget/QRCode.md +117 -0
- package/docs/widget/README.md +188 -0
- package/docs/widget/Radio.md +123 -0
- package/docs/widget/Rating.md +131 -0
- package/docs/widget/Row.md +131 -0
- package/docs/widget/START_HERE.md +146 -0
- package/docs/widget/Scaffold.md +152 -0
- package/docs/widget/Skeleton.md +130 -0
- package/docs/widget/Slider.md +146 -0
- package/docs/widget/SnackBar.md +102 -0
- package/docs/widget/Stack.md +128 -0
- package/docs/widget/Stepper.md +145 -0
- package/docs/widget/Switch.md +118 -0
- package/docs/widget/Tabs.md +124 -0
- package/docs/widget/Text.md +133 -0
- package/docs/widget/Tooltip.md +145 -0
- package/docs/widget/TreeView.md +176 -0
- package/docs/widget/Video.md +127 -0
- package/docs/widget/_template.md +61 -0
- package/package.json +4 -2
- package/src/animations/AnimatedBox.js +32 -1
- package/src/animations/AnimatedText.js +7 -3
- package/src/animations/MatrixRain.js +37 -12
- package/src/animations/ParallaxBox.js +16 -3
- package/src/animations/animate.js +187 -58
- package/src/animations/index.js +1 -0
- package/src/core/runApp.js +13 -1
- package/src/create-index.sh +1 -1
- package/src/index.d.ts +227 -91
- package/src/index.js +1 -0
- package/src/navigations/AdaptiveScaffold.js +11 -2
- package/src/navigations/AppBar.js +8 -2
- package/src/navigations/BottomNavigation.js +24 -5
- package/src/navigations/DrawerItem.js +16 -3
- package/src/navigations/Scaffold.js +8 -1
- package/src/navigations/Tabs.js +40 -8
- package/src/tools/dimensions.js +11 -3
- package/src/tools/useState.js +139 -101
- package/src/utils/getWidgetProps.js +5 -3
- package/src/widget-factory/assignProps.js +30 -11
- package/src/widget-factory/processProps.js +17 -5
- package/src/widget-factory/reactiveValue.js +172 -0
- package/src/widget-factory/translateProps.js +777 -901
- package/src/widget-factory/warnings.js +15 -0
- package/src/widget-factory/widgetFactory.js +27 -0
- package/src/widgets/Accordion.js +6 -5
- package/src/widgets/AlertDialog.js +7 -5
- package/src/widgets/Audio.js +30 -8
- package/src/widgets/BottomSheet.js +24 -1
- package/src/widgets/Chart.js +4 -1
- package/src/widgets/Checkbox.js +16 -8
- package/src/widgets/CircularBar.js +12 -1
- package/src/widgets/CircularChart.js +4 -1
- package/src/widgets/CodeViewer.js +26 -8
- package/src/widgets/DataTable.js +11 -2
- package/src/widgets/Dropdown.js +5 -1
- package/src/widgets/FloatingActionButton.js +4 -7
- package/src/widgets/Image.js +7 -2
- package/src/widgets/Input.js +119 -6
- package/src/widgets/Inspector.js +16 -10
- package/src/widgets/ListView.js +80 -30
- package/src/widgets/Markdown.js +53 -8
- package/src/widgets/Modal.js +24 -1
- package/src/widgets/Pagination.js +6 -3
- package/src/widgets/ProgressBar.js +16 -13
- package/src/widgets/QRCode.js +9 -2
- package/src/widgets/Radio.js +11 -8
- package/src/widgets/Slider.js +26 -4
- package/src/widgets/SnackBar.js +20 -2
- package/src/widgets/Stack.js +36 -3
- package/src/widgets/Stepper.js +4 -3
- package/src/widgets/Switch.js +8 -5
- package/src/widgets/TreeView.js +3 -2
package/src/index.d.ts
CHANGED
|
@@ -5,22 +5,46 @@ declare module 'flet-box' {
|
|
|
5
5
|
// =========================================================================
|
|
6
6
|
// Tipos base
|
|
7
7
|
// =========================================================================
|
|
8
|
-
type Widget = HTMLElement;
|
|
9
|
-
type Color = string;
|
|
10
|
-
type Size = number | string;
|
|
11
|
-
type Padding = number | string;
|
|
12
|
-
type Margin = number | string;
|
|
8
|
+
export type Widget = HTMLElement;
|
|
9
|
+
export type Color = string;
|
|
10
|
+
export type Size = number | string;
|
|
11
|
+
export type Padding = number | string;
|
|
12
|
+
export type Margin = number | string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The element returned by `WidgetFactory()`. It is a real `HTMLElement` with
|
|
16
|
+
* the factory's imperative API attached (see `src/widget-factory/`).
|
|
17
|
+
*/
|
|
18
|
+
export interface WidgetFactoryInstance extends Widget {
|
|
19
|
+
/** Merge new props and re-apply styles, attributes, children and effects. */
|
|
20
|
+
update(props?: Record<string, any>): WidgetFactoryInstance;
|
|
21
|
+
/** Shallow copy of the widget's currently stored props. */
|
|
22
|
+
getProps(): Record<string, any>;
|
|
23
|
+
/** Register a callback fired when the widget enters the live DOM. */
|
|
24
|
+
onMount(fn: (widget: WidgetFactoryInstance) => void): void;
|
|
25
|
+
/** Register a disposer fired on every teardown path. Must be idempotent. */
|
|
26
|
+
onUnmount(fn: (widget: WidgetFactoryInstance) => void): void;
|
|
27
|
+
/** Fire mount callbacks immediately when the widget is already connected. */
|
|
28
|
+
triggerMount(): WidgetFactoryInstance;
|
|
29
|
+
/** Release the widget's resources and remove it from the lifecycle registry. */
|
|
30
|
+
_cleanup(): void;
|
|
31
|
+
}
|
|
13
32
|
|
|
14
33
|
// =========================================================================
|
|
15
34
|
// Props comunes (heredadas by todos the widgets)
|
|
16
35
|
// =========================================================================
|
|
17
|
-
interface CommonProps {
|
|
36
|
+
export interface CommonProps {
|
|
18
37
|
width?: Size;
|
|
19
38
|
height?: Size;
|
|
20
|
-
size
|
|
39
|
+
// `Size`, not `number`: for a Text this is a font size and for a Button it is
|
|
40
|
+
// the `small | medium | large` preset — the widget decides which it reads.
|
|
41
|
+
size?: Size;
|
|
21
42
|
padding?: Padding;
|
|
22
43
|
margin?: Margin;
|
|
23
44
|
bgColor?: Color;
|
|
45
|
+
// Alias kept because the engine routes it and every generated template uses
|
|
46
|
+
// it: `bgColor` is the Flet-style short name for the same style.
|
|
47
|
+
backgroundColor?: Color;
|
|
24
48
|
color?: Color;
|
|
25
49
|
borderRadius?: number | string;
|
|
26
50
|
elevation?: number;
|
|
@@ -120,18 +144,74 @@ declare module 'flet-box' {
|
|
|
120
144
|
export function httpPatch<T = any>(url: string, options?: HttpRequestOptions): Promise<T>;
|
|
121
145
|
export function httpDelete<T = any>(url: string, options?: HttpRequestOptions): Promise<T>;
|
|
122
146
|
|
|
147
|
+
// =========================================================================
|
|
148
|
+
// Service namespaces
|
|
149
|
+
// =========================================================================
|
|
150
|
+
// Each store is also exported as a namespace object whose members are exactly
|
|
151
|
+
// the functions above, so both call styles are valid:
|
|
152
|
+
// saveRam("k", 1) | RamStore.saveRam("k", 1)
|
|
153
|
+
// Members are typed through `typeof` so a namespace can never drift from the
|
|
154
|
+
// individual declaration.
|
|
155
|
+
export const RamStore: {
|
|
156
|
+
saveRam: typeof saveRam;
|
|
157
|
+
getRam: typeof getRam;
|
|
158
|
+
getAllRam: typeof getAllRam;
|
|
159
|
+
getAllRamKeys: typeof getAllRamKeys;
|
|
160
|
+
hasRam: typeof hasRam;
|
|
161
|
+
updateRam: typeof updateRam;
|
|
162
|
+
deleteRam: typeof deleteRam;
|
|
163
|
+
clearAllRam: typeof clearAllRam;
|
|
164
|
+
subscribeRam: typeof subscribeRam;
|
|
165
|
+
getRamItemCount: typeof getRamItemCount;
|
|
166
|
+
isRamAvailable: typeof isRamAvailable;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const Session: {
|
|
170
|
+
saveSession: typeof saveSession;
|
|
171
|
+
getSession: typeof getSession;
|
|
172
|
+
getSessionSync: typeof getSessionSync;
|
|
173
|
+
updateSession: typeof updateSession;
|
|
174
|
+
deleteSession: typeof deleteSession;
|
|
175
|
+
clearAllSession: typeof clearAllSession;
|
|
176
|
+
hasSession: typeof hasSession;
|
|
177
|
+
getAllSessionKeys: typeof getAllSessionKeys;
|
|
178
|
+
getAllSessionData: typeof getAllSessionData;
|
|
179
|
+
getSessionSize: typeof getSessionSize;
|
|
180
|
+
deleteSessionByPrefix: typeof deleteSessionByPrefix;
|
|
181
|
+
deleteSessionBySuffix: typeof deleteSessionBySuffix;
|
|
182
|
+
getSessionItemCount: typeof getSessionItemCount;
|
|
183
|
+
isSessionAvailable: typeof isSessionAvailable;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const Storage: {
|
|
187
|
+
saveData: typeof saveData;
|
|
188
|
+
getData: typeof getData;
|
|
189
|
+
getDataSync: typeof getDataSync;
|
|
190
|
+
updateData: typeof updateData;
|
|
191
|
+
deleteData: typeof deleteData;
|
|
192
|
+
clearAllData: typeof clearAllData;
|
|
193
|
+
hasData: typeof hasData;
|
|
194
|
+
getAllKeys: typeof getAllKeys;
|
|
195
|
+
getAllData: typeof getAllData;
|
|
196
|
+
getStorageSize: typeof getStorageSize;
|
|
197
|
+
deleteDataByPrefix: typeof deleteDataByPrefix;
|
|
198
|
+
deleteDataBySuffix: typeof deleteDataBySuffix;
|
|
199
|
+
getItemCount: typeof getItemCount;
|
|
200
|
+
isStorageAvailable: typeof isStorageAvailable;
|
|
201
|
+
};
|
|
202
|
+
|
|
123
203
|
// =========================================================================
|
|
124
204
|
// Layouts
|
|
125
205
|
// =========================================================================
|
|
126
|
-
interface ContainerProps extends CommonProps {
|
|
206
|
+
export interface ContainerProps extends CommonProps {
|
|
127
207
|
direction?: 'row' | 'column';
|
|
128
208
|
gap?: number | string;
|
|
129
209
|
justifyContent?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
130
210
|
alignItems?: 'flex-start' | 'center' | 'flex-end' | 'stretch';
|
|
131
|
-
wrap?: boolean;
|
|
211
|
+
wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
132
212
|
child?: Widget;
|
|
133
213
|
children?: Widget[];
|
|
134
|
-
expand?: boolean;
|
|
214
|
+
expand?: boolean | number;
|
|
135
215
|
flex?: number;
|
|
136
216
|
minHeight?: Size;
|
|
137
217
|
maxHeight?: Size;
|
|
@@ -141,17 +221,17 @@ declare module 'flet-box' {
|
|
|
141
221
|
}
|
|
142
222
|
export function Container(props: ContainerProps): Widget;
|
|
143
223
|
|
|
144
|
-
interface RowProps extends CommonProps {
|
|
224
|
+
export interface RowProps extends CommonProps {
|
|
145
225
|
gap?: number | string;
|
|
146
226
|
justifyContent?: ContainerProps['justifyContent'];
|
|
147
227
|
alignItems?: ContainerProps['alignItems'];
|
|
148
|
-
wrap?: boolean;
|
|
228
|
+
wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
149
229
|
children?: Widget[];
|
|
150
230
|
onPress?: (widget: Widget) => void;
|
|
151
231
|
}
|
|
152
232
|
export function Row(props: RowProps): Widget;
|
|
153
233
|
|
|
154
|
-
interface ColumnProps extends CommonProps {
|
|
234
|
+
export interface ColumnProps extends CommonProps {
|
|
155
235
|
gap?: number | string;
|
|
156
236
|
justifyContent?: ContainerProps['justifyContent'];
|
|
157
237
|
alignItems?: ContainerProps['alignItems'];
|
|
@@ -160,14 +240,14 @@ declare module 'flet-box' {
|
|
|
160
240
|
}
|
|
161
241
|
export function Column(props: ColumnProps): Widget;
|
|
162
242
|
|
|
163
|
-
interface StackProps extends CommonProps {
|
|
243
|
+
export interface StackProps extends CommonProps {
|
|
164
244
|
children?: Widget[];
|
|
165
245
|
position?: 'relative' | 'absolute';
|
|
166
246
|
alignment?: 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
167
247
|
}
|
|
168
248
|
export function Stack(props: StackProps): Widget;
|
|
169
249
|
|
|
170
|
-
interface ListViewProps extends CommonProps {
|
|
250
|
+
export interface ListViewProps extends CommonProps {
|
|
171
251
|
data?: any[];
|
|
172
252
|
renderItem?: (item: any, index: number) => Widget;
|
|
173
253
|
height?: number | string;
|
|
@@ -184,7 +264,7 @@ declare module 'flet-box' {
|
|
|
184
264
|
ListEmptyComponent?: (() => Widget) | Widget;
|
|
185
265
|
showsScrollIndicator?: boolean;
|
|
186
266
|
bufferSize?: number;
|
|
187
|
-
expand?: boolean;
|
|
267
|
+
expand?: boolean | number;
|
|
188
268
|
}
|
|
189
269
|
export function ListView(props: ListViewProps): Widget & {
|
|
190
270
|
data: any[];
|
|
@@ -195,7 +275,7 @@ declare module 'flet-box' {
|
|
|
195
275
|
scrollToEnd(animated?: boolean): void;
|
|
196
276
|
};
|
|
197
277
|
|
|
198
|
-
interface GridViewProps extends Omit<ListViewProps, 'wrapItems' | 'crossAxisCount'> {
|
|
278
|
+
export interface GridViewProps extends Omit<ListViewProps, 'wrapItems' | 'crossAxisCount'> {
|
|
199
279
|
columns?: number;
|
|
200
280
|
spacing?: number;
|
|
201
281
|
itemHeight?: number;
|
|
@@ -205,7 +285,7 @@ declare module 'flet-box' {
|
|
|
205
285
|
// =========================================================================
|
|
206
286
|
// Widgets básicos
|
|
207
287
|
// =========================================================================
|
|
208
|
-
interface TextProps extends CommonProps {
|
|
288
|
+
export interface TextProps extends CommonProps {
|
|
209
289
|
text?: string;
|
|
210
290
|
value?: string;
|
|
211
291
|
children?: string;
|
|
@@ -223,7 +303,7 @@ declare module 'flet-box' {
|
|
|
223
303
|
}
|
|
224
304
|
export function Text(props: TextProps): Widget;
|
|
225
305
|
|
|
226
|
-
interface ButtonProps extends CommonProps {
|
|
306
|
+
export interface ButtonProps extends CommonProps {
|
|
227
307
|
text?: string;
|
|
228
308
|
onPress?: () => void;
|
|
229
309
|
variant?: 'filled' | 'outlined' | 'text';
|
|
@@ -246,7 +326,7 @@ declare module 'flet-box' {
|
|
|
246
326
|
}
|
|
247
327
|
export function Button(props: ButtonProps): Widget;
|
|
248
328
|
|
|
249
|
-
interface IconProps extends CommonProps {
|
|
329
|
+
export interface IconProps extends CommonProps {
|
|
250
330
|
name: string;
|
|
251
331
|
size?: number;
|
|
252
332
|
color?: Color;
|
|
@@ -254,7 +334,7 @@ declare module 'flet-box' {
|
|
|
254
334
|
}
|
|
255
335
|
export function Icon(props: IconProps): Widget;
|
|
256
336
|
|
|
257
|
-
interface ImageProps extends CommonProps {
|
|
337
|
+
export interface ImageProps extends CommonProps {
|
|
258
338
|
src: string;
|
|
259
339
|
alt?: string;
|
|
260
340
|
width?: Size;
|
|
@@ -267,7 +347,7 @@ declare module 'flet-box' {
|
|
|
267
347
|
}
|
|
268
348
|
export function Image(props: ImageProps): Widget;
|
|
269
349
|
|
|
270
|
-
interface AvatarProps extends CommonProps {
|
|
350
|
+
export interface AvatarProps extends CommonProps {
|
|
271
351
|
src?: string;
|
|
272
352
|
name?: string;
|
|
273
353
|
icon?: string;
|
|
@@ -281,7 +361,7 @@ declare module 'flet-box' {
|
|
|
281
361
|
updateContent(newProps: Partial<AvatarProps>): void;
|
|
282
362
|
};
|
|
283
363
|
|
|
284
|
-
interface CardProps extends CommonProps {
|
|
364
|
+
export interface CardProps extends CommonProps {
|
|
285
365
|
child?: Widget;
|
|
286
366
|
children?: Widget[];
|
|
287
367
|
elevation?: number;
|
|
@@ -295,11 +375,17 @@ declare module 'flet-box' {
|
|
|
295
375
|
}
|
|
296
376
|
export function Card(props: CardProps): Widget;
|
|
297
377
|
|
|
298
|
-
interface ListTileProps extends CommonProps {
|
|
378
|
+
export interface ListTileProps extends CommonProps {
|
|
299
379
|
leftItem?: Widget;
|
|
300
380
|
title?: string | Widget;
|
|
301
381
|
subtitle?: string | Widget;
|
|
302
382
|
description?: string | Widget;
|
|
383
|
+
/** Text props merged into the title, e.g. `{ size: 16, weight: "700" }`. */
|
|
384
|
+
titleProps?: Partial<TextProps>;
|
|
385
|
+
/** Text props merged into the subtitle. */
|
|
386
|
+
subtitleProps?: Partial<TextProps>;
|
|
387
|
+
/** Text props merged into the description line. */
|
|
388
|
+
descriptionProps?: Partial<TextProps>;
|
|
303
389
|
rightItem?: Widget;
|
|
304
390
|
onPress?: (widget: Widget) => void;
|
|
305
391
|
selected?: boolean;
|
|
@@ -315,7 +401,7 @@ declare module 'flet-box' {
|
|
|
315
401
|
}
|
|
316
402
|
export function ListTile(props: ListTileProps): Widget;
|
|
317
403
|
|
|
318
|
-
interface ProgressBarProps extends CommonProps {
|
|
404
|
+
export interface ProgressBarProps extends CommonProps {
|
|
319
405
|
value?: number;
|
|
320
406
|
max?: number;
|
|
321
407
|
height?: number;
|
|
@@ -337,7 +423,7 @@ declare module 'flet-box' {
|
|
|
337
423
|
setValue(value: number): void;
|
|
338
424
|
};
|
|
339
425
|
|
|
340
|
-
interface RatingProps extends CommonProps {
|
|
426
|
+
export interface RatingProps extends CommonProps {
|
|
341
427
|
value?: number;
|
|
342
428
|
max?: number;
|
|
343
429
|
size?: number;
|
|
@@ -360,7 +446,7 @@ declare module 'flet-box' {
|
|
|
360
446
|
getValue(): number;
|
|
361
447
|
};
|
|
362
448
|
|
|
363
|
-
interface ChipProps extends CommonProps {
|
|
449
|
+
export interface ChipProps extends CommonProps {
|
|
364
450
|
label: string;
|
|
365
451
|
icon?: string;
|
|
366
452
|
onPress?: () => void;
|
|
@@ -376,7 +462,7 @@ declare module 'flet-box' {
|
|
|
376
462
|
}
|
|
377
463
|
export function Chip(props: ChipProps): Widget;
|
|
378
464
|
|
|
379
|
-
interface AdSenseProps extends CommonProps {
|
|
465
|
+
export interface AdSenseProps extends CommonProps {
|
|
380
466
|
client?: string;
|
|
381
467
|
slot?: string;
|
|
382
468
|
format?: string;
|
|
@@ -399,7 +485,7 @@ declare module 'flet-box' {
|
|
|
399
485
|
getElement(): Widget;
|
|
400
486
|
};
|
|
401
487
|
|
|
402
|
-
interface AdMobProps extends CommonProps {
|
|
488
|
+
export interface AdMobProps extends CommonProps {
|
|
403
489
|
adId?: string;
|
|
404
490
|
isTesting?: boolean;
|
|
405
491
|
position?: 'top' | 'bottom';
|
|
@@ -430,7 +516,7 @@ declare module 'flet-box' {
|
|
|
430
516
|
getPlugin(): object | null;
|
|
431
517
|
};
|
|
432
518
|
|
|
433
|
-
interface BadgeProps extends CommonProps {
|
|
519
|
+
export interface BadgeProps extends CommonProps {
|
|
434
520
|
value: string | number;
|
|
435
521
|
child: Widget;
|
|
436
522
|
bgColor?: Color;
|
|
@@ -447,7 +533,7 @@ declare module 'flet-box' {
|
|
|
447
533
|
updateValue(newValue: string | number): void;
|
|
448
534
|
};
|
|
449
535
|
|
|
450
|
-
interface SliderProps extends CommonProps {
|
|
536
|
+
export interface SliderProps extends Omit<CommonProps, 'onPress'> {
|
|
451
537
|
value?: number;
|
|
452
538
|
min?: number;
|
|
453
539
|
max?: number;
|
|
@@ -469,6 +555,9 @@ declare module 'flet-box' {
|
|
|
469
555
|
animatedStripes?: boolean;
|
|
470
556
|
stripeColor?: string;
|
|
471
557
|
glow?: boolean;
|
|
558
|
+
/** Canonical press/change callback, like every other FletBox widget. */
|
|
559
|
+
onPress?: (value: number) => void;
|
|
560
|
+
/** @deprecated Alias of `onPress`. */
|
|
472
561
|
onChanged?: (value: number) => void;
|
|
473
562
|
onChangeEnd?: (value: number) => void;
|
|
474
563
|
}
|
|
@@ -482,7 +571,7 @@ declare module 'flet-box' {
|
|
|
482
571
|
update(props: Partial<SliderProps>): void;
|
|
483
572
|
};
|
|
484
573
|
|
|
485
|
-
interface AccordionProps extends CommonProps {
|
|
574
|
+
export interface AccordionProps extends CommonProps {
|
|
486
575
|
title: string | Widget;
|
|
487
576
|
children: Widget;
|
|
488
577
|
expanded?: boolean;
|
|
@@ -513,7 +602,7 @@ declare module 'flet-box' {
|
|
|
513
602
|
update(props: Partial<AccordionProps>): void;
|
|
514
603
|
};
|
|
515
604
|
|
|
516
|
-
interface DividerProps extends CommonProps {
|
|
605
|
+
export interface DividerProps extends Omit<CommonProps, 'margin'> {
|
|
517
606
|
color?: Color;
|
|
518
607
|
thickness?: number;
|
|
519
608
|
margin?: number | { top?: number; right?: number; bottom?: number; left?: number };
|
|
@@ -524,7 +613,7 @@ declare module 'flet-box' {
|
|
|
524
613
|
// =========================================================================
|
|
525
614
|
// Formularios e interacción
|
|
526
615
|
// =========================================================================
|
|
527
|
-
interface InputProps extends CommonProps {
|
|
616
|
+
export interface InputProps extends CommonProps {
|
|
528
617
|
value?: string;
|
|
529
618
|
placeholder?: string;
|
|
530
619
|
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'search' | 'url';
|
|
@@ -566,7 +655,7 @@ declare module 'flet-box' {
|
|
|
566
655
|
blur(): void;
|
|
567
656
|
};
|
|
568
657
|
|
|
569
|
-
interface RadioProps extends CommonProps {
|
|
658
|
+
export interface RadioProps extends CommonProps {
|
|
570
659
|
selected?: boolean;
|
|
571
660
|
onSelect?: (selected: boolean) => void;
|
|
572
661
|
disabled?: boolean;
|
|
@@ -581,7 +670,7 @@ declare module 'flet-box' {
|
|
|
581
670
|
isSelected(): boolean;
|
|
582
671
|
};
|
|
583
672
|
|
|
584
|
-
interface SwitchProps extends CommonProps {
|
|
673
|
+
export interface SwitchProps extends CommonProps {
|
|
585
674
|
value?: boolean;
|
|
586
675
|
onToggle?: (value: boolean) => void;
|
|
587
676
|
disabled?: boolean;
|
|
@@ -594,7 +683,7 @@ declare module 'flet-box' {
|
|
|
594
683
|
getValue(): boolean;
|
|
595
684
|
};
|
|
596
685
|
|
|
597
|
-
interface CheckboxProps extends CommonProps {
|
|
686
|
+
export interface CheckboxProps extends CommonProps {
|
|
598
687
|
checked?: boolean;
|
|
599
688
|
onCheck?: (checked: boolean) => void;
|
|
600
689
|
disabled?: boolean;
|
|
@@ -607,8 +696,8 @@ declare module 'flet-box' {
|
|
|
607
696
|
getChecked(): boolean;
|
|
608
697
|
};
|
|
609
698
|
|
|
610
|
-
type DropdownOption = { label: string; value: any; icon?: string };
|
|
611
|
-
interface DropdownProps extends CommonProps {
|
|
699
|
+
export type DropdownOption = { label: string; value: any; icon?: string };
|
|
700
|
+
export interface DropdownProps extends CommonProps {
|
|
612
701
|
options: (string | DropdownOption)[];
|
|
613
702
|
value?: any;
|
|
614
703
|
placeholder?: string;
|
|
@@ -640,7 +729,7 @@ declare module 'flet-box' {
|
|
|
640
729
|
// =========================================================================
|
|
641
730
|
// Alert dialogs and feedback
|
|
642
731
|
// =========================================================================
|
|
643
|
-
interface SnackBarOptions {
|
|
732
|
+
export interface SnackBarOptions {
|
|
644
733
|
message: string;
|
|
645
734
|
action?: string;
|
|
646
735
|
onAction?: () => void;
|
|
@@ -662,7 +751,7 @@ declare module 'flet-box' {
|
|
|
662
751
|
}
|
|
663
752
|
export function SnackBar(options: SnackBarOptions): { close(): void; show(): void; getElement(): Widget };
|
|
664
753
|
|
|
665
|
-
interface ModalProps {
|
|
754
|
+
export interface ModalProps {
|
|
666
755
|
title?: string;
|
|
667
756
|
content?: Widget | string;
|
|
668
757
|
actions?: Widget[];
|
|
@@ -709,7 +798,7 @@ declare module 'flet-box' {
|
|
|
709
798
|
setLoading(loading: boolean, loadingText?: string): void;
|
|
710
799
|
};
|
|
711
800
|
|
|
712
|
-
interface BottomSheetProps {
|
|
801
|
+
export interface BottomSheetProps {
|
|
713
802
|
content: Widget;
|
|
714
803
|
title?: string;
|
|
715
804
|
actions?: Widget[];
|
|
@@ -746,7 +835,7 @@ declare module 'flet-box' {
|
|
|
746
835
|
destroy(): void;
|
|
747
836
|
};
|
|
748
837
|
|
|
749
|
-
interface AlertDialogProps {
|
|
838
|
+
export interface AlertDialogProps {
|
|
750
839
|
title: string;
|
|
751
840
|
message: string;
|
|
752
841
|
confirmText?: string;
|
|
@@ -768,7 +857,7 @@ declare module 'flet-box' {
|
|
|
768
857
|
// =========================================================================
|
|
769
858
|
// Navegación
|
|
770
859
|
// =========================================================================
|
|
771
|
-
interface ScaffoldProps extends CommonProps {
|
|
860
|
+
export interface ScaffoldProps extends CommonProps {
|
|
772
861
|
appBar?: Widget | boolean;
|
|
773
862
|
body?: Widget | Record<string, any>;
|
|
774
863
|
bottomBar?: Widget | boolean;
|
|
@@ -782,6 +871,7 @@ declare module 'flet-box' {
|
|
|
782
871
|
navSideBarWidth?: number;
|
|
783
872
|
navSideBarPosition?: 'left' | 'right';
|
|
784
873
|
routes?: Record<string, any>;
|
|
874
|
+
basePath?: string;
|
|
785
875
|
backgroundColor?: Color;
|
|
786
876
|
closeDrawerOnNavigate?: boolean;
|
|
787
877
|
}
|
|
@@ -794,7 +884,7 @@ declare module 'flet-box' {
|
|
|
794
884
|
closeDrawer?(): void;
|
|
795
885
|
};
|
|
796
886
|
|
|
797
|
-
interface AdaptiveScaffoldProps extends CommonProps {
|
|
887
|
+
export interface AdaptiveScaffoldProps extends CommonProps {
|
|
798
888
|
appBar?: Widget;
|
|
799
889
|
body?: Widget | Record<string, any>;
|
|
800
890
|
bottomBar?: Widget;
|
|
@@ -818,7 +908,7 @@ declare module 'flet-box' {
|
|
|
818
908
|
closeDrawer?(): void;
|
|
819
909
|
};
|
|
820
910
|
|
|
821
|
-
interface AppBarProps extends CommonProps {
|
|
911
|
+
export interface AppBarProps extends Omit<CommonProps, 'shadow'> {
|
|
822
912
|
title?: string | Widget;
|
|
823
913
|
leading?: Widget;
|
|
824
914
|
actions?: Widget[];
|
|
@@ -840,7 +930,7 @@ declare module 'flet-box' {
|
|
|
840
930
|
margin?: Margin;
|
|
841
931
|
padding?: Padding;
|
|
842
932
|
borderRadius?: number;
|
|
843
|
-
shadow?: boolean;
|
|
933
|
+
shadow?: boolean | string;
|
|
844
934
|
}
|
|
845
935
|
export function AppBar(props: AppBarProps): Widget & {
|
|
846
936
|
setTitle(title: string): void;
|
|
@@ -849,7 +939,7 @@ declare module 'flet-box' {
|
|
|
849
939
|
hide(): void;
|
|
850
940
|
};
|
|
851
941
|
|
|
852
|
-
interface DrawerItemProps extends CommonProps {
|
|
942
|
+
export interface DrawerItemProps extends CommonProps {
|
|
853
943
|
icon?: string;
|
|
854
944
|
label: string;
|
|
855
945
|
route?: string;
|
|
@@ -866,14 +956,14 @@ declare module 'flet-box' {
|
|
|
866
956
|
}
|
|
867
957
|
export function DrawerItem(props: DrawerItemProps): Widget;
|
|
868
958
|
|
|
869
|
-
interface DrawerInstance {
|
|
959
|
+
export interface DrawerInstance {
|
|
870
960
|
open(): void;
|
|
871
961
|
close(): void;
|
|
872
962
|
toggle(): void;
|
|
873
963
|
destroy(): void;
|
|
874
964
|
element: HTMLElement;
|
|
875
965
|
}
|
|
876
|
-
interface DrawerProps {
|
|
966
|
+
export interface DrawerProps {
|
|
877
967
|
header?: Widget;
|
|
878
968
|
body?: Widget[];
|
|
879
969
|
footer?: Widget;
|
|
@@ -896,7 +986,7 @@ declare module 'flet-box' {
|
|
|
896
986
|
export function toggleDrawer(): void;
|
|
897
987
|
export function destroyDrawer(): void;
|
|
898
988
|
|
|
899
|
-
interface BottomNavigationProps extends CommonProps {
|
|
989
|
+
export interface BottomNavigationProps extends Omit<CommonProps, 'shadow'> {
|
|
900
990
|
items: Array<{ icon: string; label?: string; route?: string; onPress?: () => void }>;
|
|
901
991
|
currentIndex?: number;
|
|
902
992
|
onTabChange?: (index: number) => void;
|
|
@@ -909,7 +999,7 @@ declare module 'flet-box' {
|
|
|
909
999
|
margin?: Margin;
|
|
910
1000
|
borderRadius?: number;
|
|
911
1001
|
padding?: Padding;
|
|
912
|
-
shadow?: boolean;
|
|
1002
|
+
shadow?: boolean | string;
|
|
913
1003
|
elevation?: number;
|
|
914
1004
|
useRouter?: boolean;
|
|
915
1005
|
}
|
|
@@ -919,7 +1009,7 @@ declare module 'flet-box' {
|
|
|
919
1009
|
getCurrentRoute(): string | null;
|
|
920
1010
|
};
|
|
921
1011
|
|
|
922
|
-
interface FloatingActionButtonProps extends CommonProps {
|
|
1012
|
+
export interface FloatingActionButtonProps extends CommonProps {
|
|
923
1013
|
icon?: string | Widget;
|
|
924
1014
|
label?: string;
|
|
925
1015
|
onPress?: () => void;
|
|
@@ -933,7 +1023,7 @@ declare module 'flet-box' {
|
|
|
933
1023
|
}
|
|
934
1024
|
export function FloatingActionButton(props: FloatingActionButtonProps): Widget;
|
|
935
1025
|
|
|
936
|
-
interface TabsProps extends CommonProps {
|
|
1026
|
+
export interface TabsProps extends CommonProps {
|
|
937
1027
|
tabs: (string | { label: string; icon?: string; badge?: number | string })[];
|
|
938
1028
|
children: Widget[];
|
|
939
1029
|
activeIndex?: number;
|
|
@@ -959,7 +1049,7 @@ declare module 'flet-box' {
|
|
|
959
1049
|
setActiveTab(index: number): void;
|
|
960
1050
|
};
|
|
961
1051
|
|
|
962
|
-
interface CollapsibleSideBarProps extends CommonProps {
|
|
1052
|
+
export interface CollapsibleSideBarProps extends CommonProps {
|
|
963
1053
|
children: Widget;
|
|
964
1054
|
expanded?: boolean;
|
|
965
1055
|
id?: string;
|
|
@@ -997,7 +1087,7 @@ declare module 'flet-box' {
|
|
|
997
1087
|
// =========================================================================
|
|
998
1088
|
// Animations
|
|
999
1089
|
// =========================================================================
|
|
1000
|
-
interface AnimationStep {
|
|
1090
|
+
export interface AnimationStep {
|
|
1001
1091
|
effect: string;
|
|
1002
1092
|
from: any;
|
|
1003
1093
|
to: any;
|
|
@@ -1006,7 +1096,7 @@ declare module 'flet-box' {
|
|
|
1006
1096
|
loop?: boolean;
|
|
1007
1097
|
delay?: string;
|
|
1008
1098
|
}
|
|
1009
|
-
interface AnimatedBoxProps extends CommonProps {
|
|
1099
|
+
export interface AnimatedBoxProps extends CommonProps {
|
|
1010
1100
|
animations: AnimationStep[];
|
|
1011
1101
|
child: Widget;
|
|
1012
1102
|
timing?: string;
|
|
@@ -1019,7 +1109,7 @@ declare module 'flet-box' {
|
|
|
1019
1109
|
}
|
|
1020
1110
|
export function AnimatedBox(props: AnimatedBoxProps): Widget;
|
|
1021
1111
|
|
|
1022
|
-
interface AnimatedTextProps extends CommonProps {
|
|
1112
|
+
export interface AnimatedTextProps extends CommonProps {
|
|
1023
1113
|
child: Widget;
|
|
1024
1114
|
animations: AnimationStep[];
|
|
1025
1115
|
sameTime?: boolean;
|
|
@@ -1028,7 +1118,7 @@ declare module 'flet-box' {
|
|
|
1028
1118
|
}
|
|
1029
1119
|
export function AnimatedText(props: AnimatedTextProps): Widget;
|
|
1030
1120
|
|
|
1031
|
-
interface MatrixRainProps extends CommonProps {
|
|
1121
|
+
export interface MatrixRainProps extends CommonProps {
|
|
1032
1122
|
chars?: string;
|
|
1033
1123
|
fontSize?: number;
|
|
1034
1124
|
speed?: number;
|
|
@@ -1040,7 +1130,7 @@ declare module 'flet-box' {
|
|
|
1040
1130
|
}
|
|
1041
1131
|
export function MatrixRain(props?: MatrixRainProps): Widget;
|
|
1042
1132
|
|
|
1043
|
-
interface ParallaxBoxProps extends CommonProps {
|
|
1133
|
+
export interface ParallaxBoxProps extends CommonProps {
|
|
1044
1134
|
child: Widget;
|
|
1045
1135
|
type?: 'scroll' | 'mouse' | 'hover';
|
|
1046
1136
|
speed?: number;
|
|
@@ -1066,7 +1156,8 @@ declare module 'flet-box' {
|
|
|
1066
1156
|
to: any,
|
|
1067
1157
|
duration?: number,
|
|
1068
1158
|
easing?: string
|
|
1069
|
-
):
|
|
1159
|
+
): () => boolean;
|
|
1160
|
+
export function stopAnimation(widget: Widget, property?: string): boolean;
|
|
1070
1161
|
export function animateAsync(
|
|
1071
1162
|
widget: Widget,
|
|
1072
1163
|
property: string,
|
|
@@ -1075,9 +1166,9 @@ declare module 'flet-box' {
|
|
|
1075
1166
|
duration?: number,
|
|
1076
1167
|
easing?: string
|
|
1077
1168
|
): Promise<Widget>;
|
|
1078
|
-
export function fadeOut(widget: Widget, duration?: number):
|
|
1079
|
-
export function fadeIn(widget: Widget, duration?: number):
|
|
1080
|
-
export function pulse(widget: Widget, duration?: number):
|
|
1169
|
+
export function fadeOut(widget: Widget, duration?: number): () => boolean;
|
|
1170
|
+
export function fadeIn(widget: Widget, duration?: number): () => boolean;
|
|
1171
|
+
export function pulse(widget: Widget, duration?: number): () => boolean;
|
|
1081
1172
|
export function fadeOutAsync(widget: Widget, duration?: number): Promise<Widget>;
|
|
1082
1173
|
export function fadeInAsync(widget: Widget, duration?: number): Promise<Widget>;
|
|
1083
1174
|
export function pulseAsync(widget: Widget, duration?: number): Promise<Widget>;
|
|
@@ -1085,13 +1176,13 @@ declare module 'flet-box' {
|
|
|
1085
1176
|
// =========================================================================
|
|
1086
1177
|
// Widgets adicionales (Data, Media, Utils)
|
|
1087
1178
|
// =========================================================================
|
|
1088
|
-
interface DataTableColumn {
|
|
1179
|
+
export interface DataTableColumn {
|
|
1089
1180
|
key: string;
|
|
1090
1181
|
label: string;
|
|
1091
1182
|
align?: 'left' | 'center' | 'right';
|
|
1092
1183
|
format?: (value: any, row: any) => string;
|
|
1093
1184
|
}
|
|
1094
|
-
interface DataTableProps extends CommonProps {
|
|
1185
|
+
export interface DataTableProps extends CommonProps {
|
|
1095
1186
|
columns: (string | DataTableColumn)[];
|
|
1096
1187
|
rows: Record<string, any>[];
|
|
1097
1188
|
striped?: boolean;
|
|
@@ -1117,7 +1208,7 @@ declare module 'flet-box' {
|
|
|
1117
1208
|
updateColumns(columns: DataTableColumn[]): void;
|
|
1118
1209
|
};
|
|
1119
1210
|
|
|
1120
|
-
interface ChartProps extends CommonProps {
|
|
1211
|
+
export interface ChartProps extends Omit<CommonProps, 'padding'> {
|
|
1121
1212
|
type?: 'bar' | 'line' | 'area' | 'candle';
|
|
1122
1213
|
data: number[] | Array<{ open: number; high: number; low: number; close: number }>;
|
|
1123
1214
|
labels?: string[];
|
|
@@ -1148,7 +1239,7 @@ declare module 'flet-box' {
|
|
|
1148
1239
|
redraw(): void;
|
|
1149
1240
|
};
|
|
1150
1241
|
|
|
1151
|
-
interface QRCodeProps extends CommonProps {
|
|
1242
|
+
export interface QRCodeProps extends CommonProps {
|
|
1152
1243
|
value: string;
|
|
1153
1244
|
size?: number;
|
|
1154
1245
|
bgColor?: Color;
|
|
@@ -1164,7 +1255,7 @@ declare module 'flet-box' {
|
|
|
1164
1255
|
getValue(): string;
|
|
1165
1256
|
};
|
|
1166
1257
|
|
|
1167
|
-
interface CodeViewerProps extends CommonProps {
|
|
1258
|
+
export interface CodeViewerProps extends CommonProps {
|
|
1168
1259
|
code: string;
|
|
1169
1260
|
title?: string;
|
|
1170
1261
|
maxHeight?: number;
|
|
@@ -1186,7 +1277,7 @@ declare module 'flet-box' {
|
|
|
1186
1277
|
scrollToEnd(): void;
|
|
1187
1278
|
};
|
|
1188
1279
|
|
|
1189
|
-
interface InspectorProps {
|
|
1280
|
+
export interface InspectorProps {
|
|
1190
1281
|
widget: Widget;
|
|
1191
1282
|
indent?: number;
|
|
1192
1283
|
}
|
|
@@ -1194,7 +1285,7 @@ declare module 'flet-box' {
|
|
|
1194
1285
|
export function printWidgetCode(widget: Widget): void;
|
|
1195
1286
|
export function inspectWidget(widget: Widget): Widget;
|
|
1196
1287
|
|
|
1197
|
-
interface DraggBoxProps extends CommonProps {
|
|
1288
|
+
export interface DraggBoxProps extends CommonProps {
|
|
1198
1289
|
child: Widget;
|
|
1199
1290
|
data?: any;
|
|
1200
1291
|
group?: string;
|
|
@@ -1209,7 +1300,7 @@ declare module 'flet-box' {
|
|
|
1209
1300
|
}
|
|
1210
1301
|
export function DraggBox(props: DraggBoxProps): Widget;
|
|
1211
1302
|
|
|
1212
|
-
interface DroppBoxProps extends CommonProps {
|
|
1303
|
+
export interface DroppBoxProps extends CommonProps {
|
|
1213
1304
|
child: Widget;
|
|
1214
1305
|
onDrop?: (data: any, group: string, event: DragEvent) => void;
|
|
1215
1306
|
onDragEnter?: (event: DragEvent) => void;
|
|
@@ -1239,7 +1330,7 @@ declare module 'flet-box' {
|
|
|
1239
1330
|
}
|
|
1240
1331
|
export function DroppBox(props: DroppBoxProps): Widget;
|
|
1241
1332
|
|
|
1242
|
-
interface CarouselProps extends CommonProps {
|
|
1333
|
+
export interface CarouselProps extends CommonProps {
|
|
1243
1334
|
items: (Widget | string | { src: string; alt?: string })[];
|
|
1244
1335
|
autoPlay?: boolean;
|
|
1245
1336
|
interval?: number;
|
|
@@ -1267,7 +1358,7 @@ declare module 'flet-box' {
|
|
|
1267
1358
|
getCurrentIndex(): number;
|
|
1268
1359
|
};
|
|
1269
1360
|
|
|
1270
|
-
interface TooltipProps extends CommonProps {
|
|
1361
|
+
export interface TooltipProps extends CommonProps {
|
|
1271
1362
|
text: string;
|
|
1272
1363
|
child: Widget;
|
|
1273
1364
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -1296,7 +1387,7 @@ declare module 'flet-box' {
|
|
|
1296
1387
|
updatePosition(): void;
|
|
1297
1388
|
};
|
|
1298
1389
|
|
|
1299
|
-
interface PaginationProps extends CommonProps {
|
|
1390
|
+
export interface PaginationProps extends CommonProps {
|
|
1300
1391
|
totalItems: number;
|
|
1301
1392
|
pageSize?: number;
|
|
1302
1393
|
currentPage?: number;
|
|
@@ -1313,7 +1404,7 @@ declare module 'flet-box' {
|
|
|
1313
1404
|
}
|
|
1314
1405
|
export function Pagination(props: PaginationProps): Widget;
|
|
1315
1406
|
|
|
1316
|
-
interface TreeViewProps extends CommonProps {
|
|
1407
|
+
export interface TreeViewProps extends CommonProps {
|
|
1317
1408
|
nodes: Array<{
|
|
1318
1409
|
id: string;
|
|
1319
1410
|
label: string;
|
|
@@ -1362,7 +1453,7 @@ declare module 'flet-box' {
|
|
|
1362
1453
|
setSelected(nodeId: string): void;
|
|
1363
1454
|
};
|
|
1364
1455
|
|
|
1365
|
-
interface StepperProps extends CommonProps {
|
|
1456
|
+
export interface StepperProps extends CommonProps {
|
|
1366
1457
|
steps: Array<{ label: string; content: Widget; icon?: string }>;
|
|
1367
1458
|
activeStep?: number;
|
|
1368
1459
|
onStepChange?: (index: number) => void;
|
|
@@ -1391,7 +1482,7 @@ declare module 'flet-box' {
|
|
|
1391
1482
|
getActiveStep(): number;
|
|
1392
1483
|
};
|
|
1393
1484
|
|
|
1394
|
-
interface SkeletonProps extends CommonProps {
|
|
1485
|
+
export interface SkeletonProps extends CommonProps {
|
|
1395
1486
|
variant?: 'text' | 'circular' | 'avatar' | 'image' | 'card' | 'listTile' | 'button';
|
|
1396
1487
|
width?: number | string;
|
|
1397
1488
|
height?: number | string;
|
|
@@ -1407,7 +1498,7 @@ declare module 'flet-box' {
|
|
|
1407
1498
|
}
|
|
1408
1499
|
export function Skeleton(props: SkeletonProps): Widget;
|
|
1409
1500
|
|
|
1410
|
-
interface InstallButtonProps extends CommonProps {
|
|
1501
|
+
export interface InstallButtonProps extends CommonProps {
|
|
1411
1502
|
text?: string;
|
|
1412
1503
|
variant?: 'filled' | 'outlined' | 'text';
|
|
1413
1504
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -1419,7 +1510,7 @@ declare module 'flet-box' {
|
|
|
1419
1510
|
}
|
|
1420
1511
|
export function InstallButton(props: InstallButtonProps): Widget;
|
|
1421
1512
|
|
|
1422
|
-
interface VideoProps extends CommonProps {
|
|
1513
|
+
export interface VideoProps extends Omit<CommonProps, 'ref'> {
|
|
1423
1514
|
src: string;
|
|
1424
1515
|
width?: number | string;
|
|
1425
1516
|
height?: number | string;
|
|
@@ -1441,7 +1532,7 @@ declare module 'flet-box' {
|
|
|
1441
1532
|
unmuteVideo(): void;
|
|
1442
1533
|
};
|
|
1443
1534
|
|
|
1444
|
-
interface AudioProps extends CommonProps {
|
|
1535
|
+
export interface AudioProps extends Omit<CommonProps, 'ref'> {
|
|
1445
1536
|
src: string;
|
|
1446
1537
|
autoplay?: boolean;
|
|
1447
1538
|
controls?: boolean;
|
|
@@ -1472,7 +1563,7 @@ declare module 'flet-box' {
|
|
|
1472
1563
|
isPlaying(): boolean;
|
|
1473
1564
|
};
|
|
1474
1565
|
|
|
1475
|
-
interface CircularBarProps extends CommonProps {
|
|
1566
|
+
export interface CircularBarProps extends Omit<CommonProps, 'onClick' | 'ref'> {
|
|
1476
1567
|
value?: number;
|
|
1477
1568
|
max?: number;
|
|
1478
1569
|
size?: number;
|
|
@@ -1516,13 +1607,13 @@ declare module 'flet-box' {
|
|
|
1516
1607
|
updateValue(newValue: number, newMax?: number): void;
|
|
1517
1608
|
};
|
|
1518
1609
|
|
|
1519
|
-
interface CircularChartSlice {
|
|
1610
|
+
export interface CircularChartSlice {
|
|
1520
1611
|
value: number;
|
|
1521
1612
|
label?: string;
|
|
1522
1613
|
color?: Color;
|
|
1523
1614
|
}
|
|
1524
1615
|
|
|
1525
|
-
interface CircularChartProps extends CommonProps {
|
|
1616
|
+
export interface CircularChartProps extends Omit<CommonProps, 'onClick' | 'ref'> {
|
|
1526
1617
|
data?: CircularChartSlice[];
|
|
1527
1618
|
size?: number;
|
|
1528
1619
|
strokeWidth?: number;
|
|
@@ -1559,7 +1650,7 @@ declare module 'flet-box' {
|
|
|
1559
1650
|
setCornerRadius(radius: number): void;
|
|
1560
1651
|
};
|
|
1561
1652
|
|
|
1562
|
-
interface MarkdownProps extends CommonProps {
|
|
1653
|
+
export interface MarkdownProps extends CommonProps {
|
|
1563
1654
|
text?: string;
|
|
1564
1655
|
source?: string;
|
|
1565
1656
|
content?: string;
|
|
@@ -1612,16 +1703,37 @@ declare module 'flet-box' {
|
|
|
1612
1703
|
// =========================================================================
|
|
1613
1704
|
// Core
|
|
1614
1705
|
// =========================================================================
|
|
1615
|
-
export function runApp(
|
|
1706
|
+
export function runApp(
|
|
1707
|
+
App: (() => Widget) | Widget,
|
|
1708
|
+
rootId?: string,
|
|
1709
|
+
preventRefresh?: boolean,
|
|
1710
|
+
routes?: any
|
|
1711
|
+
): { destroy(): void };
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Mounts a single widget into `#root`, creating the container when it is
|
|
1715
|
+
* missing. Never clears `document.body`. Returns the root container.
|
|
1716
|
+
*/
|
|
1717
|
+
export function App(widget: Widget): Widget;
|
|
1718
|
+
|
|
1719
|
+
/**
|
|
1720
|
+
* The only rendering engine. Turns a tag (or config object) plus props into a
|
|
1721
|
+
* real `HTMLElement` with styles, events, children, lifecycle and reactivity.
|
|
1722
|
+
*/
|
|
1723
|
+
export function WidgetFactory(
|
|
1724
|
+
tag: string | { tag?: string; [prop: string]: any },
|
|
1725
|
+
customProps?: Record<string, any>
|
|
1726
|
+
): WidgetFactoryInstance;
|
|
1727
|
+
|
|
1616
1728
|
export function createApp(routes: any, options?: { rootId?: string; fallback?: Widget | (() => Widget) }): {
|
|
1617
1729
|
start(): void;
|
|
1618
1730
|
destroy(): void;
|
|
1619
1731
|
};
|
|
1620
1732
|
export function insertBy(widget: Widget, rootId?: string): Widget;
|
|
1621
1733
|
export function prependBy(widget: Widget, rootId?: string): Widget;
|
|
1622
|
-
export function insertBefore(widget: Widget, targetId: string
|
|
1623
|
-
export function insertAfter(widget: Widget, targetId: string
|
|
1624
|
-
export function replaceBy(widget: Widget, targetId: string
|
|
1734
|
+
export function insertBefore(widget: Widget, targetId: string): Widget;
|
|
1735
|
+
export function insertAfter(widget: Widget, targetId: string): Widget;
|
|
1736
|
+
export function replaceBy(widget: Widget, targetId: string): Widget;
|
|
1625
1737
|
export function mountAll(widget: Widget, rootIds: string[]): Widget;
|
|
1626
1738
|
|
|
1627
1739
|
// =========================================================================
|
|
@@ -1824,7 +1936,12 @@ declare module 'flet-box' {
|
|
|
1824
1936
|
export function padding(value: number | string | { all?: number; horizontal?: number; vertical?: number; top?: number; right?: number; bottom?: number; left?: number }): string;
|
|
1825
1937
|
export function gradient(type: 'linear' | 'circle' | 'conic', colors: string[], angle?: number): string;
|
|
1826
1938
|
export function shadow(x: number, y: number, blur: number, spread: number, color: string): string;
|
|
1827
|
-
|
|
1939
|
+
/**
|
|
1940
|
+
* Fluent color instance returned by `color()`. The chained methods mutate this
|
|
1941
|
+
* very instance and return it, which is why their type is `this` and not a
|
|
1942
|
+
* fixed interface name.
|
|
1943
|
+
*/
|
|
1944
|
+
export interface ColorInstance {
|
|
1828
1945
|
hex(): string;
|
|
1829
1946
|
rgb(): string;
|
|
1830
1947
|
rgba(): string;
|
|
@@ -1835,7 +1952,9 @@ declare module 'flet-box' {
|
|
|
1835
1952
|
isDark(): boolean;
|
|
1836
1953
|
isLight(): boolean;
|
|
1837
1954
|
contrast(): string;
|
|
1838
|
-
}
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
export const color: (value: string) => ColorInstance;
|
|
1839
1958
|
export function rgba(r: number, g: number, b: number, a?: number): string;
|
|
1840
1959
|
export function stackPosition(widget: Widget, props: { top?: any; right?: any; bottom?: any; left?: any }): Widget;
|
|
1841
1960
|
export function flex(grow: number | { grow?: number; shrink?: number; basis?: string }, shrink?: number, basis?: string): string;
|
|
@@ -1890,6 +2009,23 @@ declare module 'flet-box' {
|
|
|
1890
2009
|
export function memoWithKey<T extends (...args: any[]) => any>(fn: T, keyFn: (...args: Parameters<T>) => string): T;
|
|
1891
2010
|
export function clearMemo(memoizedFn: any): void;
|
|
1892
2011
|
|
|
2012
|
+
/**
|
|
2013
|
+
* Thin `console` wrapper that adds a level icon plus optional timestamp and
|
|
2014
|
+
* label. The second argument may also be the options object (legacy style).
|
|
2015
|
+
*/
|
|
2016
|
+
export function print(
|
|
2017
|
+
message: any,
|
|
2018
|
+
type?:
|
|
2019
|
+
| "log"
|
|
2020
|
+
| "warn"
|
|
2021
|
+
| "error"
|
|
2022
|
+
| "info"
|
|
2023
|
+
| "success"
|
|
2024
|
+
| "debug"
|
|
2025
|
+
| { timestamp?: boolean; label?: string; prefix?: boolean },
|
|
2026
|
+
options?: { timestamp?: boolean; label?: string; prefix?: boolean }
|
|
2027
|
+
): void;
|
|
2028
|
+
|
|
1893
2029
|
export function setBaseFontSize(size: number): void;
|
|
1894
2030
|
export function toREM(value: number | string): string | undefined;
|
|
1895
2031
|
export function toPX(value: number | string): string | undefined;
|