@rickcedwhat/playwright-smart-table 2.1.3 → 2.3.0
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/README.md +151 -61
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/strategies/index.d.ts +2 -15
- package/dist/strategies/index.js +16 -109
- package/dist/strategies/pagination.d.ts +32 -0
- package/dist/strategies/pagination.js +72 -0
- package/dist/strategies/sorting.d.ts +12 -0
- package/dist/strategies/sorting.js +68 -0
- package/dist/typeContext.d.ts +1 -1
- package/dist/typeContext.js +67 -3
- package/dist/types.d.ts +61 -3
- package/dist/useTable.d.ts +37 -1
- package/dist/useTable.js +214 -9
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +29 -0
- package/package.json +1 -1
package/dist/utils.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.waitForCondition = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Internal helper to wait for a condition to be met.
|
|
15
|
+
* Replaces the dependency on 'expect(...).toPass()' to ensure compatibility
|
|
16
|
+
* with environments where 'expect' is not globally available.
|
|
17
|
+
*/
|
|
18
|
+
const waitForCondition = (predicate, timeout, page) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const startTime = Date.now();
|
|
20
|
+
while (Date.now() - startTime < timeout) {
|
|
21
|
+
if (yield predicate()) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
// Wait 100ms before next check (Standard Polling)
|
|
25
|
+
yield page.waitForTimeout(100).catch(() => new Promise(r => setTimeout(r, 100)));
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
});
|
|
29
|
+
exports.waitForCondition = waitForCondition;
|
package/package.json
CHANGED