@forgeroute/ui 0.5.28 → 0.5.29
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/fesm2022/forgeroute-ui-calendar.mjs +103 -4
- package/fesm2022/forgeroute-ui-calendar.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-card-list-item.mjs +147 -14
- package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-contact-picker.mjs +2 -2
- package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzvm992V.mjs → forgeroute-ui-core-ui-labels.es-BViJSCO-.mjs} +4 -1
- package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzvm992V.mjs.map → forgeroute-ui-core-ui-labels.es-BViJSCO-.mjs.map} +1 -1
- package/fesm2022/forgeroute-ui-core.mjs +4 -1
- package/fesm2022/forgeroute-ui-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-data-table-core.mjs +59 -28
- package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-kpi-card.mjs +2 -2
- package/fesm2022/forgeroute-ui-kpi-card.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-notes.mjs +20 -22
- package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-panel-info-list.mjs +26 -4
- package/fesm2022/forgeroute-ui-panel-info-list.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-payments.mjs +2 -1
- package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-setup.mjs +2 -1
- package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +78 -6
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-calendar.d.ts +28 -1
- package/types/forgeroute-ui-card-list-item.d.ts +25 -1
- package/types/forgeroute-ui-core.d.ts +3 -0
- package/types/forgeroute-ui-data-table-core.d.ts +10 -1
- package/types/forgeroute-ui-messaging.d.ts +5 -5
- package/types/forgeroute-ui-panel-info-list.d.ts +11 -0
- package/types/forgeroute-ui-payments.d.ts +1 -1
- package/types/forgeroute-ui-quickbooks.d.ts +1 -1
- package/types/forgeroute-ui-square.d.ts +3 -3
- package/types/forgeroute-ui-stripe.d.ts +31 -1
- package/types/forgeroute-ui-table-types.d.ts +5 -0
|
@@ -1691,17 +1691,31 @@ var DataTableComponent = class DataTableComponent {
|
|
|
1691
1691
|
...extra
|
|
1692
1692
|
});
|
|
1693
1693
|
}
|
|
1694
|
-
_resultSummary(count, done, skipped, notAllowed) {
|
|
1695
|
-
if (
|
|
1694
|
+
_resultSummary(count, done, skipped, notAllowed, busy = 0) {
|
|
1695
|
+
if (busy > 0 && count === 0 && skipped === 0 && notAllowed === 0) return this._plural("dataTable.summaryBusyOnly", busy, { item: this._countLabel(busy) });
|
|
1696
|
+
if (skipped > 0 || notAllowed > 0 || busy > 0) return [
|
|
1696
1697
|
this.labels.t("dataTable.summaryDone", {
|
|
1697
1698
|
count,
|
|
1698
1699
|
done
|
|
1699
1700
|
}),
|
|
1700
1701
|
skipped > 0 ? this.labels.t("dataTable.summarySkipped", { count: skipped }) : "",
|
|
1701
|
-
notAllowed > 0 ? this.labels.t("dataTable.summaryNotAllowed", { count: notAllowed }) : ""
|
|
1702
|
+
notAllowed > 0 ? this.labels.t("dataTable.summaryNotAllowed", { count: notAllowed }) : "",
|
|
1703
|
+
busy > 0 ? this.labels.t("dataTable.summaryBusy", { count: busy }) : ""
|
|
1702
1704
|
].filter(Boolean).join(", ") + ".";
|
|
1703
1705
|
return this._summaryAll(count, done);
|
|
1704
1706
|
}
|
|
1707
|
+
_busyOf(r) {
|
|
1708
|
+
const b = r?.busy;
|
|
1709
|
+
return typeof b === "number" && Number.isFinite(b) && b >= 1 ? Math.floor(b) : 0;
|
|
1710
|
+
}
|
|
1711
|
+
_allBusy(count, busy, serverSkipped, notAllowed) {
|
|
1712
|
+
return busy > 0 && count === 0 && serverSkipped === 0 && notAllowed === 0;
|
|
1713
|
+
}
|
|
1714
|
+
_toastBulkResult(summary, serverMsg, count, busy) {
|
|
1715
|
+
if (busy > 0 && count === 0) this._toast.warning(serverMsg ? `${summary} ${serverMsg}` : summary);
|
|
1716
|
+
else if (serverMsg && count === 0) this._toast.error(serverMsg);
|
|
1717
|
+
else this._toast.show(serverMsg ? `${summary} ${serverMsg}` : summary);
|
|
1718
|
+
}
|
|
1705
1719
|
_summaryAll(count, done) {
|
|
1706
1720
|
const item = this.labels.t("dataTable.summaryUsesCountAgreement") === "yes" ? this._countLabel(count) : this._itemWord();
|
|
1707
1721
|
return this.labels.t(count === 1 ? "dataTable.summaryAll_one" : "dataTable.summaryAll_other", {
|
|
@@ -2136,16 +2150,18 @@ var DataTableComponent = class DataTableComponent {
|
|
|
2136
2150
|
const count = r == null ? ids.length : r.updated ?? r.deleted ?? 0;
|
|
2137
2151
|
const totalSkipped = skippedCount + (r?.skipped ?? 0);
|
|
2138
2152
|
const notAllowed = r?.notAllowed ?? 0;
|
|
2139
|
-
const
|
|
2140
|
-
const
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2153
|
+
const busy = this._busyOf(r);
|
|
2154
|
+
const msg = this._resultSummary(count, done, totalSkipped, notAllowed, busy);
|
|
2155
|
+
this._toastBulkResult(msg, this._bulkServerMessage(r), count, busy);
|
|
2156
|
+
if (!this._allBusy(count, busy, r?.skipped ?? 0, notAllowed)) {
|
|
2157
|
+
this.clearSelection();
|
|
2158
|
+
this.refresh();
|
|
2159
|
+
}
|
|
2145
2160
|
this.bulkAction.emit({
|
|
2146
2161
|
type: def.type,
|
|
2147
2162
|
ids,
|
|
2148
|
-
skippedCount
|
|
2163
|
+
skippedCount,
|
|
2164
|
+
...busy > 0 ? { busyCount: busy } : {}
|
|
2149
2165
|
});
|
|
2150
2166
|
},
|
|
2151
2167
|
error: (err) => {
|
|
@@ -2169,9 +2185,11 @@ var DataTableComponent = class DataTableComponent {
|
|
|
2169
2185
|
}
|
|
2170
2186
|
downloadBlob(res.body, fileNameFromContentDisposition(res.headers.get("Content-Disposition")) || def.download?.fileName?.trim() || key);
|
|
2171
2187
|
const serverSkipped = Math.max(0, Number(res.headers.get("X-Skipped-Count")) || 0);
|
|
2172
|
-
const
|
|
2188
|
+
const busy = Math.max(0, Math.floor(Number(res.headers.get("X-Busy-Count")) || 0));
|
|
2189
|
+
const count = Math.max(0, ids.length - serverSkipped - busy);
|
|
2173
2190
|
const totalSkipped = skippedCount + serverSkipped;
|
|
2174
|
-
|
|
2191
|
+
if (busy > 0) this._toast.show(this._resultSummary(count, done, totalSkipped, 0, busy));
|
|
2192
|
+
else this._toast.show(totalSkipped > 0 ? this.labels.t("dataTable.summaryDownloadSkipped", {
|
|
2175
2193
|
count,
|
|
2176
2194
|
done,
|
|
2177
2195
|
skipped: totalSkipped
|
|
@@ -2180,7 +2198,8 @@ var DataTableComponent = class DataTableComponent {
|
|
|
2180
2198
|
this.bulkAction.emit({
|
|
2181
2199
|
type: def.type,
|
|
2182
2200
|
ids,
|
|
2183
|
-
skippedCount
|
|
2201
|
+
skippedCount,
|
|
2202
|
+
...busy > 0 ? { busyCount: busy } : {}
|
|
2184
2203
|
});
|
|
2185
2204
|
},
|
|
2186
2205
|
error: (err) => {
|
|
@@ -2272,16 +2291,18 @@ var DataTableComponent = class DataTableComponent {
|
|
|
2272
2291
|
const deleted = r == null ? eligibleIds.length : r.deleted ?? 0;
|
|
2273
2292
|
const skipped = skippedCount + (r?.skipped ?? 0);
|
|
2274
2293
|
const notAllowed = r?.notAllowed ?? 0;
|
|
2275
|
-
const
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2294
|
+
const busy = this._busyOf(r);
|
|
2295
|
+
const generated = this._resultSummary(deleted, this.labels.t("dataTable.doneDeleted"), skipped, notAllowed, busy);
|
|
2296
|
+
this._toastBulkResult(generated, this._bulkServerMessage(r), deleted, busy);
|
|
2297
|
+
if (!this._allBusy(deleted, busy, r?.skipped ?? 0, notAllowed)) {
|
|
2298
|
+
this.clearSelection();
|
|
2299
|
+
this.refresh();
|
|
2300
|
+
}
|
|
2281
2301
|
this.bulkAction.emit({
|
|
2282
2302
|
type: "delete",
|
|
2283
2303
|
ids: eligibleIds,
|
|
2284
|
-
skippedCount
|
|
2304
|
+
skippedCount,
|
|
2305
|
+
...busy > 0 ? { busyCount: busy } : {}
|
|
2285
2306
|
});
|
|
2286
2307
|
},
|
|
2287
2308
|
error: (err) => {
|
|
@@ -2387,21 +2408,23 @@ var DataTableComponent = class DataTableComponent {
|
|
|
2387
2408
|
}).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
|
|
2388
2409
|
next: (r) => {
|
|
2389
2410
|
this._applyingBulk.set(false);
|
|
2390
|
-
this._activeBulkType.set(null);
|
|
2391
2411
|
const count = r == null ? eligibleIds.length : r.updated ?? r.deleted ?? 0;
|
|
2392
2412
|
const totalSkipped = skippedCount + (r?.skipped ?? 0);
|
|
2393
2413
|
const notAllowed = r?.notAllowed ?? 0;
|
|
2394
|
-
const
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2414
|
+
const busy = this._busyOf(r);
|
|
2415
|
+
const msg = this._resultSummary(count, this.labels.t("dataTable.doneUpdated"), totalSkipped, notAllowed, busy);
|
|
2416
|
+
this._toastBulkResult(msg, this._bulkServerMessage(r), count, busy);
|
|
2417
|
+
if (!this._allBusy(count, busy, r?.skipped ?? 0, notAllowed)) {
|
|
2418
|
+
this._activeBulkType.set(null);
|
|
2419
|
+
this.clearSelection();
|
|
2420
|
+
this.refresh();
|
|
2421
|
+
}
|
|
2400
2422
|
this.bulkAction.emit({
|
|
2401
2423
|
type: def.type,
|
|
2402
2424
|
ids: eligibleIds,
|
|
2403
2425
|
value: selectedValue,
|
|
2404
|
-
skippedCount
|
|
2426
|
+
skippedCount,
|
|
2427
|
+
...busy > 0 ? { busyCount: busy } : {}
|
|
2405
2428
|
});
|
|
2406
2429
|
},
|
|
2407
2430
|
error: (err) => {
|
|
@@ -2471,6 +2494,14 @@ var DataTableComponent = class DataTableComponent {
|
|
|
2471
2494
|
this._rowDeleting.set(false);
|
|
2472
2495
|
this._rowDeleteTarget.set(null);
|
|
2473
2496
|
if (r?.deleted === 0) {
|
|
2497
|
+
const busy = this._busyOf(r);
|
|
2498
|
+
if (busy > 0) {
|
|
2499
|
+
const serverBusyMsg = this._bulkServerMessage(r);
|
|
2500
|
+
const busyText = this._resultSummary(0, "", 0, 0, busy);
|
|
2501
|
+
this._toast.warning(serverBusyMsg ? `${busyText} ${serverBusyMsg}` : busyText);
|
|
2502
|
+
this.refresh();
|
|
2503
|
+
return;
|
|
2504
|
+
}
|
|
2474
2505
|
this._toast.error(this._bulkServerMessage(r) || this.labels.t("dataTable.rowNotDeleted", { item: this._itemWord() }));
|
|
2475
2506
|
this.refresh();
|
|
2476
2507
|
return;
|