qcobjects 2.4.43 → 2.4.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/QCObjects.js +48 -20
  2. package/VERSION +1 -1
  3. package/package.json +1 -1
package/QCObjects.js CHANGED
@@ -191,6 +191,7 @@
191
191
  _top = global;
192
192
  }
193
193
  var _domain_, _basePath_;
194
+ var _tag_filter_ = "quick-component:not([loaded]),component:not([loaded])";
194
195
  _basePath_ = (
195
196
  function () {
196
197
  var _basePath = "";
@@ -2330,25 +2331,12 @@
2330
2331
  return _ret_;
2331
2332
  }
2332
2333
 
2333
- __done__ () {
2334
+ createControllerInstance (){
2334
2335
  var _component_ = this;
2335
- var componentDone = function () {
2336
- if (typeof _component_ === "undefined") {
2337
- throw new Error("componentDone() has lost its context");
2338
- }
2336
+ return new Promise (function (resolve, reject){
2339
2337
  if (typeof _component_.body === "undefined") {
2340
2338
  throw new Error("The component has no body");
2341
2339
  }
2342
- var viewName = _component_.body.getAttribute("viewClass");
2343
- var _View = ClassFactory(viewName);
2344
- if (typeof _View !== "undefined") {
2345
- _component_.view = New(_View, {
2346
- component: _component_
2347
- }); // Initializes the main view for the component
2348
- if (Object.hasOwnProperty.call(_component_.view, "done") && typeof _component_.view.done === "function") {
2349
- _component_.view.done.call(_component_.view);
2350
- }
2351
- }
2352
2340
  var controllerName = _component_.body.getAttribute("controllerClass");
2353
2341
  if (!controllerName) {
2354
2342
  controllerName = "Controller";
@@ -2366,6 +2354,7 @@
2366
2354
  }
2367
2355
  } else {
2368
2356
  logger.debug(`${controllerName} does not have a done() method.`);
2357
+ reject(`${controllerName} does not have a done() method.`);
2369
2358
  }
2370
2359
  if (typeof _component_.controller.createRoutingController === "function") {
2371
2360
  _component_.controller.createRoutingController.call(_component_.controller);
@@ -2373,6 +2362,13 @@
2373
2362
  logger.debug(`${controllerName} does not have a createRoutingController() method.`);
2374
2363
  }
2375
2364
  }
2365
+ resolve ({component:_component_,controller:_component_.controller});
2366
+ });
2367
+ }
2368
+
2369
+ createEffectInstance (){
2370
+ var _component_ = this;
2371
+ return new Promise (function (resolve, reject){
2376
2372
  var effectClassName = _component_.body.getAttribute("effectClass");
2377
2373
  var applyEffectTo = _component_.body.getAttribute("apply-effect-to");
2378
2374
  applyEffectTo = (applyEffectTo !== null) ? (applyEffectTo) : ("load");
@@ -2381,11 +2377,42 @@
2381
2377
  } else if (effectClassName !== null && applyEffectTo === "load") {
2382
2378
  _component_.applyTransitionEffect(effectClassName);
2383
2379
  }
2384
-
2385
2380
  if (_top.CONFIG.get("overrideComponentTag")) {
2386
2381
  _component_.body.outerHTML = this.body.innerHTML;
2387
2382
  }
2388
- _component_.body.setAttribute("loaded", true);
2383
+ resolve({component:_component_, effect:_component_.effect});
2384
+ });
2385
+ }
2386
+
2387
+ createViewInstance(){
2388
+ var _component_ = this;
2389
+ return new Promise (function (resolve, reject){
2390
+ var viewName = _component_.body.getAttribute("viewClass");
2391
+ var _View = ClassFactory(viewName);
2392
+ if (typeof _View !== "undefined") {
2393
+ _component_.view = New(_View, {
2394
+ component: _component_
2395
+ }); // Initializes the main view for the component
2396
+ if (Object.hasOwnProperty.call(_component_.view, "done") && typeof _component_.view.done === "function") {
2397
+ _component_.view.done.call(_component_.view);
2398
+ }
2399
+ }
2400
+ resolve({component:_component_, view:_component_.view});
2401
+ });
2402
+ }
2403
+
2404
+ __done__ () {
2405
+ var _component_ = this;
2406
+ var componentDone = function () {
2407
+ if (typeof _component_ === "undefined") {
2408
+ throw new Error("componentDone() has lost its context");
2409
+ }
2410
+ if (typeof _component_.body === "undefined") {
2411
+ throw new Error("The component has no body");
2412
+ }
2413
+ _component_.createViewInstance();
2414
+ _component_.createControllerInstance();
2415
+ _component_.createEffectInstance();
2389
2416
 
2390
2417
  logger.debug(`Trying to run component helpers for ${_component_.name}...`);
2391
2418
  try {
@@ -2399,6 +2426,7 @@
2399
2426
  _component_.subcomponents = _component_.__buildSubComponents__();
2400
2427
 
2401
2428
  _component_._bindroute_();
2429
+ _component_.body.setAttribute("loaded", true);
2402
2430
  };
2403
2431
 
2404
2432
  return new Promise (function (resolve, reject){
@@ -2423,7 +2451,7 @@
2423
2451
 
2424
2452
  get subtags(){
2425
2453
  var _component_ = this;
2426
- var tagFilter = "component:not([loaded])";
2454
+ var tagFilter = _tag_filter_;
2427
2455
  return _component_.hostElements(tagFilter);
2428
2456
  }
2429
2457
 
@@ -3773,7 +3801,7 @@
3773
3801
  if (isBrowser) {
3774
3802
 
3775
3803
  Element.prototype.buildComponents = function (rebuildObjects = false) {
3776
- var tagFilter = "component:not([loaded])";
3804
+ var tagFilter = _tag_filter_;
3777
3805
  var d = this;
3778
3806
  var elements = d.subelements(tagFilter);
3779
3807
  return _buildComponentsFromElements_(elements, null);
@@ -3786,7 +3814,7 @@
3786
3814
  super(...arguments);
3787
3815
  const componentWidget = this;
3788
3816
  const componentName = componentWidget.nodeName.toLowerCase();
3789
- const componentBody = _DOMCreateElement("component");
3817
+ const componentBody = _DOMCreateElement("quick-component");
3790
3818
  const __enabled__atributes__ = componentWidget.getAttributeNames();
3791
3819
  componentBody.setAttribute("name", componentName);
3792
3820
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.43
1
+ 2.4.45
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects",
3
- "version": "2.4.43",
3
+ "version": "2.4.45",
4
4
  "description": "QCObjects is an Open-source framework that empowers full-stack developers to make micro-services and micro-frontends into an N-Tier architecture.",
5
5
  "main": "QCObjects.js",
6
6
  "license": "LGPL-3.0",