@motifx-community/ui 0.1.0-beta.1 → 0.1.0-beta.2

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.
Files changed (160) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +16 -10
  3. package/dist/components/calendar/Calendar.d.ts +12 -0
  4. package/dist/components/calendar/calendar-props.d.ts +5 -0
  5. package/dist/components/daterangebox/DateRangeBox.d.ts +121 -0
  6. package/dist/components/daterangebox/date-range-box-props.d.ts +35 -0
  7. package/dist/components/daterangebox/date-range-preset.d.ts +6 -0
  8. package/dist/components/daterangebox/date-range.d.ts +2 -0
  9. package/dist/components/daterangebox/index.d.ts +4 -0
  10. package/dist/components/fileuploader/FileUploader.d.ts +133 -0
  11. package/dist/components/fileuploader/file-uploader-props.d.ts +46 -0
  12. package/dist/components/fileuploader/files-added-event-args.d.ts +9 -0
  13. package/dist/components/fileuploader/index.d.ts +7 -0
  14. package/dist/components/fileuploader/upload-event-args.d.ts +10 -0
  15. package/dist/components/fileuploader/upload-item.d.ts +12 -0
  16. package/dist/components/fileuploader/upload-mode.d.ts +2 -0
  17. package/dist/components/fileuploader/upload-status.d.ts +2 -0
  18. package/dist/components/loadpanel/LoadPanel.d.ts +70 -0
  19. package/dist/components/loadpanel/index.d.ts +3 -0
  20. package/dist/components/loadpanel/load-panel-props.d.ts +29 -0
  21. package/dist/components/loadpanel/load-panel-target.d.ts +3 -0
  22. package/dist/components/popover/Popover.d.ts +98 -0
  23. package/dist/components/popover/index.d.ts +5 -0
  24. package/dist/components/popover/popover-close-reason.d.ts +2 -0
  25. package/dist/components/popover/popover-closing-event-args.d.ts +8 -0
  26. package/dist/components/popover/popover-props.d.ts +39 -0
  27. package/dist/components/popover/popover-show-on.d.ts +2 -0
  28. package/dist/components/scrollview/ScrollView.d.ts +109 -0
  29. package/dist/components/scrollview/index.d.ts +7 -0
  30. package/dist/components/scrollview/pull-down-event-args.d.ts +9 -0
  31. package/dist/components/scrollview/reach-bottom-event-args.d.ts +9 -0
  32. package/dist/components/scrollview/scroll-event-args.d.ts +7 -0
  33. package/dist/components/scrollview/scroll-view-bars.d.ts +2 -0
  34. package/dist/components/scrollview/scroll-view-direction.d.ts +2 -0
  35. package/dist/components/scrollview/scroll-view-props.d.ts +31 -0
  36. package/dist/components/sortable/Sortable.d.ts +106 -0
  37. package/dist/components/sortable/index.d.ts +5 -0
  38. package/dist/components/sortable/sortable-drag-event-args.d.ts +15 -0
  39. package/dist/components/sortable/sortable-drop-event-args.d.ts +11 -0
  40. package/dist/components/sortable/sortable-orientation.d.ts +2 -0
  41. package/dist/components/sortable/sortable-props.d.ts +34 -0
  42. package/dist/components/stepper/Stepper.d.ts +121 -0
  43. package/dist/components/stepper/Wizard.d.ts +112 -0
  44. package/dist/components/stepper/WizardStep.d.ts +44 -0
  45. package/dist/components/stepper/index.d.ts +13 -0
  46. package/dist/components/stepper/step-changed-event-args.d.ts +11 -0
  47. package/dist/components/stepper/step-changing-event-args.d.ts +18 -0
  48. package/dist/components/stepper/stepper-item.d.ts +20 -0
  49. package/dist/components/stepper/stepper-label-position.d.ts +2 -0
  50. package/dist/components/stepper/stepper-orientation.d.ts +1 -0
  51. package/dist/components/stepper/stepper-props.d.ts +32 -0
  52. package/dist/components/stepper/stepper-status.d.ts +2 -0
  53. package/dist/components/stepper/wizard-finishing-event-args.d.ts +7 -0
  54. package/dist/components/stepper/wizard-props.d.ts +48 -0
  55. package/dist/components/stepper/wizard-step-props.d.ts +32 -0
  56. package/dist/core/flow-home.d.ts +6 -0
  57. package/dist/core/fold-text.d.ts +6 -0
  58. package/dist/core/ui-locale.d.ts +0 -2
  59. package/dist/core/ui-strings.d.ts +41 -0
  60. package/dist/generated/tokens.d.ts +1146 -11
  61. package/dist/index.d.ts +8 -1
  62. package/dist/index.js +22564 -20283
  63. package/dist/index.js.map +1 -1
  64. package/dist/locales/en.json +38 -1
  65. package/dist/locales/tr.json +38 -1
  66. package/dist/styles.css +1825 -5
  67. package/dist/tokens/index.d.ts +1146 -11
  68. package/dist/tokens/index.js +1146 -11
  69. package/dist/tokens/index.js.map +1 -1
  70. package/dist/tr-B218zMtu.js +1191 -0
  71. package/dist/tr-B218zMtu.js.map +1 -0
  72. package/docs/accordion.md +1 -1
  73. package/docs/actionsheet.md +1 -1
  74. package/docs/avatar.md +1 -1
  75. package/docs/badge.md +1 -1
  76. package/docs/bottomsheet.md +3 -3
  77. package/docs/breadcrumb.md +2 -2
  78. package/docs/button.md +3 -3
  79. package/docs/buttongroup.md +1 -1
  80. package/docs/calendar.md +1 -1
  81. package/docs/card.md +1 -1
  82. package/docs/checkbox.md +3 -3
  83. package/docs/chip.md +1 -1
  84. package/docs/colorbox.md +1 -1
  85. package/docs/combobox.md +1 -1
  86. package/docs/control.md +1 -1
  87. package/docs/datagrid-api.md +3 -3
  88. package/docs/datagrid-bands.md +1 -1
  89. package/docs/datagrid-drag-select.md +1 -1
  90. package/docs/datagrid-drag.md +1 -1
  91. package/docs/datagrid-editing.md +1 -1
  92. package/docs/datagrid-filtering.md +1 -1
  93. package/docs/datagrid-forms.md +1 -1
  94. package/docs/datagrid-grouping.md +1 -1
  95. package/docs/datagrid-layout.md +1 -1
  96. package/docs/datagrid-lookups.md +1 -1
  97. package/docs/datagrid-master-detail.md +1 -1
  98. package/docs/datagrid-scrolling.md +1 -1
  99. package/docs/datagrid-selection.md +1 -1
  100. package/docs/datagrid.md +1 -1
  101. package/docs/datebox.md +3 -3
  102. package/docs/daterangebox.md +192 -0
  103. package/docs/drawer.md +1 -1
  104. package/docs/dropdown.md +3 -3
  105. package/docs/fileuploader.md +201 -0
  106. package/docs/filterbuilder.md +3 -3
  107. package/docs/formlayout.md +1 -1
  108. package/docs/home.md +1 -1
  109. package/docs/keyboard.md +1 -1
  110. package/docs/language.md +229 -0
  111. package/docs/layout.md +3 -3
  112. package/docs/listbox.md +3 -3
  113. package/docs/loadpanel.md +184 -0
  114. package/docs/lookup.md +1 -1
  115. package/docs/menus.md +1 -1
  116. package/docs/numberbox.md +3 -3
  117. package/docs/pagination.md +1 -1
  118. package/docs/popover.md +221 -0
  119. package/docs/progress.md +3 -3
  120. package/docs/radiogroup.md +1 -1
  121. package/docs/rating.md +1 -1
  122. package/docs/scheduler-agenda.md +1 -1
  123. package/docs/scheduler-big-data.md +1 -1
  124. package/docs/scheduler-editing.md +1 -1
  125. package/docs/scheduler-form.md +1 -1
  126. package/docs/scheduler-icalendar.md +1 -1
  127. package/docs/scheduler-mobile.md +1 -1
  128. package/docs/scheduler-recurrence.md +1 -1
  129. package/docs/scheduler-resources.md +1 -1
  130. package/docs/scheduler-timeline.md +1 -1
  131. package/docs/scheduler.md +1 -1
  132. package/docs/scrollview.md +185 -0
  133. package/docs/showcase.md +1 -1
  134. package/docs/skeleton.md +1 -1
  135. package/docs/slider.md +3 -3
  136. package/docs/sortable.md +213 -0
  137. package/docs/stepper.md +238 -0
  138. package/docs/switch.md +1 -1
  139. package/docs/tabdocs-dock.md +1 -1
  140. package/docs/tabdocs-drag.md +1 -1
  141. package/docs/tabdocs-menus.md +1 -1
  142. package/docs/tabdocs-mobile.md +1 -1
  143. package/docs/tabdocs-tabs.md +1 -1
  144. package/docs/tabdocs-windows.md +1 -1
  145. package/docs/tabdocs-workspace.md +1 -1
  146. package/docs/tabdocs.md +1 -1
  147. package/docs/tabs.md +3 -3
  148. package/docs/tagbox.md +3 -3
  149. package/docs/textarea.md +3 -3
  150. package/docs/textbox.md +3 -3
  151. package/docs/toast.md +3 -3
  152. package/docs/tokens.md +349 -122
  153. package/docs/toolbar.md +3 -3
  154. package/docs/tooltip.md +1 -1
  155. package/docs/treeview.md +3 -3
  156. package/docs/window.md +3 -3
  157. package/docs/wizard.md +240 -0
  158. package/llms-full.txt +2415 -240
  159. package/llms.txt +10 -1
  160. package/package.json +9 -3
@@ -0,0 +1,121 @@
1
+ import { Component, Emitter, type Bind, type ComponentBase, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
2
+ import { Control } from "../../core/control";
3
+ import type { ControlSize } from "../../core/control-size";
4
+ import type { IconSource } from "../../core/icon-source";
5
+ import type { StepChangedEventArgs } from "./step-changed-event-args";
6
+ import type { StepChangingEventArgs } from "./step-changing-event-args";
7
+ import type { StepperItem } from "./stepper-item";
8
+ import type { StepperLabelPosition } from "./stepper-label-position";
9
+ import type { StepperOrientation } from "./stepper-orientation";
10
+ import type { StepperProps } from "./stepper-props";
11
+ import type { StepperStatus } from "./stepper-status";
12
+ interface Look {
13
+ item: unknown;
14
+ key: string | null;
15
+ text: string;
16
+ description: string;
17
+ icon: IconSource | null;
18
+ status: 'done' | 'error' | 'pending' | null;
19
+ optional: boolean;
20
+ enabled: boolean;
21
+ }
22
+ interface Step {
23
+ li: Component<HTMLLIElement>;
24
+ face: Component<HTMLElement>;
25
+ indicator: Component<HTMLSpanElement>;
26
+ number: Component<HTMLSpanElement>;
27
+ mark: Component<HTMLSpanElement>;
28
+ icon: ComponentBase | null;
29
+ position: Component<HTMLSpanElement>;
30
+ label: Component<HTMLSpanElement>;
31
+ description: Component<HTMLSpanElement>;
32
+ note: Component<HTMLSpanElement>;
33
+ state: Component<HTMLSpanElement>;
34
+ line: Component<HTMLSpanElement>;
35
+ }
36
+ /**
37
+ * The steps of a longer task and where the user stands in them: a numbered indicator and a text per step, a line
38
+ * between them, the steps before the current one completed. A step is a button (`clickable`); in linear order a
39
+ * press reaches a completed step or the one right after the last completed, and `onStepChanging` may refuse or
40
+ * wait. One Tab stop: the arrow keys move between the steps, Enter and Space choose. The `Wizard` adds a page and
41
+ * the buttons to each step.
42
+ *
43
+ * @example
44
+ * <Stepper items={['Account', 'Address', 'Payment']} x-model={() => this.order.step} />
45
+ * <Stepper orientation="vertical" items={[{ text: 'Details', description: 'Name and e-mail' }, { text: 'Review', optional: true }]} />
46
+ */
47
+ export declare class Stepper extends Control<HTMLElement, StepperProps> {
48
+ changing: Emitter<StepChangingEventArgs>;
49
+ changed: Emitter<StepChangedEventArgs>;
50
+ list: Component<HTMLOListElement>;
51
+ steps: Step[];
52
+ looks: Look[];
53
+ stopItems: (() => void) | null;
54
+ focusedAt: number;
55
+ byUser: boolean;
56
+ ready: boolean;
57
+ guard: ((e: {
58
+ from: number;
59
+ to: number;
60
+ byUser: boolean;
61
+ }) => boolean | Promise<boolean>) | null;
62
+ constructor(props?: IBaseProp<StepperProps>);
63
+ previousIndex: number;
64
+ get items(): readonly (StepperItem | string)[];
65
+ set items(value: Bind<readonly (StepperItem | string)[]>);
66
+ get value(): string | number | null;
67
+ set value(value: Bind<string | number | null>);
68
+ get linear(): boolean;
69
+ set linear(value: Bind<boolean>);
70
+ get orientation(): StepperOrientation;
71
+ set orientation(value: Bind<StepperOrientation>);
72
+ get labelPosition(): StepperLabelPosition;
73
+ set labelPosition(value: Bind<StepperLabelPosition>);
74
+ get size(): ControlSize;
75
+ set size(value: Bind<ControlSize>);
76
+ get clickable(): boolean;
77
+ set clickable(value: Bind<boolean>);
78
+ get showNumbers(): boolean;
79
+ set showNumbers(value: Bind<boolean>);
80
+ get label(): string;
81
+ set label(value: Bind<string>);
82
+ /** The current step is about to change (`from`, `to`, `byUser`); `cancel` keeps it, `promise` waits. */
83
+ get onStepChanging(): MotifEvent<StepChangingEventArgs>;
84
+ /** The current step changed, by the user or from code (`byUser`). */
85
+ get onStepChanged(): MotifEvent<StepChangedEventArgs>;
86
+ /** The index of the current step; -1 when there is none. */
87
+ get selectedIndex(): number;
88
+ /** How many steps there are. */
89
+ get count(): number;
90
+ /** A step after the current one can be gone to with `next()`. */
91
+ get canGoNext(): boolean;
92
+ /** A step before the current one can be gone to with `previous()`. */
93
+ get canGoPrevious(): boolean;
94
+ /** The status of the step at `index`, as drawn. */
95
+ statusOf(index: number): StepperStatus;
96
+ /** Whether a press may reach the step at `index`: enabled, and in linear order with every step before it done or optional. */
97
+ canReach(index: number): boolean;
98
+ /** Goes to the step after the current one (the next enabled); `false` when there is none or the change was refused. */
99
+ next(): Promise<boolean>;
100
+ /** Goes to the step before the current one (the previous enabled). */
101
+ previous(): Promise<boolean>;
102
+ /** Goes to a step by index or key, whatever the order; `onStepChanging` is asked first. */
103
+ goTo(step: number | string): Promise<boolean>;
104
+ /** Reads the items again after they were changed in place. */
105
+ refresh(): void;
106
+ /** The index a value names: a key, else an index in range; -1 for none. */
107
+ indexOf(value: string | number | null | undefined): number;
108
+ /** The value that names the step at `index`: its key when it has one, else the index. */
109
+ valueAt(index: number): string | number;
110
+ renderName(): void;
111
+ renderItems(): void;
112
+ lookOf(item: unknown): Look;
113
+ drawSteps(): void;
114
+ makeStep(index: number, clickable: boolean): Step;
115
+ drawStates(): void;
116
+ drawStops(): void;
117
+ nextIndex(direction: 1 | -1): number;
118
+ go(to: number, byUser: boolean, event?: Event): Promise<boolean>;
119
+ keyDown(e: KeyboardEvent): void;
120
+ }
121
+ export {};
@@ -0,0 +1,112 @@
1
+ import { Component, Emitter, type Bind, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
2
+ import { Control } from "../../core/control";
3
+ import type { ControlSize } from "../../core/control-size";
4
+ import { Button } from "../button/Button";
5
+ import type { StepChangedEventArgs } from "./step-changed-event-args";
6
+ import type { StepChangingEventArgs } from "./step-changing-event-args";
7
+ import { Stepper } from "./Stepper";
8
+ import type { StepperLabelPosition } from "./stepper-label-position";
9
+ import type { StepperOrientation } from "./stepper-orientation";
10
+ import type { WizardFinishingEventArgs } from "./wizard-finishing-event-args";
11
+ import type { WizardProps } from "./wizard-props";
12
+ import { WizardStep } from "./WizardStep";
13
+ /**
14
+ * A task in steps: a `Stepper` above (or beside) one page per step, and the Back and Next buttons under them. Next
15
+ * validates the page first: the kit's fields on it, then the step's own `validate`; a page that fails keeps the
16
+ * wizard and marks its step. On the last step Next finishes (`onFinishing`, `onFinished`). The steps are
17
+ * `WizardStep`s, from JSX or from `steps`, and the current one is `value` (`x-model`).
18
+ *
19
+ * @example
20
+ * <Wizard onFinished={() => this.save()}>
21
+ * <WizardStep title="Account"><TextBox label="E-mail" required /></WizardStep>
22
+ * <WizardStep title="Address"><TextBox label="City" required /></WizardStep>
23
+ * <WizardStep title="Review"><p>All set.</p></WizardStep>
24
+ * </Wizard>
25
+ *
26
+ * new Wizard({ steps: [{ title: 'Account', content: () => new AccountPage() }, { title: 'Done', content: () => new DonePage() }] });
27
+ */
28
+ export declare class Wizard extends Control<HTMLDivElement, WizardProps> {
29
+ stepper: Stepper;
30
+ pages: Component<HTMLDivElement>;
31
+ bar: Component<HTMLDivElement>;
32
+ previousButton: Button;
33
+ nextButton: Button;
34
+ steps: WizardStep[];
35
+ finishing: Emitter<WizardFinishingEventArgs>;
36
+ finished: Emitter<{
37
+ source: Wizard;
38
+ }>;
39
+ done: boolean;
40
+ shownStep: WizardStep | null;
41
+ ready: boolean;
42
+ constructor(props?: IBaseProp<WizardProps>);
43
+ get value(): string | number | null;
44
+ set value(value: Bind<string | number | null>);
45
+ get linear(): boolean;
46
+ set linear(value: Bind<boolean>);
47
+ get orientation(): StepperOrientation;
48
+ set orientation(value: Bind<StepperOrientation>);
49
+ get labelPosition(): StepperLabelPosition;
50
+ set labelPosition(value: Bind<StepperLabelPosition>);
51
+ get size(): ControlSize;
52
+ set size(value: Bind<ControlSize>);
53
+ get showStepper(): boolean;
54
+ set showStepper(value: Bind<boolean>);
55
+ get clickable(): boolean;
56
+ set clickable(value: Bind<boolean>);
57
+ get showNavigation(): boolean;
58
+ set showNavigation(value: Bind<boolean>);
59
+ get lazy(): boolean;
60
+ set lazy(value: Bind<boolean>);
61
+ get keepAlive(): boolean;
62
+ set keepAlive(value: Bind<boolean>);
63
+ get previousText(): string;
64
+ set previousText(value: Bind<string>);
65
+ get nextText(): string;
66
+ set nextText(value: Bind<string>);
67
+ get finishText(): string;
68
+ set finishText(value: Bind<string>);
69
+ get label(): string;
70
+ set label(value: Bind<string>);
71
+ /** The current step is about to change (the stepper's event); `cancel` keeps it, `promise` waits. */
72
+ get onStepChanging(): MotifEvent<StepChangingEventArgs>;
73
+ /** The current step changed (the stepper's event). */
74
+ get onStepChanged(): MotifEvent<StepChangedEventArgs>;
75
+ /** The last page passed and the wizard is about to finish; `cancel` keeps it open, `promise` waits. */
76
+ get onFinishing(): MotifEvent<WizardFinishingEventArgs>;
77
+ /** The wizard finished. */
78
+ get onFinished(): MotifEvent<{
79
+ source: Wizard;
80
+ }>;
81
+ /** The step of the current page; `null` when there is none. */
82
+ get currentStep(): WizardStep | null;
83
+ /** The index of the current step; -1 when there is none. */
84
+ get selectedIndex(): number;
85
+ /** The current step is the last one that can be gone to: Next finishes. */
86
+ get isLast(): boolean;
87
+ /** The wizard finished (`finish()` passed). */
88
+ get isFinished(): boolean;
89
+ /** Adds a step at the end. */
90
+ add(step: WizardStep): WizardStep;
91
+ /** Adds a step at `index`. */
92
+ insert(index: number, step: WizardStep): WizardStep;
93
+ /** Takes a step out and disposes it. */
94
+ remove(step: WizardStep): boolean;
95
+ /** Validates the page, then goes to the next step; on the last one, finishes. */
96
+ next(): Promise<boolean>;
97
+ /** Goes back a step; nothing is validated. */
98
+ previous(): Promise<boolean>;
99
+ /** Goes to a step by index or key; going forward validates the page. */
100
+ goTo(step: number | string): Promise<boolean>;
101
+ /** Validates the page, asks `onFinishing`, then finishes: every step is drawn done and `onFinished` is raised. */
102
+ finish(): Promise<boolean>;
103
+ /** Validates the current page the way Next does: the kit's fields on it, then the step's own `validate`. The step is marked when it fails. */
104
+ leaveCheck(): Promise<boolean>;
105
+ /** The stepper's items are made again from the steps: a step changed, came or went. */
106
+ stepsChanged(): void;
107
+ stepChanged(e: StepChangedEventArgs): void;
108
+ showPage(): void;
109
+ drawBar(): void;
110
+ lazyOf(step: WizardStep): boolean;
111
+ keepAliveOf(step: WizardStep): boolean;
112
+ }
@@ -0,0 +1,44 @@
1
+ import { type Bind, type IBaseProp } from "@motifx/core";
2
+ import { Control } from "../../core/control";
3
+ import type { IconSource } from "../../core/icon-source";
4
+ import { PanelContent } from "../tabs/PanelContent";
5
+ import type { Wizard } from "./Wizard";
6
+ import type { WizardStepProps } from "./wizard-step-props";
7
+ /**
8
+ * One step of a {@link Wizard}: its entry in the stepper and its page. The JSX children are the page, built when
9
+ * the step is first shown (see `lazy`); `content` makes it from code.
10
+ *
11
+ * @example
12
+ * <Wizard>
13
+ * <WizardStep title="Account"><TextBox label="E-mail" required /></WizardStep>
14
+ * <WizardStep title="Done" content={() => new Summary()} />
15
+ * </Wizard>
16
+ */
17
+ export declare class WizardStep extends Control<HTMLDivElement, WizardStepProps> {
18
+ content: PanelContent;
19
+ validate: (() => boolean | Promise<boolean>) | null;
20
+ owner: Wizard | null;
21
+ constructor(props?: IBaseProp<WizardStepProps>);
22
+ get title(): string;
23
+ set title(value: Bind<string>);
24
+ get description(): string;
25
+ set description(value: Bind<string>);
26
+ get key(): string | undefined;
27
+ set key(value: Bind<string>);
28
+ get icon(): IconSource | null;
29
+ set icon(value: Bind<IconSource | null | undefined>);
30
+ get optional(): boolean;
31
+ set optional(value: Bind<boolean>);
32
+ get error(): boolean;
33
+ set error(value: Bind<boolean>);
34
+ get lazy(): boolean | undefined;
35
+ set lazy(value: Bind<boolean | undefined>);
36
+ get keepAlive(): boolean | undefined;
37
+ set keepAlive(value: Bind<boolean | undefined>);
38
+ get validateFields(): boolean;
39
+ set validateFields(value: Bind<boolean>);
40
+ /** Whether this is the wizard's current step. */
41
+ get isCurrent(): boolean;
42
+ /** The wizard the step is in. */
43
+ get wizard(): Wizard | null;
44
+ }
@@ -0,0 +1,13 @@
1
+ export { Stepper } from './Stepper';
2
+ export { Wizard } from './Wizard';
3
+ export { WizardStep } from './WizardStep';
4
+ export type { StepperItem } from './stepper-item';
5
+ export type { StepperProps } from './stepper-props';
6
+ export type { StepperStatus } from './stepper-status';
7
+ export type { StepperOrientation } from './stepper-orientation';
8
+ export type { StepperLabelPosition } from './stepper-label-position';
9
+ export type { StepChangingEventArgs } from './step-changing-event-args';
10
+ export type { StepChangedEventArgs } from './step-changed-event-args';
11
+ export type { WizardProps } from './wizard-props';
12
+ export type { WizardStepProps } from './wizard-step-props';
13
+ export type { WizardFinishingEventArgs } from './wizard-finishing-event-args';
@@ -0,0 +1,11 @@
1
+ import type { Stepper } from './Stepper';
2
+ /** The current step changed. */
3
+ export interface StepChangedEventArgs {
4
+ index: number;
5
+ /** The item as given; `null` when there is no current step. */
6
+ item: unknown;
7
+ previous: number;
8
+ /** By a press on a step, else from code. */
9
+ byUser: boolean;
10
+ source: Stepper;
11
+ }
@@ -0,0 +1,18 @@
1
+ import type { EventArgs } from '@motifx/core';
2
+ import type { Stepper } from './Stepper';
3
+ /**
4
+ * The current step is about to change. `cancel = true` keeps it; `promise` may be set to wait (a validation, a
5
+ * server): the step changes when it resolves to `true`.
6
+ */
7
+ export interface StepChangingEventArgs extends EventArgs {
8
+ from: number;
9
+ to: number;
10
+ /** The items as given; `null` when there is none (no current step). */
11
+ fromItem: unknown;
12
+ toItem: unknown;
13
+ /** By a press on a step, else from code. */
14
+ byUser: boolean;
15
+ promise?: Promise<boolean>;
16
+ source: Stepper;
17
+ event?: Event;
18
+ }
@@ -0,0 +1,20 @@
1
+ import type { Bind } from '@motifx/core';
2
+ import type { IconSource } from '../../core/icon-source';
3
+ /** One step of a `Stepper`. Its fields may be functions of reactive state: the stepper follows them. */
4
+ export interface StepperItem {
5
+ text: Bind<string>;
6
+ /** A second line under the text. */
7
+ description?: Bind<string>;
8
+ /** Names the step in `value`; without it the step's index does. */
9
+ key?: string;
10
+ /** Drawn in the indicator in place of the number. */
11
+ icon?: Bind<IconSource | null>;
12
+ /** `done` or `error` whatever the current step is; left out, the steps before the current one are done. */
13
+ status?: Bind<'done' | 'error' | 'pending' | null>;
14
+ /** May be skipped in linear order; says so under the text. */
15
+ optional?: Bind<boolean>;
16
+ /** `false` keeps it from being chosen. Default `true`. */
17
+ enabled?: Bind<boolean>;
18
+ /** The app's own value for the step. */
19
+ data?: unknown;
20
+ }
@@ -0,0 +1,2 @@
1
+ /** Where a step's texts sit next to its indicator: after it, or under it (horizontal steppers only). */
2
+ export type StepperLabelPosition = 'end' | 'bottom';
@@ -0,0 +1 @@
1
+ export type StepperOrientation = 'horizontal' | 'vertical';
@@ -0,0 +1,32 @@
1
+ import type { Bind } from '@motifx/core';
2
+ import type { ControlProps } from '../../core/control';
3
+ import type { ControlSize } from '../../core/control-size';
4
+ import type { StepChangedEventArgs } from './step-changed-event-args';
5
+ import type { StepChangingEventArgs } from './step-changing-event-args';
6
+ import type { StepperItem } from './stepper-item';
7
+ import type { StepperLabelPosition } from './stepper-label-position';
8
+ import type { StepperOrientation } from './stepper-orientation';
9
+ /** Props of `Stepper`. Each one is also a settable property; a function is followed. */
10
+ export interface StepperProps extends ControlProps {
11
+ /** The steps in order: `StepperItem`s or plain texts. */
12
+ items?: Bind<readonly (StepperItem | string)[]>;
13
+ /** The current step: its `key`, else its index. `x-model` binds it two-way. Default `0`; `null` for none. */
14
+ value?: Bind<string | number | null>;
15
+ /** The steps are taken in order: a press reaches a completed step, or the one right after the last completed. Default `true`. */
16
+ linear?: Bind<boolean>;
17
+ /** Default `'horizontal'`. */
18
+ orientation?: Bind<StepperOrientation>;
19
+ /** Where the texts sit next to the indicator in a horizontal stepper. Default `'bottom'`. */
20
+ labelPosition?: Bind<StepperLabelPosition>;
21
+ /** Default `'md'`. */
22
+ size?: Bind<ControlSize>;
23
+ /** The steps can be pressed. `false` shows the way only. Default `true`. */
24
+ clickable?: Bind<boolean>;
25
+ /** The indicator of a step to come shows its number. Default `true`. */
26
+ showNumbers?: Bind<boolean>;
27
+ /** What screen readers call it. Default: the kit's "Steps". */
28
+ label?: Bind<string>;
29
+ /** The current step is about to change; cancelable, may wait on `promise`. */
30
+ onStepChanging?: (e: StepChangingEventArgs) => void;
31
+ onStepChanged?: (e: StepChangedEventArgs) => void;
32
+ }
@@ -0,0 +1,2 @@
1
+ /** Where a step stands: still to come, the one in hand, completed, or with an error. */
2
+ export type StepperStatus = 'pending' | 'current' | 'done' | 'error';
@@ -0,0 +1,7 @@
1
+ import type { EventArgs } from '@motifx/core';
2
+ import type { Wizard } from './Wizard';
3
+ /** The wizard is about to finish (after the last page validated). `cancel = true` keeps it open; `promise` may be set to wait: it finishes when it resolves to `true`. */
4
+ export interface WizardFinishingEventArgs extends EventArgs {
5
+ promise?: Promise<boolean>;
6
+ source: Wizard;
7
+ }
@@ -0,0 +1,48 @@
1
+ import type { Bind } from '@motifx/core';
2
+ import type { ControlProps } from '../../core/control';
3
+ import type { ControlSize } from '../../core/control-size';
4
+ import type { StepChangedEventArgs } from './step-changed-event-args';
5
+ import type { StepChangingEventArgs } from './step-changing-event-args';
6
+ import type { StepperLabelPosition } from './stepper-label-position';
7
+ import type { StepperOrientation } from './stepper-orientation';
8
+ import type { WizardFinishingEventArgs } from './wizard-finishing-event-args';
9
+ import type { WizardStepProps } from './wizard-step-props';
10
+ /** Props of `Wizard`. Each one is also a settable property; a function is followed. */
11
+ export interface WizardProps extends ControlProps {
12
+ /** Steps made from code, each as the props of a `WizardStep` (`title`, `content`, …); the JSX `WizardStep` children come first. */
13
+ steps?: readonly WizardStepProps[];
14
+ /** The current step: its `key`, else its index. `x-model` binds it two-way. Default `0`. */
15
+ value?: Bind<string | number | null>;
16
+ /** The steps are taken in order: a step is reached only after the ones before it. Default `true`. */
17
+ linear?: Bind<boolean>;
18
+ /** `horizontal`: the stepper above the pages; `vertical`: beside them. Default `'horizontal'`. */
19
+ orientation?: Bind<StepperOrientation>;
20
+ /** Where the stepper's texts sit, horizontal only. Default `'bottom'`. */
21
+ labelPosition?: Bind<StepperLabelPosition>;
22
+ /** The stepper's size. Default `'md'`. */
23
+ size?: Bind<ControlSize>;
24
+ /** The stepper is shown. Default `true`. */
25
+ showStepper?: Bind<boolean>;
26
+ /** The steps of the stepper can be pressed. Default `true`. */
27
+ clickable?: Bind<boolean>;
28
+ /** The bar with the Back and Next buttons. Default `true`. */
29
+ showNavigation?: Bind<boolean>;
30
+ /** A page is built when first shown, then kept (a step's own `lazy` wins). Default `true`. */
31
+ lazy?: Bind<boolean>;
32
+ /** `false`: content made by a step's `content` is disposed while hidden (a step's own `keepAlive` wins). Default `true`. */
33
+ keepAlive?: Bind<boolean>;
34
+ /** The buttons' texts; the kit's “Back”, “Next” and “Finish” when not given. */
35
+ previousText?: Bind<string>;
36
+ nextText?: Bind<string>;
37
+ finishText?: Bind<string>;
38
+ /** What screen readers call the stepper. Default: the kit's "Steps". */
39
+ label?: Bind<string>;
40
+ /** The current step is about to change; cancelable, may wait on `promise`. */
41
+ onStepChanging?: (e: StepChangingEventArgs) => void;
42
+ onStepChanged?: (e: StepChangedEventArgs) => void;
43
+ /** The last page validated and the wizard is about to finish; cancelable, may wait on `promise`. */
44
+ onFinishing?: (e: WizardFinishingEventArgs) => void;
45
+ onFinished?: (e: {
46
+ source: unknown;
47
+ }) => void;
48
+ }
@@ -0,0 +1,32 @@
1
+ import type { Bind } from '@motifx/core';
2
+ import type { ControlProps } from '../../core/control';
3
+ import type { IconSource } from '../../core/icon-source';
4
+ import type { ContentFactory } from '../tabs/PanelContent';
5
+ /**
6
+ * Props of `WizardStep`: one step of a `Wizard`, its JSX children the page. Each one is also a settable property.
7
+ * `lazy` and `keepAlive` left unset follow the `Wizard`.
8
+ */
9
+ export interface WizardStepProps extends ControlProps {
10
+ /** The step's text in the stepper. The same property as `text`. */
11
+ title?: Bind<string>;
12
+ /** A second line under the title. */
13
+ description?: Bind<string>;
14
+ /** Names the step in `Wizard.value`; without it the step's index does. */
15
+ key?: Bind<string>;
16
+ /** Drawn in the indicator in place of the number. */
17
+ icon?: Bind<IconSource | null | undefined>;
18
+ /** May be skipped; says so under the title. */
19
+ optional?: Bind<boolean>;
20
+ /** `true` draws the step with an error; the wizard sets it when the page does not validate. */
21
+ error?: Bind<boolean>;
22
+ /** Builds the page when it is first shown. */
23
+ lazy?: Bind<boolean | undefined>;
24
+ /** `false`: what `content` made is disposed while the page is hidden and made again when it shows. */
25
+ keepAlive?: Bind<boolean | undefined>;
26
+ /** The kit's fields on the page are validated before the wizard moves on from it. Default `true`. */
27
+ validateFields?: Bind<boolean>;
28
+ /** Asked before the wizard moves on from the page; `false` (or a promise of it) keeps the page and marks the step. */
29
+ validate?: () => boolean | Promise<boolean>;
30
+ /** Makes the page content, called when the page is built (instead of, or after, the JSX children). */
31
+ content?: ContentFactory;
32
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Where a surface made from code goes for an anchor: the nearest container that may hold a `<div>` and is not named
3
+ * by its content (a button would read the surface as part of its name). Near the anchor, it stays in the anchor's
4
+ * landmark and window (a modal window makes the rest inert).
5
+ */
6
+ export declare function homeOf(anchor: Element): Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Text the way a search compares it: lower case by the kit's language, accents and dots taken off, so
3
+ * `iz` finds `İzmir` and `ecole` finds `École` whatever the machine's own locale is. A search with a locale of
4
+ * its own gives it.
5
+ */
6
+ export declare function foldText(text: string, locale?: string): string;
@@ -2,8 +2,6 @@ import { UiLocale } from './UiLocale';
2
2
  import type { UiStrings } from './ui-strings';
3
3
  /** The kit's built-in texts (English): what a language pack leaves out is shown in them. */
4
4
  export declare const enStrings: UiStrings;
5
- /** The Turkish pack. `uiLocale.use('tr')` loads it by itself; this is for code that assigns `uiLocale.strings`. */
6
- export declare const trStrings: UiStrings;
7
5
  /**
8
6
  * The language of the kit's controls. It starts with the page's and loads its pack; `uiLocale.use('tr-TR')`
9
7
  * switches, and every control draws its texts, dates and numbers again. Packs ship as
@@ -572,4 +572,45 @@ export interface UiStrings {
572
572
  recurrenceSummaryCount: string;
573
573
  recurrenceSummaryUntil: string;
574
574
  recurrenceSummaryCustom: string;
575
+ /** The stepper and the wizard. */
576
+ steps: string;
577
+ stepOf: string;
578
+ stepOptional: string;
579
+ stepDone: string;
580
+ stepError: string;
581
+ wizardNext: string;
582
+ wizardPrevious: string;
583
+ wizardFinish: string;
584
+ /** The date range box. */
585
+ rangeStart: string;
586
+ rangeEnd: string;
587
+ rangeOrder: string;
588
+ rangeTooShort: string;
589
+ rangeTooLong: string;
590
+ rangeToday: string;
591
+ rangeYesterday: string;
592
+ rangeLast7: string;
593
+ rangeLast30: string;
594
+ rangeThisMonth: string;
595
+ rangeLastMonth: string;
596
+ /** The file uploader. */
597
+ fileSelect: string;
598
+ fileSelectOne: string;
599
+ fileDrop: string;
600
+ fileDropOne: string;
601
+ fileUpload: string;
602
+ fileTooLarge: string;
603
+ fileTooSmall: string;
604
+ fileWrongType: string;
605
+ fileTooMany: string;
606
+ fileUploading: string;
607
+ fileUploaded: string;
608
+ fileFailed: string;
609
+ fileAborted: string;
610
+ fileAbort: string;
611
+ /** The sortable and the scroll view. */
612
+ sortableMoved: string;
613
+ scrollPullDown: string;
614
+ scrollRelease: string;
615
+ scrollRefreshing: string;
575
616
  }