haori 0.13.2 → 0.15.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.ja.md +2 -2
- package/README.md +2 -2
- package/dist/haori.cjs.js +11 -11
- package/dist/haori.es.js +616 -473
- package/dist/haori.iife.js +11 -11
- package/dist/index.d.ts +67 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1377,6 +1377,48 @@ declare class Haori {
|
|
|
1377
1377
|
* @returns 表示要素の配列
|
|
1378
1378
|
*/
|
|
1379
1379
|
static pages(totalPages: number, current: number, options?: PagesOptions): PageItem[];
|
|
1380
|
+
/**
|
|
1381
|
+
* `YYYY-MM` 形式の年月文字列に月数を加算します。
|
|
1382
|
+
*
|
|
1383
|
+
* テンプレート式中の `haori.monthAdd(...)` と同じ実装です。
|
|
1384
|
+
*
|
|
1385
|
+
* @param value 基準となる年月(`YYYY-MM` 形式)
|
|
1386
|
+
* @param delta 加算する月数(負数で過去方向)
|
|
1387
|
+
* @returns 加算後の年月(`YYYY-MM` 形式)。不正な入力は空文字
|
|
1388
|
+
*/
|
|
1389
|
+
static monthAdd(value: string | null | undefined, delta: number): string;
|
|
1390
|
+
/**
|
|
1391
|
+
* 基準月から過去方向へ `count + 1` 個の年月配列を降順で返します。
|
|
1392
|
+
*
|
|
1393
|
+
* テンプレート式中の `haori.monthRange(...)` と同じ実装です。
|
|
1394
|
+
*
|
|
1395
|
+
* @param count 基準月から遡る月数(戻り値の要素数は `count + 1`)
|
|
1396
|
+
* @param base 基準月(`YYYY-MM` 形式、省略時は現在月)
|
|
1397
|
+
* @returns 年月情報の降順配列。不正な入力は空配列
|
|
1398
|
+
*/
|
|
1399
|
+
static monthRange(count: number, base?: string): MonthItem[];
|
|
1400
|
+
/**
|
|
1401
|
+
* ページレスポンスから表示用サマリーを作ります。
|
|
1402
|
+
*
|
|
1403
|
+
* テンプレート式中の `haori.pageSummary(...)` と同じ実装です。
|
|
1404
|
+
*
|
|
1405
|
+
* @param page ページ情報(`number`・`size`・`totalElements`/`totalCount` 等)
|
|
1406
|
+
* @param visibleCount 現在表示している件数(省略可)
|
|
1407
|
+
* @returns 表示サマリー
|
|
1408
|
+
*/
|
|
1409
|
+
static pageSummary(page: Record<string, unknown> | null | undefined, visibleCount?: number): PageSummary;
|
|
1410
|
+
/**
|
|
1411
|
+
* 配列から `item[key]` が指定値に一致する最初の要素を返します。
|
|
1412
|
+
*
|
|
1413
|
+
* テンプレート式中の `haori.findBy(...)` と同じ実装です。比較は文字列化して
|
|
1414
|
+
* 行い、一致が無ければ null を返します。
|
|
1415
|
+
*
|
|
1416
|
+
* @param array 検索対象の配列
|
|
1417
|
+
* @param key 比較に使うプロパティ名
|
|
1418
|
+
* @param value 一致させたい値(文字列化して比較)
|
|
1419
|
+
* @returns 一致した最初の要素。無ければ null
|
|
1420
|
+
*/
|
|
1421
|
+
static findBy(array: unknown, key: string, value: unknown): unknown;
|
|
1380
1422
|
}
|
|
1381
1423
|
export { Haori }
|
|
1382
1424
|
export default Haori;
|
|
@@ -1423,6 +1465,16 @@ export declare class Log {
|
|
|
1423
1465
|
static error(message: string, ...args: unknown[]): void;
|
|
1424
1466
|
}
|
|
1425
1467
|
|
|
1468
|
+
/**
|
|
1469
|
+
* `monthRange()` が返す1要素分の情報です。
|
|
1470
|
+
*/
|
|
1471
|
+
declare interface MonthItem {
|
|
1472
|
+
/** 年月(`YYYY-MM` 形式) */
|
|
1473
|
+
targetMonth: string;
|
|
1474
|
+
/** 表示用ラベル(`YYYY/MM` 形式) */
|
|
1475
|
+
label: string;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1426
1478
|
/**
|
|
1427
1479
|
* `pages()` が返す1要素分の情報です。
|
|
1428
1480
|
*/
|
|
@@ -1455,6 +1507,20 @@ declare interface PagesOptions {
|
|
|
1455
1507
|
boundary?: number;
|
|
1456
1508
|
}
|
|
1457
1509
|
|
|
1510
|
+
/**
|
|
1511
|
+
* `pageSummary()` が返すページ表示サマリーです。
|
|
1512
|
+
*/
|
|
1513
|
+
declare interface PageSummary {
|
|
1514
|
+
/** 表示中の先頭要素の通し番号(1 始まり)。0 件のときは 0 */
|
|
1515
|
+
start: number;
|
|
1516
|
+
/** 表示中の末尾要素の通し番号(1 始まり)。0 件のときは 0 */
|
|
1517
|
+
end: number;
|
|
1518
|
+
/** 総件数 */
|
|
1519
|
+
total: number;
|
|
1520
|
+
/** 総件数が 0 のとき true */
|
|
1521
|
+
empty: boolean;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1458
1524
|
/**
|
|
1459
1525
|
* @fileoverview 汎用非同期キュー機能
|
|
1460
1526
|
*
|
|
@@ -1543,7 +1609,7 @@ declare class TextFragment extends Fragment {
|
|
|
1543
1609
|
evaluate(): Promise<void>;
|
|
1544
1610
|
}
|
|
1545
1611
|
|
|
1546
|
-
export declare const version = "0.
|
|
1612
|
+
export declare const version = "0.15.0";
|
|
1547
1613
|
|
|
1548
1614
|
/**
|
|
1549
1615
|
* すべてのレンダリングタスク(追従投入分を含む)の完了を待ちます。
|