@motifx-community/ui 0.1.0-beta.18 → 0.1.0-beta.19
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/CHANGELOG.md +34 -0
- package/dist/components/form/MxForm.d.ts +3 -0
- package/dist/components/form/form-props.d.ts +7 -0
- package/dist/components/formlayout/FormLayout.d.ts +21 -6
- package/dist/components/formlayout/form-item.d.ts +4 -3
- package/dist/components/formlayout/form-layout-props.d.ts +9 -5
- package/dist/components/formlayout/form-tab.d.ts +2 -1
- package/dist/components/layout/DockPanel.d.ts +16 -6
- package/dist/components/layout/Grid.d.ts +35 -25
- package/dist/components/layout/GroupBox.d.ts +14 -4
- package/dist/components/layout/Panel.d.ts +12 -2
- package/dist/components/layout/SplitContainer.d.ts +12 -2
- package/dist/components/layout/Stack.d.ts +29 -17
- package/dist/components/layout/dock-child-props.d.ts +7 -6
- package/dist/components/layout/dock-panel-props.d.ts +3 -2
- package/dist/components/layout/grid-cell.d.ts +7 -5
- package/dist/components/layout/grid-props.d.ts +17 -12
- package/dist/components/layout/group-box-props.d.ts +3 -2
- package/dist/components/layout/panel-props.d.ts +2 -1
- package/dist/components/layout/split-container-props.d.ts +2 -1
- package/dist/components/layout/stack-child-props.d.ts +3 -2
- package/dist/components/layout/stack-props.d.ts +8 -7
- package/dist/components/tabs/Tab.d.ts +6 -0
- package/dist/components/tabs/Tabs.d.ts +5 -0
- package/dist/components/tabs/tab-props.d.ts +7 -1
- package/dist/components/tabs/tabs-props.d.ts +6 -0
- package/dist/core/responsive.d.ts +52 -0
- package/dist/generated/tokens.d.ts +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +466 -102
- package/dist/index.js.map +1 -1
- package/dist/styles.css +89 -5
- package/dist/tokens/index.d.ts +40 -0
- package/dist/tokens/index.js +20 -0
- package/dist/tokens/index.js.map +1 -1
- package/docs/accordion.md +1 -1
- package/docs/actionsheet.md +1 -1
- package/docs/appbar.md +1 -1
- package/docs/appmenu-api.md +1 -1
- package/docs/appmenu-programmatic.md +1 -1
- package/docs/appmenu-search.md +1 -1
- package/docs/appmenu.md +1 -1
- package/docs/avatar.md +1 -1
- package/docs/badge.md +1 -1
- package/docs/bar-gauge-angles.md +1 -1
- package/docs/bar-gauge-data.md +1 -1
- package/docs/bar-gauge-labels.md +1 -1
- package/docs/bar-gauge.md +1 -1
- package/docs/barcode.md +1 -1
- package/docs/bottomnavigation.md +1 -1
- package/docs/bottomsheet.md +1 -1
- package/docs/breadcrumb.md +1 -1
- package/docs/button.md +1 -1
- package/docs/buttongroup.md +1 -1
- package/docs/buttons.md +1 -1
- package/docs/calendar.md +1 -1
- package/docs/card.md +1 -1
- package/docs/chart-bars.md +1 -1
- package/docs/chart-candles.md +1 -1
- package/docs/chart-funnel.md +1 -1
- package/docs/chart-heatmap.md +1 -1
- package/docs/chart-lines.md +1 -1
- package/docs/chart-live.md +1 -1
- package/docs/chart-pie.md +1 -1
- package/docs/chart-radar.md +1 -1
- package/docs/chart-ranges.md +1 -1
- package/docs/chart-references.md +1 -1
- package/docs/chart-scatter.md +1 -1
- package/docs/chart-waterfall.md +1 -1
- package/docs/chart-zoom.md +1 -1
- package/docs/chart.md +1 -1
- package/docs/chat.md +1 -1
- package/docs/checkbox.md +1 -1
- package/docs/chip.md +1 -1
- package/docs/choice.md +1 -1
- package/docs/colorbox.md +1 -1
- package/docs/combobox.md +1 -1
- package/docs/commands.md +1 -1
- package/docs/control.md +1 -1
- package/docs/data.md +1 -1
- package/docs/datagrid-api.md +1 -1
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +1 -1
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +1 -1
- package/docs/datagrid-filtering.md +1 -1
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +1 -1
- package/docs/datagrid-layout.md +1 -1
- package/docs/datagrid-lookups.md +1 -1
- package/docs/datagrid-master-detail.md +1 -1
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +1 -1
- package/docs/datagrid.md +1 -1
- package/docs/datebox.md +1 -1
- package/docs/daterangebox.md +1 -1
- package/docs/diagram-api.md +1 -1
- package/docs/diagram-commands.md +1 -1
- package/docs/diagram-connections.md +1 -1
- package/docs/diagram-custom-nodes.md +1 -1
- package/docs/diagram-designer.md +1 -1
- package/docs/diagram-editing.md +1 -1
- package/docs/diagram-flow.md +1 -1
- package/docs/diagram-keyboard.md +1 -1
- package/docs/diagram-layout.md +1 -1
- package/docs/diagram-nodes.md +1 -1
- package/docs/diagram-tables.md +1 -1
- package/docs/diagram.md +1 -1
- package/docs/display.md +1 -1
- package/docs/draggable.md +1 -1
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +1 -1
- package/docs/editors.md +1 -1
- package/docs/expressioneditor.md +1 -1
- package/docs/expressions.md +1 -1
- package/docs/feedback.md +1 -1
- package/docs/fileuploader.md +1 -1
- package/docs/filterbuilder.md +1 -1
- package/docs/formlayout-schema.md +1 -1
- package/docs/formlayout.md +52 -6
- package/docs/foundations.md +1 -1
- package/docs/gallery.md +1 -1
- package/docs/gauge-base.md +1 -1
- package/docs/gauge-circular.md +1 -1
- package/docs/gauge-dashboards.md +1 -1
- package/docs/gauge-linear.md +1 -1
- package/docs/gauge-markers.md +1 -1
- package/docs/gauge-marks.md +1 -1
- package/docs/gauge-ranges.md +1 -1
- package/docs/gauge-scales.md +1 -1
- package/docs/gauge.md +1 -1
- package/docs/home.md +1 -1
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +101 -28
- package/docs/listbox.md +1 -1
- package/docs/loadpanel.md +1 -1
- package/docs/lookup.md +1 -1
- package/docs/markdown.md +1 -1
- package/docs/menus-api.md +1 -1
- package/docs/menus-context.md +1 -1
- package/docs/menus-customization.md +1 -1
- package/docs/menus-merging.md +1 -1
- package/docs/menus-programmatic.md +1 -1
- package/docs/menus.md +1 -1
- package/docs/multiview.md +1 -1
- package/docs/navigation.md +1 -1
- package/docs/numberbox.md +1 -1
- package/docs/otpinput.md +1 -1
- package/docs/pagination.md +1 -1
- package/docs/pivotgrid-api.md +1 -1
- package/docs/pivotgrid-chart.md +1 -1
- package/docs/pivotgrid-drilldown.md +1 -1
- package/docs/pivotgrid-export.md +1 -1
- package/docs/pivotgrid-fields.md +1 -1
- package/docs/pivotgrid-keyboard.md +1 -1
- package/docs/pivotgrid-layout.md +1 -1
- package/docs/pivotgrid-panel.md +1 -1
- package/docs/pivotgrid-remote.md +1 -1
- package/docs/pivotgrid-sorting.md +1 -1
- package/docs/pivotgrid-state.md +1 -1
- package/docs/pivotgrid-summaries.md +1 -1
- package/docs/pivotgrid.md +1 -1
- package/docs/popover.md +1 -1
- package/docs/progress.md +1 -1
- package/docs/qrcode.md +1 -1
- package/docs/radiogroup.md +1 -1
- package/docs/rating.md +1 -1
- package/docs/resizable.md +1 -1
- package/docs/ribbonmenu-api.md +1 -1
- package/docs/ribbonmenu-commands.md +1 -1
- package/docs/ribbonmenu-customization.md +1 -1
- package/docs/ribbonmenu-display.md +1 -1
- package/docs/ribbonmenu-layouts.md +1 -1
- package/docs/ribbonmenu-programmatic.md +1 -1
- package/docs/ribbonmenu.md +1 -1
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +1 -1
- package/docs/scheduler-form.md +1 -1
- package/docs/scheduler-icalendar.md +1 -1
- package/docs/scheduler-mobile.md +1 -1
- package/docs/scheduler-recurrence.md +1 -1
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +1 -1
- package/docs/scrollview.md +1 -1
- package/docs/shortcuteditor.md +1 -1
- package/docs/showcase-flowstudio.md +1 -1
- package/docs/showcase-home.md +1 -1
- package/docs/showcase-mail.md +1 -1
- package/docs/showcase.md +1 -1
- package/docs/signature.md +1 -1
- package/docs/skeleton.md +1 -1
- package/docs/slider.md +1 -1
- package/docs/sortable.md +1 -1
- package/docs/sparkline.md +1 -1
- package/docs/speeddial.md +1 -1
- package/docs/splitter.md +1 -1
- package/docs/stepper.md +1 -1
- package/docs/switch.md +1 -1
- package/docs/tabdocs-dock.md +1 -1
- package/docs/tabdocs-drag.md +1 -1
- package/docs/tabdocs-menus.md +1 -1
- package/docs/tabdocs-mobile.md +1 -1
- package/docs/tabdocs-tabs.md +1 -1
- package/docs/tabdocs-windows.md +1 -1
- package/docs/tabdocs-workspace.md +1 -1
- package/docs/tabdocs.md +1 -1
- package/docs/tabs.md +58 -1
- package/docs/tagbox.md +1 -1
- package/docs/textarea.md +1 -1
- package/docs/textbox.md +1 -1
- package/docs/tileview.md +1 -1
- package/docs/timeline.md +1 -1
- package/docs/toast.md +1 -1
- package/docs/tokens.md +9 -1
- package/docs/toolbar-api.md +1 -1
- package/docs/toolbar-customization.md +1 -1
- package/docs/toolbar.md +1 -1
- package/docs/tooltip.md +1 -1
- package/docs/treeview.md +2 -2
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +45 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +452 -224
- package/llms.txt +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,40 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.0-beta.19] - 2026-11-30
|
|
10
|
+
|
|
11
|
+
Needs `@motifx/core` 1.2.0-rc.31, `@motifx-community/data` 0.1.0-beta.3 and `@motifx-community/design-system`
|
|
12
|
+
0.1.0-beta.4, for its `breakpoint` scale.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Responsive layouts. Every layout prop of `Stack`, `Grid`, `DockPanel`, `Panel` and `GroupBox`, the `orientation` of
|
|
17
|
+
`SplitContainer`, the children's `grow`, cells, `dock` and anchors, and `columns`, `minColumnWidth`, `labelMode`, an
|
|
18
|
+
item's `colSpan` and a group's or a tab's `columns` of `FormLayout` also take values per breakpoint:
|
|
19
|
+
`columns={{ xs: 1, md: 2, xl: 4 }}`. A value holds from its breakpoint up to the next one given. The breakpoint is
|
|
20
|
+
that of the room the container is laid out in, its parent's content box, not the window, so a layout in a narrow
|
|
21
|
+
pane, a split or a window changes on a wide screen too. The widths are the design system's `breakpoint` scale (sm 560,
|
|
22
|
+
md 768, lg 1024, xl 1440 px) through the new `layout.breakpoint` tokens, which a theme can change. Only a container
|
|
23
|
+
given a value per breakpoint follows its room, with the size observer, and its first frame is already laid out by
|
|
24
|
+
it; `breakpoint` on each container tells the one it is at, and reactively. `Responsive`, `Breakpoint`,
|
|
25
|
+
`isPerBreakpoint`, `valueAt` and `breakpointOf` are exported.
|
|
26
|
+
- `padding` on `Tabs`, `Tab` (inherited from the tabs) and `MxForm`: the space inside a panel's or the content area's
|
|
27
|
+
edges, one to four values as in CSS.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- In tabs given a height, the shown panel fills the room under the strip and what is longer scrolls in the panel, with
|
|
32
|
+
the scroll bar at its edge. A panel or a form's content area that holds only a part that scrolls by itself
|
|
33
|
+
(`DataGrid`, `PivotGrid`, `TreeView`, `ScrollView`, `Scheduler`, `Chat`, `Diagram`, `TabDocumentManager`,
|
|
34
|
+
`SplitContainer`, `DockPanel`, `TileView` or a scrolling `Panel`) has no padding around it: the part fills it and its
|
|
35
|
+
scroll bar stands at the edge, no longer 16 or 20 px inside. A `padding` given takes precedence.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- `FormLayout` with `minColumnWidth` keeps `columns` as the most columns, as documented; it laid out as many as fit.
|
|
40
|
+
- The boxes to write in of `Chat` take the width of their place: the composer's, the one that edits a question, and
|
|
41
|
+
those of the questions and the choices. They kept the field's default width of 16rem.
|
|
42
|
+
|
|
9
43
|
## [0.1.0-beta.18] - 2026-11-29
|
|
10
44
|
|
|
11
45
|
Needs `@motifx/core` 1.2.0-rc.31 and `@motifx-community/data` 0.1.0-beta.3.
|
|
@@ -2,6 +2,7 @@ import { Component, type Bind, type ComponentBase, type Event as MotifEvent, typ
|
|
|
2
2
|
import { FocusContainer } from '../../core/container';
|
|
3
3
|
import type { Control } from '../../core/control';
|
|
4
4
|
import type { IconSource } from '../../core/icon-source';
|
|
5
|
+
import type { LayoutSpace } from '../layout/layout-space';
|
|
5
6
|
import type { FormClosedEventArgs } from './form-closed-event-args';
|
|
6
7
|
import type { FormClosingEventArgs } from './form-closing-event-args';
|
|
7
8
|
import type { FormEventArgs } from './form-event-args';
|
|
@@ -51,6 +52,8 @@ export declare class MxForm extends FocusContainer<HTMLDialogElement, FormProps>
|
|
|
51
52
|
set showMinimize(value: Bind<boolean>);
|
|
52
53
|
get showMaximize(): boolean;
|
|
53
54
|
set showMaximize(value: Bind<boolean>);
|
|
55
|
+
get padding(): LayoutSpace | undefined;
|
|
56
|
+
set padding(value: Bind<LayoutSpace | undefined>);
|
|
54
57
|
get resizable(): boolean;
|
|
55
58
|
set resizable(value: Bind<boolean>);
|
|
56
59
|
get movable(): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
2
|
import type { Control, ControlProps } from '../../core/control';
|
|
3
3
|
import type { IconSource } from '../../core/icon-source';
|
|
4
|
+
import type { LayoutSpace } from '../layout/layout-space';
|
|
4
5
|
import type { FormClosedEventArgs } from './form-closed-event-args';
|
|
5
6
|
import type { FormClosingEventArgs } from './form-closing-event-args';
|
|
6
7
|
import type { FormEventArgs } from './form-event-args';
|
|
@@ -18,6 +19,12 @@ export interface FormProps extends ControlProps {
|
|
|
18
19
|
content?: Bind<ComponentBase | null>;
|
|
19
20
|
/** A non-scrolling row below the content, for the form's buttons. */
|
|
20
21
|
footer?: Bind<ComponentBase | null>;
|
|
22
|
+
/**
|
|
23
|
+
* The space inside the content area's edges, one to four values as in CSS. When omitted, the look's; a content area
|
|
24
|
+
* that holds only a part that scrolls by itself (a grid, a tree, a scroll view …) has none, so its scroll bar stands
|
|
25
|
+
* at the edge.
|
|
26
|
+
*/
|
|
27
|
+
padding?: Bind<LayoutSpace | undefined>;
|
|
21
28
|
/** An icon at the start of the title bar. */
|
|
22
29
|
icon?: Bind<IconSource | null>;
|
|
23
30
|
/** Shows the close button in the title bar. The default is `true`. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentBase, type Bind, type IBaseProp } from '@motifx/core';
|
|
2
2
|
import { Control } from '../../core/control';
|
|
3
|
+
import { type Breakpoint, type Responsive } from '../../core/responsive';
|
|
3
4
|
import type { FieldLabelMode } from '../../parts/field/field-label-mode';
|
|
4
5
|
import { ValidationGroup } from '../../parts/validation/ValidationGroup';
|
|
5
6
|
import type { ValidationResult } from '../../parts/validation/validation-result';
|
|
@@ -28,12 +29,16 @@ export declare class FormLayout<T extends object = Record<string, unknown>> exte
|
|
|
28
29
|
set data(value: Bind<T | null>);
|
|
29
30
|
get items(): readonly FormItem[];
|
|
30
31
|
set items(value: Bind<readonly FormItem[]>);
|
|
31
|
-
get columns(): number
|
|
32
|
-
set columns(value: Bind<number
|
|
33
|
-
get minColumnWidth(): string
|
|
34
|
-
set minColumnWidth(value: Bind<string
|
|
35
|
-
get labelMode(): FieldLabelMode
|
|
36
|
-
set labelMode(value: Bind<FieldLabelMode
|
|
32
|
+
get columns(): Responsive<number>;
|
|
33
|
+
set columns(value: Bind<Responsive<number>>);
|
|
34
|
+
get minColumnWidth(): Responsive<string>;
|
|
35
|
+
set minColumnWidth(value: Bind<Responsive<string>>);
|
|
36
|
+
get labelMode(): Responsive<FieldLabelMode>;
|
|
37
|
+
set labelMode(value: Bind<Responsive<FieldLabelMode>>);
|
|
38
|
+
/**
|
|
39
|
+
* The breakpoint of the room the form is laid out in, by which its values per breakpoint are picked. Reactive.
|
|
40
|
+
*/
|
|
41
|
+
get breakpoint(): Breakpoint;
|
|
37
42
|
get readOnly(): boolean;
|
|
38
43
|
set readOnly(value: Bind<boolean>);
|
|
39
44
|
/** The validation group of the form's fields. */
|
|
@@ -65,6 +70,16 @@ export declare class FormLayout<T extends object = Record<string, unknown>> exte
|
|
|
65
70
|
private isHidden;
|
|
66
71
|
/** Whether `part` is in one of this form's items that are not shown. */
|
|
67
72
|
private hides;
|
|
73
|
+
private drawColumns;
|
|
74
|
+
private drawMinWidth;
|
|
75
|
+
/**
|
|
76
|
+
* A value at the form's breakpoint now: one per breakpoint starts following its width. Read in a binding, it is read
|
|
77
|
+
* again when the breakpoint changes.
|
|
78
|
+
*/
|
|
79
|
+
private at;
|
|
80
|
+
private get breakpoints();
|
|
81
|
+
/** The breakpoint changed: the form's columns again (the bindings that picked a value per breakpoint follow it). */
|
|
82
|
+
private redraw;
|
|
68
83
|
private get formParts();
|
|
69
84
|
/** The form's own fields: those of its data object. */
|
|
70
85
|
private get scope();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
|
+
import type { Responsive } from '../../core/responsive';
|
|
2
3
|
import type { ButtonProps } from '../button/button-props';
|
|
3
4
|
import type { ValidationRule } from '../../parts/validation/validation-rule';
|
|
4
5
|
import type { FormEditorFactory } from './form-editor-factory';
|
|
@@ -27,15 +28,15 @@ export interface FormItem {
|
|
|
27
28
|
required?: Bind<boolean>;
|
|
28
29
|
rules?: Bind<readonly ValidationRule[]>;
|
|
29
30
|
helpText?: Bind<string>;
|
|
30
|
-
/** The number of columns it spans. Use `'all'` for the whole row. */
|
|
31
|
-
colSpan?: number | 'all'
|
|
31
|
+
/** The number of columns it spans. Use `'all'` for the whole row. Also per breakpoint of the room the form is laid out in. */
|
|
32
|
+
colSpan?: Responsive<number | 'all'>;
|
|
32
33
|
visible?: Bind<boolean>;
|
|
33
34
|
enabled?: Bind<boolean>;
|
|
34
35
|
readOnly?: Bind<boolean>;
|
|
35
36
|
/** A caption over `items`, which are laid out on their own `columns`. */
|
|
36
37
|
group?: Bind<string>;
|
|
37
38
|
items?: readonly FormItem[];
|
|
38
|
-
columns?: number
|
|
39
|
+
columns?: Responsive<number>;
|
|
39
40
|
/** Tabs, each with its own items, all of which are validated with the form. */
|
|
40
41
|
tabs?: readonly FormTab[];
|
|
41
42
|
/** A button. `submit` submits the form once it passes validation. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { Responsive } from '../../core/responsive';
|
|
3
4
|
import type { FieldLabelMode } from '../../parts/field/field-label-mode';
|
|
4
5
|
import type { ValidationResult } from '../../parts/validation/validation-result';
|
|
5
6
|
import type { FormItem } from './form-item';
|
|
@@ -8,12 +9,15 @@ export interface FormLayoutProps<T extends object> extends ControlProps {
|
|
|
8
9
|
/** The object the editors display and change, usually a reactive one. */
|
|
9
10
|
data?: Bind<T | null>;
|
|
10
11
|
items?: Bind<readonly FormItem[]>;
|
|
11
|
-
/** The number of grid columns. The default is `1`. */
|
|
12
|
-
columns?: Bind<number
|
|
13
|
-
/**
|
|
14
|
-
|
|
12
|
+
/** The number of grid columns. The default is `1`. Also per breakpoint of the room the form is laid out in. */
|
|
13
|
+
columns?: Bind<Responsive<number>>;
|
|
14
|
+
/**
|
|
15
|
+
* As many columns as fit, each at least this wide (a CSS length), and no more than `columns` when it is given. Also
|
|
16
|
+
* per breakpoint.
|
|
17
|
+
*/
|
|
18
|
+
minColumnWidth?: Bind<Responsive<string>>;
|
|
15
19
|
/** Passed to every editor. The default is `'top'`. */
|
|
16
|
-
labelMode?: Bind<FieldLabelMode
|
|
20
|
+
labelMode?: Bind<Responsive<FieldLabelMode>>;
|
|
17
21
|
readOnly?: Bind<boolean>;
|
|
18
22
|
/** Occurs when the form is submitted and every field is valid. */
|
|
19
23
|
onValidSubmit?: (e: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { Responsive } from '../../core/responsive';
|
|
2
3
|
import type { FormItem } from './form-item';
|
|
3
4
|
/** A tab of a form item's `tabs`: its caption and its own items, laid out on its own `columns`. */
|
|
4
5
|
export interface FormTab {
|
|
5
6
|
title: Bind<string>;
|
|
6
7
|
items: readonly FormItem[];
|
|
7
|
-
columns?: number
|
|
8
|
+
columns?: Responsive<number>;
|
|
8
9
|
visible?: Bind<boolean>;
|
|
9
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind, ComponentBase, IBaseProp } from '@motifx/core';
|
|
2
2
|
import { Control } from '../../core/control';
|
|
3
|
+
import { type Breakpoint, type Responsive } from '../../core/responsive';
|
|
3
4
|
import type { Dock } from './dock';
|
|
4
5
|
import type { DockChildProps } from './dock-child-props';
|
|
5
6
|
import type { DockPanelProps } from './dock-panel-props';
|
|
@@ -24,14 +25,18 @@ import type { LayoutSpace } from './layout-space';
|
|
|
24
25
|
*/
|
|
25
26
|
export declare class DockPanel extends Control<HTMLDivElement, DockPanelProps> {
|
|
26
27
|
constructor(props?: IBaseProp<DockPanelProps>);
|
|
27
|
-
get gap(): LayoutSpace | undefined;
|
|
28
|
-
set gap(value: Bind<LayoutSpace | undefined>);
|
|
29
|
-
get padding(): LayoutSpace | undefined;
|
|
30
|
-
set padding(value: Bind<LayoutSpace | undefined>);
|
|
31
|
-
/**
|
|
28
|
+
get gap(): Responsive<LayoutSpace> | undefined;
|
|
29
|
+
set gap(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
30
|
+
get padding(): Responsive<LayoutSpace> | undefined;
|
|
31
|
+
set padding(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
32
|
+
/**
|
|
33
|
+
* The breakpoint of the room the panel is laid out in, by which its values per breakpoint are picked. Reactive.
|
|
34
|
+
*/
|
|
35
|
+
get breakpoint(): Breakpoint;
|
|
36
|
+
/** The dock position of a child at the panel's breakpoint now, from its props or as set with {@link setDock}. */
|
|
32
37
|
dockOf(child: ComponentBase): Dock;
|
|
33
38
|
/** Docks a child programmatically: a value, or a tracked function. */
|
|
34
|
-
setDock(child: ComponentBase, dock: Bind<Dock
|
|
39
|
+
setDock(child: ComponentBase, dock: Bind<Responsive<Dock>>): void;
|
|
35
40
|
/** Sets the anchors of a `float` child programmatically. Each is a value or a function, and omitted fields do not change. */
|
|
36
41
|
setAnchors(child: ComponentBase, anchors: Omit<DockChildProps, 'dock'>): void;
|
|
37
42
|
private get settings();
|
|
@@ -39,4 +44,9 @@ export declare class DockPanel extends Control<HTMLDivElement, DockPanelProps> {
|
|
|
39
44
|
private arrange;
|
|
40
45
|
private clear;
|
|
41
46
|
private write;
|
|
47
|
+
/** A value at the panel's breakpoint now: one per breakpoint starts following its width. */
|
|
48
|
+
private at;
|
|
49
|
+
private get breakpoints();
|
|
50
|
+
/** The breakpoint changed: every value given per breakpoint again. */
|
|
51
|
+
private redraw;
|
|
42
52
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind, ComponentBase, IBaseProp } from '@motifx/core';
|
|
2
2
|
import { Control } from '../../core/control';
|
|
3
|
+
import { type Breakpoint, type Responsive } from '../../core/responsive';
|
|
3
4
|
import type { GridCell } from './grid-cell';
|
|
4
5
|
import type { GridFlow } from './grid-flow';
|
|
5
6
|
import type { GridJustify } from './grid-justify';
|
|
@@ -10,7 +11,8 @@ import type { LayoutSpace } from './layout-space';
|
|
|
10
11
|
/**
|
|
11
12
|
* Rows and columns defined up front, in a CSS-like form (`columns="auto 1fr 2fr 120"`). Children fill
|
|
12
13
|
* the cells in order, or declare their position in their own props: `row`, `column`, `rowSpan` and
|
|
13
|
-
* `columnSpan`, counted from 1.
|
|
14
|
+
* `columnSpan`, counted from 1. Every prop but `inline`, and every cell, also takes values per breakpoint of the
|
|
15
|
+
* room the grid is laid out in (`columns={{ xs: 1, md: '240 1fr' }}`).
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
18
|
* <Grid columns="auto 1fr" gap="sm">
|
|
@@ -23,35 +25,43 @@ import type { LayoutSpace } from './layout-space';
|
|
|
23
25
|
*/
|
|
24
26
|
export declare class Grid extends Control<HTMLDivElement, GridProps> {
|
|
25
27
|
constructor(props?: IBaseProp<GridProps>);
|
|
26
|
-
get rows(): GridTracks | undefined;
|
|
27
|
-
set rows(value: Bind<GridTracks | undefined>);
|
|
28
|
-
get columns(): GridTracks | undefined;
|
|
29
|
-
set columns(value: Bind<GridTracks | undefined>);
|
|
30
|
-
get gap(): LayoutSpace | undefined;
|
|
31
|
-
set gap(value: Bind<LayoutSpace | undefined>);
|
|
32
|
-
get rowGap(): LayoutSpace | undefined;
|
|
33
|
-
set rowGap(value: Bind<LayoutSpace | undefined>);
|
|
34
|
-
get columnGap(): LayoutSpace | undefined;
|
|
35
|
-
set columnGap(value: Bind<LayoutSpace | undefined>);
|
|
36
|
-
get padding(): LayoutSpace | undefined;
|
|
37
|
-
set padding(value: Bind<LayoutSpace | undefined>);
|
|
38
|
-
get autoRows(): number | string | undefined;
|
|
39
|
-
set autoRows(value: Bind<number | string | undefined>);
|
|
40
|
-
get autoColumns(): number | string | undefined;
|
|
41
|
-
set autoColumns(value: Bind<number | string | undefined>);
|
|
42
|
-
get flow(): GridFlow
|
|
43
|
-
set flow(value: Bind<GridFlow
|
|
44
|
-
get align(): LayoutAlign
|
|
45
|
-
set align(value: Bind<LayoutAlign
|
|
46
|
-
get justify(): GridJustify
|
|
47
|
-
set justify(value: Bind<GridJustify
|
|
28
|
+
get rows(): Responsive<GridTracks> | undefined;
|
|
29
|
+
set rows(value: Bind<Responsive<GridTracks> | undefined>);
|
|
30
|
+
get columns(): Responsive<GridTracks> | undefined;
|
|
31
|
+
set columns(value: Bind<Responsive<GridTracks> | undefined>);
|
|
32
|
+
get gap(): Responsive<LayoutSpace> | undefined;
|
|
33
|
+
set gap(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
34
|
+
get rowGap(): Responsive<LayoutSpace> | undefined;
|
|
35
|
+
set rowGap(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
36
|
+
get columnGap(): Responsive<LayoutSpace> | undefined;
|
|
37
|
+
set columnGap(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
38
|
+
get padding(): Responsive<LayoutSpace> | undefined;
|
|
39
|
+
set padding(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
40
|
+
get autoRows(): Responsive<number | string> | undefined;
|
|
41
|
+
set autoRows(value: Bind<Responsive<number | string> | undefined>);
|
|
42
|
+
get autoColumns(): Responsive<number | string> | undefined;
|
|
43
|
+
set autoColumns(value: Bind<Responsive<number | string> | undefined>);
|
|
44
|
+
get flow(): Responsive<GridFlow>;
|
|
45
|
+
set flow(value: Bind<Responsive<GridFlow>>);
|
|
46
|
+
get align(): Responsive<LayoutAlign>;
|
|
47
|
+
set align(value: Bind<Responsive<LayoutAlign>>);
|
|
48
|
+
get justify(): Responsive<GridJustify>;
|
|
49
|
+
set justify(value: Bind<Responsive<GridJustify>>);
|
|
48
50
|
get inline(): boolean;
|
|
49
51
|
set inline(value: Bind<boolean>);
|
|
52
|
+
/**
|
|
53
|
+
* The breakpoint of the room the grid is laid out in, by which its values per breakpoint are picked. Reactive.
|
|
54
|
+
*/
|
|
55
|
+
get breakpoint(): Breakpoint;
|
|
50
56
|
/** The cell of a child, from its props or as set with {@link setCell}. */
|
|
51
57
|
cellOf(child: ComponentBase): GridCell;
|
|
52
58
|
/** Places a child programmatically. Each field is a value or a tracked function, and omitted fields do not change. */
|
|
53
59
|
setCell(child: ComponentBase, cell: GridCell): void;
|
|
54
60
|
private get settings();
|
|
55
|
-
private
|
|
56
|
-
|
|
61
|
+
private placeChild;
|
|
62
|
+
/** A value at the grid's breakpoint now: one per breakpoint starts following its width. */
|
|
63
|
+
private at;
|
|
64
|
+
private get breakpoints();
|
|
65
|
+
/** The breakpoint changed: every value given per breakpoint again. */
|
|
66
|
+
private redraw;
|
|
57
67
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Bind, type Component, type Event as MotifEvent, type IBaseProp } from '@motifx/core';
|
|
2
2
|
import { Control } from '../../core/control';
|
|
3
|
+
import { type Breakpoint, type Responsive } from '../../core/responsive';
|
|
3
4
|
import type { GroupBoxProps } from './group-box-props';
|
|
4
5
|
import type { GroupBoxToggledEventArgs } from './group-box-toggled-event-args';
|
|
5
6
|
import type { GroupBoxVariant } from './group-box-variant';
|
|
@@ -28,10 +29,14 @@ export declare class GroupBox extends Control<HTMLFieldSetElement, GroupBoxProps
|
|
|
28
29
|
set collapsible(value: Bind<boolean>);
|
|
29
30
|
get collapsed(): boolean;
|
|
30
31
|
set collapsed(value: Bind<boolean>);
|
|
31
|
-
get padding(): LayoutSpace | undefined;
|
|
32
|
-
set padding(value: Bind<LayoutSpace | undefined>);
|
|
33
|
-
get gap(): LayoutSpace | undefined;
|
|
34
|
-
set gap(value: Bind<LayoutSpace | undefined>);
|
|
32
|
+
get padding(): Responsive<LayoutSpace> | undefined;
|
|
33
|
+
set padding(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
34
|
+
get gap(): Responsive<LayoutSpace> | undefined;
|
|
35
|
+
set gap(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
36
|
+
/**
|
|
37
|
+
* The breakpoint of the room the group box is laid out in, by which its values per breakpoint are picked. Reactive.
|
|
38
|
+
*/
|
|
39
|
+
get breakpoint(): Breakpoint;
|
|
35
40
|
get variant(): GroupBoxVariant;
|
|
36
41
|
set variant(value: Bind<GroupBoxVariant>);
|
|
37
42
|
/** Occurs when the content is shown or hidden, by the user or by code (`e.byUser`). */
|
|
@@ -50,6 +55,11 @@ export declare class GroupBox extends Control<HTMLFieldSetElement, GroupBoxProps
|
|
|
50
55
|
/** Moves focus to `item` when it takes focus itself, else to the first Tab stop inside it. */
|
|
51
56
|
private focusStop;
|
|
52
57
|
private change;
|
|
58
|
+
/** A value at the group box's breakpoint now: one per breakpoint starts following its width. */
|
|
59
|
+
private at;
|
|
60
|
+
private get breakpoints();
|
|
61
|
+
/** The breakpoint changed: every value given per breakpoint again. */
|
|
62
|
+
private redraw;
|
|
53
63
|
private renderTitle;
|
|
54
64
|
private renderToggle;
|
|
55
65
|
private renderCollapsed;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind, IBaseProp } from '@motifx/core';
|
|
2
2
|
import { Control } from '../../core/control';
|
|
3
|
+
import { type Breakpoint, type Responsive } from '../../core/responsive';
|
|
3
4
|
import type { LayoutSpace } from './layout-space';
|
|
4
5
|
import type { PanelProps } from './panel-props';
|
|
5
6
|
import type { PanelScroll } from './panel-scroll';
|
|
@@ -18,12 +19,21 @@ export declare class Panel extends Control<HTMLDivElement, PanelProps> {
|
|
|
18
19
|
constructor(props?: IBaseProp<PanelProps>);
|
|
19
20
|
get scrollable(): PanelScroll;
|
|
20
21
|
set scrollable(value: Bind<PanelScroll>);
|
|
21
|
-
get padding(): LayoutSpace | undefined;
|
|
22
|
-
set padding(value: Bind<LayoutSpace | undefined>);
|
|
22
|
+
get padding(): Responsive<LayoutSpace> | undefined;
|
|
23
|
+
set padding(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
24
|
+
/**
|
|
25
|
+
* The breakpoint of the room the panel is laid out in, by which its values per breakpoint are picked. Reactive.
|
|
26
|
+
*/
|
|
27
|
+
get breakpoint(): Breakpoint;
|
|
23
28
|
get variant(): PanelVariant;
|
|
24
29
|
set variant(value: Bind<PanelVariant>);
|
|
25
30
|
get focusPart(): Control | null;
|
|
26
31
|
protected applyProperty(name: string, value: unknown): void;
|
|
32
|
+
/** A value at the panel's breakpoint now: one per breakpoint starts following its width. */
|
|
33
|
+
private at;
|
|
34
|
+
private get breakpoints();
|
|
35
|
+
/** The breakpoint changed: every value given per breakpoint again. */
|
|
36
|
+
private redraw;
|
|
27
37
|
private renderName;
|
|
28
38
|
private renderScroll;
|
|
29
39
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, type Bind, type ComponentBase, type Event as MotifEvent, type IBaseProp } from '@motifx/core';
|
|
2
2
|
import { FocusContainer } from '../../core/container';
|
|
3
|
+
import { type Breakpoint, type Responsive } from '../../core/responsive';
|
|
3
4
|
import type { LayoutOrientation } from './layout-orientation';
|
|
4
5
|
import { Panel } from './Panel';
|
|
5
6
|
import type { SplitContainerProps } from './split-container-props';
|
|
@@ -30,10 +31,14 @@ export declare class SplitContainer extends FocusContainer<HTMLDivElement, Split
|
|
|
30
31
|
get first(): Panel;
|
|
31
32
|
/** The second pane (end or bottom), as a `Panel`. */
|
|
32
33
|
get second(): Panel;
|
|
34
|
+
/**
|
|
35
|
+
* The breakpoint of the room the container is laid out in, by which its values per breakpoint are picked. Reactive.
|
|
36
|
+
*/
|
|
37
|
+
get breakpoint(): Breakpoint;
|
|
33
38
|
/** The splitter part (`role="separator"`). */
|
|
34
39
|
get splitterPart(): Component<HTMLDivElement>;
|
|
35
|
-
get orientation(): LayoutOrientation
|
|
36
|
-
set orientation(value: Bind<LayoutOrientation
|
|
40
|
+
get orientation(): Responsive<LayoutOrientation>;
|
|
41
|
+
set orientation(value: Bind<Responsive<LayoutOrientation>>);
|
|
37
42
|
get position(): SplitPosition;
|
|
38
43
|
set position(value: Bind<SplitPosition>);
|
|
39
44
|
/** Maps to `position` for `x-model`. */
|
|
@@ -66,6 +71,11 @@ export declare class SplitContainer extends FocusContainer<HTMLDivElement, Split
|
|
|
66
71
|
private get parts();
|
|
67
72
|
private createParts;
|
|
68
73
|
private get horizontal();
|
|
74
|
+
/** A value at the container's breakpoint now: one per breakpoint starts following its width. */
|
|
75
|
+
private at;
|
|
76
|
+
private get breakpoints();
|
|
77
|
+
/** The breakpoint changed: every value given per breakpoint again. */
|
|
78
|
+
private redraw;
|
|
69
79
|
private route;
|
|
70
80
|
private renderLayout;
|
|
71
81
|
private tracks;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind, ComponentBase, IBaseProp } from '@motifx/core';
|
|
2
2
|
import { Control } from '../../core/control';
|
|
3
|
+
import { type Breakpoint, type Responsive } from '../../core/responsive';
|
|
3
4
|
import type { LayoutAlign } from './layout-align';
|
|
4
5
|
import type { LayoutOrientation } from './layout-orientation';
|
|
5
6
|
import type { LayoutSpace } from './layout-space';
|
|
@@ -7,7 +8,8 @@ import type { StackJustify } from './stack-justify';
|
|
|
7
8
|
import type { StackProps } from './stack-props';
|
|
8
9
|
/**
|
|
9
10
|
* Children in a row or a column with a gap between them, aligned across the direction and spread
|
|
10
|
-
* along it, with optional wrapping. A child that sets `grow` takes the free space.
|
|
11
|
+
* along it, with optional wrapping. A child that sets `grow` takes the free space. Every prop but `inline`, and `grow`,
|
|
12
|
+
* also takes values per breakpoint of the room the stack is laid out in (`orientation={{ xs: 'vertical', md: 'horizontal' }}`).
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* <Stack orientation="horizontal" gap="sm" align="center">
|
|
@@ -20,26 +22,36 @@ import type { StackProps } from './stack-props';
|
|
|
20
22
|
*/
|
|
21
23
|
export declare class Stack extends Control<HTMLDivElement, StackProps> {
|
|
22
24
|
constructor(props?: IBaseProp<StackProps>);
|
|
23
|
-
get orientation(): LayoutOrientation
|
|
24
|
-
set orientation(value: Bind<LayoutOrientation
|
|
25
|
-
get gap(): LayoutSpace | undefined;
|
|
26
|
-
set gap(value: Bind<LayoutSpace | undefined>);
|
|
27
|
-
get padding(): LayoutSpace | undefined;
|
|
28
|
-
set padding(value: Bind<LayoutSpace | undefined>);
|
|
29
|
-
get align(): LayoutAlign
|
|
30
|
-
set align(value: Bind<LayoutAlign
|
|
31
|
-
get justify(): StackJustify
|
|
32
|
-
set justify(value: Bind<StackJustify
|
|
33
|
-
get wrap(): boolean
|
|
34
|
-
set wrap(value: Bind<boolean
|
|
35
|
-
get reverse(): boolean
|
|
36
|
-
set reverse(value: Bind<boolean
|
|
25
|
+
get orientation(): Responsive<LayoutOrientation>;
|
|
26
|
+
set orientation(value: Bind<Responsive<LayoutOrientation>>);
|
|
27
|
+
get gap(): Responsive<LayoutSpace> | undefined;
|
|
28
|
+
set gap(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
29
|
+
get padding(): Responsive<LayoutSpace> | undefined;
|
|
30
|
+
set padding(value: Bind<Responsive<LayoutSpace> | undefined>);
|
|
31
|
+
get align(): Responsive<LayoutAlign>;
|
|
32
|
+
set align(value: Bind<Responsive<LayoutAlign>>);
|
|
33
|
+
get justify(): Responsive<StackJustify>;
|
|
34
|
+
set justify(value: Bind<Responsive<StackJustify>>);
|
|
35
|
+
get wrap(): Responsive<boolean>;
|
|
36
|
+
set wrap(value: Bind<Responsive<boolean>>);
|
|
37
|
+
get reverse(): Responsive<boolean>;
|
|
38
|
+
set reverse(value: Bind<Responsive<boolean>>);
|
|
37
39
|
get inline(): boolean;
|
|
38
40
|
set inline(value: Bind<boolean>);
|
|
41
|
+
/**
|
|
42
|
+
* The breakpoint of the room the stack is laid out in, by which its values per breakpoint are picked. Reactive.
|
|
43
|
+
*/
|
|
44
|
+
get breakpoint(): Breakpoint;
|
|
39
45
|
/** The `grow` of a child, from its props or as set with {@link setGrow}. */
|
|
40
|
-
growOf(child: ComponentBase): boolean | number
|
|
46
|
+
growOf(child: ComponentBase): Responsive<boolean | number>;
|
|
41
47
|
/** Sets a child's `grow` programmatically: a value, or a tracked function. */
|
|
42
|
-
setGrow(child: ComponentBase, grow: Bind<boolean | number
|
|
48
|
+
setGrow(child: ComponentBase, grow: Bind<Responsive<boolean | number>>): void;
|
|
43
49
|
private get settings();
|
|
50
|
+
private placeChild;
|
|
44
51
|
private renderLook;
|
|
52
|
+
/** A value at the stack's breakpoint now: one per breakpoint starts following its width. */
|
|
53
|
+
private at;
|
|
54
|
+
private get breakpoints();
|
|
55
|
+
/** The breakpoint changed: every value given per breakpoint again. */
|
|
56
|
+
private redraw;
|
|
45
57
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { Responsive } from '../../core/responsive';
|
|
2
3
|
import type { Dock } from './dock';
|
|
3
4
|
/**
|
|
4
5
|
* The props a child of a `DockPanel` sets for its position:
|
|
5
6
|
* `<Panel dock="start" />`, `<Button dock="float" right={16} bottom={16} />`.
|
|
6
7
|
* The edges set on a `float` child are its anchors (a number is in pixels), and `left` and `right`
|
|
7
|
-
* together stretch it.
|
|
8
|
+
* together stretch it. Each also takes values per breakpoint of the room the panel is laid out in: `dock={{ xs: 'top', md: 'start' }}`.
|
|
8
9
|
*/
|
|
9
10
|
export interface DockChildProps {
|
|
10
11
|
/** The dock position. The default is `'fill'`. */
|
|
11
|
-
dock?: Bind<Dock
|
|
12
|
-
left?: Bind<number | string
|
|
13
|
-
top?: Bind<number | string
|
|
14
|
-
right?: Bind<number | string
|
|
15
|
-
bottom?: Bind<number | string
|
|
12
|
+
dock?: Bind<Responsive<Dock>>;
|
|
13
|
+
left?: Bind<Responsive<number | string>>;
|
|
14
|
+
top?: Bind<Responsive<number | string>>;
|
|
15
|
+
right?: Bind<Responsive<number | string>>;
|
|
16
|
+
bottom?: Bind<Responsive<number | string>>;
|
|
16
17
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { Responsive } from '../../core/responsive';
|
|
3
4
|
import type { LayoutSpace } from './layout-space';
|
|
4
5
|
/** Props of `DockPanel`: the shared `ControlProps` plus its own. Each prop is also a settable, reactive property. */
|
|
5
6
|
export interface DockPanelProps extends ControlProps {
|
|
6
7
|
/** The space between docked children and what they dock against. There is none by default. */
|
|
7
|
-
gap?: Bind<LayoutSpace
|
|
8
|
+
gap?: Bind<Responsive<LayoutSpace>>;
|
|
8
9
|
/** The space inside the edges, one to four values as in CSS. There is none by default. */
|
|
9
|
-
padding?: Bind<LayoutSpace
|
|
10
|
+
padding?: Bind<Responsive<LayoutSpace>>;
|
|
10
11
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { Responsive } from '../../core/responsive';
|
|
2
3
|
/**
|
|
3
4
|
* The position of a child of a `Grid`, in its own props: `<TextBox row={2} column={1} columnSpan={2} />`.
|
|
4
|
-
* Lines are counted from 1, as in CSS, and a string is passed to CSS as is (`'-1'`, `'span 2'`).
|
|
5
|
+
* Lines are counted from 1, as in CSS, and a string is passed to CSS as is (`'-1'`, `'span 2'`). Each also takes values
|
|
6
|
+
* per breakpoint of the room the grid is laid out in: `columnSpan={{ xs: 2, md: 1 }}`.
|
|
5
7
|
*/
|
|
6
8
|
export interface GridCell {
|
|
7
|
-
row?: Bind<number | string
|
|
8
|
-
column?: Bind<number | string
|
|
9
|
-
rowSpan?: Bind<number
|
|
10
|
-
columnSpan?: Bind<number
|
|
9
|
+
row?: Bind<Responsive<number | string>>;
|
|
10
|
+
column?: Bind<Responsive<number | string>>;
|
|
11
|
+
rowSpan?: Bind<Responsive<number>>;
|
|
12
|
+
columnSpan?: Bind<Responsive<number>>;
|
|
11
13
|
}
|
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { Responsive } from '../../core/responsive';
|
|
3
4
|
import type { GridFlow } from './grid-flow';
|
|
4
5
|
import type { GridJustify } from './grid-justify';
|
|
5
6
|
import type { GridTracks } from './grid-tracks';
|
|
6
7
|
import type { LayoutAlign } from './layout-align';
|
|
7
8
|
import type { LayoutSpace } from './layout-space';
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Props of `Grid`: the shared `ControlProps` plus its own. Each prop is also a settable, reactive property. Every one but
|
|
11
|
+
* `inline` also takes values per breakpoint of the room it is laid out in: `columns={{ xs: 1, md: 2, xl: 4 }}`, each value
|
|
12
|
+
* holding from its breakpoint up to the next one given.
|
|
13
|
+
*/
|
|
9
14
|
export interface GridProps extends ControlProps {
|
|
10
15
|
/**
|
|
11
16
|
* The rows: `'auto 1fr 120'` (a bare number is in pixels, and `*` is `1fr`), a list, or a count. By default,
|
|
12
17
|
* rows are created as needed.
|
|
13
18
|
*/
|
|
14
|
-
rows?: Bind<GridTracks
|
|
19
|
+
rows?: Bind<Responsive<GridTracks>>;
|
|
15
20
|
/** The columns, in the same form as `rows`. The default is one column. */
|
|
16
|
-
columns?: Bind<GridTracks
|
|
21
|
+
columns?: Bind<Responsive<GridTracks>>;
|
|
17
22
|
/** The space between rows and columns. The default is the `layout.gap` token. */
|
|
18
|
-
gap?: Bind<LayoutSpace
|
|
23
|
+
gap?: Bind<Responsive<LayoutSpace>>;
|
|
19
24
|
/** The space between rows. It takes precedence over `gap`. */
|
|
20
|
-
rowGap?: Bind<LayoutSpace
|
|
25
|
+
rowGap?: Bind<Responsive<LayoutSpace>>;
|
|
21
26
|
/** The space between columns. It takes precedence over `gap`. */
|
|
22
|
-
columnGap?: Bind<LayoutSpace
|
|
27
|
+
columnGap?: Bind<Responsive<LayoutSpace>>;
|
|
23
28
|
/** The space inside the edges, one to four values as in CSS. There is none by default. */
|
|
24
|
-
padding?: Bind<LayoutSpace
|
|
29
|
+
padding?: Bind<Responsive<LayoutSpace>>;
|
|
25
30
|
/** The size of rows created as needed. A number is in pixels. The default is `'auto'`. */
|
|
26
|
-
autoRows?: Bind<number | string
|
|
31
|
+
autoRows?: Bind<Responsive<number | string>>;
|
|
27
32
|
/** The size of columns created as needed. A number is in pixels. The default is `'auto'`. */
|
|
28
|
-
autoColumns?: Bind<number | string
|
|
33
|
+
autoColumns?: Bind<Responsive<number | string>>;
|
|
29
34
|
/** How children without a position fill the grid. The default is `'row'`. */
|
|
30
|
-
flow?: Bind<GridFlow
|
|
35
|
+
flow?: Bind<Responsive<GridFlow>>;
|
|
31
36
|
/** The vertical alignment of children in their cells. The default is `'stretch'`. */
|
|
32
|
-
align?: Bind<LayoutAlign
|
|
37
|
+
align?: Bind<Responsive<LayoutAlign>>;
|
|
33
38
|
/** The horizontal alignment of children in their cells. The default is `'stretch'`. */
|
|
34
|
-
justify?: Bind<GridJustify
|
|
39
|
+
justify?: Bind<Responsive<GridJustify>>;
|
|
35
40
|
/** Flows within a line of text, as wide as its content. The default is `false`. */
|
|
36
41
|
inline?: Bind<boolean>;
|
|
37
42
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bind } from '@motifx/core';
|
|
2
2
|
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { Responsive } from '../../core/responsive';
|
|
3
4
|
import type { GroupBoxToggledEventArgs } from './group-box-toggled-event-args';
|
|
4
5
|
import type { GroupBoxVariant } from './group-box-variant';
|
|
5
6
|
import type { LayoutSpace } from './layout-space';
|
|
@@ -12,9 +13,9 @@ export interface GroupBoxProps extends ControlProps {
|
|
|
12
13
|
/** Hides the content (with `collapsible`). The default is `false`. */
|
|
13
14
|
collapsed?: Bind<boolean>;
|
|
14
15
|
/** The space inside the frame, one to four values as in CSS. The default is the `layout.group-box.padding` token. */
|
|
15
|
-
padding?: Bind<LayoutSpace
|
|
16
|
+
padding?: Bind<Responsive<LayoutSpace>>;
|
|
16
17
|
/** The space between the children. The default is the `layout.group-box.gap` token. */
|
|
17
|
-
gap?: Bind<LayoutSpace
|
|
18
|
+
gap?: Bind<Responsive<LayoutSpace>>;
|
|
18
19
|
/** The appearance of the box. The default is `'outline'`. */
|
|
19
20
|
variant?: Bind<GroupBoxVariant>;
|
|
20
21
|
/** Occurs when the content is shown or hidden, by the user or by code. */
|