@praxisui/stepper 1.0.0-beta.29 → 1.0.0-beta.40
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 +71 -4
- package/fesm2022/praxisui-stepper.mjs +2895 -118
- package/fesm2022/praxisui-stepper.mjs.map +1 -1
- package/index.d.ts +261 -7
- package/package.json +7 -7
package/index.d.ts
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef, EventEmitter, Provider } from '@angular/core';
|
|
2
|
+
import { OnInit, TemplateRef, EventEmitter, Provider } from '@angular/core';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
|
-
import { FormConfig, WidgetDefinition, FormReadyEvent, FormValueChangeEvent, ComponentDocMeta } from '@praxisui/core';
|
|
4
|
+
import { FormConfig, WidgetDefinition, FormReadyEvent, FormValueChangeEvent, ComponentDocMeta, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
|
|
5
5
|
import { ThemePalette } from '@angular/material/core';
|
|
6
|
+
import { BaseAiAdapter, Capability as Capability$1, PatchResult } from '@praxisui/ai';
|
|
6
7
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
7
8
|
import { BehaviorSubject } from 'rxjs';
|
|
8
9
|
import { SettingsValueProvider } from '@praxisui/settings-panel';
|
|
9
10
|
|
|
11
|
+
declare class StepperAiAdapter extends BaseAiAdapter<StepperMetadata> {
|
|
12
|
+
private stepper;
|
|
13
|
+
componentName: string;
|
|
14
|
+
constructor(stepper: PraxisStepper);
|
|
15
|
+
getCurrentConfig(): StepperMetadata;
|
|
16
|
+
getCapabilities(): Capability$1[];
|
|
17
|
+
getRuntimeState(): Record<string, any>;
|
|
18
|
+
createSnapshot(): StepperMetadata;
|
|
19
|
+
restoreSnapshot(snapshot: StepperMetadata): Promise<void>;
|
|
20
|
+
applyPatch(patch: Partial<StepperMetadata>): Promise<PatchResult>;
|
|
21
|
+
private applyConfig;
|
|
22
|
+
private smartMergeStepperConfig;
|
|
23
|
+
private mergeByKey;
|
|
24
|
+
private cloneConfig;
|
|
25
|
+
}
|
|
26
|
+
|
|
10
27
|
type StepOrientation = 'horizontal' | 'vertical';
|
|
11
28
|
type StepHeaderPosition = 'top' | 'bottom';
|
|
12
29
|
interface StepConfig {
|
|
@@ -29,6 +46,8 @@ interface StepConfig {
|
|
|
29
46
|
schemaSource?: 'resource' | 'filter';
|
|
30
47
|
formId?: string;
|
|
31
48
|
};
|
|
49
|
+
/** Widgets rendered before the step form (if present). */
|
|
50
|
+
widgetsBeforeForm?: WidgetDefinition[];
|
|
32
51
|
widgets?: WidgetDefinition[];
|
|
33
52
|
description?: string;
|
|
34
53
|
}
|
|
@@ -47,6 +66,7 @@ interface StepperMetadata {
|
|
|
47
66
|
headerClass?: string;
|
|
48
67
|
contentClass?: string;
|
|
49
68
|
appearance?: {
|
|
69
|
+
preset?: 'ft-light';
|
|
50
70
|
themeClass?: string;
|
|
51
71
|
tokens?: Record<string, string>;
|
|
52
72
|
icons?: {
|
|
@@ -68,7 +88,7 @@ interface StepperMetadata {
|
|
|
68
88
|
align?: 'start' | 'center' | 'end' | 'space-between';
|
|
69
89
|
};
|
|
70
90
|
}
|
|
71
|
-
declare class PraxisStepper {
|
|
91
|
+
declare class PraxisStepper implements OnInit {
|
|
72
92
|
stepLabelTpl?: TemplateRef<any>;
|
|
73
93
|
_config: _angular_core.WritableSignal<StepperMetadata | null>;
|
|
74
94
|
private _selectedIndex;
|
|
@@ -85,6 +105,8 @@ declare class PraxisStepper {
|
|
|
85
105
|
icon: string;
|
|
86
106
|
action: () => void;
|
|
87
107
|
}[];
|
|
108
|
+
stepperId: string;
|
|
109
|
+
componentInstanceId?: string;
|
|
88
110
|
set config(c: StepperMetadata | string | null);
|
|
89
111
|
set selectedIndexInput(i: number | null);
|
|
90
112
|
set selectedIndex(i: number | null);
|
|
@@ -114,9 +136,25 @@ declare class PraxisStepper {
|
|
|
114
136
|
output?: string;
|
|
115
137
|
payload?: any;
|
|
116
138
|
}>;
|
|
139
|
+
stepFormReady: EventEmitter<{
|
|
140
|
+
stepIndex: number;
|
|
141
|
+
stepId?: string;
|
|
142
|
+
event: FormReadyEvent;
|
|
143
|
+
}>;
|
|
144
|
+
stepFormValueChange: EventEmitter<{
|
|
145
|
+
stepIndex: number;
|
|
146
|
+
stepId?: string;
|
|
147
|
+
event: FormValueChangeEvent;
|
|
148
|
+
}>;
|
|
117
149
|
stepperContext?: Record<string, any>;
|
|
118
150
|
private readonly settings;
|
|
151
|
+
private readonly storage;
|
|
152
|
+
private readonly componentKeys;
|
|
153
|
+
private readonly logger;
|
|
154
|
+
private readonly route;
|
|
155
|
+
private warnedMissingId;
|
|
119
156
|
animationDone: EventEmitter<void>;
|
|
157
|
+
aiAdapter: StepperAiAdapter;
|
|
120
158
|
steps: _angular_core.Signal<StepConfig[]>;
|
|
121
159
|
orientation: _angular_core.Signal<StepOrientation>;
|
|
122
160
|
headerPosition: _angular_core.Signal<StepHeaderPosition>;
|
|
@@ -140,6 +178,9 @@ declare class PraxisStepper {
|
|
|
140
178
|
navNextLabel: () => string;
|
|
141
179
|
navPrevIcon: () => string | undefined;
|
|
142
180
|
navNextIcon: () => string | undefined;
|
|
181
|
+
stepperClassList: () => string;
|
|
182
|
+
contentClassList: () => string;
|
|
183
|
+
navActionsClass: () => string;
|
|
143
184
|
navAlignClass: () => "nav-align-start" | "nav-align-center" | "nav-align-space-between" | "nav-align-end";
|
|
144
185
|
isNextDisabled(i: number): boolean;
|
|
145
186
|
private clampIndex;
|
|
@@ -165,18 +206,30 @@ declare class PraxisStepper {
|
|
|
165
206
|
}): void;
|
|
166
207
|
isStepEmpty(step: StepConfig): boolean;
|
|
167
208
|
openEditor(): void;
|
|
209
|
+
applyConfigFromAdapter(next: StepperMetadata): void;
|
|
168
210
|
addFirstStep(): void;
|
|
169
211
|
onNext(i: number): Promise<void>;
|
|
170
212
|
onPrev(): void;
|
|
171
213
|
onAnimationDone(): void;
|
|
172
214
|
private applyServerErrors;
|
|
215
|
+
private persistConfig;
|
|
216
|
+
private storageKey;
|
|
217
|
+
private componentKeyId;
|
|
218
|
+
private warnMissingId;
|
|
219
|
+
ngOnInit(): void;
|
|
173
220
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PraxisStepper, never>;
|
|
174
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PraxisStepper, "praxis-stepper", never, { "config": { "alias": "config"; "required": false; }; "selectedIndexInput": { "alias": "selectedIndexInput"; "required": false; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "disableRippleInput": { "alias": "disableRippleInput"; "required": false; }; "editModeEnabled": { "alias": "editModeEnabled"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "color": { "alias": "color"; "required": false; }; "serverValidate": { "alias": "serverValidate"; "required": false; }; "stepperContext": { "alias": "stepperContext"; "required": false; }; }, { "selectedIndexChange": "selectedIndexChange"; "widgetEvent": "widgetEvent"; "animationDone": "animationDone"; "selectionChange": "selectionChange"; }, ["stepLabelTpl"], ["*"], true, never>;
|
|
221
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PraxisStepper, "praxis-stepper", never, { "stepperId": { "alias": "stepperId"; "required": true; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "config": { "alias": "config"; "required": false; }; "selectedIndexInput": { "alias": "selectedIndexInput"; "required": false; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "disableRippleInput": { "alias": "disableRippleInput"; "required": false; }; "editModeEnabled": { "alias": "editModeEnabled"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "color": { "alias": "color"; "required": false; }; "serverValidate": { "alias": "serverValidate"; "required": false; }; "stepperContext": { "alias": "stepperContext"; "required": false; }; }, { "selectedIndexChange": "selectedIndexChange"; "widgetEvent": "widgetEvent"; "stepFormReady": "stepFormReady"; "stepFormValueChange": "stepFormValueChange"; "animationDone": "animationDone"; "selectionChange": "selectionChange"; }, ["stepLabelTpl"], ["*"], true, never>;
|
|
175
222
|
}
|
|
176
223
|
|
|
177
224
|
declare const PRAXIS_STEPPER_COMPONENT_METADATA: ComponentDocMeta;
|
|
225
|
+
declare const PRAXIS_WIZARD_BENEFITS_METADATA: ComponentDocMeta;
|
|
226
|
+
declare const PRAXIS_WIZARD_CONTENT_METADATA: ComponentDocMeta;
|
|
227
|
+
declare const PRAXIS_WIZARD_NOTICE_METADATA: ComponentDocMeta;
|
|
228
|
+
declare const PRAXIS_WIZARD_DIVIDER_METADATA: ComponentDocMeta;
|
|
178
229
|
declare function providePraxisStepperMetadata(): Provider;
|
|
179
230
|
|
|
231
|
+
type WizardWidgetId = 'praxis-wizard-benefits' | 'praxis-wizard-content' | 'praxis-wizard-inline-notice' | 'praxis-wizard-divider';
|
|
232
|
+
type EditorialZone = 'before' | 'after';
|
|
180
233
|
declare class PraxisStepperConfigEditor implements SettingsValueProvider {
|
|
181
234
|
config: StepperMetadata;
|
|
182
235
|
activeIndex: number;
|
|
@@ -216,9 +269,28 @@ declare class PraxisStepperConfigEditor implements SettingsValueProvider {
|
|
|
216
269
|
removeStep(idx: number): void;
|
|
217
270
|
get activeStep(): StepConfig | null;
|
|
218
271
|
ensureWidgets(): WidgetDefinition[];
|
|
272
|
+
ensureWidgetsBeforeForm(): WidgetDefinition[];
|
|
219
273
|
displayWidgetName(w: WidgetDefinition): string;
|
|
274
|
+
editorialBeforeWidgets(step: StepConfig): WidgetDefinition[];
|
|
275
|
+
editorialAfterWidgets(step: StepConfig): WidgetDefinition[];
|
|
276
|
+
advancedWidgets(step: StepConfig): WidgetDefinition[];
|
|
277
|
+
widgetBlockId(w: WidgetDefinition): string | null;
|
|
278
|
+
editorialWidgetSummary(w: WidgetDefinition): string;
|
|
279
|
+
addEditorialWidget(id: WizardWidgetId, zone?: EditorialZone): void;
|
|
280
|
+
dropEditorialBefore(ev: CdkDragDrop<WidgetDefinition[]>): void;
|
|
281
|
+
dropEditorialAfter(ev: CdkDragDrop<WidgetDefinition[]>): void;
|
|
282
|
+
moveEditorialWidget(w: WidgetDefinition, from: EditorialZone, to: EditorialZone): void;
|
|
283
|
+
duplicateEditorialWidget(w: WidgetDefinition, zone: EditorialZone): void;
|
|
284
|
+
removeEditorialWidget(w: WidgetDefinition, zone: EditorialZone): void;
|
|
285
|
+
removeAdvancedWidget(w: WidgetDefinition): void;
|
|
220
286
|
dropWidget(ev: CdkDragDrop<WidgetDefinition[]>): void;
|
|
221
287
|
removeWidget(idx: number): void;
|
|
288
|
+
canEditWidget(w: WidgetDefinition): boolean;
|
|
289
|
+
private defaultEditorialInputs;
|
|
290
|
+
private nextEditorialBlockId;
|
|
291
|
+
private normalizeBlockIdPart;
|
|
292
|
+
private toneLabel;
|
|
293
|
+
private reorderSubset;
|
|
222
294
|
addMainForm(): void;
|
|
223
295
|
editMainForm(): void;
|
|
224
296
|
removeMainForm(): void;
|
|
@@ -228,7 +300,10 @@ declare class PraxisStepperConfigEditor implements SettingsValueProvider {
|
|
|
228
300
|
openMoreComponents(): void;
|
|
229
301
|
addTreeList(): void;
|
|
230
302
|
addTransferListQuick(): void;
|
|
231
|
-
editWidget(w: WidgetDefinition
|
|
303
|
+
editWidget(w: WidgetDefinition): void;
|
|
304
|
+
private openWizardWidgetEditor;
|
|
305
|
+
private openWizardWidgetDialog;
|
|
306
|
+
private isWizardWidgetId;
|
|
232
307
|
getSettingsValue(): any;
|
|
233
308
|
onSave(): any;
|
|
234
309
|
reset(): void;
|
|
@@ -236,5 +311,184 @@ declare class PraxisStepperConfigEditor implements SettingsValueProvider {
|
|
|
236
311
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PraxisStepperConfigEditor, "praxis-stepper-config-editor", never, {}, {}, never, never, true, never>;
|
|
237
312
|
}
|
|
238
313
|
|
|
239
|
-
|
|
240
|
-
|
|
314
|
+
type WizardCtaAction = 'next' | 'submit' | 'custom';
|
|
315
|
+
type WizardSecondaryAction = 'prev' | 'cancel';
|
|
316
|
+
interface WizardProgressConfig {
|
|
317
|
+
variant?: 'line' | 'dots';
|
|
318
|
+
showLabels?: boolean;
|
|
319
|
+
labelPosition?: 'bottom' | 'end';
|
|
320
|
+
}
|
|
321
|
+
interface WizardCard {
|
|
322
|
+
title: string;
|
|
323
|
+
description?: string;
|
|
324
|
+
icon?: string;
|
|
325
|
+
}
|
|
326
|
+
interface WizardBenefitItem {
|
|
327
|
+
icon?: string;
|
|
328
|
+
title: string;
|
|
329
|
+
text?: string;
|
|
330
|
+
}
|
|
331
|
+
type WizardBlockPlacement = 'beforeForm' | 'afterForm';
|
|
332
|
+
interface WizardBlockBase {
|
|
333
|
+
/**
|
|
334
|
+
* Optional stable identifier for telemetry/testing.
|
|
335
|
+
* When provided, it is preferred over positional index when deriving blockId.
|
|
336
|
+
*/
|
|
337
|
+
id?: string;
|
|
338
|
+
placement?: WizardBlockPlacement;
|
|
339
|
+
}
|
|
340
|
+
interface WizardBenefitsBlock extends WizardBlockBase {
|
|
341
|
+
type: 'benefitsGrid';
|
|
342
|
+
title?: string;
|
|
343
|
+
items: WizardBenefitItem[];
|
|
344
|
+
columns?: number;
|
|
345
|
+
boxed?: boolean;
|
|
346
|
+
}
|
|
347
|
+
interface WizardContentBlock extends WizardBlockBase {
|
|
348
|
+
type: 'contentBlock';
|
|
349
|
+
title?: string;
|
|
350
|
+
subtitle?: string;
|
|
351
|
+
text?: string;
|
|
352
|
+
caption?: string;
|
|
353
|
+
}
|
|
354
|
+
interface WizardInlineNoticeBlock extends WizardBlockBase {
|
|
355
|
+
type: 'inlineNotice';
|
|
356
|
+
text: string;
|
|
357
|
+
tone?: 'neutral' | 'info' | 'warning';
|
|
358
|
+
}
|
|
359
|
+
interface WizardDividerBlock extends WizardBlockBase {
|
|
360
|
+
type: 'divider';
|
|
361
|
+
label?: string;
|
|
362
|
+
}
|
|
363
|
+
type WizardBlock = WizardBenefitsBlock | WizardContentBlock | WizardInlineNoticeBlock | WizardDividerBlock;
|
|
364
|
+
interface WizardStepZones {
|
|
365
|
+
intro?: WizardBlock[];
|
|
366
|
+
body?: WizardBlock[];
|
|
367
|
+
footer?: WizardBlock[];
|
|
368
|
+
}
|
|
369
|
+
interface WizardCtaConfig {
|
|
370
|
+
label: string;
|
|
371
|
+
action?: WizardCtaAction;
|
|
372
|
+
secondaryLabel?: string;
|
|
373
|
+
secondaryAction?: WizardSecondaryAction;
|
|
374
|
+
sticky?: boolean;
|
|
375
|
+
}
|
|
376
|
+
interface WizardStepFormConfig {
|
|
377
|
+
formId?: string;
|
|
378
|
+
config: FormConfig;
|
|
379
|
+
}
|
|
380
|
+
interface WizardStepConfig {
|
|
381
|
+
id: string;
|
|
382
|
+
label: string;
|
|
383
|
+
title?: string;
|
|
384
|
+
subtitle?: string;
|
|
385
|
+
description?: string;
|
|
386
|
+
optional?: boolean;
|
|
387
|
+
cards?: WizardCard[];
|
|
388
|
+
blocks?: WizardBlock[];
|
|
389
|
+
zones?: WizardStepZones;
|
|
390
|
+
form?: WizardStepFormConfig;
|
|
391
|
+
cta?: WizardCtaConfig;
|
|
392
|
+
}
|
|
393
|
+
interface WizardPreferencesConfig {
|
|
394
|
+
stepId?: string;
|
|
395
|
+
storageKey?: string;
|
|
396
|
+
persistFields?: string[];
|
|
397
|
+
}
|
|
398
|
+
interface WizardFormConfig {
|
|
399
|
+
id: string;
|
|
400
|
+
brand?: string;
|
|
401
|
+
title?: string;
|
|
402
|
+
subtitle?: string;
|
|
403
|
+
description?: string;
|
|
404
|
+
progress?: WizardProgressConfig;
|
|
405
|
+
cta?: WizardCtaConfig;
|
|
406
|
+
steps: WizardStepConfig[];
|
|
407
|
+
preferences?: WizardPreferencesConfig;
|
|
408
|
+
/**
|
|
409
|
+
* Optional theme configuration.
|
|
410
|
+
* Keys are CSS variable names (without -- prefix) and values are the CSS values.
|
|
411
|
+
* Example: { "praxis-wizard-card-bg": "#fff1e5" }
|
|
412
|
+
*/
|
|
413
|
+
theme?: Record<string, string>;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
declare const FT_WIZARD_JSON = "{\n \"id\": \"ft-edit-wizard\",\n \"brand\": \"FINANCIAL TIMES\",\n \"progress\": {\n \"variant\": \"line\",\n \"showLabels\": true,\n \"labelPosition\": \"bottom\"\n },\n \"cta\": {\n \"label\": \"Continue\",\n \"action\": \"next\",\n \"secondaryLabel\": \"Back\",\n \"secondaryAction\": \"prev\",\n \"sticky\": true\n },\n \"preferences\": {\n \"stepId\": \"preferences\",\n \"storageKey\": \"praxis:ft-wizard\",\n \"persistFields\": [\"topStories\", \"invitesOffers\", \"recommendations\"]\n },\n \"theme\": {\n \"praxis-wizard-card-bg\": \"#fff1e5\",\n \"md-sys-color-surface\": \"#fff1e5\",\n \"md-sys-color-on-surface\": \"#33302e\",\n \"praxis-wizard-accent\": \"#0d7680\",\n \"praxis-wizard-border\": \"#cfcfcf\",\n \"md-sys-color-outline-variant\": \"#cfcfcf\",\n \"ft-font-head\": \"\\\"Financier Display\\\", Georgia, serif\",\n \"ft-font-body\": \"\\\"Metric\\\", \\\"Helvetica Neue\\\", Helvetica, Arial, sans-serif\",\n \"ft-radius\": \"0\",\n \"ft-shadow\": \"none\",\n \"ft-header-border\": \"1px solid #cfcfcf\"\n },\n \"steps\": [\n {\n \"id\": \"access\",\n \"label\": \"Access\",\n \"title\": \"Create an FT Edit account\",\n \"subtitle\": \"Get access in a couple of steps and upgrade later for the full FT experience.\",\n \"zones\": {\n \"intro\": [\n {\n \"type\": \"benefitsGrid\",\n \"title\": \"Why register?\",\n \"columns\": 4,\n \"boxed\": true,\n \"items\": [\n {\n \"icon\": \"format_quote\",\n \"title\": \"Beyond the headlines\",\n \"text\": \"Insightful news, thought-provoking opinion and fascinating features.\"\n },\n {\n \"icon\": \"edit_note\",\n \"title\": \"Curated daily editions\",\n \"text\": \"Eight fresh articles a day chosen for you by our senior editors.\"\n },\n {\n \"icon\": \"bookmarks\",\n \"title\": \"Never miss a great story\",\n \"text\": \"Explore previous editions from the past week.\"\n },\n {\n \"icon\": \"mail\",\n \"title\": \"Receive the FT Edit newsletter\",\n \"text\": \"A daily round-up delivered straight to your inbox.\"\n }\n ]\n }\n ],\n \"footer\": [\n {\n \"type\": \"inlineNotice\",\n \"text\": \"For more information about how we use your data, please refer to our privacy and cookie policies.\"\n }\n ]\n },\n \"cta\": {\n \"label\": \"Register with email\",\n \"action\": \"next\"\n },\n \"form\": {\n \"config\": {\n \"sections\": [\n {\n \"id\": \"access-section\",\n \"rows\": [\n {\n \"columns\": [\n {\n \"fields\": [\"confirmAge\", \"editNewsletter\"]\n }\n ]\n }\n ]\n }\n ],\n \"fieldMetadata\": [\n {\n \"name\": \"confirmAge\",\n \"label\": \"\",\n \"controlType\": \"checkbox\",\n \"required\": true,\n \"layout\": \"horizontal\",\n \"options\": [\n {\n \"label\": \"I confirm I am 16+ years old and agree to the Terms & Conditions.\",\n \"value\": true\n }\n ]\n },\n {\n \"name\": \"editNewsletter\",\n \"label\": \"FT Edit newsletter\",\n \"controlType\": \"toggle\",\n \"defaultValue\": true,\n \"hint\": \"All new members also start receiving our daily FT Edit newsletter.\"\n }\n ],\n \"actions\": {\n \"submit\": { \"visible\": false, \"label\": \"Submit\" },\n \"cancel\": { \"visible\": false, \"label\": \"Cancel\" },\n \"reset\": { \"visible\": false, \"label\": \"Reset\" }\n }\n }\n }\n },\n {\n \"id\": \"account\",\n \"label\": \"Account\",\n \"title\": \"Create an FT Edit account\",\n \"subtitle\": \"This address will be used to create your account.\",\n \"zones\": {\n \"intro\": [\n {\n \"type\": \"inlineNotice\",\n \"text\": \"All new members also start receiving our daily FT Edit newsletter.\",\n \"tone\": \"info\"\n }\n ],\n \"footer\": [\n {\n \"type\": \"inlineNotice\",\n \"text\": \"We will send you service messages about your account, security or legal notifications.\"\n }\n ]\n },\n \"form\": {\n \"config\": {\n \"sections\": [\n {\n \"id\": \"account-section\",\n \"rows\": [\n {\n \"columns\": [\n { \"fields\": [\"email\", \"password\"] },\n { \"fields\": [\"newsletterOptIn\"] }\n ]\n }\n ]\n }\n ],\n \"fieldMetadata\": [\n {\n \"name\": \"email\",\n \"label\": \"Email address\",\n \"controlType\": \"email\",\n \"required\": true,\n \"placeholder\": \"Enter your email address\"\n },\n {\n \"name\": \"password\",\n \"label\": \"Password\",\n \"controlType\": \"password\",\n \"required\": true,\n \"placeholder\": \"Enter a password\",\n \"hint\": \"Use 8 or more characters. You can use letters, numbers or symbols.\",\n \"validators\": {\n \"minLength\": 8\n },\n \"revealToggle\": {\n \"enabled\": true,\n \"style\": \"text\",\n \"showLabel\": \"Show password\",\n \"hideLabel\": \"Hide password\",\n \"ariaLabel\": \"Toggle password visibility\"\n }\n },\n {\n \"name\": \"newsletterOptIn\",\n \"label\": \"Stay up to date\",\n \"controlType\": \"toggle\",\n \"defaultValue\": true,\n \"hint\": \"All new members also start receiving our daily FT Edit newsletter.\"\n }\n ],\n \"actions\": {\n \"submit\": { \"visible\": false, \"label\": \"Submit\" },\n \"cancel\": { \"visible\": false, \"label\": \"Cancel\" },\n \"reset\": { \"visible\": false, \"label\": \"Reset\" }\n }\n }\n }\n },\n {\n \"id\": \"preferences\",\n \"label\": \"Preferences\",\n \"title\": \"Stay up to date\",\n \"subtitle\": \"You can update these any time in your Contact Preferences.\",\n \"description\": \"We will send you service messages about your account, security or legal notifications.\",\n \"zones\": {\n \"footer\": [\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"inlineNotice\",\n \"text\": \"We will send you service messages about your account, security or legal notifications.\"\n }\n ]\n },\n \"cta\": {\n \"label\": \"Create an FT Edit account\",\n \"action\": \"submit\",\n \"secondaryLabel\": \"Back\",\n \"secondaryAction\": \"prev\"\n },\n \"form\": {\n \"config\": {\n \"sections\": [\n {\n \"id\": \"prefs-section\",\n \"rows\": [\n {\n \"columns\": [\n { \"fields\": [\"topStories\"] },\n { \"fields\": [\"invitesOffers\"] },\n { \"fields\": [\"recommendations\"] }\n ]\n }\n ]\n }\n ],\n \"fieldMetadata\": [\n {\n \"name\": \"topStories\",\n \"label\": \"Top stories & features\",\n \"controlType\": \"toggle\",\n \"defaultValue\": true,\n \"hint\": \"Get the most from the Financial Times with personalised special reports, recommended reads and latest feature announcements.\"\n },\n {\n \"name\": \"invitesOffers\",\n \"label\": \"Invites & offers from the FT\",\n \"controlType\": \"toggle\",\n \"defaultValue\": true,\n \"hint\": \"Receive exclusive personalised event invitations, carefully-curated offers and promotions from the Financial Times.\"\n },\n {\n \"name\": \"recommendations\",\n \"label\": \"Personal recommendations\",\n \"controlType\": \"toggle\",\n \"defaultValue\": false,\n \"hint\": \"Tailored reading lists based on what you follow.\"\n }\n ],\n \"actions\": {\n \"submit\": { \"visible\": false, \"label\": \"Submit\" },\n \"cancel\": { \"visible\": false, \"label\": \"Cancel\" },\n \"reset\": { \"visible\": false, \"label\": \"Reset\" }\n }\n }\n }\n }\n ]\n}";
|
|
417
|
+
declare const FT_WIZARD_CONFIG: WizardFormConfig;
|
|
418
|
+
|
|
419
|
+
declare class PraxisWizardFormComponent {
|
|
420
|
+
private readonly el;
|
|
421
|
+
private readonly renderer;
|
|
422
|
+
private readonly storage;
|
|
423
|
+
constructor();
|
|
424
|
+
stepper?: PraxisStepper;
|
|
425
|
+
wizardId: string;
|
|
426
|
+
editModeEnabled: boolean;
|
|
427
|
+
set config(cfg: WizardFormConfig | string | null);
|
|
428
|
+
submit: EventEmitter<{
|
|
429
|
+
wizardId: string;
|
|
430
|
+
values: Record<string, any>;
|
|
431
|
+
}>;
|
|
432
|
+
private readonly _config;
|
|
433
|
+
private readonly persistedState;
|
|
434
|
+
readonly selectedIndex: _angular_core.WritableSignal<number>;
|
|
435
|
+
readonly wizard: _angular_core.Signal<WizardFormConfig | null>;
|
|
436
|
+
readonly stepperConfig: _angular_core.Signal<StepperMetadata | null>;
|
|
437
|
+
readonly activeStep: _angular_core.Signal<WizardStepConfig | null>;
|
|
438
|
+
wizardBrand: _angular_core.Signal<string>;
|
|
439
|
+
activeTitle: _angular_core.Signal<string>;
|
|
440
|
+
activeSubtitle: _angular_core.Signal<string>;
|
|
441
|
+
activeDescription: _angular_core.Signal<string>;
|
|
442
|
+
readonly resolvedCta: _angular_core.Signal<Partial<WizardCtaConfig>>;
|
|
443
|
+
primaryLabel: _angular_core.Signal<string>;
|
|
444
|
+
primaryAction: _angular_core.Signal<WizardCtaAction>;
|
|
445
|
+
secondaryLabel: _angular_core.Signal<string>;
|
|
446
|
+
secondaryAction: _angular_core.Signal<WizardSecondaryAction>;
|
|
447
|
+
showSecondaryAction(): boolean;
|
|
448
|
+
isPrimaryDisabled(): boolean;
|
|
449
|
+
onPrimaryAction(): void;
|
|
450
|
+
onSecondaryAction(): void;
|
|
451
|
+
onSelectedIndexChange(idx: number): void;
|
|
452
|
+
onStepFormValueChange(ev: {
|
|
453
|
+
stepIndex: number;
|
|
454
|
+
stepId?: string;
|
|
455
|
+
event: {
|
|
456
|
+
formData?: any;
|
|
457
|
+
};
|
|
458
|
+
}): void;
|
|
459
|
+
ngOnInit(): void;
|
|
460
|
+
private collectValues;
|
|
461
|
+
private loadPersistedState;
|
|
462
|
+
private persistState;
|
|
463
|
+
private storageKey;
|
|
464
|
+
private resetProgress;
|
|
465
|
+
private focusPrimaryAction;
|
|
466
|
+
private focusSecondaryAction;
|
|
467
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PraxisWizardFormComponent, never>;
|
|
468
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PraxisWizardFormComponent, "praxis-wizard-form", never, { "wizardId": { "alias": "wizardId"; "required": true; }; "editModeEnabled": { "alias": "editModeEnabled"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "submit": "submit"; }, never, never, true, never>;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Capabilities catalog for Praxis Stepper (StepperMetadata).
|
|
473
|
+
* Paths follow StepperMetadata shape (patch merged at config root).
|
|
474
|
+
*/
|
|
475
|
+
|
|
476
|
+
declare module '@praxisui/core' {
|
|
477
|
+
interface AiCapabilityCategoryMap {
|
|
478
|
+
navigation: true;
|
|
479
|
+
steps: true;
|
|
480
|
+
meta: true;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
type CapabilityCategory = AiCapabilityCategory;
|
|
484
|
+
type ValueKind = AiValueKind;
|
|
485
|
+
interface Capability extends AiCapability {
|
|
486
|
+
category: CapabilityCategory;
|
|
487
|
+
}
|
|
488
|
+
interface CapabilityCatalog extends AiCapabilityCatalog {
|
|
489
|
+
capabilities: Capability[];
|
|
490
|
+
}
|
|
491
|
+
declare const STEPPER_AI_CAPABILITIES: CapabilityCatalog;
|
|
492
|
+
|
|
493
|
+
export { FT_WIZARD_CONFIG, FT_WIZARD_JSON, PRAXIS_STEPPER_COMPONENT_METADATA, PRAXIS_WIZARD_BENEFITS_METADATA, PRAXIS_WIZARD_CONTENT_METADATA, PRAXIS_WIZARD_DIVIDER_METADATA, PRAXIS_WIZARD_NOTICE_METADATA, PraxisStepper, PraxisStepperConfigEditor, PraxisWizardFormComponent, STEPPER_AI_CAPABILITIES, providePraxisStepperMetadata };
|
|
494
|
+
export type { Capability, CapabilityCatalog, CapabilityCategory, StepConfig, StepHeaderPosition, StepOrientation, StepperMetadata, ValueKind, WizardBenefitItem, WizardBenefitsBlock, WizardBlock, WizardBlockBase, WizardBlockPlacement, WizardCard, WizardContentBlock, WizardCtaAction, WizardCtaConfig, WizardDividerBlock, WizardFormConfig, WizardInlineNoticeBlock, WizardPreferencesConfig, WizardProgressConfig, WizardSecondaryAction, WizardStepConfig, WizardStepFormConfig, WizardStepZones };
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/stepper",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.40",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.0.0",
|
|
6
6
|
"@angular/core": "^20.0.0",
|
|
7
7
|
"@angular/material": "^20.0.0",
|
|
8
8
|
"@angular/cdk": "^20.0.0",
|
|
9
|
-
"@praxisui/core": "^1.0.0-beta.
|
|
10
|
-
"@praxisui/dynamic-form": "^1.0.0-beta.
|
|
11
|
-
"@praxisui/settings-panel": "^1.0.0-beta.
|
|
12
|
-
"@praxisui/list": "^1.0.0-beta.
|
|
13
|
-
"@praxisui/files-upload": "^1.0.0-beta.
|
|
14
|
-
"@praxisui/page-builder": "^1.0.0-beta.
|
|
9
|
+
"@praxisui/core": "^1.0.0-beta.40",
|
|
10
|
+
"@praxisui/dynamic-form": "^1.0.0-beta.40",
|
|
11
|
+
"@praxisui/settings-panel": "^1.0.0-beta.40",
|
|
12
|
+
"@praxisui/list": "^1.0.0-beta.40",
|
|
13
|
+
"@praxisui/files-upload": "^1.0.0-beta.40",
|
|
14
|
+
"@praxisui/page-builder": "^1.0.0-beta.40"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"tslib": "^2.3.0"
|