@motifx-community/ui 0.1.0-beta.2 → 0.1.0-beta.3
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 +87 -12
- package/README.md +6 -6
- package/dist/components/accordion/Accordion.d.ts +3 -3
- package/dist/components/accordion/AccordionItem.d.ts +1 -1
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/contextmenu/ContextMenu.d.ts +1 -1
- package/dist/components/datagrid/DataGrid.d.ts +5 -5
- package/dist/components/datagrid/data-grid-props.d.ts +2 -2
- package/dist/components/datagrid/grid-adaptive-row-expanded-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-adaptive-row-expanding-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-grouping-changed-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-grouping-changing-event-args.d.ts +2 -2
- package/dist/components/datagrid/grid-master-detail.d.ts +1 -1
- package/dist/components/datagrid/grid-row-expanded-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-row-expanding-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-search-text-changed-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-search-text-changing-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-sort-changing-event-args.d.ts +1 -1
- package/dist/components/datagrid/model/GridSearch.d.ts +1 -1
- package/dist/components/draggable/Draggable.d.ts +99 -0
- package/dist/components/draggable/DropTarget.d.ts +38 -0
- package/dist/components/draggable/draggable-event-args.d.ts +17 -0
- package/dist/components/draggable/draggable-props.d.ts +37 -0
- package/dist/components/draggable/drop-event-args.d.ts +11 -0
- package/dist/components/draggable/drop-target-props.d.ts +13 -0
- package/dist/components/draggable/index.d.ts +6 -0
- package/dist/components/fileuploader/FileUploader.d.ts +1 -1
- package/dist/components/fileuploader/file-uploader-props.d.ts +1 -1
- package/dist/components/fileuploader/upload-mode.d.ts +1 -1
- package/dist/components/filterbuilder/FilterBuilder.d.ts +1 -1
- package/dist/components/gallery/Gallery.d.ts +132 -0
- package/dist/components/gallery/gallery-item-click-event-args.d.ts +9 -0
- package/dist/components/gallery/gallery-item.d.ts +18 -0
- package/dist/components/gallery/gallery-props.d.ts +38 -0
- package/dist/components/gallery/index.d.ts +6 -0
- package/dist/components/gallery/slide-changed-event-args.d.ts +11 -0
- package/dist/components/gallery/slide-changing-event-args.d.ts +14 -0
- package/dist/components/layout/ChildSettings.d.ts +1 -1
- package/dist/components/layout/DockPanel.d.ts +2 -2
- package/dist/components/layout/Grid.d.ts +1 -1
- package/dist/components/layout/SplitContainer.d.ts +1 -1
- package/dist/components/layout/Stack.d.ts +1 -1
- package/dist/components/multiview/MultiView.d.ts +87 -0
- package/dist/components/multiview/View.d.ts +41 -0
- package/dist/components/multiview/index.d.ts +6 -0
- package/dist/components/multiview/multi-view-props.d.ts +24 -0
- package/dist/components/multiview/view-props.d.ts +15 -0
- package/dist/components/multiview/view-selecting-event-args.d.ts +15 -0
- package/dist/components/multiview/view-selection-changed-event-args.d.ts +12 -0
- package/dist/components/numberbox/number-box-props.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/popover-props.d.ts +1 -1
- package/dist/components/resizable/Resizable.d.ts +84 -0
- package/dist/components/resizable/index.d.ts +3 -0
- package/dist/components/resizable/resizable-props.d.ts +41 -0
- package/dist/components/resizable/resize-event-args.d.ts +13 -0
- package/dist/components/scheduler/AppointmentEditor.d.ts +1 -1
- package/dist/components/scheduler/scheduler-props.d.ts +1 -1
- package/dist/components/scrollview/ScrollView.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/speeddial/SpeedDial.d.ts +129 -0
- package/dist/components/speeddial/index.d.ts +6 -0
- package/dist/components/speeddial/speed-dial-action-click-event-args.d.ts +9 -0
- package/dist/components/speeddial/speed-dial-action.d.ts +25 -0
- package/dist/components/speeddial/speed-dial-event-args.d.ts +8 -0
- package/dist/components/speeddial/speed-dial-props.d.ts +49 -0
- package/dist/components/speeddial/speed-dial-tooltip.d.ts +3 -0
- package/dist/components/splitter/SplitPane.d.ts +45 -0
- package/dist/components/splitter/Splitter.d.ts +116 -0
- package/dist/components/splitter/index.d.ts +6 -0
- package/dist/components/splitter/split-pane-props.d.ts +21 -0
- package/dist/components/splitter/splitter-collapse-event-args.d.ts +13 -0
- package/dist/components/splitter/splitter-props.d.ts +25 -0
- package/dist/components/splitter/splitter-resize-event-args.d.ts +10 -0
- package/dist/components/stepper/Stepper.d.ts +1 -1
- package/dist/components/stepper/WizardStep.d.ts +1 -1
- package/dist/components/stepper/step-changed-event-args.d.ts +1 -1
- package/dist/components/stepper/step-changing-event-args.d.ts +1 -1
- package/dist/components/stepper/wizard-props.d.ts +1 -1
- package/dist/components/tabdocs/TabDocumentManager.d.ts +1 -1
- package/dist/components/tabs/Tabs.d.ts +2 -2
- package/dist/components/tileview/TileView.d.ts +128 -0
- package/dist/components/tileview/index.d.ts +6 -0
- package/dist/components/tileview/tile-click-event-args.d.ts +9 -0
- package/dist/components/tileview/tile-reorder-event-args.d.ts +11 -0
- package/dist/components/tileview/tile-selection-changed-event-args.d.ts +11 -0
- package/dist/components/tileview/tile-view-item.d.ts +18 -0
- package/dist/components/tileview/tile-view-props.d.ts +38 -0
- package/dist/components/timeline/Timeline.d.ts +113 -0
- package/dist/components/timeline/index.d.ts +5 -0
- package/dist/components/timeline/timeline-item-click-event-args.d.ts +9 -0
- package/dist/components/timeline/timeline-item.d.ts +24 -0
- package/dist/components/timeline/timeline-props.d.ts +30 -0
- package/dist/components/timeline/timeline-selection-changed-event-args.d.ts +11 -0
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/treeview/TreeView.d.ts +1 -1
- package/dist/components/validationsummary/ValidationSummary.d.ts +56 -0
- package/dist/components/validationsummary/index.d.ts +3 -0
- package/dist/components/validationsummary/summary-item-click-event-args.d.ts +11 -0
- package/dist/components/validationsummary/validation-summary-props.d.ts +17 -0
- package/dist/core/control.d.ts +4 -4
- package/dist/core/flow-home.d.ts +1 -1
- package/dist/core/ui-strings.d.ts +26 -0
- package/dist/generated/tokens.d.ts +6390 -4745
- package/dist/index.d.ts +9 -0
- package/dist/index.js +5119 -759
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +22 -1
- package/dist/locales/tr.json +22 -1
- package/dist/parts/slide/slide-track-host.d.ts +19 -0
- package/dist/parts/slide/slide-track.d.ts +45 -0
- package/dist/styles.css +3072 -182
- package/dist/tokens/index.d.ts +6390 -4745
- package/dist/tokens/index.js +6390 -4745
- package/dist/tokens/index.js.map +1 -1
- package/dist/{tr-B218zMtu.js → tr-C5IXRzAH.js} +45 -3
- package/dist/{tr-B218zMtu.js.map → tr-C5IXRzAH.js.map} +1 -1
- package/docs/accordion.md +9 -9
- package/docs/actionsheet.md +2 -2
- package/docs/avatar.md +5 -5
- package/docs/badge.md +6 -6
- package/docs/bottomsheet.md +4 -4
- package/docs/breadcrumb.md +3 -3
- package/docs/button.md +8 -8
- package/docs/buttongroup.md +5 -5
- package/docs/calendar.md +6 -6
- package/docs/card.md +6 -6
- package/docs/checkbox.md +7 -7
- package/docs/chip.md +5 -5
- package/docs/colorbox.md +3 -3
- package/docs/combobox.md +7 -7
- package/docs/control.md +12 -12
- package/docs/datagrid-api.md +5 -5
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +2 -2
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +2 -2
- package/docs/datagrid-filtering.md +3 -3
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +1 -1
- package/docs/datagrid-layout.md +4 -4
- package/docs/datagrid-lookups.md +1 -1
- package/docs/datagrid-master-detail.md +3 -3
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +3 -3
- package/docs/datagrid.md +8 -8
- package/docs/datebox.md +6 -6
- package/docs/daterangebox.md +4 -4
- package/docs/draggable.md +194 -0
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +8 -8
- package/docs/fileuploader.md +4 -4
- package/docs/filterbuilder.md +7 -7
- package/docs/formlayout.md +1 -1
- package/docs/gallery.md +244 -0
- package/docs/home.md +11 -7
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +13 -13
- package/docs/listbox.md +8 -8
- package/docs/loadpanel.md +4 -4
- package/docs/lookup.md +1 -1
- package/docs/menus.md +2 -2
- package/docs/multiview.md +202 -0
- package/docs/numberbox.md +7 -7
- package/docs/pagination.md +4 -4
- package/docs/popover.md +11 -11
- package/docs/progress.md +7 -7
- package/docs/radiogroup.md +7 -7
- package/docs/rating.md +4 -4
- package/docs/resizable.md +139 -0
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +5 -5
- 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 +2 -2
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +4 -4
- package/docs/scrollview.md +5 -5
- package/docs/showcase.md +1 -1
- package/docs/skeleton.md +2 -2
- package/docs/slider.md +7 -7
- package/docs/sortable.md +2 -2
- package/docs/speeddial.md +290 -0
- package/docs/splitter.md +204 -0
- package/docs/stepper.md +5 -5
- package/docs/switch.md +7 -7
- package/docs/tabdocs-dock.md +3 -3
- 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 +5 -5
- package/docs/tabs.md +9 -9
- package/docs/tagbox.md +8 -8
- package/docs/textarea.md +7 -7
- package/docs/textbox.md +8 -8
- package/docs/tileview.md +206 -0
- package/docs/timeline.md +174 -0
- package/docs/toast.md +5 -5
- package/docs/tokens.md +333 -4
- package/docs/toolbar.md +6 -6
- package/docs/tooltip.md +12 -12
- package/docs/treeview.md +9 -9
- package/docs/validationsummary.md +115 -0
- package/docs/window.md +5 -5
- package/docs/wizard.md +9 -9
- package/llms-full.txt +2525 -379
- package/llms.txt +13 -4
- package/package.json +1 -1
package/docs/card.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Card
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A surface holding one thing: a picture, a header with an avatar and titles, content and a row of actions. Parts with nothing in them are left out.
|
|
6
6
|
|
|
@@ -10,16 +10,16 @@ A surface holding one thing: a picture, a header with an avatar and titles, cont
|
|
|
10
10
|
import { Card } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
|
-
Every prop takes a value or a function. Created with `new`, the same properties are set
|
|
15
|
+
Every prop takes a value or a function. Created with `new`, the same properties are set programmatically.
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
19
19
|
import { Button, Card, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** A card from JSX follows its functions; one made with `new` takes the same properties
|
|
22
|
-
export default function
|
|
21
|
+
/** A card from JSX follows its functions; one made with `new` takes the same properties programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ following: false });
|
|
24
24
|
const coded = new Card({ title: 'Made in code', subtitle: 'new Card({ … })', variant: 'outline' });
|
|
25
25
|
|
|
@@ -250,5 +250,5 @@ export default function Sizes() {
|
|
|
250
250
|
| Property | Access | Description |
|
|
251
251
|
| --- | --- | --- |
|
|
252
252
|
| `every prop above` | read/write | A value or a function, like the prop. |
|
|
253
|
-
| `contentPart` | read-only | The part holding the content, for adding to it
|
|
253
|
+
| `contentPart` | read-only | The part holding the content, for adding to it programmatically. |
|
|
254
254
|
| `avatarControl` | read-only | The avatar before the titles, when it has one. |
|
package/docs/checkbox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CheckBox
|
|
2
2
|
|
|
3
|
-
> Choice · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Choice · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A checkbox with its caption: checked, unchecked or indeterminate, three states on request, read-only, required and checked with its group. A native checkbox underneath, drawn from the design tokens.
|
|
6
6
|
|
|
@@ -10,21 +10,21 @@ A checkbox with its caption: checked, unchecked or indeterminate, three states o
|
|
|
10
10
|
import { CheckBox } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
|
-
Every prop takes a value or a function; `x-model` binds the value two-way. Created with `new`, the same properties are set
|
|
15
|
+
Every prop takes a value or a function; `x-model` binds the value two-way. Created with `new`, the same properties are set programmatically.
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
19
19
|
import { Button, CheckBox, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** A checkbox bound to state with x-model, and checkboxes created with `new` and added
|
|
22
|
-
export default function
|
|
21
|
+
/** A checkbox bound to state with x-model, and checkboxes created with `new` and added programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ remember: true, result: '' });
|
|
24
24
|
let added = 0;
|
|
25
25
|
let host: Stack | null = null;
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const addProgrammatic = () => {
|
|
28
28
|
const box = new CheckBox({ label: `Option ${++added}`, threeState: true });
|
|
29
29
|
box.onValueChanged((e) => (s.result = `${box.label}: ${String(e.value)}`));
|
|
30
30
|
host?.controls.add(box);
|
|
@@ -35,7 +35,7 @@ export default function FromCode() {
|
|
|
35
35
|
<>
|
|
36
36
|
<CheckBox label="&Remember me" x-model={() => s.remember} helpText={() => (s.remember ? 'You stay signed in.' : 'You sign in every time.')} />
|
|
37
37
|
<Stack orientation="horizontal" wrap align="center">
|
|
38
|
-
<Button text="Add a checkbox
|
|
38
|
+
<Button text="Add a checkbox programmatically" variant="outline" onclick={addProgrammatic} />
|
|
39
39
|
<output class="cb-result">{() => s.result}</output>
|
|
40
40
|
</Stack>
|
|
41
41
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
|
package/docs/chip.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chip and ChipGroup
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A short text with an icon or an avatar before it: a filter to turn on, a choice among a few, or something picked that can be removed. A group selects one or several and moves between them with the arrow keys.
|
|
6
6
|
|
|
@@ -10,16 +10,16 @@ A short text with an icon or an avatar before it: a filter to turn on, a choice
|
|
|
10
10
|
import { Chip, ChipGroup } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
|
-
Every prop takes a value or a function. Created with `new`, the same properties are set
|
|
15
|
+
Every prop takes a value or a function. Created with `new`, the same properties are set programmatically.
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
19
19
|
import { Chip, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** A chip from JSX follows its functions; one made with `new` takes the same properties
|
|
22
|
-
export default function
|
|
21
|
+
/** A chip from JSX follows its functions; one made with `new` takes the same properties programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ vegan: false });
|
|
24
24
|
const coded = new Chip({ text: 'Spicy', selectable: true });
|
|
25
25
|
|
package/docs/colorbox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ColorBox and ColorPicker
|
|
2
2
|
|
|
3
|
-
> Editors · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Editors · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A colour as a field, with a picker in a popup; or the picker on its own. The picker has an area of saturation and brightness, a hue strip, an opacity strip, inputs for the channels and preset colours.
|
|
6
6
|
|
|
@@ -20,8 +20,8 @@ import { ColorBox, Stack } from '@motifx-community/ui';
|
|
|
20
20
|
|
|
21
21
|
const PALETTE = ['#3b5bdb', '#1971c2', '#0c8599', '#2b8a3e', '#f08c00', '#e8590c', '#e03131', '#c2255c', '#862e9c', '#495057'];
|
|
22
22
|
|
|
23
|
-
/** A colour field bound with `x-model`: type a hex, or open the picker (Alt+Down); one made with `new`
|
|
24
|
-
export default function
|
|
23
|
+
/** A colour field bound with `x-model`: type a hex, or open the picker (Alt+Down); one made with `new` programmatically. */
|
|
24
|
+
export default function Programmatic() {
|
|
25
25
|
const s = reactive({ accent: '#3b5bdb' as string | null });
|
|
26
26
|
const coded = new ColorBox({ label: 'Made in code', value: '#2b8a3e', clearButton: true });
|
|
27
27
|
|
package/docs/combobox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ComboBox and Autocomplete
|
|
2
2
|
|
|
3
|
-
> Choice · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Choice · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A text field with a list that follows what is typed. The items come from memory or from a data source of the data layer, searched on the server. `Autocomplete` is the free-text kind: the value is the text.
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import { ComboBox, Autocomplete } from '@motifx-community/ui';
|
|
|
11
11
|
import { data } from '@motifx-community/data';
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Declarative and programmatic
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
17
|
/** The cities the combo boxes of the examples suggest. */
|
|
@@ -97,20 +97,20 @@ The items part is shared: `DataItems` feeds any list control from an array or a
|
|
|
97
97
|
|
|
98
98
|
## Example files
|
|
99
99
|
|
|
100
|
-
`
|
|
100
|
+
`Programmatic.tsx`
|
|
101
101
|
|
|
102
102
|
```tsx
|
|
103
103
|
import { reactive } from '@motifx/core';
|
|
104
104
|
import { Button, ComboBox, Stack } from '@motifx-community/ui';
|
|
105
105
|
import { cities } from './cities';
|
|
106
106
|
|
|
107
|
-
/** A combo box bound with x-model, and combo boxes created with `new` and added
|
|
108
|
-
export default function
|
|
107
|
+
/** A combo box bound with x-model, and combo boxes created with `new` and added programmatically. */
|
|
108
|
+
export default function Programmatic() {
|
|
109
109
|
const form = reactive({ city: 'İzmir' as string | null, result: '' });
|
|
110
110
|
let added = 0;
|
|
111
111
|
let host: Stack | null = null;
|
|
112
112
|
|
|
113
|
-
const
|
|
113
|
+
const addProgrammatic = () => {
|
|
114
114
|
const town = new ComboBox<string, string>({ label: `Town ${++added}`, items: cities, minSearchLength: 2 });
|
|
115
115
|
town.onValueChanged((e) => (form.result = `${town.label}: ${e.value ?? '—'}`));
|
|
116
116
|
host?.controls.add(town);
|
|
@@ -121,7 +121,7 @@ export default function FromCode() {
|
|
|
121
121
|
<>
|
|
122
122
|
<ComboBox label="&City" items={cities} x-model={() => form.city} clearButton />
|
|
123
123
|
<output class="cb-city">{() => `city: ${form.city ?? '—'}`}</output>
|
|
124
|
-
<Button text="Add a combo box
|
|
124
|
+
<Button text="Add a combo box programmatically" variant="outline" onclick={addProgrammatic} />
|
|
125
125
|
<output class="cb-made">{() => form.result}</output>
|
|
126
126
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
|
|
127
127
|
</>
|
package/docs/control.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Control
|
|
2
2
|
|
|
3
|
-
> Foundations · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Foundations · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
|
-
The base of every control in the package. It gives each one the same `text`, `enabled`, `visible` and `tabStop`, and the same focus methods, whether the control is written in JSX and bound to state or created with `new` and changed
|
|
5
|
+
The base of every control in the package. It gives each one the same `text`, `enabled`, `visible` and `tabStop`, and the same focus methods, whether the control is written in JSX and bound to state or created with `new` and changed programmatically.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ import { Control, type ControlProps } from '@motifx-community/ui';
|
|
|
12
12
|
|
|
13
13
|
Every component of the package ([Button](button.md), …) extends it; extend it for your own controls.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Declarative and programmatic
|
|
16
16
|
|
|
17
17
|
Both ways are complete; the developer using the control decides.
|
|
18
18
|
|
|
@@ -33,12 +33,12 @@ unread.text = () => `Unread (${this.mail.count})`; // a function is followed
|
|
|
33
33
|
```tsx
|
|
34
34
|
import { Button, Stack } from '@motifx-community/ui';
|
|
35
35
|
|
|
36
|
-
/** Buttons created with `new`, added to a container, and their text changed
|
|
37
|
-
export default function
|
|
36
|
+
/** Buttons created with `new`, added to a container, and their text changed programmatically on a click. */
|
|
37
|
+
export default function AddProgrammatically() {
|
|
38
38
|
let added = 0;
|
|
39
39
|
let target: Stack | null = null;
|
|
40
40
|
|
|
41
|
-
const
|
|
41
|
+
const addProgrammatic = () => {
|
|
42
42
|
const b = new Button({ text: `Button ${++added}` });
|
|
43
43
|
b.motif.on('click', () => (b.text = `${b.text} ✓`));
|
|
44
44
|
target?.controls.add(b);
|
|
@@ -46,7 +46,7 @@ export default function AddFromCode() {
|
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
48
|
<>
|
|
49
|
-
<Button text="Add a button
|
|
49
|
+
<Button text="Add a button programmatically" onclick={addProgrammatic} />
|
|
50
50
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (target = c)} />
|
|
51
51
|
</>
|
|
52
52
|
);
|
|
@@ -61,7 +61,7 @@ export default function AddFromCode() {
|
|
|
61
61
|
|
|
62
62
|
- With `x-model` the model always shows the control's state: a change by the user, by your code (`ctrl.value = …`, `select()`, `show()`) or by a rule you gave (`decimals`, a mask, `min` / `max`) is written back to it.
|
|
63
63
|
|
|
64
|
-
- A property set
|
|
64
|
+
- A property set programmatically takes the same: a function (`ctrl.enabled = () => !state.busy`) is bound in place of what was there and followed; a value (`ctrl.enabled = false`) drops what was bound, and from then on the code owns it.
|
|
65
65
|
|
|
66
66
|
- Every property is reactive to read: `{() => ctrl.text}` in JSX or a `bindings.watch` follows it, whichever way it changed.
|
|
67
67
|
|
|
@@ -84,7 +84,7 @@ If focus was inside, it moves to the next usable element in the same window (or
|
|
|
84
84
|
```tsx
|
|
85
85
|
import { Button, Panel, Stack } from '@motifx-community/ui';
|
|
86
86
|
|
|
87
|
-
/** A panel disabled and enabled
|
|
87
|
+
/** A panel disabled and enabled programmatically: everything inside follows, and the inner button keeps its own `enabled`. */
|
|
88
88
|
export default function EnabledPanel() {
|
|
89
89
|
let panel: Panel | null = null;
|
|
90
90
|
let inner: Button | null = null;
|
|
@@ -171,7 +171,7 @@ class Badge extends Control<HTMLSpanElement, BadgeProps> {
|
|
|
171
171
|
| --- | --- |
|
|
172
172
|
| `static elementTag` | The root element. `div` unless the subclass sets another (`button` for a button). |
|
|
173
173
|
| `focusElement` | Getter: the element that takes focus; the root by default. Composite controls override it. It runs from the constructor, so derive it from `this.element`. |
|
|
174
|
-
| `observeProperty(name, apply)` | Renders a property without an effect: `apply` runs now and on every change, from a getter prop or
|
|
174
|
+
| `observeProperty(name, apply)` | Renders a property without an effect: `apply` runs now and on every change, from a getter prop or programmatically. |
|
|
175
175
|
| `getProperty(name) / setProperty(name, value)` | The storage behind the shared properties, for your own: tracked read, and set-from-code (which replaces a bound getter). |
|
|
176
176
|
| `bindProperty(name, prop)` | Binds one of your own props: a getter is read now and followed by a binding of the control (so `reState()` reads it again), a value is stored once. Call it from your constructor. |
|
|
177
177
|
| `applyProperty(name, value) / peekProperty(name)` | Render your own properties without an effect: override `applyProperty` (call `super`); read the current value untracked with `peekProperty`. Can run from the constructor: touch only `this.element`. |
|
|
@@ -187,7 +187,7 @@ The base adds no listeners per control and pays only for what is used.
|
|
|
187
187
|
| `A plain value (`enabled={false}`, `new Badge({ text })`)` | Stored and written to the DOM once. |
|
|
188
188
|
| `A getter (`enabled={() => !state.busy}`)` | One binding for that property, stopped when the control is disposed or another value or function is set. |
|
|
189
189
|
| `Reading a property` | A small change counter, created the first time someone reads it. |
|
|
190
|
-
| `Setting
|
|
190
|
+
| `Setting programmatically` | A direct DOM write; readers are notified through the counter. |
|
|
191
191
|
| ``enabled = false`` | One pass over the control's subtree, plus one shared observer while anything is disabled (it disappears when nothing is). |
|
|
192
192
|
|
|
193
193
|
## API reference
|
|
@@ -207,7 +207,7 @@ The base adds no listeners per control and pays only for what is used.
|
|
|
207
207
|
|
|
208
208
|
| Property | Type | Access | Description |
|
|
209
209
|
| --- | --- | --- | --- |
|
|
210
|
-
| `text` | `string` | read/write, reactive | Set
|
|
210
|
+
| `text` | `string` | read/write, reactive | Set programmatically with a value or a function, like the prop (see "How a property gets its value"). |
|
|
211
211
|
| `enabled` | `boolean` | read/write, reactive | This control's own value, as set or bound (like the HTML `disabled` attribute). |
|
|
212
212
|
| `isEnabled` | `boolean` | read-only, reactive | Whether it can be used now: enabled itself and in every control it sits in (like CSS `:enabled`). Windows shown inside do not inherit it. |
|
|
213
213
|
| `visible` | `boolean` | read/write, reactive | This control's own value; a hidden parent does not change it. |
|
package/docs/datagrid-api.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid: API reference
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
## Columns
|
|
6
6
|
|
|
@@ -185,13 +185,13 @@ export interface Order {
|
|
|
185
185
|
| `filterValue, filterEnabled` | `Bind<data.FilterExpression \| null>`, `Bind<boolean>` | `null`, `true` | The filter value the filter panel shows and the builder edits (with `filterSyncEnabled`, the filter row's and header filters' too) and whether it applies; functions are followed, the user's changes come in `onFilterChanged`. See [Filter panel and builder](datagrid-filtering.md#filter-panel). |
|
|
186
186
|
| `filterPanelText, filterBuilder, filterBuilderPopup` | function, objects | — | The panel's text; the builder's props (any of `FilterBuilder` but `value` and `fields`); its window (`title`, `width`, `height`, …). |
|
|
187
187
|
| `onFilterBuilderOpening / Opened / Closing / Closed` | `(e) => void` | — | The builder's window opens and closes; the `…ing` ones cancel (`e.apply` says whether OK was pressed). |
|
|
188
|
-
| `searchText / onSearchTextChanged` | `Bind<string>` / `(e) => void` | `''` | The search panel’s text (a function is followed); told when it changes, typed or set
|
|
188
|
+
| `searchText / onSearchTextChanged` | `Bind<string>` / `(e) => void` | `''` | The search panel’s text (a function is followed); told when it changes, typed or set programmatically (`{ text }`). The two together bind it both ways. |
|
|
189
189
|
| `toolbar` | `{ visible?: Bind<boolean>, items?: Bind<(GridToolbarItem \| GridToolbarItemName)[]> }` | the items whose features are on | The bar above the rows: which items, in which order and place; `visible` left out shows it while it has an item. |
|
|
190
190
|
| `export` | `{ formats?, allowExportSelectedData?, texts? }`, each a `Bind` | `{ formats: ['csv'] }` | What the toolbar’s export button (`exportButton`) offers: a command per format (`'xlsx'`, `'csv'`, any of your own), and “Export selected rows” for each with `allowExportSelectedData`; one command is a plain button, more a menu. `texts`: `exportTo`, `exportAll`, `exportSelectedRows` (`{format}` is the format’s name), `formats` (names by code). Live through `grid.export`. |
|
|
191
191
|
| `onRowExpanding / onRowExpanded` | `(e) => void` | — | Before and after a group or a row's details open: `{ kind, key, row }` — `kind: 'group'` with the values of the groups from the top level down, or `kind: 'detail'` with the row's key and the row; `e.cancel = true` keeps it closed. |
|
|
192
192
|
| `onRowCollapsing / onRowCollapsed` | `(e) => void` | — | Before and after a group or a row's details close; `e.cancel = true` keeps it open. |
|
|
193
193
|
| `masterDetail` | `GridMasterDetail<T>`, each field a `Bind` | `{ enabled: false }` | Details under the rows: the expand column (`enabled`), what they hold (`template`), `autoExpandAll`, `canExpand`, `keepDetails`, `keepAcrossPages`, `keepLimit`, `height`, `estimatedHeight`, `columnWidth`, `toggleKeys`, `arrowKeys`. Live through `grid.masterDetail`. See [Master-detail](datagrid-master-detail.md#master-detail). |
|
|
194
|
-
| `onGroupingChanging / onGroupingChanged` | `(e) => void` | — | Before and after the grouping changes, by the user or
|
|
194
|
+
| `onGroupingChanging / onGroupingChanged` | `(e) => void` | — | Before and after the grouping changes, by the user or programmatically: `{ group, previous, byUser }`; `e.cancel = true` keeps it. |
|
|
195
195
|
| `onGroupDropping` | `(e) => void` | — | A header or a chip dropped to change the grouping: `{ field, from, to, index }`; `e.cancel = true` cancels the drop. |
|
|
196
196
|
| `groupCell` | `(ctx) => component` | — | Content of your own in the group rows of columns without a `groupCell`. |
|
|
197
197
|
| `summary` | `Bind<GridSummary>` | — | The summaries: `totalItems` in the row under the rows, `groupItems` in group rows and footers, and how they are worked out. See [Summaries](datagrid-grouping.md#summaries). |
|
|
@@ -257,7 +257,7 @@ export interface Order {
|
|
|
257
257
|
| `selectRow(row, add?) / deselectRow(row) / isSelected(row)` | | One row in or out of the selection. |
|
|
258
258
|
| `selectAll() / clearSelection()` | | Every row of the filter, loaded or not; none. |
|
|
259
259
|
| `clearFilters()` | | Takes every filter away, the filter value too, and the search text. |
|
|
260
|
-
| `openFilterBuilder() / closeFilterBuilder(apply?) / clearFilterValue()` | `boolean` / `boolean` / `void` | The filter panel's builder window and its Clear,
|
|
260
|
+
| `openFilterBuilder() / closeFilterBuilder(apply?) / clearFilterValue()` | `boolean` / `boolean` / `void` | The filter panel's builder window and its Clear, programmatically. |
|
|
261
261
|
| `searchByText(text)` | `void` | Searches for a text at once, as the search panel does; `''` stops searching. |
|
|
262
262
|
| `showColumnChooser()` | `void` | Opens the column list, under the toolbar’s column button when it shows. |
|
|
263
263
|
| `expandAll(level?) / collapseAll(level?)` | `void` | Opens or closes every group of a level (0 is the top level), or of every level. |
|
|
@@ -285,7 +285,7 @@ export interface Order {
|
|
|
285
285
|
| `focusCell(i, field?) / editCell(i, field) / editRow(i) / closeEditCell()` | `boolean` | Moves the active cell as the arrows do; opens a cell’s editor, or the first one of a row (in the form modes its form); keeps the open editor’s value and closes it. |
|
|
286
286
|
| `editRowByKey(key)` | `boolean` | `editRow` for the row with this key, while it is loaded. |
|
|
287
287
|
| `saveEditData() / cancelEditData()` | `Promise<boolean>` / `void` | Saves or gives up what is being edited, as Save and Cancel do: the edit form, else the row being edited; in batch mode every unsaved change. |
|
|
288
|
-
| `beginUpdate() / endUpdate()` | `void` | Changes
|
|
288
|
+
| `beginUpdate() / endUpdate()` | `void` | Changes programmatically in between lay the rows out once, at the last `endUpdate()`. |
|
|
289
289
|
| `repaint()` | `void` | Draws again, without loading, what shows your data: the rows, their details and adaptive detail, the group rows and footers, the totals, the toolbar and the actions (after a row, an option or what a template or `onRowPrepared` reads was changed in place). |
|
|
290
290
|
| `repaintRows(keys)` | `void` | Draws again only the rows with these keys, with their actions and details: after you changed those rows in place. |
|
|
291
291
|
| `refreshSummary()` | `void` | Reads the summary items again and works the values out again: after an item, the items or the rows’ values were changed in place. |
|
package/docs/datagrid-bands.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid: Selecting by dragging
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
## Rows
|
|
6
6
|
|
|
@@ -40,7 +40,7 @@ export interface Order {
|
|
|
40
40
|
|
|
41
41
|
## Over 100,000 rows
|
|
42
42
|
|
|
43
|
-
Ranges are marks on the cells drawn now: the pooled rows and, with virtual columns, the columns in view. Drawing one over 100,000 rows × 60 columns keeps the frame rate, and a change of a range writes only the marks that changed, never a cell's text. The buttons set ranges by key
|
|
43
|
+
Ranges are marks on the cells drawn now: the pooled rows and, with virtual columns, the columns in view. Drawing one over 100,000 rows × 60 columns keeps the frame rate, and a change of a range writes only the marks that changed, never a cell's text. The buttons set ranges by key programmatically.
|
|
44
44
|
|
|
45
45
|
```tsx
|
|
46
46
|
import { reactive } from '@motifx/core';
|
package/docs/datagrid-drag.md
CHANGED
package/docs/datagrid-editing.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid: Editing
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
## Editing and save modes
|
|
6
6
|
|
|
@@ -131,7 +131,7 @@ export interface Order {
|
|
|
131
131
|
|
|
132
132
|
| Member | Gets / returns | What it does |
|
|
133
133
|
| --- | --- | --- |
|
|
134
|
-
| `onActionRunning` | `{ action, rows, selection, location, cancel }` | An action is about to run (in a row, a bar, a row’s menu or
|
|
134
|
+
| `onActionRunning` | `{ action, rows, selection, location, cancel }` | An action is about to run (in a row, a bar, a row’s menu or programmatically); `cancel` keeps it from running. `rows` is empty for a selection that is not loaded. |
|
|
135
135
|
| `onActionRan` | `{ action, rows, location, done, failed, canceled, errors }` | An action ran. Without a listener, what failed rows threw goes to the console. |
|
|
136
136
|
| `runAction(id, rows?)` | `Promise<GridActionRanEventArgs \| null>` | Runs an action on `rows`, or on the rows the bars act on now, where it is visible and enabled; `null` when it is not there or was cancelled. |
|
|
137
137
|
| `actionTargets` | `T[]`, reactive | The rows the bars act on now; empty for a selection that is not loaded. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid: Filtering and search
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
## Filters
|
|
6
6
|
|
|
@@ -55,7 +55,7 @@ export class SlowAdapter<T extends object, K> extends data.ArrayAdapter<T, K> {
|
|
|
55
55
|
| `filterPanelText` | The panel's text, from the one it would show. `({ text, filterValue }) => string`. |
|
|
56
56
|
| `filterBuilder` | Any prop of `FilterBuilder` but `value` and `fields` (`customOperations`, `maxGroupLevel`, `groupOperations`, its events…); live as `grid.filterBuilder`. `GridFilterBuilderOptions`, default `{}`. |
|
|
57
57
|
| `filterBuilderPopup` | The window: `title`, `showTitle`, `width` (`'40rem'`), `height`, `resizable`, `movable`, `showCloseButton`, `showMaximize`, `fullScreen`; live as `grid.filterBuilderPopup`. `GridFilterBuilderPopup`, default `{}`. |
|
|
58
|
-
| `openFilterBuilder(), closeFilterBuilder(apply?), clearFilterValue()` | What the panel does,
|
|
58
|
+
| `openFilterBuilder(), closeFilterBuilder(apply?), clearFilterValue()` | What the panel does, programmatically. `filterText` is the panel's text, `filterBuilderInstance` the open builder. |
|
|
59
59
|
| `onFilterBuilderOpening / Opened, onFilterBuilderClosing / Closed` | `e.cancel` keeps the builder closed, or open; `e.apply` / `e.applied` say whether OK was pressed. `onFilterChanging` (cancelable) and `onFilterChanged` carry `filterValue` and `filterEnabled` too. |
|
|
60
60
|
|
|
61
61
|
## Ranges, dates and entries
|
|
@@ -80,7 +80,7 @@ export interface Order {
|
|
|
80
80
|
|
|
81
81
|
## Search panel
|
|
82
82
|
|
|
83
|
-
`searchPanel` puts a search box in the toolbar: its text is looked for in every searchable column at once, after a short typing pause. Each column reads it by its type — text columns contain it (without case, in the locale), number, date and yes/no columns match it when it reads as one of their values, list columns by their option texts — and the columns are joined with OR, then with the filter row and the header filter with AND. A text no column can read leaves no row. The filter goes to the data source like any other (`data.where`, `data.or`), so a server runs it; what was found is marked in the cells. `searchText` binds the text both ways with `onSearchTextChanged`; `searchByText()` searches
|
|
83
|
+
`searchPanel` puts a search box in the toolbar: its text is looked for in every searchable column at once, after a short typing pause. Each column reads it by its type — text columns contain it (without case, in the locale), number, date and yes/no columns match it when it reads as one of their values, list columns by their option texts — and the columns are joined with OR, then with the filter row and the header filter with AND. A text no column can read leaves no row. The filter goes to the data source like any other (`data.where`, `data.or`), so a server runs it; what was found is marked in the cells. `searchText` binds the text both ways with `onSearchTextChanged`; `searchByText()` searches programmatically.
|
|
84
84
|
|
|
85
85
|
A lookup column is searched by its texts: the lookup source — here a customers service apart from the sales' server — is asked for the items whose text holds the search (at most `searchLimit`), and their keys go to the rows' server as `customerId in [...]`. A column with a `textFrom` field searches that field of the row instead.
|
|
86
86
|
|
package/docs/datagrid-forms.md
CHANGED
package/docs/datagrid-layout.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid: Layout and events
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
## Toolbar
|
|
6
6
|
|
|
@@ -162,7 +162,7 @@ export interface Order {
|
|
|
162
162
|
|
|
163
163
|
## Events
|
|
164
164
|
|
|
165
|
-
Every action of the user has an event, given as a prop or listened to with `grid.onX((e) => …)`; one that is about to happen (`…ing`) can be stopped with `e.cancel = true`, and most can change what happens (the values sent, the items of a menu, the text copied). Here amounts over 900 are drawn in bold, the rows get a menu of their own (right click, or Shift + F10), a change to “Cancelled” is not saved, and the list tells what happened. Methods do the same
|
|
165
|
+
Every action of the user has an event, given as a prop or listened to with `grid.onX((e) => …)`; one that is about to happen (`…ing`) can be stopped with `e.cancel = true`, and most can change what happens (the values sent, the items of a menu, the text copied). Here amounts over 900 are drawn in bold, the rows get a menu of their own (right click, or Shift + F10), a change to “Cancelled” is not saved, and the list tells what happened. Methods do the same programmatically: `editCell`, `cellValue`, `navigateToRow`, `columnOption`, `state()` and the others in the [API reference](datagrid-api.md#api).
|
|
166
166
|
|
|
167
167
|
```tsx
|
|
168
168
|
/** An order, as the examples' made-up server keeps it. */
|
|
@@ -199,13 +199,13 @@ export interface Order {
|
|
|
199
199
|
| `onFocusedRowChanging / onFocusedRowChanged` | `{ rowIndex, previousRowIndex, row }` / `{ rowIndex, row, key }` | yes / — | The active row changes. |
|
|
200
200
|
| `onKeyHandling` | `{ event, rowIndex, field }` | yes | A key went down in the rows, an editor, the filter row or a group chip, before the grid handles it; cancel and handle it yourself. DevExtreme calls it `onKeyDown`, a DOM event name in JSX. |
|
|
201
201
|
| `onOptionChanged` | `{ name, field?, value, previous }` | | A setting was assigned: `grid.settings`, `columnSettings(field)` (with `field`), `toolbar` (`toolbar.visible`, `toolbar.items`), `columnOption` (with `field`); a column was added or taken out (`name: 'columns'`, the fields). |
|
|
202
|
-
| `onSortChanging / onSortChanged` | `{ sort, previous, byUser }` | yes / — | The sort is about to change, by the user or
|
|
202
|
+
| `onSortChanging / onSortChanged` | `{ sort, previous, byUser }` | yes / — | The sort is about to change, by the user or programmatically. |
|
|
203
203
|
| `onFilterChanging / onFilterChanged` | `{ filters, previous }` / `{ filters, filter }` | yes / — | The filter row and header filters are about to apply; cancel puts the ones before back in the cells. |
|
|
204
204
|
| `onSearchTextChanging / onSearchTextChanged` | `{ text, previous }` / `{ text }` | yes / — | The search text is about to change; cancel keeps the one before in the box. |
|
|
205
205
|
| `onPageChanging / onPageChanged` | `{ page, previous }` | yes / — | Another page is about to show. |
|
|
206
206
|
| `onPageSizeChanging / onPageSizeChanged` | `{ pageSize, previous }` | yes / — | The rows per page are about to change (0: all); the grid goes back to the first page. |
|
|
207
207
|
| `onMoreRowsLoading / onMoreRowsLoaded` | `{ skip, take }` / `{ skip, count, ended }` | yes / — | Infinite mode: the next part of the rows is about to load; it came. |
|
|
208
|
-
| `onSelectionChanging / onSelectionChanged` | `{ selection, previous }` / `{ selection }` | yes / — | The selection is about to change, by the user or
|
|
208
|
+
| `onSelectionChanging / onSelectionChanged` | `{ selection, previous }` / `{ selection }` | yes / — | The selection is about to change, by the user or programmatically. |
|
|
209
209
|
| `onLayoutChanging / onLayoutChange` | `{ layout, previous }` / `layout` | yes / — | The user resized, moved, hid, pinned, sorted or reset; cancel puts the layout before back. |
|
|
210
210
|
| `onGroupingChanging / onGroupingChanged, onGroupDropping` | see [Grouping](datagrid-grouping.md#grouping) | yes | The grouping; a dropped header or chip. |
|
|
211
211
|
| `onRowExpanding / onRowExpanded, onRowCollapsing / onRowCollapsed` | `{ kind, key, row }` | yes / — | A group (`kind: 'group'`) or a row's details (`kind: 'detail'`) open or close. |
|
package/docs/datagrid-lookups.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid: Master-detail
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
## Master-detail
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ export function makeCustomers(n: number): Customer[] {
|
|
|
30
30
|
|
|
31
31
|
| Option | Type | Default | What it does |
|
|
32
32
|
| --- | --- | --- | --- |
|
|
33
|
-
| `masterDetail.enabled` | `Bind<boolean>` | `false` | The expand column, after the status and check box columns and pinned like them: the user opens and closes the details. Off, they open
|
|
33
|
+
| `masterDetail.enabled` | `Bind<boolean>` | `false` | The expand column, after the status and check box columns and pinned like them: the user opens and closes the details. Off, they open programmatically only. |
|
|
34
34
|
| `masterDetail.template` | `(ctx: DetailContext<T>) => unknown` | — | What a row’s details hold: a component (another `DataGrid`, a `FormLayout`, `Tabs` …), an element or a text. Made the first time the details show. `ctx`: `row` (the row itself) and `rowIndex`, both read again in getters when the row shows another one and on `grid.repaint()` or `grid.repaintRows(keys)`, `key`, `grid`, `collapse()`. |
|
|
35
35
|
| `masterDetail.autoExpandAll` | `Bind<boolean>` | `false` | Every row starts open. Changing it, `enabled` or `template` opens or closes every row again. |
|
|
36
36
|
| `masterDetail.canExpand` | `Bind<boolean> \| (row) => boolean` | `true` | Whether a row has details; a row without has no arrow, and `expandRow` leaves it closed. New rows not saved yet have none. |
|
|
@@ -89,7 +89,7 @@ The arrow is a button with `aria-expanded` and `aria-controls`; the row says `ar
|
|
|
89
89
|
|
|
90
90
|
| Event | Gets | When |
|
|
91
91
|
| --- | --- | --- |
|
|
92
|
-
| `onRowExpanding / onRowCollapsing` | `{ kind: 'detail', key, row, cancel }` | A row’s details are about to open or close, by the user or
|
|
92
|
+
| `onRowExpanding / onRowCollapsing` | `{ kind: 'detail', key, row, cancel }` | A row’s details are about to open or close, by the user or programmatically; `cancel` keeps them as they are. The same events as for groups (`kind: 'group'`). |
|
|
93
93
|
| `onRowExpanded / onRowCollapsed` | `{ kind: 'detail', key, row }` | They opened or closed. |
|
|
94
94
|
| `onRowPrepared` | `{ rowType: 'detail', row, rowIndex, element }` | A row’s details were drawn for a row. |
|
|
95
95
|
| `onOptionChanged` | `{ name: 'masterDetail.enabled', value, previous }` | A `masterDetail` option was assigned through `grid.masterDetail`. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid: Selection and export
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
## Selection
|
|
6
6
|
|
|
@@ -308,7 +308,7 @@ import { Button, CheckBox, DataGrid, Stack } from '@motifx-community/ui';
|
|
|
308
308
|
import type { Order } from './order';
|
|
309
309
|
import { columns, makeOrders } from './orders';
|
|
310
310
|
|
|
311
|
-
/** Ctrl+C and Ctrl+V as tab-separated text, and the same
|
|
311
|
+
/** Ctrl+C and Ctrl+V as tab-separated text, and the same programmatically. */
|
|
312
312
|
export default function Clipboard() {
|
|
313
313
|
const s = reactive({ raw: false, headers: false, newRows: false, copied: '' });
|
|
314
314
|
let grid: DataGrid<Order> | null = null;
|
|
@@ -340,7 +340,7 @@ export default function Clipboard() {
|
|
|
340
340
|
ref={(g: DataGrid<Order>) => (grid = g)}
|
|
341
341
|
/>
|
|
342
342
|
<Stack orientation="horizontal" wrap align="center">
|
|
343
|
-
<Button text="Copy
|
|
343
|
+
<Button text="Copy programmatically" variant="outline" onclick={() => (s.copied = grid?.copy() ?? '')} />
|
|
344
344
|
<Button text="Paste two lines at the active cell" variant="outline" onclick={() => grid?.paste('Ada Lovelace\tİzmir\nGrace Hopper\tAnkara')} />
|
|
345
345
|
<output class="dg-copied">{() => (s.copied ? `Copied: ${s.copied.replace(/\t/g, ' → ').replace(/\r?\n/g, ' ¶ ')}` : '')}</output>
|
|
346
346
|
</Stack>
|
package/docs/datagrid.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataGrid
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A grid for data entry and large data: rows in memory or from any adapter of the data layer, a virtual list or pages, sorting, column layout, editing with the kit's editors, new rows with the Tab chain, three save modes, row actions, selection, filters, a search panel, grouping, summaries, a toolbar, lookup columns from other services, copy and paste, export and a layout that is kept — and every feature can be turned off, for the grid or for one column.
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import { DataGrid, type GridColumn } from '@motifx-community/ui';
|
|
|
11
11
|
import { data } from '@motifx-community/data';
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Declarative and programmatic
|
|
15
15
|
|
|
16
16
|
Give rows in memory with `rows` and their key with `rowKey`; the grid puts them in a `DataSource` over an `ArrayAdapter` itself. Every prop takes a value or a function. Created with `new`, the grid is an object like any other: add it, sort it, ask it.
|
|
17
17
|
|
|
@@ -77,7 +77,7 @@ export class SlowAdapter<T extends object, K> extends data.ArrayAdapter<T, K> {
|
|
|
77
77
|
|
|
78
78
|
## Pager
|
|
79
79
|
|
|
80
|
-
The pager under the rows shows the page sizes (`pageSizeSelector`, the sizes of `allowedPageSizes`, `all` for one page with every row), “Page 3 of 12 (250 items)” (`pagerInfo`, `pagerInfoText` with `{0}`, `{1}`, `{2}`), the first, previous, next and last buttons (`pagerNavigation`) and the pages around the current one (`pagerNeighbors`). `pagerDisplayMode` picks its look: `full` with page buttons and the sizes as buttons, `compact` with a box for the page number and a drop-down of the sizes, `adaptive` (the default) full while it fits in the grid's width. The rows per page change
|
|
80
|
+
The pager under the rows shows the page sizes (`pageSizeSelector`, the sizes of `allowedPageSizes`, `all` for one page with every row), “Page 3 of 12 (250 items)” (`pagerInfo`, `pagerInfoText` with `{0}`, `{1}`, `{2}`), the first, previous, next and last buttons (`pagerNavigation`) and the pages around the current one (`pagerNeighbors`). `pagerDisplayMode` picks its look: `full` with page buttons and the sizes as buttons, `compact` with a box for the page number and a drop-down of the sizes, `adaptive` (the default) full while it fits in the grid's width. The rows per page change programmatically with `pageSize(n)` too; either way `onPageSizeChanging` can keep the old size, the grid goes back to the first page, and with `layoutKey` the size is kept with the layout. PageUp and PageDown turn the page (`pageKeys`).
|
|
81
81
|
|
|
82
82
|
```tsx
|
|
83
83
|
/** An order, as the examples' made-up server keeps it. */
|
|
@@ -95,7 +95,7 @@ export interface Order {
|
|
|
95
95
|
|
|
96
96
|
## Example files
|
|
97
97
|
|
|
98
|
-
`
|
|
98
|
+
`Programmatic.tsx`
|
|
99
99
|
|
|
100
100
|
```tsx
|
|
101
101
|
import { reactive } from '@motifx/core';
|
|
@@ -103,8 +103,8 @@ import { Button, DataGrid, Stack } from '@motifx-community/ui';
|
|
|
103
103
|
import type { Order } from './order';
|
|
104
104
|
import { columns, makeOrders, newOrder } from './orders';
|
|
105
105
|
|
|
106
|
-
/** Rows in memory given with `rows`, rows added
|
|
107
|
-
export default function
|
|
106
|
+
/** Rows in memory given with `rows`, rows added programmatically, and a grid created with `new`. */
|
|
107
|
+
export default function Programmatic() {
|
|
108
108
|
const s = reactive({ orders: makeOrders(40) });
|
|
109
109
|
let grid: DataGrid<Order> | null = null;
|
|
110
110
|
let host: Stack | null = null;
|
|
@@ -139,9 +139,9 @@ export default function FromCode() {
|
|
|
139
139
|
ref={(g: DataGrid<Order>) => (grid = g)}
|
|
140
140
|
/>
|
|
141
141
|
<Stack orientation="horizontal" wrap align="center">
|
|
142
|
-
<Button text="Add a row
|
|
142
|
+
<Button text="Add a row programmatically" variant="outline" onclick={() => void grid?.addRow({ customer: 'Ada Lovelace' })} />
|
|
143
143
|
<Button text="Push an order into the array" variant="outline" onclick={pushOrder} />
|
|
144
|
-
<Button text="Add a grid
|
|
144
|
+
<Button text="Add a grid programmatically" variant="outline" onclick={addGrid} />
|
|
145
145
|
<output class="dg-local-count">{() => `${s.orders.length} orders in the array`}</output>
|
|
146
146
|
</Stack>
|
|
147
147
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
|