@bbn/bbn 1.0.318 → 1.0.320

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.
@@ -0,0 +1 @@
1
+ export default function getSiblingIndex(ele: any): number;
@@ -0,0 +1,8 @@
1
+ export default function getSiblingIndex(ele) {
2
+ var i = 0;
3
+ while (ele.previousElementSibling) {
4
+ i++;
5
+ ele = ele.previousElementSibling;
6
+ }
7
+ return i;
8
+ }
@@ -112,6 +112,7 @@ export default function extend() {
112
112
  throw new Error("No argument given");
113
113
  }
114
114
  var out = args[0];
115
+ var hasNoData;
115
116
  for (var i = 1; i < args.length; i++) {
116
117
  iterate(args[i], function (a, key) {
117
118
  if (deep) {
@@ -148,15 +149,21 @@ export default function extend() {
148
149
  out[key] = a;
149
150
  }
150
151
  });
151
- if (args[i].__bbnNoData) {
152
- Object.defineProperty(out, "__bbnNoData", {
153
- value: true,
154
- enumerable: false,
155
- configurable: false,
156
- writable: false,
157
- });
152
+ if (!hasNoData) {
153
+ hasNoData = !!args[i].__bbnNoData;
158
154
  }
159
155
  }
156
+ if (hasNoData && 'bbnData' in window) {
157
+ if (out.__bbnData) {
158
+ out.__bbnData.unset();
159
+ }
160
+ Object.defineProperty(out, "__bbnNoData", {
161
+ value: true,
162
+ enumerable: false,
163
+ configurable: false,
164
+ writable: false,
165
+ });
166
+ }
160
167
  return out;
161
168
  }
162
169
  ;
package/dist/fn.d.ts CHANGED
@@ -109,6 +109,7 @@ import getProperty from './fn/object/getProperty.js';
109
109
  import getRequestId from './fn/ajax/getRequestId.js';
110
110
  import getRow from './fn/object/getRow.js';
111
111
  import getScrollBarSize from './fn/style/getScrollBarSize.js';
112
+ import getSiblingIndex from './fn/html/getSiblingIndex.js';
112
113
  import getText from './fn/html/getText.js';
113
114
  import getTimeoff from './fn/misc/getTimeoff.js';
114
115
  import happy from './fn/browser/happy.js';
@@ -349,6 +350,7 @@ declare const _default: {
349
350
  getRequestId: typeof getRequestId;
350
351
  getRow: typeof getRow;
351
352
  getScrollBarSize: typeof getScrollBarSize;
353
+ getSiblingIndex: typeof getSiblingIndex;
352
354
  getText: typeof getText;
353
355
  getTimeoff: typeof getTimeoff;
354
356
  happy: typeof happy;
package/dist/fn.js CHANGED
@@ -109,6 +109,7 @@ import getProperty from './fn/object/getProperty.js';
109
109
  import getRequestId from './fn/ajax/getRequestId.js';
110
110
  import getRow from './fn/object/getRow.js';
111
111
  import getScrollBarSize from './fn/style/getScrollBarSize.js';
112
+ import getSiblingIndex from './fn/html/getSiblingIndex.js';
112
113
  import getText from './fn/html/getText.js';
113
114
  import getTimeoff from './fn/misc/getTimeoff.js';
114
115
  import happy from './fn/browser/happy.js';
@@ -349,6 +350,7 @@ export default {
349
350
  getRequestId: getRequestId,
350
351
  getRow: getRow,
351
352
  getScrollBarSize: getScrollBarSize,
353
+ getSiblingIndex: getSiblingIndex,
352
354
  getText: getText,
353
355
  getTimeoff: getTimeoff,
354
356
  happy: happy,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.318",
3
+ "version": "1.0.320",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",