@synopackageland/ui 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -0
- package/dist/PageLayoutDemo.vue.d.ts +6 -0
- package/dist/UiDefectsDemo.vue.d.ts +3 -0
- package/dist/components/advanced-panel/AdvancePanelGrid.vue.d.ts +1 -0
- package/dist/components/app/app-sidebar/AppSidebar.vue.d.ts +4 -0
- package/dist/components/app/page-content/PageContent.vue.d.ts +22 -0
- package/dist/components/app/section-tabs/SectionTabs.vue.d.ts +1 -0
- package/dist/components/composite/about-dialog/AboutDialog.vue.d.ts +13 -0
- package/dist/components/composite/config-provider/ConfigProvider.vue.d.ts +2 -0
- package/dist/components/composite/data-table/DataTable.vue.d.ts +1 -1
- package/dist/components/composite/file-picker/FilePicker.vue.d.ts +8 -4
- package/dist/components/composite/form/Form.vue.d.ts +3 -0
- package/dist/components/composite/form/FormItem.vue.d.ts +8 -3
- package/dist/components/composite/form/context.d.ts +9 -1
- package/dist/components/composite/form/types.d.ts +1 -1
- package/dist/components/composite/form-actions/FormActions.vue.d.ts +20 -0
- package/dist/components/composite/key-value-row/KeyValueRow.vue.d.ts +20 -0
- package/dist/components/composite/repeat-rows/FieldCell.vue.d.ts +19 -0
- package/dist/components/composite/repeat-rows/RepeatRow.vue.d.ts +26 -0
- package/dist/components/composite/repeat-rows/RepeatRows.vue.d.ts +21 -0
- package/dist/components/composite/search-field/SearchField.vue.d.ts +2 -0
- package/dist/components/composite/settings-row/SettingsRow.vue.d.ts +4 -0
- package/dist/components/composite/wizard/Wizard.vue.d.ts +2 -0
- package/dist/components/composite/wizard/types.d.ts +1 -0
- package/dist/components/containers/card/Card.vue.d.ts +3 -0
- package/dist/components/containers/card-grid/CardGrid.vue.d.ts +27 -0
- package/dist/components/feedback/info-mask/InfoMask.vue.d.ts +1 -1
- package/dist/components/primitives/color-picker/ColorPicker.vue.d.ts +6 -0
- package/dist/components/primitives/combobox/Combobox.vue.d.ts +2 -2
- package/dist/components/primitives/date-picker/DatePicker.vue.d.ts +14 -3
- package/dist/components/primitives/input-steppers/InputSteppers.vue.d.ts +5 -0
- package/dist/components/primitives/link/Link.vue.d.ts +32 -0
- package/dist/components/primitives/multiple-select/MultipleSelect.vue.d.ts +2 -2
- package/dist/components/primitives/pagination/Pagination.vue.d.ts +3 -3
- package/dist/components/primitives/schedule-table/ScheduleTable.vue.d.ts +9 -0
- package/dist/components/primitives/segment-control/SegmentControl.vue.d.ts +2 -2
- package/dist/components/primitives/select/internal/ComboboxField.vue.d.ts +3 -2
- package/dist/components/primitives/select/internal/types.d.ts +1 -0
- package/dist/components/primitives/superbox-select/SuperboxSelect.vue.d.ts +2 -2
- package/dist/components/primitives/toast/ToastProvider.vue.d.ts +2 -0
- package/dist/components/primitives/toggle-button/ToggleButton.vue.d.ts +2 -2
- package/dist/components/primitives/toggle-button/ToggleButtonGroup.vue.d.ts +2 -2
- package/dist/components/primitives/typography/TypoHeader.vue.d.ts +2 -0
- package/dist/composables/elementWidth.d.ts +4 -0
- package/dist/composables/formControl.d.ts +21 -0
- package/dist/i18n/filePicker.d.ts +15 -0
- package/dist/i18n/locale.d.ts +6 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +10050 -9461
- package/dist/lib/fieldWidth.d.ts +4 -0
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -465,3 +465,94 @@ The public npm package is `@synopackageland/ui`. Both release targets are built
|
|
|
465
465
|
from the same source and share runtime files, exports, MIT license and notices.
|
|
466
466
|
Public repository and issue tracker links will be added once those are selected.
|
|
467
467
|
See the [documentation](https://www.varvis.me/docs/) for usage.
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
## Form controls and compact settings (0.5.6)
|
|
471
|
+
|
|
472
|
+
`Form` and standalone `FormItem` default to `direction="auto"`. They use the
|
|
473
|
+
container's width, including a DSM package window, and stack labels below 520px.
|
|
474
|
+
Set `direction="horizontal"` to keep the previous layout or `direction="vertical"`
|
|
475
|
+
to stack at every width. An item can override its form. Controls bind their
|
|
476
|
+
FormItem id and ARIA state automatically; remove Select `role="group"` workarounds
|
|
477
|
+
and manual `field.controlId` bindings unless an application deliberately chooses
|
|
478
|
+
an explicit id. Explicit descriptions are merged with the field's help/error ids.
|
|
479
|
+
|
|
480
|
+
Use one FormItem for each primary control. For rows containing multiple fields,
|
|
481
|
+
put each labelled field in its own FormItem inside a FieldCell; use `text-only`
|
|
482
|
+
on an outer item that is only a layout heading. Multiple siblings do not reuse
|
|
483
|
+
the primary id. Native/custom controls can still use the `field.controlProps`
|
|
484
|
+
slot or `useFormField()` contract. If mounting independent Vue apps in the same
|
|
485
|
+
document, set a distinct `app.config.idPrefix` for each app.
|
|
486
|
+
|
|
487
|
+
```vue
|
|
488
|
+
<ConfigProvider :locale="locale">
|
|
489
|
+
<Form>
|
|
490
|
+
<FormItem label="Protocol" description="Transport protocol">
|
|
491
|
+
<Select v-model="protocol" :options="protocols" />
|
|
492
|
+
</FormItem>
|
|
493
|
+
<FormItem label="Upload" field-width="full">
|
|
494
|
+
<FilePicker v-model="files" variant="compact" :max-size="524288" />
|
|
495
|
+
</FormItem>
|
|
496
|
+
</Form>
|
|
497
|
+
<KeyValueRow label="Version" value="0.5.6" />
|
|
498
|
+
<KeyValueRow label="Download">
|
|
499
|
+
<Link :href="downloadUrl" download="notes.txt" :download-label="t('download')">{{ t('download') }}</Link>
|
|
500
|
+
</KeyValueRow>
|
|
501
|
+
<Link href="https://example.com/docs" external :external-label="t('opensNewTab')">{{ t('docs') }}</Link>
|
|
502
|
+
</ConfigProvider>
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
FilePicker retains browser `File[]` semantics. Built-in `locale` values are
|
|
506
|
+
`en`, `zh-TW`, `zh-CN`, `ja`, `ko`, `de`, `fr`, `es`, `it`; an explicit picker
|
|
507
|
+
locale overrides ConfigProvider. Its `text` accepts partial overrides of
|
|
508
|
+
`title`, `description`, `chooseFiles`, `chooseFolder`, `maxSize`, `maxFiles`,
|
|
509
|
+
`remove`, `typeRejected`, `sizeRejected`, `countRejected`, `duplicateRejected`.
|
|
510
|
+
The messages use `{name}`, `{size}` and `{count}` placeholders. Existing
|
|
511
|
+
`title`/`description` props still win. Other controls retain their exposed text
|
|
512
|
+
props; the provider locale currently localizes FilePicker only.
|
|
513
|
+
|
|
514
|
+
`KeyValueRow` renders a `dl` with `dt`/`dd`; its default slot accepts rich values,
|
|
515
|
+
including Link. `Wizard show-steps` shows registered step headlines and does not
|
|
516
|
+
permit jumping past guards. Localize its `aria-label`, `footer` labels (including
|
|
517
|
+
`startLabel`) and `progressText(current,total)`. `RepeatRow` places wrapped cells
|
|
518
|
+
inside `[data-repeat-fields]` and keeps its remove action beside the first control;
|
|
519
|
+
`removeDisabled` disables the action. Use wrapping rows for adjacent controls.
|
|
520
|
+
|
|
521
|
+
DOM attrs on controls target the focusable control (a Reka checkbox is a button
|
|
522
|
+
with `role="checkbox"`), while class/style target the layout wrapper. Overlay attrs
|
|
523
|
+
target content, except Tooltip, whose attrs target the slotted trigger. Renderless
|
|
524
|
+
providers without a rendered surface do not provide an attr destination.
|
|
525
|
+
|
|
526
|
+
The scoped preflight removes browser heading/paragraph/list margins and bare
|
|
527
|
+
button chrome inside library roots. Use explicit classes or Typo components for
|
|
528
|
+
intentional typography. Restore EmptyState's former spacing with
|
|
529
|
+
`class="min-h-48 py-10"`. The supplied DSM theme is light; forced-colors keyboard
|
|
530
|
+
focus has an outline. A dark theme is not part of this release.
|
|
531
|
+
|
|
532
|
+
### Testing Select with jsdom
|
|
533
|
+
|
|
534
|
+
Mount with `attachTo: document.body` and unmount after each test. Reka uses
|
|
535
|
+
keyboard interaction reliably in jsdom; pointer simulation depends on the
|
|
536
|
+
PointerEvent implementation. This helper works without synthesizing pointer
|
|
537
|
+
positions or exposing component internals:
|
|
538
|
+
|
|
539
|
+
```ts
|
|
540
|
+
import { flushPromises } from '@vue/test-utils'
|
|
541
|
+
|
|
542
|
+
async function chooseSelect(selectWrapper, label: string) {
|
|
543
|
+
await selectWrapper.get('[role="combobox"]').trigger('keydown', { key: 'ArrowDown' })
|
|
544
|
+
await flushPromises()
|
|
545
|
+
// Options may be portalled into AppRoot or document.body.
|
|
546
|
+
const option = [...document.querySelectorAll<HTMLElement>('[role="option"]')]
|
|
547
|
+
.find(node => node.textContent?.trim() === label)
|
|
548
|
+
if (!option || option.getAttribute('aria-disabled') === 'true') throw new Error(`No enabled option: ${label}`)
|
|
549
|
+
option.focus()
|
|
550
|
+
option.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true }))
|
|
551
|
+
await flushPromises()
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
Assert the emitted model value and label/ARIA links. For browser checks, use
|
|
556
|
+
actual ArrowDown/ArrowUp/Enter/Escape input and verify the selected value and focus.
|
|
557
|
+
`pnpm check` is valid without existing dist; `release:stage` requires a complete
|
|
558
|
+
build and refuses missing/empty exported artifacts before copying files.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
page: 'dashboard' | 'form';
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
columns: AdvancePanelGridColumn[];
|
|
4
4
|
data: AdvancePanelGridRow[];
|
|
5
5
|
/** Custom comparator per column; falls back to a numeric/locale compare. */
|
|
6
|
+
sortLabel?: (title: string) => string;
|
|
6
7
|
localSortFunc?: AdvancePanelGridSortResolver;
|
|
7
8
|
};
|
|
8
9
|
declare function deactivateRow(): void;
|
|
@@ -4,6 +4,8 @@ type __VLS_Props = {
|
|
|
4
4
|
modelValue?: string;
|
|
5
5
|
groups: AppSidebarGroup[];
|
|
6
6
|
/** Show the DSM search field above the list; it filters items by label. */
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
clearSearchLabel?: string;
|
|
7
9
|
searchable?: boolean;
|
|
8
10
|
searchPlaceholder?: string;
|
|
9
11
|
/** Section headers get a chevron and fold their items. */
|
|
@@ -23,10 +25,12 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
23
25
|
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
24
26
|
onBranchToggle?: ((key: string, expanded: boolean) => any) | undefined;
|
|
25
27
|
}>, {
|
|
28
|
+
ariaLabel: string;
|
|
26
29
|
searchPlaceholder: string;
|
|
27
30
|
collapsible: boolean;
|
|
28
31
|
expandedKeys: string[];
|
|
29
32
|
defaultExpandedKeys: string[];
|
|
33
|
+
clearSearchLabel: string;
|
|
30
34
|
searchable: boolean;
|
|
31
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
36
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/**
|
|
3
|
+
* `'fill'` uses the whole content area; `'readable'` caps the width at
|
|
4
|
+
* `--ui-page-readable-width`; any other value is a CSS maximum width.
|
|
5
|
+
*/
|
|
6
|
+
width?: 'fill' | 'readable' | (string & {});
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
13
|
+
width: "fill" | "readable" | (string & {});
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -11,6 +11,19 @@ import { AboutCheckState, AboutVersionInfo } from './types';
|
|
|
11
11
|
* `checkForUpdates()`.
|
|
12
12
|
*/
|
|
13
13
|
type __VLS_Props = {
|
|
14
|
+
text?: Partial<{
|
|
15
|
+
beta: string;
|
|
16
|
+
version: string;
|
|
17
|
+
checking: string;
|
|
18
|
+
available: string;
|
|
19
|
+
betaAvailable: string;
|
|
20
|
+
failed: string;
|
|
21
|
+
retry: string;
|
|
22
|
+
releaseNotes: string;
|
|
23
|
+
terms: string;
|
|
24
|
+
privacy: string;
|
|
25
|
+
legal: string;
|
|
26
|
+
}>;
|
|
14
27
|
open?: boolean;
|
|
15
28
|
defaultOpen?: boolean;
|
|
16
29
|
title: string;
|
|
@@ -20,9 +20,9 @@ type __VLS_Slots = {} & {
|
|
|
20
20
|
[K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
23
|
+
compact: boolean;
|
|
23
24
|
rowKey: string;
|
|
24
25
|
emptyText: string;
|
|
25
|
-
compact: boolean;
|
|
26
26
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FilePickerText } from '../../../i18n/filePicker';
|
|
2
|
+
import { UiLocale } from '../../../i18n/locale';
|
|
1
3
|
export type FileRejection = {
|
|
2
4
|
file: File;
|
|
3
5
|
reason: 'type' | 'size' | 'count' | 'duplicate';
|
|
@@ -12,15 +14,18 @@ type __VLS_Props = {
|
|
|
12
14
|
maxSize?: number;
|
|
13
15
|
directory?: boolean;
|
|
14
16
|
showList?: boolean;
|
|
17
|
+
variant?: 'dropzone' | 'compact';
|
|
18
|
+
locale?: UiLocale;
|
|
19
|
+
text?: Partial<FilePickerText>;
|
|
15
20
|
title?: string;
|
|
16
21
|
description?: string;
|
|
17
22
|
};
|
|
18
|
-
declare var
|
|
23
|
+
declare var __VLS_27: {
|
|
19
24
|
file: File;
|
|
20
25
|
index: number;
|
|
21
26
|
};
|
|
22
27
|
type __VLS_Slots = {} & {
|
|
23
|
-
'file-actions'?: (props: typeof
|
|
28
|
+
'file-actions'?: (props: typeof __VLS_27) => any;
|
|
24
29
|
};
|
|
25
30
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
31
|
"update:modelValue": (files: File[]) => any;
|
|
@@ -29,10 +34,9 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
29
34
|
"onUpdate:modelValue"?: ((files: File[]) => any) | undefined;
|
|
30
35
|
onRejected?: ((items: FileRejection[]) => any) | undefined;
|
|
31
36
|
}>, {
|
|
32
|
-
|
|
37
|
+
variant: "dropzone" | "compact";
|
|
33
38
|
disabled: boolean;
|
|
34
39
|
modelValue: File[];
|
|
35
|
-
description: string;
|
|
36
40
|
multiple: boolean;
|
|
37
41
|
maxFiles: number;
|
|
38
42
|
maxSize: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FieldWidth } from '../../../lib/fieldWidth';
|
|
1
2
|
import { FormFieldHandle } from './context';
|
|
2
3
|
import { FormDirection, FormRules, FormSpacing, FormValidatedResult, ValidateMessageDisplayMode, ValidateTrigger } from './types';
|
|
3
4
|
type __VLS_Props = {
|
|
@@ -7,6 +8,8 @@ type __VLS_Props = {
|
|
|
7
8
|
direction?: FormDirection;
|
|
8
9
|
/** Gap between items; `'auto'` uses `dense` (horizontal) or `regular` (vertical). */
|
|
9
10
|
spacing?: FormSpacing;
|
|
11
|
+
/** Maximum width of every control: `'xs'`–`'lg'`, `'full'` or a CSS length. A FormItem can override it. */
|
|
12
|
+
fieldWidth?: FieldWidth;
|
|
10
13
|
/** Default message placement; a FormItem can override it. */
|
|
11
14
|
validateMessageDisplayMode?: ValidateMessageDisplayMode;
|
|
12
15
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { FieldWidth } from '../../../lib/fieldWidth';
|
|
1
2
|
import { FormFieldContext } from './context';
|
|
2
|
-
import { FormItemValidateMessageDisplayMode, FormRule, ValidateStatus, ValidateTrigger } from './types';
|
|
3
|
+
import { FormDirection, FormItemValidateMessageDisplayMode, FormRule, ValidateStatus, ValidateTrigger } from './types';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
/** Controlled field value; when `undefined` the value is reported by the control. */
|
|
5
6
|
modelValue?: unknown;
|
|
@@ -43,8 +44,12 @@ type __VLS_Props = {
|
|
|
43
44
|
textOnly?: boolean;
|
|
44
45
|
/** Indentation level (multiples of 28px) or any CSS length. */
|
|
45
46
|
indent?: string | number;
|
|
47
|
+
/** Auto follows the available width; explicit directions override the enclosing form. */
|
|
48
|
+
direction?: FormDirection;
|
|
46
49
|
/** Width of the label column in the horizontal layout. */
|
|
47
50
|
labelWidth?: string;
|
|
51
|
+
/** Maximum control width; inherits the form's `fieldWidth` (`'md'` by default). */
|
|
52
|
+
fieldWidth?: FieldWidth;
|
|
48
53
|
/** Value restored by `resetFields()`; also the initial dirty baseline. */
|
|
49
54
|
initialValue?: unknown;
|
|
50
55
|
};
|
|
@@ -96,15 +101,15 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
|
96
101
|
setFieldDisabled: typeof setDisabled;
|
|
97
102
|
ensureVisible: typeof ensureVisible;
|
|
98
103
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
99
|
-
"update:modelValue": (value: unknown) => any;
|
|
100
104
|
validating: () => any;
|
|
105
|
+
"update:modelValue": (value: unknown) => any;
|
|
101
106
|
validated: (result: {
|
|
102
107
|
message: string;
|
|
103
108
|
status: ValidateStatus;
|
|
104
109
|
}) => any;
|
|
105
110
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
106
|
-
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
107
111
|
onValidating?: (() => any) | undefined;
|
|
112
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
108
113
|
onValidated?: ((result: {
|
|
109
114
|
message: string;
|
|
110
115
|
status: ValidateStatus;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
|
+
import { FieldWidth } from '../../../lib/fieldWidth';
|
|
2
3
|
import { FormRules, FormDirection, FormSpacing, ValidateMessageDisplayMode, ValidateStatus, ValidateTrigger } from './types';
|
|
3
4
|
export declare const FORM_CONTEXT_KEY: InjectionKey<FormContext>;
|
|
4
|
-
export declare const FORM_FIELD_KEY: InjectionKey<FormFieldContext>;
|
|
5
|
+
export declare const FORM_FIELD_KEY: InjectionKey<FormFieldContext | null>;
|
|
5
6
|
/** What Form exposes to its FormItems. Values are unwrapped (the provided object is reactive). */
|
|
6
7
|
export type FormContext = {
|
|
7
8
|
rules: FormRules;
|
|
8
9
|
direction: FormDirection;
|
|
9
10
|
spacing: FormSpacing;
|
|
11
|
+
fieldWidth: FieldWidth;
|
|
10
12
|
validateMessageDisplayMode: ValidateMessageDisplayMode;
|
|
11
13
|
registerField: (field: FormFieldHandle) => void;
|
|
12
14
|
unregisterField: (field: FormFieldHandle) => void;
|
|
@@ -29,6 +31,12 @@ export type FormFieldHandle = {
|
|
|
29
31
|
*/
|
|
30
32
|
export type FormFieldContext = {
|
|
31
33
|
controlId: string;
|
|
34
|
+
defaultControlId?: string;
|
|
35
|
+
isPrimaryControl?: (owner: symbol) => boolean;
|
|
36
|
+
claimControl?: (owner: symbol) => boolean;
|
|
37
|
+
releaseControl?: (owner: symbol) => void;
|
|
38
|
+
labelId?: string;
|
|
39
|
+
setControlId?: (id: string) => void;
|
|
32
40
|
descriptionId: string | undefined;
|
|
33
41
|
messageId: string | undefined;
|
|
34
42
|
/** Value for `aria-describedby`, covering the rendered description and message. */
|
|
@@ -5,7 +5,7 @@ export type ValidateStatus = '' | 'success' | 'error' | 'warning' | 'validating'
|
|
|
5
5
|
export type ValidateMessageDisplayMode = 'popup' | 'text';
|
|
6
6
|
/** FormItem-level value: `'form'` inherits the enclosing form's mode. */
|
|
7
7
|
export type FormItemValidateMessageDisplayMode = ValidateMessageDisplayMode | 'form';
|
|
8
|
-
export type FormDirection = 'horizontal' | 'vertical';
|
|
8
|
+
export type FormDirection = 'auto' | 'horizontal' | 'vertical';
|
|
9
9
|
export type FormSpacing = 'none' | 'dense' | 'compact' | 'regular' | 'relaxed' | number | 'auto';
|
|
10
10
|
export type FormRuleType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'email' | 'url' | 'date';
|
|
11
11
|
export type FormRuleCallback = (error?: Error | string | void) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
align?: 'start' | 'end';
|
|
3
|
+
/** Indents the actions past a horizontal form's label column, so they line up with the fields. */
|
|
4
|
+
labelWidth?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
align: "start" | "end";
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: string | number;
|
|
4
|
+
labelWidth?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
label?: (props: typeof __VLS_1) => any;
|
|
9
|
+
} & {
|
|
10
|
+
default?: (props: typeof __VLS_3) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FieldWidth } from '../../../lib/fieldWidth';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
width?: FieldWidth;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
width: FieldWidth;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
removable?: boolean;
|
|
3
|
+
removeLabel?: string;
|
|
4
|
+
removeDisabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
remove: () => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onRemove?: (() => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
removeLabel: string;
|
|
16
|
+
removable: boolean;
|
|
17
|
+
removeDisabled: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
addLabel: string;
|
|
3
|
+
addDisabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
add: () => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onAdd?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -4,6 +4,7 @@ type __VLS_Props = {
|
|
|
4
4
|
clearLabel?: string;
|
|
5
5
|
/** `filter` is the DSM toolbar filter box (funnel icon); `search` keeps the magnifier. */
|
|
6
6
|
variant?: 'search' | 'filter';
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
10
|
"update:modelValue": (value: string) => any;
|
|
@@ -11,6 +12,7 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
11
12
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
12
13
|
}>, {
|
|
13
14
|
variant: "search" | "filter";
|
|
15
|
+
disabled: boolean;
|
|
14
16
|
modelValue: string;
|
|
15
17
|
placeholder: string;
|
|
16
18
|
clearLabel: string;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { FieldWidth } from '../../../lib/fieldWidth';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
label: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
required?: boolean;
|
|
5
6
|
align?: 'start' | 'center';
|
|
7
|
+
/** Maximum control width: `'xs'`–`'lg'`, `'full'` or a CSS length. */
|
|
8
|
+
fieldWidth?: FieldWidth;
|
|
6
9
|
};
|
|
7
10
|
declare var __VLS_1: {};
|
|
8
11
|
type __VLS_Slots = {} & {
|
|
@@ -11,6 +14,7 @@ type __VLS_Slots = {} & {
|
|
|
11
14
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
15
|
required: boolean;
|
|
13
16
|
align: "start" | "center";
|
|
17
|
+
fieldWidth: FieldWidth;
|
|
14
18
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
19
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
20
|
declare const _default: typeof __VLS_export;
|
|
@@ -11,6 +11,8 @@ type __VLS_Props = {
|
|
|
11
11
|
/** Shows the Cancel action in the footer. */
|
|
12
12
|
cancellable?: boolean;
|
|
13
13
|
ariaLabel?: string;
|
|
14
|
+
showSteps?: boolean;
|
|
15
|
+
progressText?: (current: number, total: number) => string;
|
|
14
16
|
};
|
|
15
17
|
declare function toNextStep(): Promise<void>;
|
|
16
18
|
declare function toPreviousStep(): Promise<void>;
|
|
@@ -9,6 +9,8 @@ type __VLS_Props = {
|
|
|
9
9
|
expanded?: boolean;
|
|
10
10
|
/** Accessible name for the disclosure arrow when the card has no title. */
|
|
11
11
|
toggleLabel?: string;
|
|
12
|
+
/** Where footer actions sit; DSM aligns them to a side, never the centre. */
|
|
13
|
+
footerAlign?: 'start' | 'end' | 'between';
|
|
12
14
|
};
|
|
13
15
|
declare var __VLS_8: {}, __VLS_10: {}, __VLS_17: {}, __VLS_19: {}, __VLS_21: {};
|
|
14
16
|
type __VLS_Slots = {} & {
|
|
@@ -31,6 +33,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
31
33
|
expanded: boolean;
|
|
32
34
|
layoutType: "regular" | "compact";
|
|
33
35
|
hasHeader: boolean;
|
|
36
|
+
footerAlign: "start" | "end" | "between";
|
|
34
37
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
35
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
39
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Narrowest a card may get before the grid drops a column. */
|
|
3
|
+
minItemWidth?: string;
|
|
4
|
+
gap?: string;
|
|
5
|
+
/**
|
|
6
|
+
* `'stretch'` (auto-fit) grows the cards to use the whole row; `'fill'`
|
|
7
|
+
* (auto-fill) keeps empty tracks, so a few cards stay at column width.
|
|
8
|
+
*/
|
|
9
|
+
fit?: 'stretch' | 'fill';
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_1: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
gap: string;
|
|
17
|
+
minItemWidth: string;
|
|
18
|
+
fit: "stretch" | "fill";
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -9,8 +9,8 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_3) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
-
ariaLabel: string;
|
|
13
12
|
active: boolean;
|
|
13
|
+
ariaLabel: string;
|
|
14
14
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
15
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
@@ -4,6 +4,12 @@ export type ColorSwatch = {
|
|
|
4
4
|
hex?: string;
|
|
5
5
|
};
|
|
6
6
|
type __VLS_Props = {
|
|
7
|
+
text?: Partial<{
|
|
8
|
+
choose: string;
|
|
9
|
+
common: string;
|
|
10
|
+
palette: string;
|
|
11
|
+
custom: string;
|
|
12
|
+
}>;
|
|
7
13
|
/** Current colour string, in the format selected by `colorFormat`. */
|
|
8
14
|
modelValue?: string;
|
|
9
15
|
colorFormat?: ColorPickerFormat;
|
|
@@ -5,20 +5,20 @@ type __VLS_Props = Omit<SelectFieldProps, 'multiple' | 'modelValue' | 'defaultVa
|
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
7
|
select: (option: SelectOption) => any;
|
|
8
|
+
blur: (event: FocusEvent) => any;
|
|
8
9
|
invalid: (text: string) => any;
|
|
9
10
|
"update:modelValue": (value: string) => any;
|
|
10
11
|
focus: (event: FocusEvent) => any;
|
|
11
|
-
blur: (event: FocusEvent) => any;
|
|
12
12
|
"update:loading": (loading: boolean) => any;
|
|
13
13
|
create: (value: string) => any;
|
|
14
14
|
"open-dropdown": () => any;
|
|
15
15
|
"close-dropdown": () => any;
|
|
16
16
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
17
|
onSelect?: ((option: SelectOption) => any) | undefined;
|
|
18
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
18
19
|
onInvalid?: ((text: string) => any) | undefined;
|
|
19
20
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
20
21
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
21
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
22
22
|
"onUpdate:loading"?: ((loading: boolean) => any) | undefined;
|
|
23
23
|
onCreate?: ((value: string) => any) | undefined;
|
|
24
24
|
"onOpen-dropdown"?: (() => any) | undefined;
|