@wavemaker/app-ng-runtime 11.4.0-next.28152 → 11.4.0-rc.121
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.
- app-ng-runtime/build-task/basic/tree/tree.build.d.ts +1 -2
- app-ng-runtime/build-task/bundles/index.umd.js +8 -10
- app-ng-runtime/build-task/bundles/index.umd.js.map +1 -1
- app-ng-runtime/build-task/esm2015/basic/tree/tree.build.js +3 -4
- app-ng-runtime/build-task/esm2015/data/form/form-field/form-field.build.js +2 -2
- app-ng-runtime/build-task/esm2015/navigation/popover/popover.build.js +3 -3
- app-ng-runtime/build-task/fesm2015/index.js +8 -10
- app-ng-runtime/build-task/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/bundles/index.umd.js +44 -8
- app-ng-runtime/components/base/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/base/esm2015/directives/show-in-device.directive.js +16 -5
- app-ng-runtime/components/base/esm2015/public_api.js +2 -2
- app-ng-runtime/components/base/esm2015/utils/widget-utils.js +22 -4
- app-ng-runtime/components/base/esm2015/widgets/common/base/base-field-validations.js +3 -2
- app-ng-runtime/components/base/esm2015/widgets/common/dialog/dialog.service.js +7 -1
- app-ng-runtime/components/base/fesm2015/index.js +45 -10
- app-ng-runtime/components/base/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/index.metadata.json +1 -1
- app-ng-runtime/components/base/public_api.d.ts +1 -1
- app-ng-runtime/components/base/utils/widget-utils.d.ts +8 -1
- app-ng-runtime/components/basic/tree/bundles/index.umd.js +369 -245
- app-ng-runtime/components/basic/tree/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/basic/tree/esm2015/public_api.js +2 -2
- app-ng-runtime/components/basic/tree/esm2015/tree.component.js +403 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.module.js +3 -3
- app-ng-runtime/components/basic/tree/fesm2015/index.js +333 -240
- app-ng-runtime/components/basic/tree/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/basic/tree/index.metadata.json +1 -1
- app-ng-runtime/components/basic/tree/public_api.d.ts +1 -1
- app-ng-runtime/components/basic/tree/tree.component.d.ts +43 -0
- app-ng-runtime/components/chart/bundles/index.umd.js +1 -1
- app-ng-runtime/components/chart/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/chart/esm2015/chart.component.js +2 -2
- app-ng-runtime/components/chart/fesm2015/index.js +1 -1
- app-ng-runtime/components/chart/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/containers/tabs/bundles/index.umd.js +39 -23
- app-ng-runtime/components/containers/tabs/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/containers/tabs/esm2015/tab-pane/tab-pane.component.js +8 -1
- app-ng-runtime/components/containers/tabs/esm2015/tabs.animator.js +33 -13
- app-ng-runtime/components/containers/tabs/fesm2015/index.js +40 -13
- app-ng-runtime/components/containers/tabs/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/containers/tabs/tabs.animator.d.ts +5 -1
- app-ng-runtime/components/containers/wizard/bundles/index.umd.js +43 -2
- app-ng-runtime/components/containers/wizard/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/containers/wizard/esm2015/wizard-step/wizard-step.props.js +3 -2
- app-ng-runtime/components/containers/wizard/esm2015/wizard.component.js +42 -2
- app-ng-runtime/components/containers/wizard/fesm2015/index.js +43 -2
- app-ng-runtime/components/containers/wizard/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/containers/wizard/index.metadata.json +1 -1
- app-ng-runtime/components/containers/wizard/wizard.component.d.ts +2 -0
- app-ng-runtime/components/data/form/bundles/index.umd.js +37 -13
- app-ng-runtime/components/data/form/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/form/esm2015/form-field/form-field.directive.js +26 -7
- app-ng-runtime/components/data/form/esm2015/form.component.js +10 -5
- app-ng-runtime/components/data/form/fesm2015/index.js +34 -10
- app-ng-runtime/components/data/form/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/form/index.metadata.json +1 -1
- app-ng-runtime/components/data/list/bundles/index.umd.js +52 -43
- app-ng-runtime/components/data/list/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/list/esm2015/list.component.js +52 -43
- app-ng-runtime/components/data/list/fesm2015/index.js +51 -42
- app-ng-runtime/components/data/list/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/list/index.metadata.json +1 -1
- app-ng-runtime/components/data/list/list.component.d.ts +1 -1
- app-ng-runtime/components/data/pagination/bundles/index.umd.js +22 -5
- app-ng-runtime/components/data/pagination/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/pagination/esm2015/pagination.component.js +23 -6
- app-ng-runtime/components/data/pagination/fesm2015/index.js +22 -5
- app-ng-runtime/components/data/pagination/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/pagination/index.metadata.json +1 -1
- app-ng-runtime/components/data/pagination/pagination.component.d.ts +1 -0
- app-ng-runtime/components/data/table/bundles/index.umd.js +64 -12
- app-ng-runtime/components/data/table/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/table/esm2015/table.component.js +63 -13
- app-ng-runtime/components/data/table/esm2015/table.props.js +3 -1
- app-ng-runtime/components/data/table/fesm2015/index.js +64 -12
- app-ng-runtime/components/data/table/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/table/index.metadata.json +1 -1
- app-ng-runtime/components/data/table/table.component.d.ts +9 -0
- app-ng-runtime/components/dialogs/default/base-dialog.d.ts +1 -0
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js +17 -3
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/dialogs/default/esm2015/base-dialog.js +18 -5
- app-ng-runtime/components/dialogs/default/fesm2015/index.js +17 -4
- app-ng-runtime/components/dialogs/default/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/dialogs/default/index.metadata.json +1 -1
- app-ng-runtime/components/input/epoch/base-date-time.component.d.ts +1 -0
- app-ng-runtime/components/input/epoch/bundles/index.umd.js +78 -35
- app-ng-runtime/components/input/epoch/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/input/epoch/date-time/date-time-picker.component.d.ts +1 -0
- app-ng-runtime/components/input/epoch/esm2015/base-date-time.component.js +55 -31
- app-ng-runtime/components/input/epoch/esm2015/date/date.component.js +3 -3
- app-ng-runtime/components/input/epoch/esm2015/date-time/date-time-picker.component.js +31 -11
- app-ng-runtime/components/input/epoch/esm2015/date-time/date-time.component.js +2 -2
- app-ng-runtime/components/input/epoch/fesm2015/index.js +87 -43
- app-ng-runtime/components/input/epoch/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/input/epoch/index.metadata.json +1 -1
- app-ng-runtime/components/navigation/menu/bundles/index.umd.js +25 -19
- app-ng-runtime/components/navigation/menu/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/navigation/menu/esm2015/menu-dropdown-item/menu-dropdown-item.component.js +15 -5
- app-ng-runtime/components/navigation/menu/esm2015/menu.component.js +14 -19
- app-ng-runtime/components/navigation/menu/fesm2015/index.js +25 -20
- app-ng-runtime/components/navigation/menu/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/navigation/menu/index.metadata.json +1 -1
- app-ng-runtime/components/navigation/menu/menu-dropdown-item/menu-dropdown-item.component.d.ts +7 -4
- app-ng-runtime/components/navigation/menu/menu.component.d.ts +3 -7
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js +3 -1
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/navigation/popover/esm2015/popover.component.js +5 -3
- app-ng-runtime/components/navigation/popover/fesm2015/index.js +4 -2
- app-ng-runtime/components/navigation/popover/fesm2015/index.js.map +1 -1
- app-ng-runtime/core/bundles/index.umd.js +19 -3
- app-ng-runtime/core/bundles/index.umd.js.map +1 -1
- app-ng-runtime/core/esm2015/services/pagination.service.js +8 -2
- app-ng-runtime/core/esm2015/services/viewport.service.js +6 -4
- app-ng-runtime/core/esm2015/utils/utils.js +11 -3
- app-ng-runtime/core/fesm2015/index.js +22 -6
- app-ng-runtime/core/fesm2015/index.js.map +1 -1
- app-ng-runtime/core/index.metadata.json +1 -1
- app-ng-runtime/core/utils/utils.d.ts +2 -2
- app-ng-runtime/mobile/components/page/default/bundles/index.umd.js +24 -6
- app-ng-runtime/mobile/components/page/default/bundles/index.umd.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/esm2015/page.directive.js +20 -3
- app-ng-runtime/mobile/components/page/default/fesm2015/index.js +19 -2
- app-ng-runtime/mobile/components/page/default/fesm2015/index.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/index.metadata.json +1 -1
- app-ng-runtime/mobile/components/page/default/page.directive.d.ts +4 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +164 -133
- app-ng-runtime/runtime/base/bundles/index.umd.js.map +1 -1
- app-ng-runtime/runtime/base/esm2015/components/app-component/app.component.js +2 -2
- app-ng-runtime/runtime/base/esm2015/public_api.js +2 -1
- app-ng-runtime/runtime/base/esm2015/runtime-base.module.js +3 -1
- app-ng-runtime/runtime/base/esm2015/services/app.service.js +3 -1
- app-ng-runtime/runtime/base/esm2015/services/pipe.service.js +33 -0
- app-ng-runtime/runtime/base/fesm2015/index.js +149 -120
- app-ng-runtime/runtime/base/fesm2015/index.js.map +1 -1
- app-ng-runtime/runtime/base/index.metadata.json +1 -1
- app-ng-runtime/runtime/base/public_api.d.ts +1 -0
- app-ng-runtime/runtime/base/services/pipe.service.d.ts +9 -0
- app-ng-runtime/scripts/datatable/datatable.js +86 -36
- app-ng-runtime/scripts/tree-keyboard-navigation/keyboard-navigation.js +251 -0
- app-ng-runtime/variables/bundles/index.umd.js +37 -22
- app-ng-runtime/variables/bundles/index.umd.js.map +1 -1
- app-ng-runtime/variables/esm2015/manager/action/notification-action.manager.js +29 -24
- app-ng-runtime/variables/esm2015/service/variables.service.js +8 -1
- app-ng-runtime/variables/fesm2015/index.js +35 -24
- app-ng-runtime/variables/fesm2015/index.js.map +1 -1
- app-ng-runtime/variables/index.metadata.json +1 -1
- app-ng-runtime/variables/manager/action/notification-action.manager.d.ts +1 -0
- app-ng-runtime/variables/service/variables.service.d.ts +4 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.directive.js +0 -310
- app-ng-runtime/components/basic/tree/tree.directive.d.ts +0 -35
|
@@ -28,7 +28,8 @@ const registerProps = () => {
|
|
|
28
28
|
['doneiconclass', Object.assign({ value: 'wi wi-done' }, PROP_STRING)],
|
|
29
29
|
['name', PROP_STRING],
|
|
30
30
|
['show', Object.assign({ value: true }, PROP_BOOLEAN)],
|
|
31
|
-
['title', Object.assign({ value: 'Step Title' }, PROP_STRING)]
|
|
31
|
+
['title', Object.assign({ value: 'Step Title' }, PROP_STRING)],
|
|
32
|
+
['subtitle', PROP_STRING]
|
|
32
33
|
]));
|
|
33
34
|
};
|
|
34
35
|
|
|
@@ -278,6 +279,7 @@ class WizardComponent extends StylableComponent {
|
|
|
278
279
|
this.setDefaultStep(step);
|
|
279
280
|
}
|
|
280
281
|
}
|
|
282
|
+
this.addMoreText();
|
|
281
283
|
}
|
|
282
284
|
/**
|
|
283
285
|
* Selects the associated step when the wizard header is clicked.
|
|
@@ -301,6 +303,7 @@ class WizardComponent extends StylableComponent {
|
|
|
301
303
|
// set the selected step as current step and make it active
|
|
302
304
|
this.currentStep = currentStep;
|
|
303
305
|
this.currentStep.active = true;
|
|
306
|
+
this.addMoreText();
|
|
304
307
|
}
|
|
305
308
|
}
|
|
306
309
|
// Method to navigate to next step
|
|
@@ -328,6 +331,7 @@ class WizardComponent extends StylableComponent {
|
|
|
328
331
|
nextStep.active = true;
|
|
329
332
|
this.currentStep = nextStep;
|
|
330
333
|
}
|
|
334
|
+
this.addMoreText();
|
|
331
335
|
}
|
|
332
336
|
// Method to navigate to previous step
|
|
333
337
|
prev() {
|
|
@@ -346,6 +350,7 @@ class WizardComponent extends StylableComponent {
|
|
|
346
350
|
prevStep.active = true;
|
|
347
351
|
this.currentStep = prevStep;
|
|
348
352
|
}
|
|
353
|
+
this.addMoreText();
|
|
349
354
|
}
|
|
350
355
|
skip() {
|
|
351
356
|
this.next('skip');
|
|
@@ -359,6 +364,37 @@ class WizardComponent extends StylableComponent {
|
|
|
359
364
|
cancel() {
|
|
360
365
|
this.invokeEventCallback('cancel', { steps: this.steps.toArray() });
|
|
361
366
|
}
|
|
367
|
+
addMoreText() {
|
|
368
|
+
setTimeout(() => {
|
|
369
|
+
var newWindowWidth = $(window).width();
|
|
370
|
+
if (newWindowWidth < 768) {
|
|
371
|
+
$(".app-wizard-step.current .subtitle-wrapper .step-title").css({ "height": "auto", "display": "block" });
|
|
372
|
+
var subtitleTextLength = $(".app-wizard-step.current .subtitle-wrapper .step-title").height();
|
|
373
|
+
$(".read_more").css("display", "none");
|
|
374
|
+
$(".current .subtitle-wrapper").removeClass("readmore_subtitle");
|
|
375
|
+
if (subtitleTextLength > 44) {
|
|
376
|
+
$(".app-wizard-step.current .subtitle-wrapper .step-title").css({ "height": "44px", "display": "-webkit-box" });
|
|
377
|
+
$(".current .read_more").css("display", "block");
|
|
378
|
+
$(".active .read_more").css("display", "none");
|
|
379
|
+
$(".disable .read_more").css("display", "none");
|
|
380
|
+
$(".app-wizard-step>a").css("height", "100px");
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
readMoreSubtitle() {
|
|
386
|
+
$(".current .subtitle-wrapper").addClass("readmore_subtitle");
|
|
387
|
+
$(".current .read_more").css("display", "none");
|
|
388
|
+
$(document).on("mouseup", function (e) {
|
|
389
|
+
var container = $(".subtitle-wrapper");
|
|
390
|
+
// if the target of the click isn't the container nor a descendant of the container
|
|
391
|
+
if (!container.is(e.target) && container.has(e.target).length === 0) {
|
|
392
|
+
$(".current .subtitle-wrapper").removeClass("readmore_subtitle");
|
|
393
|
+
$(".current .read_more").css("display", "block");
|
|
394
|
+
$(document).off("mouseup");
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
}
|
|
362
398
|
isFirstStep(stepRef) {
|
|
363
399
|
return this.steps.first === stepRef;
|
|
364
400
|
}
|
|
@@ -385,13 +421,18 @@ class WizardComponent extends StylableComponent {
|
|
|
385
421
|
ngAfterViewInit() {
|
|
386
422
|
super.ngAfterViewInit();
|
|
387
423
|
styler(this.nativeElement.querySelector('.panel-body'), this, APPLY_STYLES_TYPE.INNER_SHELL);
|
|
424
|
+
setTimeout(() => {
|
|
425
|
+
if ($(window).width() < 768) {
|
|
426
|
+
$(".app-wizard").removeClass("vertical");
|
|
427
|
+
}
|
|
428
|
+
});
|
|
388
429
|
}
|
|
389
430
|
}
|
|
390
431
|
WizardComponent.initializeProps = registerProps$1();
|
|
391
432
|
WizardComponent.decorators = [
|
|
392
433
|
{ type: Component, args: [{
|
|
393
434
|
selector: 'div[wmWizard]',
|
|
394
|
-
template: "<div class=\"app-wizard-heading\" role=\"tab\">\n <ul class=\"app-wizard-steps nav nav-pills {{stepClass}}\">\n <li class=\"app-wizard-step\" *ngFor=\"let step of steps; let i = index\" [hidden]=\"!step.show\"\n [ngClass]=\"{active: step.done, current: step.active, disabled: step.disabled}\"\n (click)=\"onWizardHeaderClick($event, step)\">\n <a href=\"javascript:void(0)\" [attr.aria-label]=\"step.title\" [attr.title]=\"step.title\">\n <span class=\"arrow\" *ngIf=\"class && class.includes('classic')\"></span>\n <span class=\"wizard-step-number\">\n <span class=\"count\" *ngIf=\"class && class.includes('number') && !step.isDone\">{{i+1}}</span>\n <i class=\"dottedstepper\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('text-inline') && !class.includes('iconstepper')) && !step.isDone\"></i>\n <i class=\"app-icon wi wi-done\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('number')) && step.isDone\"></i>\n <i class=\"app-icon {{step.iconclass}}\" *ngIf=\"(class && class.includes('iconstepper')) && ((step.iconclass && !step.isDone) || (step.iconclass && step.isDone && step.doneiconclass ===''))\"></i>\n <i class=\"app-icon {{step.doneiconclass}}\" *ngIf=\"step.doneiconclass && step.isDone && (class && class.includes('iconstepper'))\"></i>\n </span>\n <span class=\"title-wrapper\">\n <span *ngIf=\"class && class.includes('text-inline')\">{{'0' + (i+1)}}</span>\n <span class=\"step-title\" [textContent]=\"step.title\"></span>\n </span>\n
|
|
435
|
+
template: "<div class=\"app-wizard-heading\" role=\"tab\">\n <ul class=\"app-wizard-steps nav nav-pills {{stepClass}}\">\n <li class=\"app-wizard-step\" *ngFor=\"let step of steps; let i = index\" [hidden]=\"!step.show\"\n [ngClass]=\"{active: step.done, current: step.active, disabled: step.disabled}\"\n (click)=\"onWizardHeaderClick($event, step)\">\n <a href=\"javascript:void(0)\" [attr.aria-label]=\"step.title\" [attr.title]=\"step.title\" [ngClass]=\"{'title-center-align':class && class.includes('classic') && !step.subtitle}\">\n <span class=\"arrow\" *ngIf=\"class && class.includes('classic')\"></span>\n <span class=\"wizard-step-number\">\n <span class=\"count\" *ngIf=\"class && class.includes('number') && !step.isDone\">{{i+1}}</span>\n <i class=\"dottedstepper\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('text-inline') && !class.includes('iconstepper')) && !step.isDone\"></i>\n <i class=\"app-icon wi wi-done\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('number')) && step.isDone\"></i>\n <i class=\"app-icon {{step.iconclass}}\" *ngIf=\"(class && class.includes('iconstepper')) && ((step.iconclass && !step.isDone) || (step.iconclass && step.isDone && step.doneiconclass ===''))\"></i>\n <i class=\"app-icon {{step.doneiconclass}}\" *ngIf=\"step.doneiconclass && step.isDone && (class && class.includes('iconstepper'))\"></i>\n </span>\n <span class=\"title-wrapper\">\n <span *ngIf=\"class && class.includes('text-inline')\">{{'0' + (i+1)}}</span>\n <span class=\"step-title\" [textContent]=\"step.title\"></span>\n </span>\n <span class=\"subtitle-wrapper\" [attr.title]=\"step.subtitle\" *ngIf=\"step.subtitle\">\n <span class=\"step-title\" [textContent]=\"step.subtitle\"></span>\n <a class=\"read_more\" (click)=\"readMoreSubtitle()\" style=\"display:none\">more</a>\n </span>\n </a> \n </li>\n </ul>\n</div>\n<div class=\"app-wizard-body panel-body\" role=\"tabpanel\">\n <p wmMessage *ngIf=\"message.caption\" caption.bind=\"message.caption\" type.bind=\"message.type\"></p>\n <ng-content ngProjectAs=\"form[wmWizardStep]\"></ng-content>\n</div>\n<div class=\"app-wizard-actions panel-footer {{actionsalignment}}\">\n <a class=\"app-wizard-skip\" name=\"skipStep_{{name}}\" *ngIf=\"currentStep?.enableskip\" title=\"Skip step\" (click)=\"skip()\">Skip »</a>\n <div class=\"app-wizard-actions-right\">\n <button type=\"button\" name=\"cancelBtn_{{name}}\" class=\"btn app-button btn-default\" *ngIf=\"cancelable\"\n (click)=\"cancel()\" [title]=\"cancelbtnlabel\" [textContent]=\"cancelbtnlabel\"></button>\n <button type=\"button\" name=\"previousBtn_{{name}}\" class=\"btn app-button btn-default\"\n *ngIf=\"hasPrevStep\" (click)=\"prev()\" [disabled]=\"!enablePrev\">\n <i class=\"app-icon wi wi-chevron-left\"></i>\n <span class=\"btn-caption\" [textContent]=\"previousbtnlabel\"></span>\n </button>\n <button type=\"button\" name=\"nextBtn_{{name}}\" class=\"btn app-button btn-primary\"\n *ngIf=\"hasNextStep\" (click)=\"next()\" [disabled]=\"!enableNext\">\n <span class=\"btn-caption\" [textContent]=\"nextbtnlabel\"></span>\n <i class=\"app-icon wi wi-chevron-right\"></i>\n </button>\n <button type=\"button\" name=\"doneBtn_{{name}}\" class=\"btn app-button btn-success\"\n *ngIf=\"showDoneBtn\" (click)=\"done()\"\n [disabled]=\"!enableDone\">\n <i class=\"app-icon wm-sl-l sl-check\"></i>\n <span class=\"btn-caption\" [textContent]=\"donebtnlabel\"></span>\n </button>\n </div>\n</div>\n",
|
|
395
436
|
providers: [
|
|
396
437
|
provideAsWidgetRef(WizardComponent)
|
|
397
438
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../projects/components/widgets/containers/wizard/src/wizard.props.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard-step/wizard-step.props.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard-step/wizard-step.directive.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard.component.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard.module.ts","../../../../../projects/components/widgets/containers/wizard/src/index.ts"],"sourcesContent":["import { PROP_BOOLEAN, PROP_STRING, register } from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-wizard',\n new Map(\n [\n ['actionsalignment', {value: 'right', ...PROP_STRING}],\n ['cancelable', {value: true, ...PROP_BOOLEAN}],\n ['cancelbtnlabel', {value: 'Cancel', ...PROP_STRING}],\n ['class', {value: 'classic', ...PROP_STRING}],\n ['defaultstep', {value: 'none', ...PROP_STRING}],\n ['donebtnlabel', {value: 'Done', ...PROP_STRING}],\n ['name', PROP_STRING],\n ['nextbtnlabel', {value: 'Next', ...PROP_STRING}],\n ['previousbtnlabel', {value: 'Previous', ...PROP_STRING}],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ['stepstyle', {value: 'auto', ...PROP_STRING}]\n ]\n )\n );\n};\n","import { PROP_BOOLEAN, PROP_STRING, register } from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-wizardstep',\n new Map(\n [\n ['class', PROP_STRING],\n ['enableskip', {value: false, ...PROP_BOOLEAN}],\n ['iconclass', {value: 'wi wi-person', ...PROP_STRING}],\n ['doneiconclass', {value: 'wi wi-done', ...PROP_STRING}],\n ['name', PROP_STRING],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ['title', {value: 'Step Title', ...PROP_STRING}]\n ]\n )\n );\n};\n","import { ContentChildren, Directive, HostBinding, Injector, Self } from '@angular/core';\nimport { NgForm } from '@angular/forms';\n\nimport { BaseComponent, IWidgetConfig, provideAsWidgetRef, RedrawableDirective } from '@wm/components/base';\nimport { WizardComponent } from '../wizard.component';\n\nimport { registerProps } from './wizard-step.props';\n\nconst DEFAULT_CLS = 'app-wizard-step-content';\nconst WIDGET_CONFIG: IWidgetConfig = {\n widgetType: 'wm-wizardstep',\n hostClass: DEFAULT_CLS,\n};\n\nconst enum STEP_STATUS {\n CURRENT = 1,\n DISABLED,\n COMPLETED\n}\n\n@Directive({\n selector: 'form[wmWizardStep]',\n providers: [\n provideAsWidgetRef(WizardStepDirective)\n ],\n exportAs: 'wmWizardStep'\n})\nexport class WizardStepDirective extends BaseComponent {\n static initializeProps = registerProps();\n\n public show: boolean;\n public name: string;\n public enableskip: any;\n public disablenext: boolean;\n public disabledone: boolean;\n public disableprevious: boolean;\n public isInitialized: boolean;\n isDone: boolean = false ;\n\n private status: STEP_STATUS = STEP_STATUS.DISABLED;\n private wizardComponent: WizardComponent;\n\n // reference to the components which needs a redraw(eg, grid, chart) when the height of this component changes\n @ContentChildren(RedrawableDirective, {descendants: true}) reDrawableComponents;\n\n @HostBinding('class.current')\n get isCurrent() {\n return this.active;\n }\n\n /**\n * along with the wizard form , also validate the forms\n * if there are any inside the wizard\n * @returns {boolean}\n */\n public get isValid() {\n return (this.ngForm.valid || this.ngForm.disabled) && this.areEmbeddedFormsValid();\n }\n\n /**\n * get all the forms inside the wizard if any and validate\n * @returns {boolean}\n */\n private areEmbeddedFormsValid() {\n let embeddedForms = this.getAllEmbeddedForms();\n for (let form of embeddedForms) {\n if (form.widget && !form.widget.ngform.valid) {\n return false;\n }\n }\n return true;\n }\n\n private getAllEmbeddedForms() {\n return this.$element.find('form');\n }\n\n public get enableNext() {\n return !this.disablenext;\n }\n\n public get enableDone() {\n return !this.disabledone;\n }\n\n public get enablePrev() {\n return !this.disableprevious;\n }\n\n public set active(nv: boolean) {\n const isActive = this.active;\n this.status = STEP_STATUS.CURRENT;\n if (nv && !isActive) {\n this.redrawChildren();\n }\n }\n\n public get active(): boolean {\n return this.status === STEP_STATUS.CURRENT;\n }\n\n public set done(nv: boolean) {\n if (nv) {\n this.status = STEP_STATUS.COMPLETED;\n }\n }\n\n public get done(): boolean {\n return this.status === STEP_STATUS.COMPLETED;\n }\n\n public set disabled(nv: boolean) {\n if (nv) {\n this.status = STEP_STATUS.DISABLED;\n }\n }\n\n public get disabled(): boolean {\n return this.status === STEP_STATUS.DISABLED;\n }\n\n constructor(inj: Injector, @Self() private ngForm: NgForm) {\n super(inj, WIDGET_CONFIG);\n // If we inject directly as a param in the constructor, getting circular dependency error in unit testcases\n this.wizardComponent = this.inj.get(WizardComponent);\n }\n\n public invokeNextCB(index: number): boolean {\n return this.invokeEventCallback('next', {currentStep: this, stepIndex: index});\n }\n\n public invokePrevCB(index: number): boolean {\n return this.invokeEventCallback('prev', {currentStep: this, stepIndex: index});\n }\n\n public invokeSkipCB(index: number): boolean {\n return this.invokeEventCallback('skip', {currentStep: this, stepIndex: index});\n }\n\n // redraw all the projected components which are projected.\n private redrawChildren() {\n setTimeout(() => {\n if (this.reDrawableComponents) {\n this.reDrawableComponents.forEach(c => c.redraw());\n }\n const stepIndex = (this as any).wizardComponent.getCurrentStepIndex();\n this.invokeEventCallback('load', { stepIndex });\n }, 100);\n }\n}\n","import { AfterContentInit, AfterViewInit, Component, ContentChildren, Injector, OnInit, QueryList } from '@angular/core';\n\nimport { noop } from '@wm/core';\nimport { APPLY_STYLES_TYPE, IWidgetConfig, provideAsWidgetRef, styler, StylableComponent } from '@wm/components/base';\n\nimport { registerProps } from './wizard.props';\nimport { WizardStepDirective } from './wizard-step/wizard-step.directive';\n\nconst DEFAULT_CLS = 'app-wizard panel clearfix';\nconst WIDGET_CONFIG: IWidgetConfig = {\n widgetType: 'wm-wizard',\n hostClass: DEFAULT_CLS\n};\n\n@Component({\n selector: 'div[wmWizard]',\n templateUrl: './wizard.component.html',\n providers: [\n provideAsWidgetRef(WizardComponent)\n ]\n})\nexport class WizardComponent extends StylableComponent implements OnInit, AfterContentInit, AfterViewInit {\n static initializeProps = registerProps();\n\n @ContentChildren(WizardStepDirective) steps: QueryList<WizardStepDirective>;\n\n public message: {caption: string, type: string};\n public currentStep: WizardStepDirective;\n\n public stepClass: string;\n public class;\n private readonly promiseResolverFn: Function;\n public actionsalignment: any;\n public cancelable: any;\n\n get hasPrevStep(): boolean {\n return !this.isFirstStep(this.currentStep);\n }\n\n get hasNextStep(): boolean {\n return !this.isLastStep(this.currentStep);\n }\n\n get showDoneBtn(): boolean {\n if (!this.currentStep) {\n return;\n }\n return !this.hasNextStep && this.currentStep.enableDone;\n }\n\n get enablePrev(): boolean {\n if (!this.currentStep) {\n return;\n }\n return this.currentStep.enablePrev;\n }\n\n get enableNext(): boolean {\n if (!this.currentStep) {\n return;\n }\n return this.currentStep.enableNext && this.currentStep.isValid;\n }\n\n get enableDone(): boolean {\n if (!this.currentStep) {\n return;\n }\n return this.currentStep.enableDone && this.currentStep.isValid;\n }\n\n constructor(inj: Injector) {\n let resolveFn: Function = noop;\n\n super(inj, WIDGET_CONFIG, new Promise(res => resolveFn = res));\n styler(this.nativeElement, this, APPLY_STYLES_TYPE.SHELL);\n\n this.promiseResolverFn = resolveFn;\n\n // initialize the message object with default values\n this.message = {\n caption: '',\n type: ''\n };\n }\n\n /**\n * returns next valid step. the index passed is also checked if its valid step\n * @param index\n * @returns {WizardStepDirective}\n */\n private getNextValidStepFormIndex(index: number): WizardStepDirective {\n for (let i = index; i < this.steps.length; i++) {\n const step = this.getStepRefByIndex(i);\n if (step.show) {\n return step;\n }\n }\n }\n\n /**\n * returns previous valid step. the index passed is also checked if its valid step\n * @param index\n * @returns {WizardStepDirective}\n */\n private getPreviousValidStepFormIndex(index: number): WizardStepDirective {\n for (let i = index; i >= 0; i--) {\n const step = this.getStepRefByIndex(i);\n if (step.show) {\n return step;\n }\n }\n }\n\n /**\n * returns current step index value.\n * @returns {number}\n */\n private getCurrentStepIndex(): number {\n return this.getStepIndexByRef(this.currentStep);\n }\n\n /**\n * returns stepRef when index is passed.\n * @param {number} index\n * @returns {WizardStepDirective}\n */\n private getStepRefByIndex(index: number): WizardStepDirective {\n return this.steps.toArray()[index];\n }\n\n /**\n * returns the index value of the step.\n * @param {WizardStepDirective} wizardStep\n * @returns {number}\n */\n private getStepIndexByRef(wizardStep: WizardStepDirective): number {\n return this.steps.toArray().indexOf(wizardStep);\n }\n\n /**\n * gets stepRef by searching on the name property.\n * @param {string} name\n * @returns {WizardStepDirective}\n */\n private getStepRefByName(name: string): WizardStepDirective {\n return this.steps.find(step => step.name === name);\n }\n\n /**\n * sets default step as current step if configured\n * or finds first valid step and set it as current step.\n * @param {WizardStepDirective} step\n */\n private setDefaultStep(step: WizardStepDirective) {\n // If the default step has show true then only update the currentStep\n if (step && step.show) {\n this.currentStep = step;\n step.active = true;\n step.isInitialized = true;\n // Mark all previous step status COMPLETED\n let index = this.getStepIndexByRef(step) - 1;\n while (index >= 0) {\n const prevStep = this.getStepRefByIndex(index);\n prevStep.done = true;\n prevStep.isInitialized = true;\n index--;\n }\n } else {\n // set next valid step as current step\n step = this.getNextValidStepFormIndex(0);\n if (step) {\n this.setDefaultStep(step);\n }\n }\n }\n\n /**\n * Selects the associated step when the wizard header is clicked.\n * @param $event\n * @param {WizardStepDirective} currentStep\n */\n private onWizardHeaderClick($event: Event, currentStep: WizardStepDirective) {\n // select the step if it's status is done\n if (currentStep.done) {\n // set all the next steps status as disabled and previous steps as done\n this.steps.forEach((step, index) => {\n if (index < this.getStepIndexByRef(currentStep)) {\n step.done = true;\n step.isDone = true;\n } else {\n step.disabled = true;\n step.isDone = false;\n }\n });\n // set the selected step as current step and make it active\n this.currentStep = currentStep;\n this.currentStep.active = true;\n }\n }\n\n // Method to navigate to next step\n public next(eventName: string = 'next') {\n const currentStep = this.currentStep;\n const currentStepIndex = this.getCurrentStepIndex();\n\n let nextStep: WizardStepDirective;\n\n // abort if onSkip method returns false\n if (eventName === 'skip') {\n if (currentStep.invokeSkipCB(currentStepIndex) === false) {\n return;\n }\n } else if (eventName === 'next') {\n if (currentStep.invokeNextCB(currentStepIndex) === false) {\n return;\n }\n }\n nextStep = this.getNextValidStepFormIndex(currentStepIndex + 1);\n nextStep.isInitialized = true;\n\n // If there are any steps which has show then only change state of current step else remain same\n if (nextStep) {\n currentStep.isDone = true;\n currentStep.done = true;\n nextStep.active = true;\n this.currentStep = nextStep;\n }\n }\n // Method to navigate to previous step\n public prev() {\n const currentStep = this.currentStep;\n const currentStepIndex = this.getCurrentStepIndex();\n\n let prevStep: WizardStepDirective;\n\n // abort if onPrev method returns false.\n if (currentStep.invokePrevCB(currentStepIndex) === false) {\n return;\n }\n\n prevStep = this.getPreviousValidStepFormIndex(currentStepIndex - 1);\n\n // If there are any steps which has show then only change state of current step else remain same\n if (prevStep) {\n currentStep.isDone = false;\n currentStep.disabled = true;\n prevStep.active = true;\n this.currentStep = prevStep;\n }\n }\n\n public skip() {\n this.next('skip');\n }\n\n // Method to invoke on-Done event on wizard\n public done() {\n this.currentStep.isDone = true;\n this.invokeEventCallback('done', {steps: this.steps.toArray()});\n }\n // Method to invoke on-Cancel event on wizard\n public cancel () {\n this.invokeEventCallback('cancel', {steps: this.steps.toArray()});\n }\n\n private isFirstStep(stepRef: WizardStepDirective) {\n return this.steps.first === stepRef;\n }\n\n private isLastStep(stepRef: WizardStepDirective) {\n return this.steps.last === stepRef;\n }\n\n // Define the property change handler. This Method will be triggered when there is a change in the widget property\n onPropertyChange(key: string, nv: any, ov?: any) {\n // Monitoring changes for properties and accordingly handling respective changes\n\n if (key === 'stepstyle') {\n this.stepClass = nv === 'justified' ? 'nav-justified' : '';\n } else if (key === 'defaultstep') {\n this.setDefaultStep(this.getStepRefByName(nv));\n } else {\n super.onPropertyChange(key, nv, ov);\n }\n }\n\n ngAfterContentInit() {\n super.ngAfterContentInit();\n this.promiseResolverFn();\n }\n\n ngAfterViewInit() {\n super.ngAfterViewInit();\n styler(\n this.nativeElement.querySelector('.panel-body') as HTMLElement,\n this,\n APPLY_STYLES_TYPE.INNER_SHELL\n );\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { WmComponentsModule } from '@wm/components/base';\n\nimport { WizardComponent } from './wizard.component';\nimport { WizardStepDirective} from './wizard-step/wizard-step.directive';\n\nconst components = [\n WizardStepDirective,\n WizardComponent\n];\n\n@NgModule({\n imports: [\n CommonModule,\n WmComponentsModule\n ],\n declarations: [...components],\n exports: [...components],\n entryComponents: []\n})\nexport class WizardModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n\nexport {registerProps as ɵa} from './wizard-step/wizard-step.props';\nexport {registerProps as ɵb} from './wizard.props';"],"names":["registerProps","DEFAULT_CLS","WIDGET_CONFIG"],"mappings":";;;;;;MAEaA,eAAa,GAAG;IACzB,QAAQ,CACJ,WAAW,EACX,IAAI,GAAG,CACH;QACI,CAAC,kBAAkB,kBAAG,KAAK,EAAE,OAAO,IAAK,WAAW,EAAE;QACtD,CAAC,YAAY,kBAAG,KAAK,EAAE,IAAI,IAAK,YAAY,EAAE;QAC9C,CAAC,gBAAgB,kBAAG,KAAK,EAAE,QAAQ,IAAK,WAAW,EAAE;QACrD,CAAC,OAAO,kBAAG,KAAK,EAAE,SAAS,IAAK,WAAW,EAAE;QAC7C,CAAC,aAAa,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;QAChD,CAAC,cAAc,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;QACjD,CAAC,MAAM,EAAE,WAAW,CAAC;QACrB,CAAC,cAAc,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;QACjD,CAAC,kBAAkB,kBAAG,KAAK,EAAE,UAAU,IAAK,WAAW,EAAE;QACzD,CAAC,MAAM,kBAAG,KAAK,EAAE,IAAI,IAAK,YAAY,EAAE;QACxC,CAAC,WAAW,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;KACjD,CACJ,CACJ,CAAC;AACN;;MCnBa,aAAa,GAAG;IACzB,QAAQ,CACJ,eAAe,EACf,IAAI,GAAG,CACH;QACI,CAAC,OAAO,EAAE,WAAW,CAAC;QACtB,CAAC,YAAY,kBAA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;;;ACrBD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../projects/components/widgets/containers/wizard/src/wizard.props.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard-step/wizard-step.props.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard-step/wizard-step.directive.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard.component.ts","../../../../../projects/components/widgets/containers/wizard/src/wizard.module.ts","../../../../../projects/components/widgets/containers/wizard/src/index.ts"],"sourcesContent":["import { PROP_BOOLEAN, PROP_STRING, register } from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-wizard',\n new Map(\n [\n ['actionsalignment', {value: 'right', ...PROP_STRING}],\n ['cancelable', {value: true, ...PROP_BOOLEAN}],\n ['cancelbtnlabel', {value: 'Cancel', ...PROP_STRING}],\n ['class', {value: 'classic', ...PROP_STRING}],\n ['defaultstep', {value: 'none', ...PROP_STRING}],\n ['donebtnlabel', {value: 'Done', ...PROP_STRING}],\n ['name', PROP_STRING],\n ['nextbtnlabel', {value: 'Next', ...PROP_STRING}],\n ['previousbtnlabel', {value: 'Previous', ...PROP_STRING}],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ['stepstyle', {value: 'auto', ...PROP_STRING}]\n ]\n )\n );\n};\n","import { PROP_BOOLEAN, PROP_STRING, register } from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-wizardstep',\n new Map(\n [\n ['class', PROP_STRING],\n ['enableskip', {value: false, ...PROP_BOOLEAN}],\n ['iconclass', {value: 'wi wi-person', ...PROP_STRING}],\n ['doneiconclass', {value: 'wi wi-done', ...PROP_STRING}],\n ['name', PROP_STRING],\n ['show', {value: true, ...PROP_BOOLEAN}],\n ['title', {value: 'Step Title', ...PROP_STRING}],\n ['subtitle', PROP_STRING]\n ]\n )\n );\n};\n","import { ContentChildren, Directive, HostBinding, Injector, Self } from '@angular/core';\nimport { NgForm } from '@angular/forms';\n\nimport { BaseComponent, IWidgetConfig, provideAsWidgetRef, RedrawableDirective } from '@wm/components/base';\nimport { WizardComponent } from '../wizard.component';\n\nimport { registerProps } from './wizard-step.props';\n\nconst DEFAULT_CLS = 'app-wizard-step-content';\nconst WIDGET_CONFIG: IWidgetConfig = {\n widgetType: 'wm-wizardstep',\n hostClass: DEFAULT_CLS,\n};\n\nconst enum STEP_STATUS {\n CURRENT = 1,\n DISABLED,\n COMPLETED\n}\n\n@Directive({\n selector: 'form[wmWizardStep]',\n providers: [\n provideAsWidgetRef(WizardStepDirective)\n ],\n exportAs: 'wmWizardStep'\n})\nexport class WizardStepDirective extends BaseComponent {\n static initializeProps = registerProps();\n\n public show: boolean;\n public name: string;\n public enableskip: any;\n public disablenext: boolean;\n public disabledone: boolean;\n public disableprevious: boolean;\n public isInitialized: boolean;\n isDone: boolean = false ;\n\n private status: STEP_STATUS = STEP_STATUS.DISABLED;\n private wizardComponent: WizardComponent;\n\n // reference to the components which needs a redraw(eg, grid, chart) when the height of this component changes\n @ContentChildren(RedrawableDirective, {descendants: true}) reDrawableComponents;\n\n @HostBinding('class.current')\n get isCurrent() {\n return this.active;\n }\n\n /**\n * along with the wizard form , also validate the forms\n * if there are any inside the wizard\n * @returns {boolean}\n */\n public get isValid() {\n return (this.ngForm.valid || this.ngForm.disabled) && this.areEmbeddedFormsValid();\n }\n\n /**\n * get all the forms inside the wizard if any and validate\n * @returns {boolean}\n */\n private areEmbeddedFormsValid() {\n let embeddedForms = this.getAllEmbeddedForms();\n for (let form of embeddedForms) {\n if (form.widget && !form.widget.ngform.valid) {\n return false;\n }\n }\n return true;\n }\n\n private getAllEmbeddedForms() {\n return this.$element.find('form');\n }\n\n public get enableNext() {\n return !this.disablenext;\n }\n\n public get enableDone() {\n return !this.disabledone;\n }\n\n public get enablePrev() {\n return !this.disableprevious;\n }\n\n public set active(nv: boolean) {\n const isActive = this.active;\n this.status = STEP_STATUS.CURRENT;\n if (nv && !isActive) {\n this.redrawChildren();\n }\n }\n\n public get active(): boolean {\n return this.status === STEP_STATUS.CURRENT;\n }\n\n public set done(nv: boolean) {\n if (nv) {\n this.status = STEP_STATUS.COMPLETED;\n }\n }\n\n public get done(): boolean {\n return this.status === STEP_STATUS.COMPLETED;\n }\n\n public set disabled(nv: boolean) {\n if (nv) {\n this.status = STEP_STATUS.DISABLED;\n }\n }\n\n public get disabled(): boolean {\n return this.status === STEP_STATUS.DISABLED;\n }\n\n constructor(inj: Injector, @Self() private ngForm: NgForm) {\n super(inj, WIDGET_CONFIG);\n // If we inject directly as a param in the constructor, getting circular dependency error in unit testcases\n this.wizardComponent = this.inj.get(WizardComponent);\n }\n\n public invokeNextCB(index: number): boolean {\n return this.invokeEventCallback('next', {currentStep: this, stepIndex: index});\n }\n\n public invokePrevCB(index: number): boolean {\n return this.invokeEventCallback('prev', {currentStep: this, stepIndex: index});\n }\n\n public invokeSkipCB(index: number): boolean {\n return this.invokeEventCallback('skip', {currentStep: this, stepIndex: index});\n }\n\n // redraw all the projected components which are projected.\n private redrawChildren() {\n setTimeout(() => {\n if (this.reDrawableComponents) {\n this.reDrawableComponents.forEach(c => c.redraw());\n }\n const stepIndex = (this as any).wizardComponent.getCurrentStepIndex();\n this.invokeEventCallback('load', { stepIndex });\n }, 100);\n }\n}\n","import { AfterContentInit, AfterViewInit, Component, ContentChildren, Injector, OnInit, QueryList } from '@angular/core';\n\nimport { noop } from '@wm/core';\nimport { APPLY_STYLES_TYPE, IWidgetConfig, provideAsWidgetRef, styler, StylableComponent } from '@wm/components/base';\n\nimport { registerProps } from './wizard.props';\nimport { WizardStepDirective } from './wizard-step/wizard-step.directive';\n\nconst DEFAULT_CLS = 'app-wizard panel clearfix';\nconst WIDGET_CONFIG: IWidgetConfig = {\n widgetType: 'wm-wizard',\n hostClass: DEFAULT_CLS\n};\n\n@Component({\n selector: 'div[wmWizard]',\n templateUrl: './wizard.component.html',\n providers: [\n provideAsWidgetRef(WizardComponent)\n ]\n})\nexport class WizardComponent extends StylableComponent implements OnInit, AfterContentInit, AfterViewInit {\n static initializeProps = registerProps();\n\n @ContentChildren(WizardStepDirective) steps: QueryList<WizardStepDirective>;\n\n public message: {caption: string, type: string};\n public currentStep: WizardStepDirective;\n\n public stepClass: string;\n public class;\n private readonly promiseResolverFn: Function;\n public actionsalignment: any;\n public cancelable: any;\n\n get hasPrevStep(): boolean {\n return !this.isFirstStep(this.currentStep);\n }\n\n get hasNextStep(): boolean {\n return !this.isLastStep(this.currentStep);\n }\n\n get showDoneBtn(): boolean {\n if (!this.currentStep) {\n return;\n }\n return !this.hasNextStep && this.currentStep.enableDone;\n }\n\n get enablePrev(): boolean {\n if (!this.currentStep) {\n return;\n }\n return this.currentStep.enablePrev;\n }\n\n get enableNext(): boolean {\n if (!this.currentStep) {\n return;\n }\n return this.currentStep.enableNext && this.currentStep.isValid;\n }\n\n get enableDone(): boolean {\n if (!this.currentStep) {\n return;\n }\n return this.currentStep.enableDone && this.currentStep.isValid;\n }\n\n constructor(inj: Injector) {\n let resolveFn: Function = noop;\n\n super(inj, WIDGET_CONFIG, new Promise(res => resolveFn = res));\n styler(this.nativeElement, this, APPLY_STYLES_TYPE.SHELL);\n\n this.promiseResolverFn = resolveFn;\n\n // initialize the message object with default values\n this.message = {\n caption: '',\n type: ''\n };\n }\n\n /**\n * returns next valid step. the index passed is also checked if its valid step\n * @param index\n * @returns {WizardStepDirective}\n */\n private getNextValidStepFormIndex(index: number): WizardStepDirective {\n for (let i = index; i < this.steps.length; i++) {\n const step = this.getStepRefByIndex(i);\n if (step.show) {\n return step;\n }\n }\n }\n\n /**\n * returns previous valid step. the index passed is also checked if its valid step\n * @param index\n * @returns {WizardStepDirective}\n */\n private getPreviousValidStepFormIndex(index: number): WizardStepDirective {\n for (let i = index; i >= 0; i--) {\n const step = this.getStepRefByIndex(i);\n if (step.show) {\n return step;\n }\n }\n }\n\n /**\n * returns current step index value.\n * @returns {number}\n */\n private getCurrentStepIndex(): number {\n return this.getStepIndexByRef(this.currentStep);\n }\n\n /**\n * returns stepRef when index is passed.\n * @param {number} index\n * @returns {WizardStepDirective}\n */\n private getStepRefByIndex(index: number): WizardStepDirective {\n return this.steps.toArray()[index];\n }\n\n /**\n * returns the index value of the step.\n * @param {WizardStepDirective} wizardStep\n * @returns {number}\n */\n private getStepIndexByRef(wizardStep: WizardStepDirective): number {\n return this.steps.toArray().indexOf(wizardStep);\n }\n\n /**\n * gets stepRef by searching on the name property.\n * @param {string} name\n * @returns {WizardStepDirective}\n */\n private getStepRefByName(name: string): WizardStepDirective {\n return this.steps.find(step => step.name === name);\n }\n\n /**\n * sets default step as current step if configured\n * or finds first valid step and set it as current step.\n * @param {WizardStepDirective} step\n */\n private setDefaultStep(step: WizardStepDirective) {\n // If the default step has show true then only update the currentStep\n if (step && step.show) {\n this.currentStep = step;\n step.active = true;\n step.isInitialized = true;\n // Mark all previous step status COMPLETED\n let index = this.getStepIndexByRef(step) - 1;\n while (index >= 0) {\n const prevStep = this.getStepRefByIndex(index);\n prevStep.done = true;\n prevStep.isInitialized = true;\n index--;\n }\n } else {\n // set next valid step as current step\n step = this.getNextValidStepFormIndex(0);\n if (step) {\n this.setDefaultStep(step);\n }\n }\n this.addMoreText(); \n }\n\n /**\n * Selects the associated step when the wizard header is clicked.\n * @param $event\n * @param {WizardStepDirective} currentStep\n */\n private onWizardHeaderClick($event: Event, currentStep: WizardStepDirective) {\n // select the step if it's status is done\n if (currentStep.done) {\n // set all the next steps status as disabled and previous steps as done\n this.steps.forEach((step, index) => {\n if (index < this.getStepIndexByRef(currentStep)) {\n step.done = true;\n step.isDone = true;\n } else {\n step.disabled = true;\n step.isDone = false;\n }\n });\n // set the selected step as current step and make it active\n this.currentStep = currentStep;\n this.currentStep.active = true;\n this.addMoreText();\n }\n }\n\n // Method to navigate to next step\n public next(eventName: string = 'next') {\n const currentStep = this.currentStep;\n const currentStepIndex = this.getCurrentStepIndex();\n\n let nextStep: WizardStepDirective;\n\n // abort if onSkip method returns false\n if (eventName === 'skip') {\n if (currentStep.invokeSkipCB(currentStepIndex) === false) {\n return;\n }\n } else if (eventName === 'next') {\n if (currentStep.invokeNextCB(currentStepIndex) === false) {\n return;\n }\n }\n nextStep = this.getNextValidStepFormIndex(currentStepIndex + 1);\n nextStep.isInitialized = true;\n\n // If there are any steps which has show then only change state of current step else remain same\n if (nextStep) {\n currentStep.isDone = true;\n currentStep.done = true;\n nextStep.active = true;\n this.currentStep = nextStep;\n }\n this.addMoreText();\n }\n // Method to navigate to previous step\n public prev() {\n const currentStep = this.currentStep;\n const currentStepIndex = this.getCurrentStepIndex();\n\n let prevStep: WizardStepDirective;\n\n // abort if onPrev method returns false.\n if (currentStep.invokePrevCB(currentStepIndex) === false) {\n return;\n }\n\n prevStep = this.getPreviousValidStepFormIndex(currentStepIndex - 1);\n\n // If there are any steps which has show then only change state of current step else remain same\n if (prevStep) {\n currentStep.isDone = false;\n currentStep.disabled = true;\n prevStep.active = true;\n this.currentStep = prevStep;\n }\n this.addMoreText();\n }\n\n public skip() {\n this.next('skip');\n }\n\n // Method to invoke on-Done event on wizard\n public done() {\n this.currentStep.isDone = true;\n this.invokeEventCallback('done', {steps: this.steps.toArray()});\n }\n // Method to invoke on-Cancel event on wizard\n public cancel () {\n this.invokeEventCallback('cancel', {steps: this.steps.toArray()});\n }\n public addMoreText(){\n setTimeout(() => { \n\n \n var newWindowWidth = $(window).width();\n if(newWindowWidth < 768){\n $(\".app-wizard-step.current .subtitle-wrapper .step-title\").css({\"height\":\"auto\",\"display\":\"block\"}); \n var subtitleTextLength = $(\".app-wizard-step.current .subtitle-wrapper .step-title\").height();\n $(\".read_more\").css(\"display\",\"none\");\n $(\".current .subtitle-wrapper\").removeClass(\"readmore_subtitle\");\n\n if(subtitleTextLength>44){\n $(\".app-wizard-step.current .subtitle-wrapper .step-title\").css({\"height\":\"44px\",\"display\":\"-webkit-box\"});\n $(\".current .read_more\").css(\"display\",\"block\");\n $(\".active .read_more\").css(\"display\",\"none\");\n $(\".disable .read_more\").css(\"display\",\"none\");\n $(\".app-wizard-step>a\").css(\"height\",\"100px\")\n }\n }\n });\n \n }\n public readMoreSubtitle(){\n $(\".current .subtitle-wrapper\").addClass(\"readmore_subtitle\");\n $(\".current .read_more\").css(\"display\",\"none\"); \n $(document).on(\"mouseup\",function(e:any) \n {\n var container = $(\".subtitle-wrapper\");\n // if the target of the click isn't the container nor a descendant of the container\n if (!container.is(e.target) && container.has(e.target).length === 0) \n {\n $(\".current .subtitle-wrapper\").removeClass(\"readmore_subtitle\");\n $(\".current .read_more\").css(\"display\",\"block\"); \n $(document).off(\"mouseup\");\n }\n });\n }\n \n private isFirstStep(stepRef: WizardStepDirective) {\n return this.steps.first === stepRef;\n }\n\n private isLastStep(stepRef: WizardStepDirective) {\n return this.steps.last === stepRef;\n }\n\n // Define the property change handler. This Method will be triggered when there is a change in the widget property\n onPropertyChange(key: string, nv: any, ov?: any) {\n // Monitoring changes for properties and accordingly handling respective changes\n\n if (key === 'stepstyle') {\n this.stepClass = nv === 'justified' ? 'nav-justified' : '';\n } else if (key === 'defaultstep') {\n this.setDefaultStep(this.getStepRefByName(nv));\n } else {\n super.onPropertyChange(key, nv, ov);\n }\n }\n\n ngAfterContentInit() {\n super.ngAfterContentInit();\n this.promiseResolverFn();\n }\n\n ngAfterViewInit() {\n super.ngAfterViewInit();\n styler(\n this.nativeElement.querySelector('.panel-body') as HTMLElement,\n this,\n APPLY_STYLES_TYPE.INNER_SHELL\n );\n setTimeout(() => { if($(window).width()<768){\n $(\".app-wizard\").removeClass(\"vertical\");\n } \n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { WmComponentsModule } from '@wm/components/base';\n\nimport { WizardComponent } from './wizard.component';\nimport { WizardStepDirective} from './wizard-step/wizard-step.directive';\n\nconst components = [\n WizardStepDirective,\n WizardComponent\n];\n\n@NgModule({\n imports: [\n CommonModule,\n WmComponentsModule\n ],\n declarations: [...components],\n exports: [...components],\n entryComponents: []\n})\nexport class WizardModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n\nexport {registerProps as ɵa} from './wizard-step/wizard-step.props';\nexport {registerProps as ɵb} from './wizard.props';"],"names":["registerProps","DEFAULT_CLS","WIDGET_CONFIG"],"mappings":";;;;;;MAEaA,eAAa,GAAG;IACzB,QAAQ,CACJ,WAAW,EACX,IAAI,GAAG,CACH;QACI,CAAC,kBAAkB,kBAAG,KAAK,EAAE,OAAO,IAAK,WAAW,EAAE;QACtD,CAAC,YAAY,kBAAG,KAAK,EAAE,IAAI,IAAK,YAAY,EAAE;QAC9C,CAAC,gBAAgB,kBAAG,KAAK,EAAE,QAAQ,IAAK,WAAW,EAAE;QACrD,CAAC,OAAO,kBAAG,KAAK,EAAE,SAAS,IAAK,WAAW,EAAE;QAC7C,CAAC,aAAa,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;QAChD,CAAC,cAAc,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;QACjD,CAAC,MAAM,EAAE,WAAW,CAAC;QACrB,CAAC,cAAc,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;QACjD,CAAC,kBAAkB,kBAAG,KAAK,EAAE,UAAU,IAAK,WAAW,EAAE;QACzD,CAAC,MAAM,kBAAG,KAAK,EAAE,IAAI,IAAK,YAAY,EAAE;QACxC,CAAC,WAAW,kBAAG,KAAK,EAAE,MAAM,IAAK,WAAW,EAAE;KACjD,CACJ,CACJ,CAAC;AACN;;MCnBa,aAAa,GAAG;IACzB,QAAQ,CACJ,eAAe,EACf,IAAI,GAAG,CACH;QACI,CAAC,OAAO,EAAE,WAAW,CAAC;QACtB,CAAC,YAAY,kBAAG,KAAK,EAAE,KAAK,IAAK,YAAY,EAAE;QAC/C,CAAC,WAAW,kBAAG,KAAK,EAAE,cAAc,IAAK,WAAW,EAAE;QACtD,CAAC,eAAe,kBAAG,KAAK,EAAE,YAAY,IAAK,WAAW,EAAE;QACxD,CAAC,MAAM,EAAE,WAAW,CAAC;QACrB,CAAC,M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C,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAC,GAAG,EAAC;gBACxC,CAAC,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;aAC9C;SACF,CAAC,CAAC;KACF;;AAlUM,+BAAe,GAAGF,eAAa,EAAE,CAAC;;YAR5C,SAAS,SAAC;gBACP,QAAQ,EAAE,eAAe;gBACzB,m8HAAsC;gBACtC,SAAS,EAAE;oBACP,kBAAkB,CAAC,eAAe,CAAC;iBACtC;aACJ;;;YApBqE,QAAQ;;;oBAwBzE,eAAe,SAAC,mBAAmB;;;AChBxC,MAAM,UAAU,GAAG;IACf,mBAAmB;IACnB,eAAe;CAClB,CAAC;MAWW,YAAY;;;YATxB,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,kBAAkB;iBACrB;gBACD,YAAY,EAAE,CAAC,GAAG,UAAU,CAAC;gBAC7B,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;gBACxB,eAAe,EAAE,EAAE;aACtB;;;ACrBD;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"WizardModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":15,"character":8},{"__symbolic":"reference","module":"@wm/components/base","name":"WmComponentsModule","line":16,"character":8}],"declarations":[{"__symbolic":"reference","name":"WizardStepDirective"},{"__symbolic":"reference","name":"WizardComponent"}],"exports":[{"__symbolic":"reference","name":"WizardStepDirective"},{"__symbolic":"reference","name":"WizardComponent"}],"entryComponents":[]}]}],"members":{}},"WizardComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@wm/components/base","name":"StylableComponent","line":21,"character":37},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"div[wmWizard]","providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@wm/components/base","name":"provideAsWidgetRef","line":18,"character":8},"arguments":[{"__symbolic":"reference","name":"WizardComponent"}]}],"template":"<div class=\"app-wizard-heading\" role=\"tab\">\n <ul class=\"app-wizard-steps nav nav-pills {{stepClass}}\">\n <li class=\"app-wizard-step\" *ngFor=\"let step of steps; let i = index\" [hidden]=\"!step.show\"\n [ngClass]=\"{active: step.done, current: step.active, disabled: step.disabled}\"\n (click)=\"onWizardHeaderClick($event, step)\">\n <a href=\"javascript:void(0)\" [attr.aria-label]=\"step.title\" [attr.title]=\"step.title\">\n <span class=\"arrow\" *ngIf=\"class && class.includes('classic')\"></span>\n <span class=\"wizard-step-number\">\n <span class=\"count\" *ngIf=\"class && class.includes('number') && !step.isDone\">{{i+1}}</span>\n <i class=\"dottedstepper\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('text-inline') && !class.includes('iconstepper')) && !step.isDone\"></i>\n <i class=\"app-icon wi wi-done\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('number')) && step.isDone\"></i>\n <i class=\"app-icon {{step.iconclass}}\" *ngIf=\"(class && class.includes('iconstepper')) && ((step.iconclass && !step.isDone) || (step.iconclass && step.isDone && step.doneiconclass ===''))\"></i>\n <i class=\"app-icon {{step.doneiconclass}}\" *ngIf=\"step.doneiconclass && step.isDone && (class && class.includes('iconstepper'))\"></i>\n </span>\n <span class=\"title-wrapper\">\n <span *ngIf=\"class && class.includes('text-inline')\">{{'0' + (i+1)}}</span>\n <span class=\"step-title\" [textContent]=\"step.title\"></span>\n </span>\n
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"WizardModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":15,"character":8},{"__symbolic":"reference","module":"@wm/components/base","name":"WmComponentsModule","line":16,"character":8}],"declarations":[{"__symbolic":"reference","name":"WizardStepDirective"},{"__symbolic":"reference","name":"WizardComponent"}],"exports":[{"__symbolic":"reference","name":"WizardStepDirective"},{"__symbolic":"reference","name":"WizardComponent"}],"entryComponents":[]}]}],"members":{}},"WizardComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@wm/components/base","name":"StylableComponent","line":21,"character":37},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"div[wmWizard]","providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@wm/components/base","name":"provideAsWidgetRef","line":18,"character":8},"arguments":[{"__symbolic":"reference","name":"WizardComponent"}]}],"template":"<div class=\"app-wizard-heading\" role=\"tab\">\n <ul class=\"app-wizard-steps nav nav-pills {{stepClass}}\">\n <li class=\"app-wizard-step\" *ngFor=\"let step of steps; let i = index\" [hidden]=\"!step.show\"\n [ngClass]=\"{active: step.done, current: step.active, disabled: step.disabled}\"\n (click)=\"onWizardHeaderClick($event, step)\">\n <a href=\"javascript:void(0)\" [attr.aria-label]=\"step.title\" [attr.title]=\"step.title\" [ngClass]=\"{'title-center-align':class && class.includes('classic') && !step.subtitle}\">\n <span class=\"arrow\" *ngIf=\"class && class.includes('classic')\"></span>\n <span class=\"wizard-step-number\">\n <span class=\"count\" *ngIf=\"class && class.includes('number') && !step.isDone\">{{i+1}}</span>\n <i class=\"dottedstepper\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('text-inline') && !class.includes('iconstepper')) && !step.isDone\"></i>\n <i class=\"app-icon wi wi-done\" *ngIf=\"class && (class.includes('dottedstepper') || class.includes('number')) && step.isDone\"></i>\n <i class=\"app-icon {{step.iconclass}}\" *ngIf=\"(class && class.includes('iconstepper')) && ((step.iconclass && !step.isDone) || (step.iconclass && step.isDone && step.doneiconclass ===''))\"></i>\n <i class=\"app-icon {{step.doneiconclass}}\" *ngIf=\"step.doneiconclass && step.isDone && (class && class.includes('iconstepper'))\"></i>\n </span>\n <span class=\"title-wrapper\">\n <span *ngIf=\"class && class.includes('text-inline')\">{{'0' + (i+1)}}</span>\n <span class=\"step-title\" [textContent]=\"step.title\"></span>\n </span>\n <span class=\"subtitle-wrapper\" [attr.title]=\"step.subtitle\" *ngIf=\"step.subtitle\">\n <span class=\"step-title\" [textContent]=\"step.subtitle\"></span>\n <a class=\"read_more\" (click)=\"readMoreSubtitle()\" style=\"display:none\">more</a>\n </span>\n </a> \n </li>\n </ul>\n</div>\n<div class=\"app-wizard-body panel-body\" role=\"tabpanel\">\n <p wmMessage *ngIf=\"message.caption\" caption.bind=\"message.caption\" type.bind=\"message.type\"></p>\n <ng-content ngProjectAs=\"form[wmWizardStep]\"></ng-content>\n</div>\n<div class=\"app-wizard-actions panel-footer {{actionsalignment}}\">\n <a class=\"app-wizard-skip\" name=\"skipStep_{{name}}\" *ngIf=\"currentStep?.enableskip\" title=\"Skip step\" (click)=\"skip()\">Skip »</a>\n <div class=\"app-wizard-actions-right\">\n <button type=\"button\" name=\"cancelBtn_{{name}}\" class=\"btn app-button btn-default\" *ngIf=\"cancelable\"\n (click)=\"cancel()\" [title]=\"cancelbtnlabel\" [textContent]=\"cancelbtnlabel\"></button>\n <button type=\"button\" name=\"previousBtn_{{name}}\" class=\"btn app-button btn-default\"\n *ngIf=\"hasPrevStep\" (click)=\"prev()\" [disabled]=\"!enablePrev\">\n <i class=\"app-icon wi wi-chevron-left\"></i>\n <span class=\"btn-caption\" [textContent]=\"previousbtnlabel\"></span>\n </button>\n <button type=\"button\" name=\"nextBtn_{{name}}\" class=\"btn app-button btn-primary\"\n *ngIf=\"hasNextStep\" (click)=\"next()\" [disabled]=\"!enableNext\">\n <span class=\"btn-caption\" [textContent]=\"nextbtnlabel\"></span>\n <i class=\"app-icon wi wi-chevron-right\"></i>\n </button>\n <button type=\"button\" name=\"doneBtn_{{name}}\" class=\"btn app-button btn-success\"\n *ngIf=\"showDoneBtn\" (click)=\"done()\"\n [disabled]=\"!enableDone\">\n <i class=\"app-icon wm-sl-l sl-check\"></i>\n <span class=\"btn-caption\" [textContent]=\"donebtnlabel\"></span>\n </button>\n </div>\n</div>\n"}]}],"members":{"steps":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":24,"character":5},"arguments":[{"__symbolic":"reference","name":"WizardStepDirective"}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":71,"character":21}]}],"getNextValidStepFormIndex":[{"__symbolic":"method"}],"getPreviousValidStepFormIndex":[{"__symbolic":"method"}],"getCurrentStepIndex":[{"__symbolic":"method"}],"getStepRefByIndex":[{"__symbolic":"method"}],"getStepIndexByRef":[{"__symbolic":"method"}],"getStepRefByName":[{"__symbolic":"method"}],"setDefaultStep":[{"__symbolic":"method"}],"onWizardHeaderClick":[{"__symbolic":"method"}],"next":[{"__symbolic":"method"}],"prev":[{"__symbolic":"method"}],"skip":[{"__symbolic":"method"}],"done":[{"__symbolic":"method"}],"cancel":[{"__symbolic":"method"}],"addMoreText":[{"__symbolic":"method"}],"readMoreSubtitle":[{"__symbolic":"method"}],"isFirstStep":[{"__symbolic":"method"}],"isLastStep":[{"__symbolic":"method"}],"onPropertyChange":[{"__symbolic":"method"}],"ngAfterContentInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}]},"statics":{"initializeProps":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵb"}}}},"WizardStepDirective":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@wm/components/base","name":"BaseComponent","line":27,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":20,"character":1},"arguments":[{"selector":"form[wmWizardStep]","providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@wm/components/base","name":"provideAsWidgetRef","line":23,"character":8},"arguments":[{"__symbolic":"reference","name":"WizardStepDirective"}]}],"exportAs":"wmWizardStep"}]}],"members":{"reDrawableComponents":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":43,"character":5},"arguments":[{"__symbolic":"reference","module":"@wm/components/base","name":"RedrawableDirective","line":43,"character":21},{"descendants":true}]}]}],"isCurrent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":45,"character":5},"arguments":["class.current"]}]}],"areEmbeddedFormsValid":[{"__symbolic":"method"}],"getAllEmbeddedForms":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":121,"character":32}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":121,"character":21},{"__symbolic":"reference","module":"@angular/forms","name":"NgForm","line":121,"character":55}]}],"invokeNextCB":[{"__symbolic":"method"}],"invokePrevCB":[{"__symbolic":"method"}],"invokeSkipCB":[{"__symbolic":"method"}],"redrawChildren":[{"__symbolic":"method"}]},"statics":{"initializeProps":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵa"}}}},"ɵa":{"__symbolic":"error","message":"Lambda not supported","line":2,"character":29,"module":"./wizard-step/wizard-step.props"},"ɵb":{"__symbolic":"error","message":"Lambda not supported","line":2,"character":29,"module":"./wizard.props"}},"origins":{"WizardModule":"./wizard.module","WizardComponent":"./wizard.component","WizardStepDirective":"./wizard-step/wizard-step.directive","ɵa":"./wizard-step/wizard-step.props","ɵb":"./wizard.props"},"importAs":"@wm/components/containers/wizard"}
|
|
@@ -73,6 +73,8 @@ export declare class WizardComponent extends StylableComponent implements OnInit
|
|
|
73
73
|
skip(): void;
|
|
74
74
|
done(): void;
|
|
75
75
|
cancel(): void;
|
|
76
|
+
addMoreText(): void;
|
|
77
|
+
readMoreSubtitle(): void;
|
|
76
78
|
private isFirstStep;
|
|
77
79
|
private isLastStep;
|
|
78
80
|
onPropertyChange(key: string, nv: any, ov?: any): void;
|
|
@@ -436,16 +436,21 @@
|
|
|
436
436
|
};
|
|
437
437
|
};
|
|
438
438
|
var ɵ2 = findInvalidElement;
|
|
439
|
-
var setTouchedState = function (ngForm) {
|
|
439
|
+
var setTouchedState = function (self, ngForm, fieldName) {
|
|
440
|
+
var _a, _b;
|
|
440
441
|
if (ngForm.valid) {
|
|
441
442
|
return;
|
|
442
443
|
}
|
|
443
444
|
if (ngForm.controls) {
|
|
444
|
-
_.forEach(ngForm.controls, function (ctrl) {
|
|
445
|
-
setTouchedState(ctrl);
|
|
445
|
+
_.forEach(ngForm.controls, function (ctrl, fieldName) {
|
|
446
|
+
setTouchedState(self, ctrl, fieldName);
|
|
446
447
|
});
|
|
447
448
|
}
|
|
448
449
|
else {
|
|
450
|
+
var element = self.$element.find("[wmformfield][key=\"" + fieldName + "\"]");
|
|
451
|
+
element[0].setAttribute('__errormsg', element[0].getAttribute('__validationId'));
|
|
452
|
+
(_a = element[0].querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', ngForm.invalid);
|
|
453
|
+
(_b = element[0].querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', element[0].getAttribute('__validationId'));
|
|
449
454
|
ngForm.markAsTouched();
|
|
450
455
|
}
|
|
451
456
|
};
|
|
@@ -766,7 +771,7 @@
|
|
|
766
771
|
};
|
|
767
772
|
// This method loops through the form fields and highlights the invalid fields by setting state to touched
|
|
768
773
|
FormComponent.prototype.highlightInvalidFields = function () {
|
|
769
|
-
setTouchedState(this.ngform);
|
|
774
|
+
setTouchedState(this, this.ngform, '');
|
|
770
775
|
};
|
|
771
776
|
// Disable the form submit if form is in invalid state. Highlight all the invalid fields if validation type is default
|
|
772
777
|
FormComponent.prototype.validateFieldsOnSubmit = function () {
|
|
@@ -1357,8 +1362,8 @@
|
|
|
1357
1362
|
FormComponent.prototype.generateFormFields = function () {
|
|
1358
1363
|
return __awaiter(this, void 0, void 0, function () {
|
|
1359
1364
|
var noOfColumns, $gridLayout, columnWidth, fieldTemplate, colCount, index, userFields, fields, colTmpl, componentFactoryRef, component;
|
|
1360
|
-
return __generator(this, function (
|
|
1361
|
-
switch (
|
|
1365
|
+
return __generator(this, function (_c) {
|
|
1366
|
+
switch (_c.label) {
|
|
1362
1367
|
case 0:
|
|
1363
1368
|
// Check if grid layout is present or not for first time
|
|
1364
1369
|
if (_.isUndefined(this._isGridLayoutPresent)) {
|
|
@@ -1416,7 +1421,7 @@
|
|
|
1416
1421
|
transpile: true
|
|
1417
1422
|
})];
|
|
1418
1423
|
case 1:
|
|
1419
|
-
componentFactoryRef =
|
|
1424
|
+
componentFactoryRef = _c.sent();
|
|
1420
1425
|
component = this.dynamicFormRef.createComponent(componentFactoryRef, 0, this.inj);
|
|
1421
1426
|
core.extendProto(component.instance, this._dynamicContext);
|
|
1422
1427
|
$gridLayout[0].appendChild(component.location.nativeElement);
|
|
@@ -1828,10 +1833,20 @@
|
|
|
1828
1833
|
$($evt.target).closest('.live-field').addClass('active');
|
|
1829
1834
|
};
|
|
1830
1835
|
FormFieldDirective.prototype._onBlurField = function ($evt) {
|
|
1831
|
-
var _a, _b;
|
|
1836
|
+
var _a, _b, _c, _d;
|
|
1832
1837
|
$($evt.target).closest('.live-field').removeClass('active');
|
|
1833
|
-
|
|
1834
|
-
|
|
1838
|
+
var ele = this.nativeElement.querySelector('p.text-danger');
|
|
1839
|
+
// Fix for [WMS-23959]: ADA issue - adding aria-describedby, aria-invalid, __errormsg attributes only when the form field is invalid , else removing the attributes
|
|
1840
|
+
if (this.ngform.controls[this._fieldName].invalid && this.ngform.controls[this._fieldName].touched && this.form.isUpdateMode) {
|
|
1841
|
+
this.nativeElement.setAttribute('__errormsg', "" + this.nativeElement.getAttribute('__validationId'));
|
|
1842
|
+
(_a = this.nativeElement.querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', "" + this.ngform.controls[this._fieldName].invalid);
|
|
1843
|
+
(_b = this.nativeElement.querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', "" + this.nativeElement.getAttribute('__validationId'));
|
|
1844
|
+
}
|
|
1845
|
+
else {
|
|
1846
|
+
this.nativeElement.removeAttribute('__errormsg');
|
|
1847
|
+
(_c = this.nativeElement.querySelector('input')) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-invalid');
|
|
1848
|
+
(_d = this.nativeElement.querySelector('input')) === null || _d === void 0 ? void 0 : _d.removeAttribute('aria-describedby');
|
|
1849
|
+
}
|
|
1835
1850
|
this._activeField = false;
|
|
1836
1851
|
this._triggeredByUser = false;
|
|
1837
1852
|
this._clicktriggeredByUser = false;
|
|
@@ -2067,7 +2082,7 @@
|
|
|
2067
2082
|
};
|
|
2068
2083
|
// On field value change, propagate event to parent form
|
|
2069
2084
|
FormFieldDirective.prototype.onValueChange = function (val) {
|
|
2070
|
-
var _a, _b;
|
|
2085
|
+
var _a, _b, _c, _d;
|
|
2071
2086
|
if (!this.isDestroyed) {
|
|
2072
2087
|
var captionEl = $(this.nativeElement).find('.caption-floating');
|
|
2073
2088
|
if (captionEl.length > 0) {
|
|
@@ -2077,8 +2092,17 @@
|
|
|
2077
2092
|
var hasValue = ((core.isDefined(val) && val !== '' && val !== null) || captionEl.find('input').val()) || captionEl.find('input:-webkit-autofill').length;
|
|
2078
2093
|
this.app.notify('captionPositionAnimate', { displayVal: hasValue, nativeEl: captionEl, isSelectMultiple: this.formWidget && this.formWidget.multiple, isFocused: this._activeField });
|
|
2079
2094
|
}
|
|
2080
|
-
|
|
2081
|
-
(
|
|
2095
|
+
// Fix for [WMS-23959]: ADA issue - adding aria-describedby, aria-invalid, __errormsg attributes only when the form field is invalid , else removing the attributes
|
|
2096
|
+
if (this.ngform.controls[this._fieldName].invalid && this.ngform.controls[this._fieldName].touched && this.form.isUpdateMode) {
|
|
2097
|
+
this.nativeElement.setAttribute('__errormsg', "" + this.nativeElement.getAttribute('__validationId'));
|
|
2098
|
+
(_a = this.nativeElement.querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', this._triggeredByUser && this.ngform.controls[this._fieldName].invalid ? 'true' : 'false');
|
|
2099
|
+
(_b = this.nativeElement.querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', "" + this.nativeElement.getAttribute('__validationId'));
|
|
2100
|
+
}
|
|
2101
|
+
else {
|
|
2102
|
+
this.nativeElement.removeAttribute('__errormsg');
|
|
2103
|
+
(_c = this.nativeElement.querySelector('input')) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-invalid');
|
|
2104
|
+
(_d = this.nativeElement.querySelector('input')) === null || _d === void 0 ? void 0 : _d.removeAttribute('aria-describedby');
|
|
2105
|
+
}
|
|
2082
2106
|
this.form.onFieldValueChange(this, val);
|
|
2083
2107
|
this.notifyChanges();
|
|
2084
2108
|
// Do mark as touched, only incase when user has entered an input but not through the script. Hence added mousedown event check
|