PageSourceSearch

https://andrewmolinaukulele.com/wp-content/plugins/smart-forms/js/bundle/conditionalHandlers_bundle.js?ver=5

js andrewmolinaukulele.com collected 2026-10-06 18:43:53 UTC 30,214 bytes, 676 lines download raw bytes

vendor: 3,645 bytes, lines 1-88
1/******/ (function(modules) { // webpackBootstrap
2/******/ 	// The module cache
3/******/ 	var installedModules = {};
4/******/
5/******/ 	// The require function
6/******/ 	function __webpack_require__(moduleId) {
7/******/
8/******/ 		// Check if module is in cache
9/******/ 		if(installedModules[moduleId]) {
10/******/ 			return installedModules[moduleId].exports;
11/******/ 		}
12/******/ 		// Create a new module (and put it into the cache)
13/******/ 		var module = installedModules[moduleId] = {
14/******/ 			i: moduleId,
15/******/ 			l: false,
16/******/ 			exports: {}
17/******/ 		};
18/******/
19/******/ 		// Execute the module function
20/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ 		// Flag the module as loaded
23/******/ 		module.l = true;
24/******/
25/******/ 		// Return the exports of the module
26/******/ 		return module.exports;
27/******/ 	}
28/******/
29/******/
30/******/ 	// expose the modules object (__webpack_modules__)
31/******/ 	__webpack_require__.m = modules;
32/******/
33/******/ 	// expose the module cache
34/******/ 	__webpack_require__.c = installedModules;
35/******/
36/******/ 	// define getter function for harmony exports
37/******/ 	__webpack_require__.d = function(exports, name, getter) {
38/******/ 		if(!__webpack_require__.o(exports, name)) {
39/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
40/******/ 		}
41/******/ 	};
42/******/
43/******/ 	// define __esModule on exports
44/******/ 	__webpack_require__.r = function(exports) {
45/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
46/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47/******/ 		}
48/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
49/******/ 	};
50/******/
51/******/ 	// create a fake namespace object
52/******/ 	// mode & 1: value is a module id, require it
53/******/ 	// mode & 2: merge all properties of value into the ns
54/******/ 	// mode & 4: return value when already ns object
55/******/ 	// mode & 8|1: behave like require
56/******/ 	__webpack_require__.t = function(value, mode) {
57/******/ 		if(mode & 1) value = __webpack_require__(value);
58/******/ 		if(mode & 8) return value;
59/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
60/******/ 		var ns = Object.create(null);
61/******/ 		__webpack_require__.r(ns);
62/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
63/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
64/******/ 		return ns;
65/******/ 	};
66/******/
67/******/ 	// getDefaultExport function for compatibility with non-harmony modules
68/******/ 	__webpack_require__.n = function(module) {
69/******/ 		var getter = module && module.__esModule ?
70/******/ 			function getDefault() { return module['default']; } :
71/******/ 			function getModuleExports() { return module; };
72/******/ 		__webpack_require__.d(getter, 'a', getter);
73/******/ 		return getter;
74/******/ 	};
75/******/
76/******/ 	// Object.prototype.hasOwnProperty.call
77/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
78/******/
79/******/ 	// __webpack_public_path__
80/******/ 	__webpack_require__.p = "";
81/******/
82/******/
83/******/ 	// Load entry module and return exports
84/******/ 	return __webpack_require__(__webpack_require__.s = "./conditional_manager/handlers/HandlerBootstrap.ts");
85/******/ })
86/************************************************************************/
87/******/ ({
88
89/***/ "./conditional_manager/handlers/HandlerBootstrap.ts":
90/*!**********************************************************!*\
91  !*** ./conditional_manager/handlers/HandlerBootstrap.ts ***!
92  \**********************************************************/
93/*! no static exports found */
94/***/ (function(module, exports, __webpack_require__) {
95
96__webpack_require__(/*! ./SfConditionalHandlerBase */ "./conditional_manager/handlers/SfConditionalHandlerBase.ts");
97__webpack_require__(/*! ./SfShowConditionalHandler */ "./conditional_manager/handlers/SfShowConditionalHandler.ts");
98__webpack_require__(/*! ./SfMkFieldInvalidHandler */ "./conditional_manager/handlers/SfMkFieldInvalidHandler.ts");
99__webpack_require__(/*! ./SfShowStepHandler */ "./conditional_manager/handlers/SfShowStepHandler.ts");
100var SmartFormsConditionalHandlerArray = [];
101function SmartFormsGetConditionalHandlerByType(handlerId, options) {
102    var handlers = SmartFormsGetConditionalHandlerArray();
103    for (var i = 0; i < handlers.length; i++) {
104        if (handlers[i].id == handlerId) {
105            return handlers[i].create(options);
106        }
107    }
108    throw ('Invalid handler');
109}
110function SmartFormsGetConditionalHandlerArray() {
111    SmartFormsConditionalHandlerArray = [
112        { Label: "Show fields depending on a condition", id: "SfShowConditionalHandler", create: function (options) { return new SfShowConditionalHandler(options); }, ShouldShow: function (builder) { return true; } },
113        { Label: "Make fields invalid depending on a condition", id: "SfMkFieldInvalidHandler", create: function (options) { return new SfMkFieldInvalidHandler(options); }, ShouldShow: function (builder) { return true; } },
114        { Label: "Show a multiple step tab depending on a condition", id: "SfShowStepHandler", create: function (options) { return new SfShowStepHandler(options); }, ShouldShow: function (builder) { return builder.FormType == "sec"; } },
115    ];
116    return SmartFormsConditionalHandlerArray;
117}
118function SmartFormsCalculateCondition(condition, values, instance, current) {
119    if (current === void 0) { current = null; }
120    var compiledCondition = condition.CompiledCondition;
121    if (typeof condition.Mode != 'undefined' && condition.Mode == 'Formula')
122        compiledCondition = condition.Formula.CompiledFormula;
123    var Remote = null;
124    if (instance == null)
125        Remote = new SmartFormsRemote();
126    else
127        Remote = instance.GetRemote();
128    condition = new Function('formData,Remote,current', 'return ' + compiledCondition);
129    return condition(values, Remote, current != null ? current : (instance == null ? null : instance.FormElement));
130}
131RedNaoEventManager.Subscribe('CalculateCondition', function (data) { return SmartFormsCalculateCondition(data.Condition, data.Values, data.Instance, data.Current != null ? data.Current : null); });
132window.SmartFormsGetConditionalHandlerByType = SmartFormsGetConditionalHandlerByType;
133window.SmartFormsGetConditionalHandlerArray = SmartFormsGetConditionalHandlerArray;
134window.SmartFormsCalculateCondition = SmartFormsCalculateCondition;
135
136
137/***/ }),
138
139/***/ "./conditional_manager/handlers/SfConditionalHandlerBase.ts":
140/*!******************************************************************!*\
141  !*** ./conditional_manager/handlers/SfConditionalHandlerBase.ts ***!
142  \******************************************************************/
143/*! no static exports found */
144/***/ (function(module, exports, __webpack_require__) {
145
146"use strict";
147
148var SfConditionalHandlerBase = /** @class */ (function () {
149    function SfConditionalHandlerBase(options) {
150        this._remote = null;
151        this.PreviousActionWas = -1;
152        if (options == null) {
153            this.Options = {};
154            SfConditionalHandlerBase.ConditionId++;
155            this.Options.Id = SfConditionalHandlerBase.ConditionId;
156            this.IsNew = true;
157        }
158        else
159            this.Options = options;
160        this.Id = this.Options.Id;
161    }
162    SfConditionalHandlerBase.prototype.GetOptionsToSave = function () {
163        this.Options.Label = this.Options.GeneralInfo.Name;
164        return this.Options;
165    };
166    ;
167    SfConditionalHandlerBase.prototype.SubscribeCondition = function (condition, initialData) {
168        var self = this;
169        //this.ConditionFunction=new Function('formData','return '+condition.CompiledCondition);
170        var fieldsInCondition = [];
171        if (condition.Mode == 'Formula') {
172            for (var _i = 0, _a = condition.Formula.FieldsUsed; _i < _a.length; _i++) {
173                var field = _a[_i];
174                fieldsInCondition.push(field);
175            }
176        }
177        else
178            for (var i = 0; i < condition.Conditions.length; i++) {
179                fieldsInCondition.push(condition.Conditions[i].Field);
180                if (typeof condition.Conditions[i].Formula != 'undefined' && condition.Conditions[i].Formula.RowMode == "Formula") {
181                    for (var _b = 0, _c = condition.Conditions[i].Formula.Formula.FieldsUsed; _b < _c.length; _b++) {
182                        var fieldInFormula = _c[_b];
183                        fieldsInCondition.push(fieldInFormula);
184                    }
185                }
186            }
187        RedNaoEventManager.Subscribe('ProcessConditionsAfterValueChanged', function (data) {
188            if (fieldsInCondition.indexOf(data.FieldName) > -1) {
189                var action = self.ProcessCondition(data.Data);
190                if (action != null)
191                    data.Actions.push(action);
192            }
193        });
194    };
195    ;
196    SfConditionalHandlerBase.prototype.GetRemote = function () {
197        if (this._remote == null)
198            this._remote = new SmartFormsRemote();
199        return this._remote;
200    };
201    SfConditionalHandlerBase.prototype.ProcessCondition = function (data) {
202        var _this = this;
203        if (this.IsRepeaterCondition()) {
204            return this.ProcessRepeaterCondition(data);
205        }
206        var result = RedNaoEventManager.Publish('CalculateCondition', { Condition: this.Condition, Values: data, Instance: this });
207        if (result instanceof Promise) {
208            this.ExecutingPromise();
209            return result.then(function (result) { return _this.ProcessResult(result, null); });
210        }
211        else
212            return new Promise(function (resolve) { resolve(_this.ProcessResult(result, null)); });
213    };
214    ;
215    SfConditionalHandlerBase.prototype.ProcessResult = function (result, index) {
216        var _this = this;
217        if (index === void 0) { index = null; }
218        if (result) //this.ConditionFunction(data))
219         {
220            if (this.PreviousActionWas != 1 || index !== null) {
221                return {
222                    ActionType: 'show',
223                    Execute: function () {
224                        _this.PreviousActionWas = 1;
225                        _this.ExecuteTrueAction(index);
226                    }
227                };
228            }
229        }
230        else if (this.PreviousActionWas != 0 || index !== null) {
231            return {
232                ActionType: 'hide',
233                Execute: function () {
234                    _this.PreviousActionWas = 0;
235                    _this.ExecuteFalseAction(null, index);
236                }
237            };
238        }
239        return null;
240    };
241    SfConditionalHandlerBase.prototype.IsRepeaterCondition = function () {
242        return this.Options.FieldPicker != null &&
243            this.Options.FieldPicker.AffectedItems != null &&
244            this.Options.FieldPicker.AffectedItems.some(function (x) { return x.indexOf('.') >= 0; });
245    };
246    SfConditionalHandlerBase.prototype.ProcessRepeaterCondition = function (data) {
247        var _this = this;
248        var multiple = new MultipleActions();
249        var resolvedCount = 0;
250        return new Promise(function (resolve) {
251            var finishedExecutingAction = function () {
252                resolvedCount++;
253                if (resolvedCount == repeaterField.DynamicItems.length)
254                    resolve(multiple);
255            };
256            var repeaterId = _this.Options.FieldPicker.AffectedItems[0].split('.')[0];
257            var repeaterField = _this.Form.FormElements.find(function (x) { return x.Options.Id == repeaterId; });
258            if (repeaterField == null) {
259                throw new Error("invalid repeater field " + repeaterId);
260            }
261            var _loop_1 = function (i) {
262                var result = RedNaoEventManager.Publish('CalculateCondition', { Condition: _this.Condition, Values: data, Instance: _this, Current: i });
263                if (result instanceof Promise) {
264                    _this.ExecutingPromise();
265                    result.then(function (result) {
266                        multiple.Actions.push(_this.ProcessResult(result, i));
267                        finishedExecutingAction();
268                    });
269                }
270                else {
271                    multiple.Actions.push(_this.ProcessResult(result, i));
272                    finishedExecutingAction();
273                }
274            };
275            for (var i = 0; i < repeaterField.DynamicItems.length; i++) {
276                _loop_1(i);
277            }
278        });
279    };
280    SfConditionalHandlerBase.ConditionId = 0;
281    return SfConditionalHandlerBase;
282}());
283var MultipleActions = /** @class */ (function () {
284    function MultipleActions() {
285        this.Actions = [];
286    }
287    MultipleActions.prototype.Execute = function () {
288        for (var _i = 0, _a = this.Actions; _i < _a.length; _i++) {
289            var action = _a[_i];
290            action.Execute();
291        }
292    };
293    return MultipleActions;
294}());
295window.SfConditionalHandlerBase = SfConditionalHandlerBase;
296
297
298/***/ }),
299
300/***/ "./conditional_manager/handlers/SfMkFieldInvalidHandler.ts":
301/*!*****************************************************************!*\
302  !*** ./conditional_manager/handlers/SfMkFieldInvalidHandler.ts ***!
303  \*****************************************************************/
304/*! no static exports found */
305/***/ (function(module, exports) {
306
307var __extends = (this && this.__extends) || (function () {
308    var extendStatics = function (d, b) {
309        extendStatics = Object.setPrototypeOf ||
310            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
311            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
312        return extendStatics(d, b);
313    };
314    return function (d, b) {
315        extendStatics(d, b);
316        function __() { this.constructor = d; }
317        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
318    };
319})();
320var SfMkFieldInvalidHandler = /** @class */ (function (_super) {
321    __extends(SfMkFieldInvalidHandler, _super);
322    function SfMkFieldInvalidHandler(options) {
323        var _this = _super.call(this, options) || this;
324        _this.Options.Type = "SfMkFieldInvalidHandler";
325        _this.Fields = "";
326        _this.FormElements = null;
327        return _this;
328    }
329    SfMkFieldInvalidHandler.prototype.ExecutingPromise = function () {
330        //this.ExecuteFalseAction();
331    };
332    SfMkFieldInvalidHandler.prototype.GetConditionalSteps = function () {
333        if (this.IsNew) {
334            this.Options.GeneralInfo = {};
335            this.Options.FieldPicker = {};
336            this.Options.Condition = {};
337            this.Options.ErrorMessage = {};
338        }
339        return [
340            { Type: "SfNamePicker", Label: 'HowDoYouWantToName', Options: this.Options.GeneralInfo, Id: this.Id },
341            { Type: "SfHandlerFieldPicker", Label: 'whichFieldYouWantToMakeInvalid', Options: this.Options.FieldPicker },
342            { Type: "SfHandlerConditionGenerator", Label: 'WhenDoYouWantToMakeInvalid', Options: this.Options.Condition },
343            { Type: "SfTextPicker", Label: 'WhatMessageWhenInvalid', Options: this.Options.ErrorMessage }
344        ];
345    };
346    ;
347    SfMkFieldInvalidHandler.prototype.Initialize = function (form, data) {
348        var _this = this;
349        this.Form = form;
350        this.Condition = this.Options.Condition;
351        this.PreviousActionWas = -1;
352        RedNaoEventManager.Subscribe('BeforeValidatingForm', function (args) {
353            args.Promises.push(_this.ProcessCondition(_this.Form.GetCurrentData()).then(function (result) {
354                if (result != null)
355                    result.Execute();
356            }));
357        });
358    };
359    ;
360    SfMkFieldInvalidHandler.prototype.GetFormElements = function () {
361        if (this.FormElements == null) {
362            this.FormElements = [];
363            for (var i = 0; i < this.Options.FieldPicker.AffectedItems.length; i++) {
364                var fieldId = this.Options.FieldPicker.AffectedItems[i];
365                for (var t = 0; t < this.Form.FormElements.length; t++)
366                    if (this.Form.FormElements[t].Id == fieldId)
367                        this.FormElements.push(this.Form.FormElements[t]);
368            }
369        }
370        return this.FormElements;
371    };
372    ;
373    SfMkFieldInvalidHandler.prototype.ExecuteTrueAction = function (index) {
374        if (index === void 0) { index = null; }
375        var formElements = null;
376        if (index === null)
377            formElements = this.GetFormElements();
378        else {
379            formElements = this.GetRepeaterElements(index);
380        }
381        var errorId = "mfi" + this.Id;
382        for (var i = 0; i < formElements.length; i++) {
383            formElements[i].AddError(errorId, this.Options.ErrorMessage.Text);
384        }
385    };
386    ;
387    SfMkFieldInvalidHandler.prototype.ExecuteFalseAction = function (from, index) {
388        if (index === void 0) { index = null; }
389        var formElements = null;
390        if (index === null)
391            formElements = this.GetFormElements();
392        else {
393            formElements = this.GetRepeaterElements(index);
394        }
395        var errorId = "mfi" + this.Id;
396        for (var i = 0; i < formElements.length; i++)
397            formElements[i].RemoveError(errorId);
398    };
399    ;
400    SfMkFieldInvalidHandler.prototype.GetRepeaterElements = function (index) {
401        var fields = [];
402        for (var i = 0; i < this.Options.FieldPicker.AffectedItems.length; i++) {
403            var fieldId = this.Options.FieldPicker.AffectedItems[i];
404            var repeaterId = fieldId.split('.')[0];
405            var repeaterFieldId = fieldId.split('.')[1];
406            for (var t = 0; t < this.Form.FormElements.length; t++)
407                if (this.Form.FormElements[t].Id == repeaterId) {
408                    for (var _i = 0, _a = this.Form.FormElements[t].DynamicItems; _i < _a.length; _i++) {
409                        var item = _a[_i];
410                        for (var _b = 0, _c = item.Fields; _b < _c.length; _b++) {
411                            var field = _c[_b];
412                            if (field.Id == repeaterFieldId + '_row_' + index)
413                                fields.push(field);
414                        }
415                    }
416                }
417        }
418        return fields;
419    };
420    return SfMkFieldInvalidHandler;
421}(SfConditionalHandlerBase));
422window.SfMkFieldInvalidHandler = SfMkFieldInvalidHandler;
423
424
425/***/ }),
426
427/***/ "./conditional_manager/handlers/SfShowConditionalHandler.ts":
428/*!******************************************************************!*\
429  !*** ./conditional_manager/handlers/SfShowConditionalHandler.ts ***!
430  \******************************************************************/
431/*! no static exports found */
432/***/ (function(module, exports) {
433
434var __extends = (this && this.__extends) || (function () {
435    var extendStatics = function (d, b) {
436        extendStatics = Object.setPrototypeOf ||
437            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
438            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
439        return extendStatics(d, b);
440    };
441    return function (d, b) {
442        extendStatics(d, b);
443        function __() { this.constructor = d; }
444        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
445    };
446})();
447var SfShowConditionalHandler = /** @class */ (function (_super) {
448    __extends(SfShowConditionalHandler, _super);
449    function SfShowConditionalHandler(options) {
450        var _this = _super.call(this, options) || this;
451        _this.Options.Type = "SfShowConditionalHandler";
452        _this.Fields = "";
453        _this.FormElements = null;
454        return _this;
455    }
456    SfShowConditionalHandler.prototype.ExecutingPromise = function () {
457    };
458    SfShowConditionalHandler.prototype.GetConditionalSteps = function () {
459        if (this.IsNew) {
460            this.Options.GeneralInfo = {};
461            this.Options.FieldPicker = {};
462            this.Options.Condition = {};
463        }
464        return [
465            { Type: "SfNamePicker", Label: 'HowDoYouWantToName', Options: this.Options.GeneralInfo, Id: this.Id },
466            { Type: "SfHandlerFieldPicker", Label: 'typeOrSelectFieldsToBeShown', Options: this.Options.FieldPicker },
467            { Type: "SfHandlerConditionGenerator", Label: 'WhenDoYouWantToDisplay', Options: this.Options.Condition }
468        ];
469    };
470    ;
471    SfShowConditionalHandler.prototype.Initialize = function (form, data) {
472        this.Form = form;
473        this.PreviousActionWas = -1;
474        this.Condition = this.Options.Condition;
475        this.SubscribeCondition(this.Options.Condition, data);
476        this.ProcessCondition(data).then(function (result) { if (result != null)
477            result.Execute(); });
478    };
479    ;
480    SfShowConditionalHandler.prototype.HideFields = function () {
481        this.Form.JQueryForm.find(this.GetFieldIds()).css('display', 'none');
482        var formElements = this.GetFormElements();
483        for (var i = 0; i < formElements.length; i++)
484            formElements[i].Ignore();
485    };
486    ;
487    SfShowConditionalHandler.prototype.GetFieldIds = function () {
488        if (this.Fields == "")
489            for (var i = 0; i < this.Options.FieldPicker.AffectedItems.length; i++) {
490                if (i > 0)
491                    this.Fields += ",";
492                this.Fields += '#' + this.Options.FieldPicker.AffectedItems[i];
493            }
494        return this.Fields;
495    };
496    ;
497    SfShowConditionalHandler.prototype.GetFormElements = function () {
498        if (this.FormElements == null) {
499            this.FormElements = [];
500            for (var i = 0; i < this.Options.FieldPicker.AffectedItems.length; i++) {
501                var fieldId = this.Options.FieldPicker.AffectedItems[i];
502                for (var t = 0; t < this.Form.FormElements.length; t++)
503                    if (this.Form.FormElements[t].Id == fieldId)
504                        this.FormElements.push(this.Form.FormElements[t]);
505            }
506        }
507        return this.FormElements;
508    };
509    ;
510    SfShowConditionalHandler.prototype.ExecuteTrueAction = function (index) {
511        if (index === void 0) { index = null; }
512        var formElements = null;
513        if (index === null)
514            formElements = this.GetFormElements();
515        else {
516            formElements = this.GetRepeaterElements(index);
517        }
518        for (var i = 0; i < formElements.length; i++)
519            formElements[i].Show(this.Options.Id);
520    };
521    ;
522    SfShowConditionalHandler.prototype.ExecuteFalseAction = function (form, index) {
523        if (index === void 0) { index = null; }
524        var formElements = null;
525        if (index === null)
526            formElements = this.GetFormElements();
527        else {
528            formElements = this.GetRepeaterElements(index);
529        }
530        for (var i = 0; i < formElements.length; i++)
531            formElements[i].Hide(this.Options.Id);
532    };
533    ;
534    SfShowConditionalHandler.prototype.GetRepeaterElements = function (index) {
535        var fields = [];
536        for (var i = 0; i < this.Options.FieldPicker.AffectedItems.length; i++) {
537            var fieldId = this.Options.FieldPicker.AffectedItems[i];
538            var repeaterId = fieldId.split('.')[0];
539            var repeaterFieldId = fieldId.split('.')[1];
540            for (var t = 0; t < this.Form.FormElements.length; t++)
541                if (this.Form.FormElements[t].Id == repeaterId) {
542                    for (var _i = 0, _a = this.Form.FormElements[t].DynamicItems; _i < _a.length; _i++) {
543                        var item = _a[_i];
544                        for (var _b = 0, _c = item.Fields; _b < _c.length; _b++) {
545                            var field = _c[_b];
546                            if (field.Id == repeaterFieldId + '_row_' + index)
547                                fields.push(field);
548                        }
549                    }
550                }
551        }
552        return fields;
553    };
554    return SfShowConditionalHandler;
555}(SfConditionalHandlerBase));
556window.SfShowConditionalHandler = SfShowConditionalHandler;
557
558
559/***/ }),
560
561/***/ "./conditional_manager/handlers/SfShowStepHandler.ts":
562/*!***********************************************************!*\
563  !*** ./conditional_manager/handlers/SfShowStepHandler.ts ***!
564  \***********************************************************/
565/*! no static exports found */
566/***/ (function(module, exports) {
567
568var __extends = (this && this.__extends) || (function () {
569    var extendStatics = function (d, b) {
570        extendStatics = Object.setPrototypeOf ||
571            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
572            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
573        return extendStatics(d, b);
574    };
575    return function (d, b) {
576        extendStatics(d, b);
577        function __() { this.constructor = d; }
578        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
579    };
580})();
581var SfShowStepHandler = /** @class */ (function (_super) {
582    __extends(SfShowStepHandler, _super);
583    function SfShowStepHandler(options) {
584        var _this = _super.call(this, options) || this;
585        _this.$StepList = [];
586        _this.Options.Type = "SfShowStepHandler";
587        _this.Fields = "";
588        _this.FormElements = null;
589        return _this;
590    }
591    SfShowStepHandler.prototype.ExecutingPromise = function () {
592    };
593    SfShowStepHandler.prototype.GetConditionalSteps = function () {
594        if (this.IsNew) {
595            this.Options.GeneralInfo = {};
596            this.Options.StepPicker = {};
597            this.Options.Condition = {};
598        }
599        return [
600            { Type: "SfNamePicker", Label: 'HowDoYouWantToName', Options: this.Options.GeneralInfo, Id: this.Id },
601            { Type: "SfStepPicker", Label: 'SelectTheStepsToBeShow', Options: this.Options.StepPicker },
602            { Type: "SfHandlerConditionGenerator", Label: 'WhenDoYouWantToDisplay', Options: this.Options.Condition }
603        ];
604    };
605    ;
606    SfShowStepHandler.prototype.Initialize = function (form, data) {
607        var _this = this;
608        this.Form = form;
609        var stepPickerOptions = this.Options.StepPicker;
610        this.Form.JQueryForm.find('.rnMLStep').each(function (index, value) {
611            if (stepPickerOptions.StepsToShow.find(function (x) { return x == rnJQuery(value).data('step-id'); }))
612                _this.$StepList.push({ $element: rnJQuery(value), id: rnJQuery(value).data('step-id') });
613        });
614        this.PreviousActionWas = -1;
615        this.Condition = this.Options.Condition;
616        this.SubscribeCondition(this.Options.Condition, data);
617        this.ProcessCondition(data).then(function (result) { if (result != null)
618            result.Execute(); });
619    };
620    ;
621    SfShowStepHandler.prototype.GetFormElements = function () {
622        if (this.FormElements == null) {
623            this.FormElements = [];
624            for (var i = 0; i < this.Options.FieldPicker.AffectedItems.length; i++) {
625                var fieldId = this.Options.FieldPicker.AffectedItems[i];
626                for (var t = 0; t < this.Form.FormElements.length; t++)
627                    if (this.Form.FormElements[t].Id == fieldId)
628                        this.FormElements.push(this.Form.FormElements[t]);
629            }
630        }
631        return this.FormElements;
632    };
633    ;
634    SfShowStepHandler.prototype.ExecuteTrueAction = function (index) {
635        if (index === void 0) { index = null; }
636        var _loop_1 = function (step) {
637            if (typeof step.OriginalWidth == "undefined")
638                return "continue";
639            this_1.Form.MultipleStepsManager.UnIgnoreStep(step.id);
640            step.$element.css('display', 'block');
641            step.$element.velocity({ width: step.OriginalWidth, 'padding-left': 30, 'padding-right': 20 }, 200, 'easeInExp', function () { step.$element.css('width', ''); });
642        };
643        var this_1 = this;
644        for (var _i = 0, _a = this.$StepList; _i < _a.length; _i++) {
645            var step = _a[_i];
646            _loop_1(step);
647        }
648        if (this.Form != null && this.Form.MultipleStepsManager != null)
649            this.Form.MultipleStepsManager.RefreshNextButtonText();
650    };
651    ;
652    SfShowStepHandler.prototype.ExecuteFalseAction = function (from, index) {
653        if (index === void 0) { index = null; }
654        var _loop_2 = function (step) {
655            this_2.Form.MultipleStepsManager.IgnoreStep(step.id);
656            step.OriginalWidth = step.$element.width();
657            step.$element.velocity({ width: 0, 'padding-left': 0, 'padding-right': 0 }, 200, 'easeOutExp', function () { step.$element.css('display', 'none'); });
658        };
659        var this_2 = this;
660        for (var _i = 0, _a = this.$StepList; _i < _a.length; _i++) {
661            var step = _a[_i];
662            _loop_2(step);
663        }
664        if (this.Form != null && this.Form.MultipleStepsManager != null)
665            this.Form.MultipleStepsManager.RefreshNextButtonText();
666    };
667    ;
668    return SfShowStepHandler;
669}(SfConditionalHandlerBase));
670window.SfShowStepHandler = SfShowStepHandler;
671
672
673/***/ })
673
674
675/******/ });
676//# sourceMappingURL=conditionalHandlers_bundle.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.