@nexxtmove/ui 1.52.0 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/editor/composables/useRadioGrid.d.ts +48 -0
- package/dist/components/editor/molecules/EditorAlignItems/EditorAlignItems.vue.d.ts +2 -2
- package/dist/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.vue.d.ts +101 -0
- package/dist/components/editor/molecules/EditorGap/EditorGap.vue.d.ts +32 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1525 -1153
- package/dist/nuxt.js +1 -0
- package/package.json +1 -1
- package/src/components/editor/composables/useRadioGrid.ts +155 -0
- package/src/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.vue +515 -0
- package/src/components/editor/molecules/EditorAnchor/EditorAnchor.vue +25 -41
- package/src/components/editor/molecules/EditorAnchor/__snapshots__/EditorAnchor.test.ts.snap +65 -0
- package/src/components/editor/molecules/EditorGap/EditorGap.vue +76 -2
- package/src/components/editor/molecules/EditorGap/__snapshots__/EditorGap.test.ts.snap +103 -0
- package/src/components.json +1 -0
- package/src/index.ts +9 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComponentPublicInstance, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Keyboard behaviour of a two-dimensional radiogroup (WAI-ARIA APG radio group,
|
|
4
|
+
* in 2D): one tab stop, arrows that move *and* choose, no wrap at the edges.
|
|
5
|
+
*
|
|
6
|
+
* Positions are cell indices in reading order, `row * columns + column`. A
|
|
7
|
+
* radio that spans several cells (a band) is registered on one of its cells;
|
|
8
|
+
* `positions` lists those, so the arrows only move along the radios that
|
|
9
|
+
* exist. Cell rendering stays with the component.
|
|
10
|
+
*/
|
|
11
|
+
export interface UseRadioGridOptions {
|
|
12
|
+
/** Number of rows of the grid. */
|
|
13
|
+
rows: MaybeRefOrGetter<number>;
|
|
14
|
+
/** Number of columns of the grid. */
|
|
15
|
+
columns: MaybeRefOrGetter<number>;
|
|
16
|
+
/**
|
|
17
|
+
* The positions that hold a radio, in any order. Defaults to every cell. An
|
|
18
|
+
* arrow towards a cell that is not in here does not move.
|
|
19
|
+
*/
|
|
20
|
+
positions?: MaybeRefOrGetter<readonly number[]>;
|
|
21
|
+
/** The chosen position, or `null` while no radio is chosen. */
|
|
22
|
+
selected: MaybeRefOrGetter<number | null>;
|
|
23
|
+
/**
|
|
24
|
+
* The position that takes the tab stop while none is chosen. Without one, or
|
|
25
|
+
* when it returns a position that holds no radio, the first position does.
|
|
26
|
+
*/
|
|
27
|
+
preferred?: () => number | null;
|
|
28
|
+
/**
|
|
29
|
+
* What Home and End jump to: the first and last radio of the current row, or
|
|
30
|
+
* of the whole grid. Defaults to `'grid'`.
|
|
31
|
+
*/
|
|
32
|
+
homeEnd?: 'row' | 'grid';
|
|
33
|
+
/** Called with the position an arrow, Home or End lands on. */
|
|
34
|
+
onChoose: (position: number) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Called when the focus leaves the grid after one or more keyboard choices:
|
|
37
|
+
* the end of a keyboard run, where a consumer closes its undo step.
|
|
38
|
+
*/
|
|
39
|
+
onLeave?: () => void;
|
|
40
|
+
}
|
|
41
|
+
export declare const useRadioGrid: (options: UseRadioGridOptions) => {
|
|
42
|
+
tabStop: import('vue').ComputedRef<number>;
|
|
43
|
+
cellRef: (position: number) => (el: Element | ComponentPublicInstance | null) => void;
|
|
44
|
+
onKeydown: (event: KeyboardEvent, position: number) => void;
|
|
45
|
+
onFocusout: (event: FocusEvent) => void;
|
|
46
|
+
reset: () => void;
|
|
47
|
+
focusTabStop: () => void;
|
|
48
|
+
};
|
|
@@ -56,10 +56,10 @@ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorAlignItemsP
|
|
|
56
56
|
/** The selected alignment, as the Tailwind class to apply. */
|
|
57
57
|
modelValue: EditorAlignItemsValue;
|
|
58
58
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
59
|
-
"update:modelValue": (value: "items-center" | "items-
|
|
59
|
+
"update:modelValue": (value: "items-center" | "items-start" | "items-end" | "items-stretch") => any;
|
|
60
60
|
}, string, import('vue').PublicProps, Readonly<NexxtEditorAlignItemsProps & {
|
|
61
61
|
/** The selected alignment, as the Tailwind class to apply. */
|
|
62
62
|
modelValue: EditorAlignItemsValue;
|
|
63
63
|
}> & Readonly<{
|
|
64
|
-
"onUpdate:modelValue"?: ((value: "items-center" | "items-
|
|
64
|
+
"onUpdate:modelValue"?: ((value: "items-center" | "items-start" | "items-end" | "items-stretch") => any) | undefined;
|
|
65
65
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** The three places on one axis, in reading order: left/top, middle, right/bottom. */
|
|
2
|
+
export declare const EDITOR_ALIGNMENT_POSITIONS: readonly ["start", "center", "end"];
|
|
3
|
+
/** A visual place on one axis: `start` is left or top, `end` is right or bottom. */
|
|
4
|
+
export type EditorAlignmentPosition = (typeof EDITOR_ALIGNMENT_POSITIONS)[number];
|
|
5
|
+
/**
|
|
6
|
+
* Where the content sits, as a visual place: `x` horizontal, `y` vertical,
|
|
7
|
+
* whatever the direction. `null` for an axis that does not count in a band
|
|
8
|
+
* mode; the grid writes `null` there, and reads only the axis that counts.
|
|
9
|
+
*/
|
|
10
|
+
export interface EditorAlignmentValue {
|
|
11
|
+
x: EditorAlignmentPosition | null;
|
|
12
|
+
y: EditorAlignmentPosition | null;
|
|
13
|
+
}
|
|
14
|
+
/** The direction the content stacks in. Decides the glyph and which way bands run. */
|
|
15
|
+
export type EditorAlignmentDirection = 'row' | 'column';
|
|
16
|
+
/**
|
|
17
|
+
* What can be chosen: `'both'` axes (nine cells), only the `'cross'` axis
|
|
18
|
+
* (three bands along the main axis), or only the `'main'` axis (three bands
|
|
19
|
+
* along the cross axis).
|
|
20
|
+
*/
|
|
21
|
+
export type EditorAlignmentMode = 'both' | 'cross' | 'main';
|
|
22
|
+
/** Overridable copy. Every key is optional. */
|
|
23
|
+
export interface EditorAlignmentGridMessages {
|
|
24
|
+
/** Name of the top left cell. Defaults to `'Linksboven'`. */
|
|
25
|
+
topLeft?: string;
|
|
26
|
+
/** Name of the top middle cell. Defaults to `'Midden boven'`. */
|
|
27
|
+
topCenter?: string;
|
|
28
|
+
/** Name of the top right cell. Defaults to `'Rechtsboven'`. */
|
|
29
|
+
topRight?: string;
|
|
30
|
+
/** Name of the middle left cell. Defaults to `'Links midden'`. */
|
|
31
|
+
centerLeft?: string;
|
|
32
|
+
/** Name of the middle cell. Defaults to `'Midden'`. */
|
|
33
|
+
center?: string;
|
|
34
|
+
/** Name of the middle right cell. Defaults to `'Rechts midden'`. */
|
|
35
|
+
centerRight?: string;
|
|
36
|
+
/** Name of the bottom left cell. Defaults to `'Linksonder'`. */
|
|
37
|
+
bottomLeft?: string;
|
|
38
|
+
/** Name of the bottom middle cell. Defaults to `'Midden onder'`. */
|
|
39
|
+
bottomCenter?: string;
|
|
40
|
+
/** Name of the bottom right cell. Defaults to `'Rechtsonder'`. */
|
|
41
|
+
bottomRight?: string;
|
|
42
|
+
/** Name of the top band. Defaults to `'Boven'`. */
|
|
43
|
+
top?: string;
|
|
44
|
+
/** Name of the middle band, horizontal or vertical. Defaults to `'Midden'`. */
|
|
45
|
+
middle?: string;
|
|
46
|
+
/** Name of the bottom band. Defaults to `'Onder'`. */
|
|
47
|
+
bottom?: string;
|
|
48
|
+
/** Name of the left band. Defaults to `'Links'`. */
|
|
49
|
+
left?: string;
|
|
50
|
+
/** Name of the right band. Defaults to `'Rechts'`. */
|
|
51
|
+
right?: string;
|
|
52
|
+
/** The main axis as a place while `auto` is on, in the stretched readout. Defaults to `'Auto'`. */
|
|
53
|
+
auto?: string;
|
|
54
|
+
/** Readout while `auto` is on; `{position}` is the band. Defaults to `'Auto · {position}'`. */
|
|
55
|
+
autoValue?: string;
|
|
56
|
+
/** Readout while `stretched` is on; `{position}` is the main-axis place. Defaults to `'Uitgerekt · {position}'`. */
|
|
57
|
+
stretchedValue?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface NexxtEditorAlignmentGridProps {
|
|
60
|
+
/**
|
|
61
|
+
* Header text of the settings block, and the name of the radiogroup.
|
|
62
|
+
* Defaults to the Dutch `'Uitlijning'`; the library has no i18n layer, so a
|
|
63
|
+
* consumer in another language passes its own copy in.
|
|
64
|
+
*/
|
|
65
|
+
label?: string;
|
|
66
|
+
/** The direction the content stacks in. Defaults to `'row'`. */
|
|
67
|
+
direction?: EditorAlignmentDirection;
|
|
68
|
+
/** What can be chosen. Defaults to `'both'`, the nine cells. */
|
|
69
|
+
mode?: EditorAlignmentMode;
|
|
70
|
+
/**
|
|
71
|
+
* The main axis distributes the space (Auto): in `'cross'` mode the bands
|
|
72
|
+
* draw their bars spread out, and the readout says `autoValue`.
|
|
73
|
+
*/
|
|
74
|
+
auto?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The content is stretched over the cross axis (a legacy setting): no radio
|
|
77
|
+
* is checked, and a band with long bars marks the main-axis place. Every
|
|
78
|
+
* radio stays clickable; a choice is the way out.
|
|
79
|
+
*/
|
|
80
|
+
stretched?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Copy of the cells, bands and readout. Defaults are Dutch and are merged
|
|
83
|
+
* per key. Copy is never translated inside the component.
|
|
84
|
+
*/
|
|
85
|
+
messages?: EditorAlignmentGridMessages;
|
|
86
|
+
}
|
|
87
|
+
declare const _default: typeof __VLS_export;
|
|
88
|
+
export default _default;
|
|
89
|
+
declare const __VLS_export: import('vue').DefineComponent<NexxtEditorAlignmentGridProps & {
|
|
90
|
+
/** The chosen place. Every choice writes it: a click, an arrow, Space. */
|
|
91
|
+
modelValue: EditorAlignmentValue;
|
|
92
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
93
|
+
"update:modelValue": (value: EditorAlignmentValue) => any;
|
|
94
|
+
commit: () => any;
|
|
95
|
+
}, string, import('vue').PublicProps, Readonly<NexxtEditorAlignmentGridProps & {
|
|
96
|
+
/** The chosen place. Every choice writes it: a click, an arrow, Space. */
|
|
97
|
+
modelValue: EditorAlignmentValue;
|
|
98
|
+
}> & Readonly<{
|
|
99
|
+
"onUpdate:modelValue"?: ((value: EditorAlignmentValue) => any) | undefined;
|
|
100
|
+
onCommit?: (() => any) | undefined;
|
|
101
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -59,10 +59,25 @@ export declare const EDITOR_GAP_STEPS: readonly [{
|
|
|
59
59
|
* can put the model value straight on the element it styles.
|
|
60
60
|
*/
|
|
61
61
|
export type EditorGapValue = `gap-${(typeof EDITOR_GAP_STEPS)[number]['token']}`;
|
|
62
|
-
/** Overridable copy
|
|
62
|
+
/** Overridable copy. Every key is optional. */
|
|
63
63
|
export interface EditorGapMessages {
|
|
64
64
|
/** Unit shown behind the value. Defaults to `'px'`. */
|
|
65
65
|
unit?: string;
|
|
66
|
+
/** The fixed option, with the `auto` model bound. Defaults to `'Vast'`. */
|
|
67
|
+
fixed?: string;
|
|
68
|
+
/** The auto option, with the `auto` model bound. Defaults to `'Auto'`. */
|
|
69
|
+
auto?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Name of the slider while Auto is on, when the gap is a minimum rather than
|
|
72
|
+
* the gap itself. Defaults to `'Tussenruimte, minimaal'`; on Vast the slider
|
|
73
|
+
* is named by `label`.
|
|
74
|
+
*/
|
|
75
|
+
minimumName?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Name of the Vast | Auto toolbar, so it is not named like the slider.
|
|
78
|
+
* Defaults to `'Soort tussenruimte'`.
|
|
79
|
+
*/
|
|
80
|
+
modeName?: string;
|
|
66
81
|
}
|
|
67
82
|
export interface NexxtEditorGapProps {
|
|
68
83
|
/**
|
|
@@ -82,11 +97,27 @@ export default _default;
|
|
|
82
97
|
declare const __VLS_export: import('vue').DefineComponent<NexxtEditorGapProps & {
|
|
83
98
|
/** The selected gap, as the Tailwind class to apply. */
|
|
84
99
|
modelValue: EditorGapValue;
|
|
100
|
+
/**
|
|
101
|
+
* Optional: whether the main axis distributes the space (Auto). Only when it
|
|
102
|
+
* is bound does the block offer Vast | Auto above the slider; the slider then
|
|
103
|
+
* sets the minimum gap. The component writes nothing else for Auto, and the
|
|
104
|
+
* gap model does not change when it is switched.
|
|
105
|
+
*/
|
|
106
|
+
auto?: boolean;
|
|
85
107
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
86
108
|
"update:modelValue": (value: "gap-0" | "gap-1" | "gap-2" | "gap-3" | "gap-4" | "gap-5" | "gap-6" | "gap-7" | "gap-8" | "gap-9" | "gap-10" | "gap-11" | "gap-12" | "gap-14" | "gap-16") => any;
|
|
109
|
+
"update:auto": (value: boolean) => any;
|
|
87
110
|
}, string, import('vue').PublicProps, Readonly<NexxtEditorGapProps & {
|
|
88
111
|
/** The selected gap, as the Tailwind class to apply. */
|
|
89
112
|
modelValue: EditorGapValue;
|
|
113
|
+
/**
|
|
114
|
+
* Optional: whether the main axis distributes the space (Auto). Only when it
|
|
115
|
+
* is bound does the block offer Vast | Auto above the slider; the slider then
|
|
116
|
+
* sets the minimum gap. The component writes nothing else for Auto, and the
|
|
117
|
+
* gap model does not change when it is switched.
|
|
118
|
+
*/
|
|
119
|
+
auto?: boolean;
|
|
90
120
|
}> & Readonly<{
|
|
91
121
|
"onUpdate:modelValue"?: ((value: "gap-0" | "gap-1" | "gap-2" | "gap-3" | "gap-4" | "gap-5" | "gap-6" | "gap-7" | "gap-8" | "gap-9" | "gap-10" | "gap-11" | "gap-12" | "gap-14" | "gap-16") => any) | undefined;
|
|
122
|
+
"onUpdate:auto"?: ((value: boolean) => any) | undefined;
|
|
92
123
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export type { NexxtPageMockupType } from './components/molecules/PageMockup/Page
|
|
|
11
11
|
export type { NexxtPickerGroupData, NexxtPickerItemData, } from './components/molecules/PickerList/PickerList.vue';
|
|
12
12
|
export type { NexxtTreeMove, NexxtTreeNode, NexxtTreeProps, NexxtTreeSlots, } from './components/molecules/Tree/Tree.vue';
|
|
13
13
|
export type { NexxtPlaceholderGroup, NexxtPlaceholderInputMessages, NexxtPlaceholderInputProps, } from './components/molecules/PlaceholderInput/PlaceholderInput.vue';
|
|
14
|
+
export { EDITOR_ALIGNMENT_POSITIONS } from './components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.vue';
|
|
15
|
+
export type { EditorAlignmentDirection, EditorAlignmentGridMessages, EditorAlignmentMode, EditorAlignmentPosition, EditorAlignmentValue, } from './components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.vue';
|
|
14
16
|
export { EDITOR_ALIGN_ITEMS_OPTIONS } from './components/editor/molecules/EditorAlignItems/EditorAlignItems.vue';
|
|
15
17
|
export type { EditorAlignItemsMessages, EditorAlignItemsValue, } from './components/editor/molecules/EditorAlignItems/EditorAlignItems.vue';
|
|
16
18
|
export { EDITOR_ANCHOR_OPTIONS } from './components/editor/molecules/EditorAnchor/EditorAnchor.vue';
|
|
@@ -78,6 +80,7 @@ export { default as NexxtDatePicker } from './components/organisms/DatePicker/Da
|
|
|
78
80
|
export { default as NexxtDoughnutChart } from './components/molecules/DoughnutChart/DoughnutChart.vue';
|
|
79
81
|
export { default as NexxtDropdownButton } from './components/organisms/DropdownButton/DropdownButton.vue';
|
|
80
82
|
export { default as NexxtEditorAlignItems } from './components/editor/molecules/EditorAlignItems/EditorAlignItems.vue';
|
|
83
|
+
export { default as NexxtEditorAlignmentGrid } from './components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.vue';
|
|
81
84
|
export { default as NexxtEditorAnchor } from './components/editor/molecules/EditorAnchor/EditorAnchor.vue';
|
|
82
85
|
export { default as NexxtEditorBackgroundSize } from './components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.vue';
|
|
83
86
|
export { default as NexxtEditorBorder } from './components/editor/molecules/EditorBorder/EditorBorder.vue';
|