pome-ui 2.0.0-preview47 → 2.0.0-preview49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pome-ui",
3
- "version": "2.0.0-preview47",
3
+ "version": "2.0.0-preview49",
4
4
  "description": "Front-end MVC library",
5
5
  "main": "pome-ui.js",
6
6
  "bin": {
package/pome-ui.dev.js CHANGED
@@ -18277,6 +18277,17 @@ function build(options, exports) {
18277
18277
  return _root;
18278
18278
  };
18279
18279
 
18280
+ function _findRoot(instance) {
18281
+ var globalRoot = exports.root();
18282
+ if (globalRoot) return globalRoot;
18283
+ if (!instance) return null;
18284
+ var current = instance;
18285
+ while (current.parent) {
18286
+ current = current.parent;
18287
+ }
18288
+ return current.proxy || current;
18289
+ }
18290
+
18280
18291
  exports._rules = [];
18281
18292
 
18282
18293
  function useRoutes(url) {
@@ -18329,6 +18340,12 @@ function build(options, exports) {
18329
18340
  if (extraFn) {
18330
18341
  extraFn.call(this, instance, opt);
18331
18342
  }
18343
+ if (!instance.$root) {
18344
+ instance.$root = _findRoot(instance);
18345
+ }
18346
+ if (!instance.$parent) {
18347
+ instance.$parent = (instance.parent && instance.parent.proxy) || instance.$root;
18348
+ }
18332
18349
  };
18333
18350
  }
18334
18351
 
@@ -18468,8 +18485,8 @@ function build(options, exports) {
18468
18485
  })
18469
18486
  .then(function (component) {
18470
18487
  _hookSetup(component, function (instance, comp) {
18471
- instance.$parent = parent || exports.root();
18472
- instance.$root = exports.root() || parent;
18488
+ instance.$parent = parent || _findRoot(instance);
18489
+ instance.$root = _findRoot(instance) || parent;
18473
18490
  instance.$view = url;
18474
18491
  instance.$data = comp.data || function () { return {}; };
18475
18492
  instance.$created = comp.created || function () { };
@@ -18710,8 +18727,8 @@ function build(options, exports) {
18710
18727
  function Root(options, el, layout) {
18711
18728
  options = options || {};
18712
18729
  _hookSetup(options, function (instance) {
18713
- instance.$parent = parent || exports.root();
18714
- instance.$root = exports.root() || parent;
18730
+ instance.$parent = parent || _findRoot(instance);
18731
+ instance.$root = _findRoot(instance) || parent;
18715
18732
  instance.$onUpdating = options.onUpdating;
18716
18733
  if (layout) {
18717
18734
  instance.$layout = layout;
@@ -19240,12 +19257,14 @@ function build(options, exports) {
19240
19257
  if (options.delayOpen) {
19241
19258
  var self = this;
19242
19259
  (self.createdPromise || Promise.resolve()).then(function () {
19243
- setTimeout(function () {
19244
- var doms = self.$el.parentNode.querySelectorAll('._pome-ui-opening');
19245
- for (var i = 0; i < doms.length; ++i) {
19246
- doms[i].classList.remove('_pome-ui-opening');
19247
- }
19248
- }, 1);
19260
+ requestAnimationFrame(function () {
19261
+ requestAnimationFrame(function () {
19262
+ var doms = self.$el.parentNode.querySelectorAll('._pome-ui-opening');
19263
+ for (var i = 0; i < doms.length; ++i) {
19264
+ doms[i].classList.remove('_pome-ui-opening');
19265
+ }
19266
+ });
19267
+ });
19249
19268
 
19250
19269
  setTimeout(function () {
19251
19270
  var doms = self.$el.parentNode.querySelectorAll('._pome-ui-opened');