sdc_client 0.57.12 → 0.57.15

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.
@@ -1,19 +1,24 @@
1
1
  import {
2
- camelCaseToTagName,
3
- tagNameToCamelCase,
4
- getBody,
5
- uploadFileFormData,
6
- promiseDummyFactory
2
+ camelCaseToTagName,
3
+ getBody,
4
+ uploadFileFormData,
7
5
  } from "./sdc_utils.js";
8
6
  import {
9
- replaceTagElementsInContainer,
10
- reloadHTMLController,
11
- DATA_CONTROLLER_KEY,
12
- CONTROLLER_CLASS, getController, cleanCache, reloadMethodHTML
7
+ replaceTagElementsInContainer,
8
+ reloadHTMLController,
9
+ DATA_CONTROLLER_KEY,
10
+ CONTROLLER_CLASS, getController, cleanCache, refresh
13
11
  } from "./sdc_view.js";
14
12
  import {AbstractSDC} from "./AbstractSDC.js";
15
- import {Global, controllerList, tagList, resetChildren} from "./sdc_controller.js";
16
- import {initEvents, setControllerEvents, STD_EVENT_LIST, windowEventHandler} from "./sdc_dom_events.js";
13
+ import {
14
+ Global,
15
+ controllerList,
16
+ tagList,
17
+ resetChildren,
18
+ updateEventAndTriggerOnRefresh,
19
+ prepareRefreshProcess
20
+ } from "./sdc_controller.js";
21
+ import {initEvents, STD_EVENT_LIST, windowEventHandler} from "./sdc_dom_events.js";
17
22
  import {reconcile} from "./sdc_view.js";
18
23
  import {trigger} from "./sdc_events.js";
19
24
  import {isConnected, close} from "./sdc_server_call.js";
@@ -21,389 +26,378 @@ import {isConnected, close} from "./sdc_server_call.js";
21
26
  const PROPERTIES_UPDATE = {'classname': 'class'}
22
27
 
23
28
  let sdcDomFragment = function (element, props) {
24
- let $new_elem, is_self = false;
25
- if (typeof element === 'string') {
26
- $new_elem = $(document.createElement(element));
27
- } else {
28
- const tagName = `this.${element.name}`;
29
- $new_elem = $(document.createElement(tagName));
30
- $new_elem.data('handler', element);
31
- is_self = true
32
- }
33
-
34
-
35
- if (props) {
36
- Object.entries(props).forEach(([k, v]) => {
37
- if (k.startsWith('on')) {
38
- $new_elem[0].addEventListener(k.substring(2).toLowerCase(), v);
39
- } else {
40
- if (PROPERTIES_UPDATE[k.toLowerCase()]) {
41
- k = PROPERTIES_UPDATE[k.toLowerCase()];
42
- }
43
- $new_elem[0].setAttribute(k, v);
44
- }
45
- });
46
- }
29
+ let $new_elem, is_self = false;
30
+ if (typeof element === 'string') {
31
+ $new_elem = $(document.createElement(element));
32
+ } else {
33
+ const tagName = `this.${element.name}`;
34
+ $new_elem = $(document.createElement(tagName));
35
+ $new_elem.data('handler', element);
36
+ is_self = true
37
+ }
38
+
39
+
40
+ if (props) {
41
+ Object.entries(props).forEach(([k, v]) => {
42
+ if (k.startsWith('on')) {
43
+ $new_elem[0].addEventListener(k.substring(2).toLowerCase(), v);
44
+ } else {
45
+ if (PROPERTIES_UPDATE[k.toLowerCase()]) {
46
+ k = PROPERTIES_UPDATE[k.toLowerCase()];
47
+ }
48
+ $new_elem[0].setAttribute(k, v);
49
+ }
50
+ });
51
+ }
47
52
 
48
- if (is_self) {
49
- $new_elem.addClass('_bind_to_update_handler _with_handler');
50
- }
53
+ if (is_self) {
54
+ $new_elem.addClass('_bind_to_update_handler _with_handler');
55
+ }
51
56
 
52
- return $new_elem;
57
+ return $new_elem;
53
58
  }
54
59
 
55
60
  window.sdcDom = function (tagName, props, ...children) {
56
- if (!tagName) {
57
- return '';
58
- }
59
- const $new_elem = sdcDomFragment(tagName, props);
60
- for (const c of children) {
61
- $new_elem.append(c);
62
- }
63
- return $new_elem;
61
+ if (!tagName) {
62
+ return '';
63
+ }
64
+ const $new_elem = sdcDomFragment(tagName, props);
65
+ for (const c of children) {
66
+ $new_elem.append(c);
67
+ }
68
+ return $new_elem;
64
69
 
65
70
  }
66
71
 
67
72
  export let app = {
68
- CSRF_TOKEN: window.CSRF_TOKEN || '',
69
- LANGUAGE_CODE: window.LANGUAGE_CODE || 'en',
70
- DEBUG: window.DEBUG || false,
71
- VERSION: window.VERSION || '0.0',
72
- tagNames: [],
73
- Global: Global,
74
- rootController: null,
75
- _isInit: false,
76
- _origin_trigger: null,
77
-
78
- init_sdc: () => {
79
- if (!app._isInit) {
80
- app._isInit = true;
81
- if (!app._origin_trigger) {
82
- app._origin_trigger = $.fn.trigger;
83
- $.fn.trigger = function (event) {
84
- const ev_type = {}.hasOwnProperty.call(event, "type") ? event.type : event;
85
- if (!STD_EVENT_LIST.includes(ev_type)) {
86
- STD_EVENT_LIST.push(ev_type);
87
- $(window).on(ev_type, windowEventHandler);
88
- }
89
- return app._origin_trigger.call(this, event);
90
- }
91
-
92
- app.updateJquery();
93
- } else {
94
- close();
95
- }
96
-
97
- isConnected();
98
-
99
- initEvents();
100
-
101
- app.rootController = app.rootController || new AbstractSDC();
102
- }
103
-
104
- app.tagNames = tagList();
105
-
106
- for (let [tag, controller] of Object.entries(app.Global)) {
107
- if (!controller.$container) Global[tag].$container = getBody();
108
- }
109
-
110
- return replaceTagElementsInContainer(app.tagNames, getBody(), app.rootController);
111
- },
112
-
113
- updateJquery: () => {
114
- $.fn.safeReplace = function ($elem) {
115
- return app.safeReplace($(this), $elem);
116
- }
117
- $.fn.safeEmpty = function () {
118
- return app.safeEmpty($(this));
119
- }
120
- $.fn.safeRemove = function () {
121
- return app.safeRemove($(this));
122
- }
123
- },
124
-
125
- controllerToTag: (Controller) => {
126
- let tagName = camelCaseToTagName(Controller.name);
127
- return tagName.replace(/-controller$/, '');
128
- },
129
-
130
- /**
131
- *
132
- * @param {AbstractSDC} Controller
133
- */
134
- registerGlobal: (Controller) => {
135
- let tagName = app.controllerToTag(Controller);
136
- let globalController = new Controller();
137
- controllerList[tagName] = [globalController, []];
138
- globalController._tagName = tagName;
139
- window[tagNameToCamelCase(tagName)] = Global[tagNameToCamelCase(tagName)] = globalController;
140
- },
141
-
142
- cleanCache: () => {
143
- cleanCache();
144
- },
145
-
146
- /**
147
- *
148
- * @param {AbstractSDC} Controller
149
- */
150
- register: (Controller) => {
151
- let tagName = app.controllerToTag(Controller);
152
- controllerList[tagName] = [Controller, []];
153
- Controller.prototype._tagName = tagName;
154
- return {
155
- /**
156
- *
157
- * @param {Array<string>} mixins Controller tag names
158
- */
159
- addMixin: (...mixins) => {
160
- for (let mixin of mixins) {
161
- let mixinName;
162
- if (typeof mixin === "string") {
163
- mixinName = camelCaseToTagName(mixin);
164
- } else if (mixin) {
165
- mixinName = app.controllerToTag(mixin)
166
- }
167
- controllerList[tagName][1].push(mixinName);
168
- }
169
- }
170
- }
171
- },
172
-
173
- /**
174
- *
175
- * @param {AbstractSDC} controller
176
- * @param {string} url
177
- * @param {object} args
178
- * @return {Promise}
179
- */
180
- post: (controller, url, args) => {
181
- if (!args) {
182
- args = {};
183
- }
184
-
185
- args.CSRF_TOKEN = app.CSRF_TOKEN;
186
- return app.ajax(controller, url, params, $.post);
187
- },
188
-
189
- /**
190
- *
191
- * @param {AbstractSDC} controller
192
- * @param {string} url
193
- * @param {object} args
194
- * @return {Promise}
195
- */
196
- get: (controller, url, args) => {
197
- return app.ajax(controller, url, args, $.get);
198
- },
199
-
200
- /**
201
- *
202
- * @param {AbstractSDC} controller
203
- * @param {string} url
204
- * @param {object} args
205
- * @param {function} method $.get or $.post
206
- * @return {Promise}
207
- */
208
- ajax: (controller, url, args, method) => {
209
- if (!args) {
210
- args = {};
73
+ CSRF_TOKEN: window.CSRF_TOKEN || '',
74
+ LANGUAGE_CODE: window.LANGUAGE_CODE || 'en',
75
+ DEBUG: window.DEBUG || false,
76
+ VERSION: window.VERSION || '0.0',
77
+ tagNames: [],
78
+ Global: Global,
79
+ rootController: null,
80
+ globalRootController: null,
81
+ _isInit: false,
82
+ _origin_trigger: null,
83
+ _globalControllerClasses: [],
84
+
85
+ init_sdc: () => {
86
+ if (!app._isInit) {
87
+ app._isInit = true;
88
+ if (!app._origin_trigger) {
89
+ app._origin_trigger = $.fn.trigger;
90
+ $.fn.trigger = function (event) {
91
+ const ev_type = {}.hasOwnProperty.call(event, "type") ? event.type : event;
92
+ if (!STD_EVENT_LIST.includes(ev_type)) {
93
+ STD_EVENT_LIST.push(ev_type);
94
+ $(window).on(ev_type, windowEventHandler);
95
+ }
96
+ return app._origin_trigger.call(this, event);
211
97
  }
212
98
 
213
- args.VERSION = app.VERSION;
214
- args._method = args._method || 'api';
215
-
216
- const p = new Promise((resolve, reject) => {
217
- return method(url, args).then((a, b, c) => {
218
- resolve(a, b, c);
219
- if (a.status === 'redirect') {
220
- trigger('onNavLink', a['url-link']);
221
- } else {
222
- p.then(() => {
223
- app.refresh(controller.$container);
224
- });
225
- }
226
- }).catch(reject);
227
- });
99
+ app.updateJquery();
100
+ } else {
101
+ close();
102
+ }
228
103
 
229
- return p;
230
- },
104
+ isConnected();
231
105
 
232
- submitFormAndUpdateView: (controller, form, url, method) => {
233
- let formData = new FormData(form);
234
- const redirector = (a) => {
235
- if (a['url-link']) {
236
- trigger('onNavLink', a['url-link']);
237
- } else {
238
- window.location.href = a['url'];
239
- }
106
+ initEvents();
240
107
 
241
- }
242
-
243
- const p = new Promise((resolve, reject) => {
244
- uploadFileFormData(formData, (url || form.action), (method || form.method))
245
- .then((a, b, c) => {
246
- resolve(a, b, c);
247
- if (a.status === 'redirect') {
248
- redirector(a);
249
- } else {
250
- p.then(() => {
251
- app.refresh(controller.$container);
252
- });
253
- }
254
- })
255
- .catch((a, b, c) => {
256
- if (a.status === 301) {
257
- a = a.responseJSON;
258
- redirector(a);
259
- resolve(a, b, c);
260
- } else {
261
- reject(a, b, c);
262
- }
263
- });
264
- });
108
+ app.rootController = app.rootController || new AbstractSDC();
109
+ app.globalRootController = app.globalRootController || new AbstractSDC();
110
+ }
265
111
 
266
- return p;
112
+ app.tagNames = tagList();
267
113
 
268
- },
269
- submitForm: (form, url, method) => {
270
- let formData = new FormData(form);
271
- return new Promise((resolve, reject) => {
272
- uploadFileFormData(formData, (url || form.action), (method || form.method))
273
- .then(resolve).catch(reject);
274
- });
275
- },
276
-
277
- /**
278
- *
279
- * @param {jquery} $elem
280
- * @return {AbstractSDC}
281
- */
282
- getController: ($elem) => getController($elem),
283
-
284
- /**
285
- * safeEmpty removes all content of a dom
286
- * and deletes all child controller safely.
287
- *
288
- * @param $elem - jQuery DOM container to be emptyed
289
- */
290
- safeEmpty: ($elem) => {
291
- let $children = $elem.children();
292
- $children.each(function (_, element) {
293
- let $element = $(element);
294
- app.safeRemove($element);
295
- });
114
+ const $globalDiv = $('<div></div>');
115
+ Global.forEach((tagName) => {
116
+ const ControllerClass = controllerList[tagName][0];
117
+ $globalDiv.append(`<${ControllerClass.prototype._tagName}></${ControllerClass.prototype._tagName}>`);
118
+ });
296
119
 
297
- return $elem;
298
- },
299
-
300
- /**
301
- * safeReplace removes all content of a dom
302
- * and deletes all child controller safely.
303
- *
304
- * @param $elem - jQuery DOM to be repleaced
305
- * @param $new - jQuery new DOM container
306
- */
307
- safeReplace: ($elem, $new) => {
308
- $new.insertBefore($elem);
309
- return app.safeRemove($elem);
310
- },
311
-
312
-
313
- /**
314
- * safeRemove removes a dom and deletes all child controller safely.
315
- *
316
- * @param $elem - jQuery Dom
317
- */
318
- safeRemove: ($elem) => {
319
- $elem.each(function () {
320
- let $this = $(this);
321
- if ($this.data(`${DATA_CONTROLLER_KEY}`)) {
322
- $this.data(`${DATA_CONTROLLER_KEY}`).remove();
323
- }
324
- });
120
+ const {refreshProcess} = prepareRefreshProcess(null, app.rootController);
325
121
 
326
- $elem.find(`.${CONTROLLER_CLASS}`).each(function () {
327
- const controller = $(this).data(`${DATA_CONTROLLER_KEY}`);
328
- controller && controller.remove();
329
- });
122
+ return replaceTagElementsInContainer(app.tagNames, $globalDiv, app.globalRootController, refreshProcess).then(() => {
123
+ return replaceTagElementsInContainer(app.tagNames, getBody(), app.rootController, refreshProcess).then((res) => {
124
+ updateEventAndTriggerOnRefresh(refreshProcess);
125
+ return res;
126
+ });
127
+ });
128
+ },
330
129
 
331
- return $elem.remove();
332
- },
333
-
334
- /**
335
- *
336
- * @param {AbstractSDC} controller
337
- * @return {Promise<jQuery>}
338
- */
339
- reloadController: (controller) => {
340
- return reloadHTMLController(controller).then((html) => {
341
- let $html = $(html);
342
- return app.reconcile(controller, $html);
343
- });
344
- },
345
-
346
-
347
- /**
348
- *
349
- * @param {AbstractSDC} controller
350
- * @param {jquery} $virtualNode
351
- * @param {jquery} $realNode
352
- */
353
- reconcile: (controller, $virtualNode, $realNode = null) => {
354
- if (!$realNode) {
355
- let $temp = controller.$container.clone().empty();
356
- $temp.data(DATA_CONTROLLER_KEY, null);
357
- $temp.removeClass(CONTROLLER_CLASS);
358
- $temp.append($virtualNode);
359
- $virtualNode = $temp;
130
+ updateJquery: () => {
131
+ $.fn.safeReplace = function ($elem) {
132
+ return app.safeReplace($(this), $elem);
133
+ }
134
+ $.fn.safeEmpty = function () {
135
+ return app.safeEmpty($(this));
136
+ }
137
+ $.fn.safeRemove = function () {
138
+ return app.safeRemove($(this));
139
+ }
140
+ },
141
+
142
+ controllerToTag: (Controller) => {
143
+ let tagName = camelCaseToTagName(Controller.name);
144
+ return tagName.replace(/-controller$/, '');
145
+ },
146
+
147
+ /**
148
+ *
149
+ * @param {AbstractSDC} Controller
150
+ */
151
+ registerGlobal: (Controller) => {
152
+ app.register(Controller);
153
+ let tagName = Controller.prototype._tagName;
154
+ Global.push(tagName);
155
+ },
156
+
157
+ cleanCache: () => {
158
+ cleanCache();
159
+ },
160
+
161
+ /**
162
+ *
163
+ * @param {AbstractSDC} Controller
164
+ */
165
+ register: (Controller) => {
166
+ let tagName = app.controllerToTag(Controller);
167
+ controllerList[tagName] = [Controller, []];
168
+ Controller.prototype._tagName = tagName;
169
+ return {
170
+ /**
171
+ *
172
+ * @param {Array<string>} mixins Controller tag names
173
+ */
174
+ addMixin: (...mixins) => {
175
+ for (let mixin of mixins) {
176
+ let mixinName;
177
+ if (typeof mixin === "string") {
178
+ mixinName = camelCaseToTagName(mixin);
179
+ } else if (mixin) {
180
+ mixinName = app.controllerToTag(mixin)
181
+ }
182
+ controllerList[tagName][1].push(mixinName);
360
183
  }
184
+ }
185
+ }
186
+ },
187
+
188
+ /**
189
+ *
190
+ * @param {AbstractSDC} controller
191
+ * @param {string} url
192
+ * @param {object} args
193
+ * @return {Promise}
194
+ */
195
+ post: (controller, url, args) => {
196
+ if (!args) {
197
+ args = {};
198
+ }
361
199
 
362
- $realNode = $realNode ?? controller.$container;
363
-
364
- return app.refresh($virtualNode, controller, true).then(() => {
365
- reconcile($virtualNode, $realNode);
366
- resetChildren(controller);
367
- return controller;
368
- });
200
+ args.CSRF_TOKEN = app.CSRF_TOKEN;
201
+ return app.ajax(controller, url, params, $.post);
202
+ },
203
+
204
+ /**
205
+ *
206
+ * @param {AbstractSDC} controller
207
+ * @param {string} url
208
+ * @param {object} args
209
+ * @return {Promise}
210
+ */
211
+ get: (controller, url, args) => {
212
+ return app.ajax(controller, url, args, $.get);
213
+ },
214
+
215
+ /**
216
+ *
217
+ * @param {AbstractSDC} controller
218
+ * @param {string} url
219
+ * @param {object} args
220
+ * @param {function} method $.get or $.post
221
+ * @return {Promise}
222
+ */
223
+ ajax: (controller, url, args, method) => {
224
+ if (!args) {
225
+ args = {};
226
+ }
369
227
 
370
- },
371
-
372
- /**
373
- *
374
- * @param {jquery} $dom
375
- * @param {AbstractSDC} leafController
376
- * @param {bool} silent
377
- * @return {Promise<jQuery>}
378
- */
379
- refresh: ($dom, leafController, silent = false) => {
380
- if (!leafController) {
381
- leafController = app.getController($dom);
228
+ args.VERSION = app.VERSION;
229
+ args._method = args._method || 'api';
230
+
231
+ const p = new Promise((resolve, reject) => {
232
+ return method(url, args).then((a, b, c) => {
233
+ resolve(a, b, c);
234
+ if (a.status === 'redirect') {
235
+ trigger('onNavLink', a['url-link']);
236
+ } else {
237
+ p.then(() => {
238
+ app.refresh(controller.$container);
239
+ });
382
240
  }
241
+ }).catch(reject);
242
+ });
383
243
 
384
- if (!leafController) {
385
- return promiseDummyFactory();
386
- }
244
+ return p;
245
+ },
387
246
 
388
- let controller = leafController;
389
- let controllerList = [];
390
- while (controller) {
391
- controller._isEventsSet = false;
392
- controllerList.unshift(controller);
393
- controller = controller._parentController;
394
- }
247
+ submitFormAndUpdateView: (controller, form, url, method) => {
248
+ let formData = new FormData(form);
249
+ const redirector = (a) => {
250
+ if (a['url-link']) {
251
+ trigger('onNavLink', a['url-link']);
252
+ } else {
253
+ window.location.href = a['url'];
254
+ }
395
255
 
396
- $dom ??= leafController.$container;
397
-
398
- return replaceTagElementsInContainer(app.tagNames, $dom, leafController).then(() => {
399
- reloadMethodHTML(leafController, $dom).then(() => {
400
- for (let con of controllerList) {
401
- setControllerEvents(con);
402
- }
256
+ }
403
257
 
404
- !silent && leafController.onRefresh($dom);
258
+ const p = new Promise((resolve, reject) => {
259
+ uploadFileFormData(formData, (url || form.action), (method || form.method))
260
+ .then((a, b, c) => {
261
+ resolve(a, b, c);
262
+ if (a.status === 'redirect') {
263
+ redirector(a);
264
+ } else {
265
+ p.then(() => {
266
+ app.refresh(controller.$container, controller);
405
267
  });
406
-
268
+ }
269
+ })
270
+ .catch((a, b, c) => {
271
+ if (a.status === 301) {
272
+ a = a.responseJSON;
273
+ redirector(a);
274
+ resolve(a, b, c);
275
+ } else {
276
+ reject(a, b, c);
277
+ }
407
278
  });
408
- },
279
+ });
280
+
281
+ return p;
282
+
283
+ },
284
+
285
+ submitForm: (form, url, method) => {
286
+ let formData = new FormData(form);
287
+ return new Promise((resolve, reject) => {
288
+ uploadFileFormData(formData, (url || form.action), (method || form.method))
289
+ .then(resolve).catch(reject);
290
+ });
291
+ },
292
+
293
+ /**
294
+ *
295
+ * @param {jquery} $elem
296
+ * @return {AbstractSDC}
297
+ */
298
+ getController: ($elem) => getController($elem),
299
+
300
+ /**
301
+ * safeEmpty removes all content of a dom
302
+ * and deletes all child controller safely.
303
+ *
304
+ * @param $elem - jQuery DOM container to be emptyed
305
+ */
306
+ safeEmpty: ($elem) => {
307
+ let $children = $elem.children();
308
+ $children.each(function (_, element) {
309
+ let $element = $(element);
310
+ app.safeRemove($element);
311
+ });
312
+
313
+ return $elem;
314
+ },
315
+
316
+ /**
317
+ * safeReplace removes all content of a dom
318
+ * and deletes all child controller safely.
319
+ *
320
+ * @param $elem - jQuery DOM to be repleaced
321
+ * @param $new - jQuery new DOM container
322
+ */
323
+ safeReplace: ($elem, $new) => {
324
+ $new.insertBefore($elem);
325
+ return app.safeRemove($elem);
326
+ },
327
+
328
+
329
+ /**
330
+ * safeRemove removes a dom and deletes all child controller safely.
331
+ *
332
+ * @param $elem - jQuery Dom
333
+ */
334
+ safeRemove: ($elem) => {
335
+ $elem.each(function () {
336
+ let $this = $(this);
337
+ if ($this.data(`${DATA_CONTROLLER_KEY}`)) {
338
+ $this.data(`${DATA_CONTROLLER_KEY}`).remove();
339
+ }
340
+ });
341
+
342
+ $elem.find(`.${CONTROLLER_CLASS}`).each(function () {
343
+ const controller = $(this).data(`${DATA_CONTROLLER_KEY}`);
344
+ controller && controller.remove();
345
+ });
346
+
347
+ return $elem.remove();
348
+ },
349
+
350
+ /**
351
+ *
352
+ * @param {AbstractSDC} controller
353
+ * @return {Promise<jQuery>}
354
+ */
355
+ reloadController: (controller) => {
356
+ return reloadHTMLController(controller).then((html) => {
357
+ let $html = $(html);
358
+ return app.reconcile(controller, $html);
359
+ });
360
+ },
361
+
362
+
363
+ /**
364
+ *
365
+ * @param {AbstractSDC} controller
366
+ * @param {jquery} $virtualNode
367
+ * @param {jquery} $realNode
368
+ * @param {Object} process - Process object containing the refresh process
369
+ */
370
+ reconcile: (controller, $virtualNode, $realNode = null, process = null) => {
371
+ if (!$realNode) {
372
+ let $temp = controller.$container.clone().empty();
373
+ $temp.data(DATA_CONTROLLER_KEY, null);
374
+ $temp.removeClass(CONTROLLER_CLASS);
375
+ $temp.append($virtualNode);
376
+ $virtualNode = $temp;
377
+ }
378
+
379
+ $realNode = $realNode ?? controller.$container;
380
+
381
+ const {refreshProcess, isRunningProcess} = prepareRefreshProcess(process, controller);
382
+
383
+ return refresh($virtualNode, controller, refreshProcess).then(() => {
384
+ reconcile($virtualNode, $realNode);
385
+ resetChildren(controller);
386
+ if (!isRunningProcess) {
387
+ updateEventAndTriggerOnRefresh(refreshProcess);
388
+ }
389
+ return controller;
390
+ });
391
+
392
+ },
393
+
394
+ /**
395
+ *
396
+ * @param {jquery} $dom
397
+ * @param {AbstractSDC} leafController
398
+ * @return {Promise<void>}
399
+ */
400
+ refresh: ($dom, leafController) => {
401
+ return refresh($dom, leafController);
402
+ },
409
403
  };