@nan0web/ui 1.6.2 → 1.7.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.
Files changed (43) hide show
  1. package/package.json +89 -85
  2. package/src/core/GeneratorRunner.js +213 -0
  3. package/src/core/Intent.js +168 -0
  4. package/src/core/IntentErrorModel.js +94 -0
  5. package/src/core/MaskHandler.js +125 -0
  6. package/src/core/index.js +7 -0
  7. package/src/domain/SandboxModel.js +193 -0
  8. package/src/domain/ShowcaseAppModel.js +88 -0
  9. package/src/domain/components/AutocompleteModel.js +58 -0
  10. package/src/domain/components/BreadcrumbModel.js +265 -0
  11. package/src/domain/components/ButtonModel.js +92 -0
  12. package/src/domain/components/ConfirmModel.js +64 -0
  13. package/src/domain/components/InputModel.js +142 -0
  14. package/src/domain/components/SelectModel.js +59 -0
  15. package/src/domain/components/SpinnerModel.js +58 -0
  16. package/src/domain/components/TableModel.js +60 -0
  17. package/src/domain/components/ToastModel.js +77 -0
  18. package/src/domain/components/TreeModel.js +53 -0
  19. package/src/domain/components/index.js +11 -0
  20. package/src/domain/index.js +16 -0
  21. package/src/format.js +21 -0
  22. package/src/index.js +6 -0
  23. package/types/core/GeneratorRunner.d.ts +51 -0
  24. package/types/core/Intent.d.ts +227 -85
  25. package/types/core/IntentErrorModel.d.ts +55 -0
  26. package/types/core/MaskHandler.d.ts +33 -0
  27. package/types/core/index.d.ts +4 -0
  28. package/types/domain/SandboxModel.d.ts +59 -0
  29. package/types/domain/ShowcaseAppModel.d.ts +62 -0
  30. package/types/domain/components/AutocompleteModel.d.ts +47 -0
  31. package/types/domain/components/BreadcrumbModel.d.ts +164 -0
  32. package/types/domain/components/ButtonModel.d.ts +81 -0
  33. package/types/domain/components/ConfirmModel.d.ts +54 -0
  34. package/types/domain/components/InputModel.d.ts +121 -0
  35. package/types/domain/components/SelectModel.d.ts +48 -0
  36. package/types/domain/components/SpinnerModel.d.ts +45 -0
  37. package/types/domain/components/TableModel.d.ts +44 -0
  38. package/types/domain/components/ToastModel.d.ts +62 -0
  39. package/types/domain/components/TreeModel.d.ts +49 -0
  40. package/types/domain/components/index.d.ts +10 -0
  41. package/types/domain/index.d.ts +3 -0
  42. package/types/format.d.ts +5 -0
  43. package/types/index.d.ts +4 -0
@@ -0,0 +1,55 @@
1
+ export class IntentErrorModel {
2
+ static intent_not_object: {
3
+ help: string;
4
+ error: string;
5
+ };
6
+ static intent_unknown_type: {
7
+ help: string;
8
+ error: string;
9
+ };
10
+ static ask_missing_field: {
11
+ help: string;
12
+ error: string;
13
+ };
14
+ static ask_missing_schema_help: {
15
+ help: string;
16
+ error: string;
17
+ };
18
+ static intent_missing_message: {
19
+ help: string;
20
+ error: string;
21
+ };
22
+ static adapter_missing_ask: {
23
+ help: string;
24
+ error: string;
25
+ };
26
+ static ask_wrong_response: {
27
+ help: string;
28
+ error: string;
29
+ };
30
+ static validation_failed: {
31
+ help: string;
32
+ error: string;
33
+ };
34
+ static unhandled_intent: {
35
+ help: string;
36
+ error: string;
37
+ };
38
+ static timeout: {
39
+ help: string;
40
+ error: string;
41
+ };
42
+ static aborted: {
43
+ help: string;
44
+ error: string;
45
+ };
46
+ /**
47
+ * Build a ModelError for a specific error field.
48
+ *
49
+ * @param {string} field - Static field name on IntentErrorModel.
50
+ * @param {Record<string, *>} [params] - Template parameters to substitute {key} placeholders.
51
+ * @returns {ModelError}
52
+ */
53
+ static error(field: string, params?: Record<string, any>): ModelError;
54
+ }
55
+ import { ModelError } from '@nan0web/types';
@@ -0,0 +1,33 @@
1
+ export class MaskHandler {
2
+ constructor(mask: any);
3
+ mask: any;
4
+ raw: string;
5
+ /** How many placeholder positions the mask has */
6
+ get _slotCount(): number;
7
+ /** Static prefix of the mask (literal characters before first placeholder) */
8
+ get _prefix(): string;
9
+ get isComplete(): boolean;
10
+ get formatted(): string;
11
+ /**
12
+ * Append a digit/letter character.
13
+ * Only accepts characters that fit into placeholders.
14
+ *
15
+ * @param {string} char
16
+ * @returns {boolean} true if accepted
17
+ */
18
+ input(char: string): boolean;
19
+ /**
20
+ * Remove last character
21
+ */
22
+ backspace(): boolean;
23
+ /**
24
+ * Set a full value, intelligently stripping the mask's static prefix
25
+ * if the user pasted or injected the full formatted number.
26
+ *
27
+ * e.g. setValue('+380660848404') with mask '+38 (099) 999 9999'
28
+ * strips "+38" → raw = '0660848404'
29
+ *
30
+ * @param {string} val
31
+ */
32
+ setValue(val: string): void;
33
+ }
@@ -4,9 +4,13 @@ export { default as UiMessage } from "./Message/Message.js";
4
4
  export { default as FormMessage } from "./Form/Message.js";
5
5
  export { default as FormInput } from "./Form/Input.js";
6
6
  export { default as UiAdapter } from "./UiAdapter.js";
7
+ export { IntentErrorModel } from "./IntentErrorModel.js";
8
+ export { runGenerator } from "./GeneratorRunner.js";
9
+ export { MaskHandler } from "./MaskHandler.js";
7
10
  import UIStream from './Stream.js';
8
11
  import StreamEntry from './StreamEntry.js';
9
12
  import UIForm from './Form/Form.js';
10
13
  export { UIStream, UIStream as UiStream, StreamEntry, StreamEntry as UiStreamEntry, UIForm, UIForm as UiForm };
11
14
  export { default as Error, CancelError } from "./Error/index.js";
12
15
  export { runFlow, flow, View, Prompt, Stream, Alert, Toast, Badge, Text, Table, Input, Select, Confirm, Multiselect, Mask, Password, Spinner, Progress, default as Flow } from "./Flow.js";
16
+ export { validateIntent, ask, progress, log, result, INTENT_TYPES, isModelSchema } from "./Intent.js";
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @typedef {Object} SandboxData
3
+ * @property {string[]} [components]
4
+ * @property {string} [selectedComponent]
5
+ * @property {string} [themeFormat]
6
+ */
7
+ /**
8
+ * Model-as-Schema for the UI Sandbox environment.
9
+ * Represents a tool wrapping standard OLMUI components, allowing
10
+ * users to inspect their models, tweak variables interactively,
11
+ * and export the configuration as themes for the Marketplace.
12
+ *
13
+ * Navigation uses BreadcrumbModel:
14
+ * ESC = pop one level (if stack has no parent → exit app)
15
+ * Ctrl+C = always exit (handled by prompts.js wrapper)
16
+ *
17
+ * URL mapping:
18
+ * /sandbox → Select Component
19
+ * /sandbox/button → Edit Button properties
20
+ * /sandbox/button/export → Choose export format
21
+ */
22
+ export class SandboxModel extends Model {
23
+ static components: {
24
+ help: string;
25
+ type: string;
26
+ default: never[];
27
+ };
28
+ static selectedComponent: {
29
+ help: string;
30
+ type: string;
31
+ };
32
+ static themeFormat: {
33
+ help: string;
34
+ options: string[];
35
+ default: string;
36
+ };
37
+ /**
38
+ * @param {SandboxData | any} [data]
39
+ */
40
+ constructor(data?: SandboxData | any);
41
+ /** @type {string[]|undefined} */ components: string[] | undefined;
42
+ /** @type {string|undefined} */ selectedComponent: string | undefined;
43
+ /** @type {string|undefined} */ themeFormat: string | undefined;
44
+ run(): AsyncGenerator<any, {
45
+ type: string;
46
+ data: {
47
+ targetComponent: string | undefined;
48
+ themeConfig: any;
49
+ exportFormat: string | undefined;
50
+ breadcrumb: string;
51
+ };
52
+ }, any>;
53
+ }
54
+ export type SandboxData = {
55
+ components?: string[] | undefined;
56
+ selectedComponent?: string | undefined;
57
+ themeFormat?: string | undefined;
58
+ };
59
+ import { Model } from '@nan0web/core';
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Model-as-Schema for the entire UI Sandbox Showcase.
3
+ * Represents a complete User Journey demonstrating all components.
4
+ * Showcases OLMUI Scenario Testing capabilities.
5
+ */
6
+ export class ShowcaseAppModel {
7
+ static appName: {
8
+ help: string;
9
+ default: string;
10
+ type: string;
11
+ };
12
+ appName: string;
13
+ run(): AsyncGenerator<{
14
+ type: string;
15
+ field: string;
16
+ schema: {
17
+ help: string;
18
+ };
19
+ component: string;
20
+ model: any;
21
+ } | {
22
+ type: string;
23
+ field: string;
24
+ schema: {
25
+ help: string | undefined;
26
+ type: string;
27
+ };
28
+ component: string;
29
+ model: any;
30
+ } | {
31
+ type: string;
32
+ level: string;
33
+ message: string | undefined;
34
+ component: string;
35
+ model: any;
36
+ } | {
37
+ type: string;
38
+ message: string;
39
+ component: string;
40
+ model: any;
41
+ }, {
42
+ type: string;
43
+ data: {
44
+ success: boolean;
45
+ reason: string;
46
+ profile?: undefined;
47
+ rowsDisplayed?: undefined;
48
+ };
49
+ } | {
50
+ type: string;
51
+ data: {
52
+ success: boolean;
53
+ profile: {
54
+ userName: string;
55
+ role: string;
56
+ tool: string;
57
+ };
58
+ rowsDisplayed: number;
59
+ reason?: undefined;
60
+ };
61
+ }, unknown>;
62
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @typedef {Object} AutocompleteData
3
+ * @property {string} [content]
4
+ * @property {string[]} [options]
5
+ */
6
+ /**
7
+ * Model-as-Schema for Autocomplete component.
8
+ * Represents a text input with search suggestions.
9
+ */
10
+ export class AutocompleteModel extends Model {
11
+ static content: {
12
+ help: string;
13
+ default: string;
14
+ type: string;
15
+ };
16
+ static options: {
17
+ help: string;
18
+ default: never[];
19
+ type: string;
20
+ };
21
+ /**
22
+ * @param {AutocompleteData | any} [data]
23
+ */
24
+ constructor(data?: AutocompleteData | any);
25
+ /** @type {string|undefined} */ content: string | undefined;
26
+ /** @type {string[]|undefined} */ options: string[] | undefined;
27
+ run(): AsyncGenerator<{
28
+ type: string;
29
+ field: string;
30
+ schema: {
31
+ help: string;
32
+ options: string[] | undefined;
33
+ };
34
+ component: string;
35
+ model: any;
36
+ }, {
37
+ type: string;
38
+ data: {
39
+ selected: string | undefined;
40
+ };
41
+ }, unknown>;
42
+ }
43
+ export type AutocompleteData = {
44
+ content?: string | undefined;
45
+ options?: string[] | undefined;
46
+ };
47
+ import { Model } from '@nan0web/core';
@@ -0,0 +1,164 @@
1
+ /**
2
+ * @typedef {Object} BreadcrumbItem
3
+ * @property {string} label - Human-readable display name (e.g. "Sandbox", "Кнопка")
4
+ * @property {string} path - URL-safe segment (e.g. "sandbox", "button")
5
+ */
6
+ /**
7
+ * @typedef {Object} BreadcrumbData
8
+ * @property {BreadcrumbItem[]} [items]
9
+ * @property {string} [separator]
10
+ */
11
+ /**
12
+ * Model-as-Schema for Breadcrumb navigation.
13
+ *
14
+ * Each breadcrumb item has a `label` (display) and a `path` (URL segment).
15
+ * The full path is the join of all segments, mirroring both:
16
+ * - Web URL: /sandbox/button/export
17
+ * - DBFS URI: sandbox/button/export/index (relative to db.root)
18
+ * - Data path: {db.root}/sandbox/button/export/index.yaml
19
+ * - CLI nav: 🏖 Sandbox › Button › Export
20
+ *
21
+ * This is the universal "where am I?" model for any OLMUI application.
22
+ *
23
+ * ESC/Back = pop() one item. Empty stack = app exit.
24
+ * Ctrl+C = always exit (adapter responsibility).
25
+ */
26
+ export class BreadcrumbModel extends Model {
27
+ static items: {
28
+ help: string;
29
+ type: string;
30
+ default: never[];
31
+ };
32
+ static separator: {
33
+ help: string;
34
+ default: string;
35
+ type: string;
36
+ };
37
+ /**
38
+ * Reconstruct a BreadcrumbModel from a URL path string.
39
+ *
40
+ * @param {string} urlPath - e.g. "/sandbox/button" or "sandbox/button"
41
+ * @param {Record<string,string>} [labelMap={}] - Optional map of path→label for display names.
42
+ * @returns {BreadcrumbModel}
43
+ */
44
+ static fromPath(urlPath: string, labelMap?: Record<string, string>): BreadcrumbModel;
45
+ /**
46
+ * Create a URL-safe slug from any label.
47
+ * Handles Unicode (Cyrillic, etc.) by lowercasing and replacing spaces/special chars.
48
+ *
49
+ * @param {string} label
50
+ * @returns {string}
51
+ */
52
+ static slugify(label: string): string;
53
+ /**
54
+ * @param {BreadcrumbData | any} [data]
55
+ */
56
+ constructor(data?: BreadcrumbData | any);
57
+ /** @type {BreadcrumbItem[]} */ items: BreadcrumbItem[];
58
+ /** @type {string} */ separator: string;
59
+ /**
60
+ * Push a new level onto the navigation stack.
61
+ *
62
+ * @param {string} label - Display label (e.g. "Button", "Кнопка")
63
+ * @param {string} [path] - URL segment. Auto-slugified from label if omitted.
64
+ * @returns {this}
65
+ */
66
+ push(label: string, path?: string): this;
67
+ /**
68
+ * Pop the last level from the navigation stack.
69
+ *
70
+ * @returns {BreadcrumbItem|undefined} The removed item, or undefined if stack was empty.
71
+ */
72
+ pop(): BreadcrumbItem | undefined;
73
+ /**
74
+ * Whether the user can navigate back (stack has > 0 items after pop).
75
+ *
76
+ * @returns {boolean}
77
+ */
78
+ canGoBack(): boolean;
79
+ /**
80
+ * Navigate to a specific depth by truncating the stack.
81
+ *
82
+ * @param {number} depth - Target depth (0 = root only).
83
+ * @returns {this}
84
+ */
85
+ navigateTo(depth: number): this;
86
+ /**
87
+ * Full URL-style path: `/sandbox/button/export`
88
+ * @returns {string}
89
+ */
90
+ get path(): string;
91
+ /**
92
+ * Just the path segments array: `['sandbox', 'button', 'export']`
93
+ * @returns {string[]}
94
+ */
95
+ get segments(): string[];
96
+ /**
97
+ * Just the display labels: `['Sandbox', 'Button', 'Export']`
98
+ * @returns {string[]}
99
+ */
100
+ get labels(): string[];
101
+ /**
102
+ * Current (last) breadcrumb item.
103
+ * @returns {BreadcrumbItem|undefined}
104
+ */
105
+ get current(): BreadcrumbItem | undefined;
106
+ /**
107
+ * Current navigation depth (0 = no items).
108
+ * @returns {number}
109
+ */
110
+ get depth(): number;
111
+ /**
112
+ * Serialize to URL query param value: `sandbox/button/export`
113
+ * @returns {string}
114
+ */
115
+ toURL(): string;
116
+ /**
117
+ * DBFS document URI — the key you pass to `db.fetch()` or `db.get()`.
118
+ * Relative to `db.root`, without extension (DBFS resolves `.yaml`/`.json` automatically).
119
+ *
120
+ * @example
121
+ * nav.push('sandbox').push('button')
122
+ * nav.toURI() // → 'sandbox/button/index'
123
+ * db.fetch(nav.toURI()) // ← DBFS resolves to {root}/sandbox/button/index.yaml
124
+ *
125
+ * @param {string} [leaf='index'] - Document name without extension.
126
+ * @returns {string}
127
+ */
128
+ toURI(leaf?: string): string;
129
+ /**
130
+ * Full filesystem path relative to db.root: `sandbox/button/export/index.yaml`
131
+ * This is what DBFS resolves to on disk: `{cwd}/{root}/{toDataPath()}`.
132
+ *
133
+ * @param {string} [filename='index.yaml'] - Leaf filename with extension.
134
+ * @returns {string}
135
+ */
136
+ toDataPath(filename?: string): string;
137
+ /**
138
+ * Yields a log intent with the current breadcrumb path.
139
+ * This is a "display-only" run — it shows the navigation state.
140
+ */
141
+ run(): AsyncGenerator<any, {
142
+ type: string;
143
+ data: {
144
+ path: string;
145
+ items: BreadcrumbItem[];
146
+ depth: number;
147
+ };
148
+ }, unknown>;
149
+ }
150
+ export type BreadcrumbItem = {
151
+ /**
152
+ * - Human-readable display name (e.g. "Sandbox", "Кнопка")
153
+ */
154
+ label: string;
155
+ /**
156
+ * - URL-safe segment (e.g. "sandbox", "button")
157
+ */
158
+ path: string;
159
+ };
160
+ export type BreadcrumbData = {
161
+ items?: BreadcrumbItem[] | undefined;
162
+ separator?: string | undefined;
163
+ };
164
+ import { Model } from '@nan0web/core';
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @typedef {'primary'|'secondary'|'info'|'ok'|'warn'|'err'|'ghost'} ButtonVariant
3
+ * @typedef {'sm'|'md'|'lg'} ButtonSize
4
+ * @typedef {Object} ButtonData
5
+ * @property {string} [content]
6
+ * @property {ButtonVariant} [variant]
7
+ * @property {ButtonSize} [size]
8
+ * @property {boolean} [outline]
9
+ * @property {boolean} [disabled]
10
+ * @property {boolean} [loading]
11
+ */
12
+ /**
13
+ * Model-as-Schema for Button component.
14
+ * Represents the intention and state of a Button interaction.
15
+ * Used exclusively for schema definition and editor validation.
16
+ */
17
+ export class ButtonModel extends Model {
18
+ static content: {
19
+ help: string;
20
+ default: string;
21
+ type: string;
22
+ };
23
+ static variant: {
24
+ help: string;
25
+ default: string;
26
+ options: string[];
27
+ };
28
+ static size: {
29
+ help: string;
30
+ default: string;
31
+ options: string[];
32
+ };
33
+ static outline: {
34
+ help: string;
35
+ default: boolean;
36
+ type: string;
37
+ };
38
+ static disabled: {
39
+ help: string;
40
+ default: boolean;
41
+ type: string;
42
+ };
43
+ static loading: {
44
+ help: string;
45
+ default: boolean;
46
+ type: string;
47
+ };
48
+ /**
49
+ * @param {ButtonData | any} [data]
50
+ */
51
+ constructor(data?: ButtonData | any);
52
+ /** @type {string|undefined} */ content: string | undefined;
53
+ /** @type {ButtonVariant|undefined} */ variant: ButtonVariant | undefined;
54
+ /** @type {ButtonSize|undefined} */ size: ButtonSize | undefined;
55
+ /** @type {boolean|undefined} */ outline: boolean | undefined;
56
+ /** @type {boolean|undefined} */ disabled: boolean | undefined;
57
+ /** @type {boolean|undefined} */ loading: boolean | undefined;
58
+ run(): AsyncGenerator<{
59
+ type: string;
60
+ field: string;
61
+ schema: {
62
+ help: string;
63
+ };
64
+ component: string;
65
+ model: any;
66
+ }, {
67
+ type: string;
68
+ data: any;
69
+ }, unknown>;
70
+ }
71
+ export type ButtonVariant = "primary" | "secondary" | "info" | "ok" | "warn" | "err" | "ghost";
72
+ export type ButtonSize = "sm" | "md" | "lg";
73
+ export type ButtonData = {
74
+ content?: string | undefined;
75
+ variant?: ButtonVariant | undefined;
76
+ size?: ButtonSize | undefined;
77
+ outline?: boolean | undefined;
78
+ disabled?: boolean | undefined;
79
+ loading?: boolean | undefined;
80
+ };
81
+ import { Model } from '@nan0web/core';
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @typedef {Object} ConfirmData
3
+ * @property {string} [message]
4
+ * @property {string} [confirmText]
5
+ * @property {string} [cancelText]
6
+ */
7
+ /**
8
+ * Model-as-Schema for Confirm component.
9
+ */
10
+ export class ConfirmModel extends Model {
11
+ static message: {
12
+ help: string;
13
+ default: string;
14
+ type: string;
15
+ };
16
+ static confirmText: {
17
+ help: string;
18
+ default: string;
19
+ type: string;
20
+ };
21
+ static cancelText: {
22
+ help: string;
23
+ default: string;
24
+ type: string;
25
+ };
26
+ /**
27
+ * @param {ConfirmData | any} [data]
28
+ */
29
+ constructor(data?: ConfirmData | any);
30
+ /** @type {string|undefined} */ message: string | undefined;
31
+ /** @type {string|undefined} */ confirmText: string | undefined;
32
+ /** @type {string|undefined} */ cancelText: string | undefined;
33
+ run(): AsyncGenerator<{
34
+ type: string;
35
+ field: string;
36
+ schema: {
37
+ help: string | undefined;
38
+ type: string;
39
+ };
40
+ component: string;
41
+ model: any;
42
+ }, {
43
+ type: string;
44
+ data: {
45
+ confirmed: boolean;
46
+ };
47
+ }, unknown>;
48
+ }
49
+ export type ConfirmData = {
50
+ message?: string | undefined;
51
+ confirmText?: string | undefined;
52
+ cancelText?: string | undefined;
53
+ };
54
+ import { Model } from '@nan0web/core';
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @typedef {'text'|'email'|'password'|'number'|'tel'|'url'|'date'} InputType
3
+ * @typedef {Object} InputData
4
+ * @property {InputType} [type]
5
+ * @property {string} [label]
6
+ * @property {string} [placeholder]
7
+ * @property {boolean} [required]
8
+ * @property {string} [pattern]
9
+ * @property {string} [min]
10
+ * @property {string} [max]
11
+ * @property {string} [step]
12
+ * @property {string} [hint]
13
+ * @property {boolean} [disabled]
14
+ * @property {string} [content]
15
+ */
16
+ /**
17
+ * Model-as-Schema for Input component.
18
+ * Used exclusively for schema definition, validation, and editor reflection.
19
+ */
20
+ export class InputModel extends Model {
21
+ static type: {
22
+ help: string;
23
+ default: string;
24
+ options: string[];
25
+ };
26
+ static label: {
27
+ help: string;
28
+ default: string;
29
+ type: string;
30
+ };
31
+ static placeholder: {
32
+ help: string;
33
+ default: string;
34
+ type: string;
35
+ };
36
+ static required: {
37
+ help: string;
38
+ default: boolean;
39
+ type: string;
40
+ };
41
+ static pattern: {
42
+ help: string;
43
+ default: string;
44
+ type: string;
45
+ };
46
+ static min: {
47
+ help: string;
48
+ default: string;
49
+ type: string;
50
+ };
51
+ static max: {
52
+ help: string;
53
+ default: string;
54
+ type: string;
55
+ };
56
+ static step: {
57
+ help: string;
58
+ default: string;
59
+ type: string;
60
+ };
61
+ static hint: {
62
+ help: string;
63
+ default: string;
64
+ type: string;
65
+ };
66
+ static disabled: {
67
+ help: string;
68
+ default: boolean;
69
+ type: string;
70
+ };
71
+ static content: {
72
+ help: string;
73
+ default: string;
74
+ type: string;
75
+ };
76
+ /**
77
+ * @param {InputData | any} [data]
78
+ */
79
+ constructor(data?: InputData | any);
80
+ /** @type {InputType|undefined} */ type: InputType | undefined;
81
+ /** @type {string|undefined} */ label: string | undefined;
82
+ /** @type {string|undefined} */ placeholder: string | undefined;
83
+ /** @type {boolean|undefined} */ required: boolean | undefined;
84
+ /** @type {string|undefined} */ pattern: string | undefined;
85
+ /** @type {string|undefined} */ min: string | undefined;
86
+ /** @type {string|undefined} */ max: string | undefined;
87
+ /** @type {string|undefined} */ step: string | undefined;
88
+ /** @type {string|undefined} */ hint: string | undefined;
89
+ /** @type {boolean|undefined} */ disabled: boolean | undefined;
90
+ /** @type {string|undefined} */ content: string | undefined;
91
+ run(): AsyncGenerator<{
92
+ type: string;
93
+ field: string;
94
+ schema: {
95
+ help: string;
96
+ validate: (val: any) => true | "This field is required" | "Invalid format";
97
+ };
98
+ component: string;
99
+ model: any;
100
+ }, {
101
+ type: string;
102
+ data: {
103
+ value: string | undefined;
104
+ };
105
+ }, unknown>;
106
+ }
107
+ export type InputType = "text" | "email" | "password" | "number" | "tel" | "url" | "date";
108
+ export type InputData = {
109
+ type?: InputType | undefined;
110
+ label?: string | undefined;
111
+ placeholder?: string | undefined;
112
+ required?: boolean | undefined;
113
+ pattern?: string | undefined;
114
+ min?: string | undefined;
115
+ max?: string | undefined;
116
+ step?: string | undefined;
117
+ hint?: string | undefined;
118
+ disabled?: boolean | undefined;
119
+ content?: string | undefined;
120
+ };
121
+ import { Model } from '@nan0web/core';