matsuri-ui 9.9.1 → 9.9.2-alpha.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/CHANGELOG.md +2 -0
- package/dist/cjs/Pagination/makePagination.js +47 -0
- package/dist/cjs/Pagination/makePagination.js.map +1 -0
- package/dist/cjs/Pagination/makePagination.test.js +31 -0
- package/dist/cjs/Pagination/makePagination.test.js.map +1 -0
- package/dist/esm/Pagination/makePagination.js +40 -0
- package/dist/esm/Pagination/makePagination.js.map +1 -0
- package/dist/esm/Pagination/makePagination.test.js +28 -0
- package/dist/esm/Pagination/makePagination.test.js.map +1 -0
- package/dist/types/Pagination/makePagination.d.ts +7 -0
- package/dist/types/Pagination/makePagination.test.d.ts +1 -0
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [9.9.2-alpha.0](https://github.com/matsuri-tech/matsuri-ui/compare/v9.9.1...v9.9.2-alpha.0) (2021-12-21)
|
|
6
|
+
|
|
5
7
|
### [9.9.1](https://github.com/matsuri-tech/matsuri-ui/compare/v9.9.0...v9.9.1) (2021-12-20)
|
|
6
8
|
|
|
7
9
|
## [9.9.0](https://github.com/matsuri-tech/matsuri-ui/compare/v9.8.0...v9.9.0) (2021-11-18)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.makePagination = void 0;
|
|
5
|
+
// first, ..., prev, current, next, ..., last
|
|
6
|
+
const MINIMAL_PAGE_ITEM_COUNT = 7;
|
|
7
|
+
|
|
8
|
+
const makePagination = (current, option) => {
|
|
9
|
+
const {
|
|
10
|
+
width,
|
|
11
|
+
total
|
|
12
|
+
} = option;
|
|
13
|
+
|
|
14
|
+
if (width < MINIMAL_PAGE_ITEM_COUNT) {
|
|
15
|
+
throw new Error(`Must allow at least ${MINIMAL_PAGE_ITEM_COUNT} page items`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (width % 2 === 0) {
|
|
19
|
+
throw new Error(`Must allow odd number of page items`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (total < width) {
|
|
23
|
+
return Array.from({
|
|
24
|
+
length: total
|
|
25
|
+
}, (_, i) => i);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const left = Math.max(0, Math.min(total - width, current - Math.floor(width / 2)));
|
|
29
|
+
const items = Array.from({
|
|
30
|
+
length: width
|
|
31
|
+
}, (_, i) => i + left);
|
|
32
|
+
|
|
33
|
+
if (items[0] > 0) {
|
|
34
|
+
items[0] = 0;
|
|
35
|
+
items[1] = "prev-more";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (items[items.length - 1] < total - 1) {
|
|
39
|
+
items[items.length - 1] = total - 1;
|
|
40
|
+
items[items.length - 2] = "next-more";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return items;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.makePagination = makePagination;
|
|
47
|
+
//# sourceMappingURL=makePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/Pagination/makePagination.ts"],"names":["MINIMAL_PAGE_ITEM_COUNT","makePagination","current","option","width","total","Error","Array","from","length","_","i","left","Math","max","min","floor","items"],"mappings":";;;;AAAA;AACA,MAAMA,uBAAuB,GAAG,CAAhC;;AASO,MAAMC,cAAc,GAAG,CAACC,OAAD,EAAkBC,MAAlB,KAA0D;AACpF,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAmBF,MAAzB;;AACA,MAAIC,KAAK,GAAGJ,uBAAZ,EAAqC;AACjC,UAAM,IAAIM,KAAJ,CAAW,uBAAsBN,uBAAwB,aAAzD,CAAN;AACH;;AACD,MAAII,KAAK,GAAG,CAAR,KAAc,CAAlB,EAAqB;AACjB,UAAM,IAAIE,KAAJ,CAAW,qCAAX,CAAN;AACH;;AACD,MAAID,KAAK,GAAGD,KAAZ,EAAmB;AACf,WAAOG,KAAK,CAACC,IAAN,CAAW;AAAEC,MAAAA,MAAM,EAAEJ;AAAV,KAAX,EAA8B,CAACK,CAAD,EAAIC,CAAJ,KAAUA,CAAxC,CAAP;AACH;;AACD,QAAMC,IAAI,GAAGC,IAAI,CAACC,GAAL,CAAS,CAAT,EAAYD,IAAI,CAACE,GAAL,CAASV,KAAK,GAAGD,KAAjB,EAAwBF,OAAO,GAAGW,IAAI,CAACG,KAAL,CAAWZ,KAAK,GAAG,CAAnB,CAAlC,CAAZ,CAAb;AACA,QAAMa,KAAY,GAAGV,KAAK,CAACC,IAAN,CAAW;AAAEC,IAAAA,MAAM,EAAEL;AAAV,GAAX,EAA8B,CAACM,CAAD,EAAIC,CAAJ,KAAUA,CAAC,GAAGC,IAA5C,CAArB;;AACA,MAAIK,KAAK,CAAC,CAAD,CAAL,GAAW,CAAf,EAAkB;AACdA,IAAAA,KAAK,CAAC,CAAD,CAAL,GAAW,CAAX;AACAA,IAAAA,KAAK,CAAC,CAAD,CAAL,GAAW,WAAX;AACH;;AACD,MAAIA,KAAK,CAACA,KAAK,CAACR,MAAN,GAAe,CAAhB,CAAL,GAA0BJ,KAAK,GAAG,CAAtC,EAAyC;AACrCY,IAAAA,KAAK,CAACA,KAAK,CAACR,MAAN,GAAe,CAAhB,CAAL,GAA0BJ,KAAK,GAAG,CAAlC;AACAY,IAAAA,KAAK,CAACA,KAAK,CAACR,MAAN,GAAe,CAAhB,CAAL,GAA0B,WAA1B;AACH;;AACD,SAAOQ,KAAP;AACH,CAtBM","sourcesContent":["// first, ..., prev, current, next, ..., last\nconst MINIMAL_PAGE_ITEM_COUNT = 7\n\ninterface MakePaginationOption {\n total: number\n width: number\n}\n\ntype Items = (number | \"next-more\" | \"prev-more\")[]\n\nexport const makePagination = (current: number, option: MakePaginationOption): Items => {\n const { width, total } = option\n if (width < MINIMAL_PAGE_ITEM_COUNT) {\n throw new Error(`Must allow at least ${MINIMAL_PAGE_ITEM_COUNT} page items`)\n }\n if (width % 2 === 0) {\n throw new Error(`Must allow odd number of page items`)\n }\n if (total < width) {\n return Array.from({ length: total }, (_, i) => i)\n }\n const left = Math.max(0, Math.min(total - width, current - Math.floor(width / 2)))\n const items: Items = Array.from({ length: width }, (_, i) => i + left)\n if (items[0] > 0) {\n items[0] = 0\n items[1] = \"prev-more\"\n }\n if (items[items.length - 1] < total - 1) {\n items[items.length - 1] = total - 1\n items[items.length - 2] = \"next-more\"\n }\n return items\n}\n"],"file":"makePagination.js"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _makePagination = require("./makePagination");
|
|
4
|
+
|
|
5
|
+
describe("makePagination", () => {
|
|
6
|
+
describe.each([[0, {
|
|
7
|
+
total: 20,
|
|
8
|
+
width: 7
|
|
9
|
+
}, [0, 1, 2, 3, 4, "next-more", 19]], [10, {
|
|
10
|
+
total: 20,
|
|
11
|
+
width: 7
|
|
12
|
+
}, [0, "prev-more", 9, 10, 11, "next-more", 19]], [20, {
|
|
13
|
+
total: 20,
|
|
14
|
+
width: 7
|
|
15
|
+
}, [0, "prev-more", 15, 16, 17, 18, 19]], [0, {
|
|
16
|
+
total: 5,
|
|
17
|
+
width: 7
|
|
18
|
+
}, [0, 1, 2, 3, 4]], [2, {
|
|
19
|
+
total: 5,
|
|
20
|
+
width: 7
|
|
21
|
+
}, [0, 1, 2, 3, 4]], [4, {
|
|
22
|
+
total: 5,
|
|
23
|
+
width: 7
|
|
24
|
+
}, [0, 1, 2, 3, 4]]])("current:%o, option:%o", (current, option, expected) => {
|
|
25
|
+
test(`f(${current})=[${expected}]`, () => {
|
|
26
|
+
const result = (0, _makePagination.makePagination)(current, option);
|
|
27
|
+
expect(result).toEqual(expected);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=makePagination.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/Pagination/makePagination.test.ts"],"names":["describe","each","total","width","current","option","expected","test","result","expect","toEqual"],"mappings":";;AAAA;;AAEAA,QAAQ,CAAC,gBAAD,EAAmB,MAAM;AAC7BA,EAAAA,QAAQ,CAACC,IAAT,CAAc,CACV,CAAC,CAAD,EAAI;AAAEC,IAAAA,KAAK,EAAE,EAAT;AAAaC,IAAAA,KAAK,EAAE;AAApB,GAAJ,EAA6B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,EAAgB,WAAhB,EAA6B,EAA7B,CAA7B,CADU,EAEV,CAAC,EAAD,EAAK;AAAED,IAAAA,KAAK,EAAE,EAAT;AAAaC,IAAAA,KAAK,EAAE;AAApB,GAAL,EAA8B,CAAC,CAAD,EAAI,WAAJ,EAAiB,CAAjB,EAAoB,EAApB,EAAwB,EAAxB,EAA4B,WAA5B,EAAyC,EAAzC,CAA9B,CAFU,EAGV,CAAC,EAAD,EAAK;AAAED,IAAAA,KAAK,EAAE,EAAT;AAAaC,IAAAA,KAAK,EAAE;AAApB,GAAL,EAA8B,CAAC,CAAD,EAAI,WAAJ,EAAiB,EAAjB,EAAqB,EAArB,EAAyB,EAAzB,EAA6B,EAA7B,EAAiC,EAAjC,CAA9B,CAHU,EAIV,CAAC,CAAD,EAAI;AAAED,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,KAAK,EAAE;AAAnB,GAAJ,EAA4B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,CAA5B,CAJU,EAKV,CAAC,CAAD,EAAI;AAAED,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,KAAK,EAAE;AAAnB,GAAJ,EAA4B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,CAA5B,CALU,EAMV,CAAC,CAAD,EAAI;AAAED,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,KAAK,EAAE;AAAnB,GAAJ,EAA4B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,CAA5B,CANU,CAAd,EAOG,uBAPH,EAO4B,CAACC,OAAD,EAAUC,MAAV,EAAkBC,QAAlB,KAA+B;AACvDC,IAAAA,IAAI,CAAE,KAAIH,OAAQ,MAAKE,QAAS,GAA5B,EAAgC,MAAM;AACtC,YAAME,MAAM,GAAG,oCAAeJ,OAAf,EAAwBC,MAAxB,CAAf;AACAI,MAAAA,MAAM,CAACD,MAAD,CAAN,CAAeE,OAAf,CAAuBJ,QAAvB;AACH,KAHG,CAAJ;AAIH,GAZD;AAaH,CAdO,CAAR","sourcesContent":["import { makePagination } from \"./makePagination\"\n\ndescribe(\"makePagination\", () => {\n describe.each([\n [0, { total: 20, width: 7 }, [0, 1, 2, 3, 4, \"next-more\", 19]],\n [10, { total: 20, width: 7 }, [0, \"prev-more\", 9, 10, 11, \"next-more\", 19]],\n [20, { total: 20, width: 7 }, [0, \"prev-more\", 15, 16, 17, 18, 19]],\n [0, { total: 5, width: 7 }, [0, 1, 2, 3, 4]],\n [2, { total: 5, width: 7 }, [0, 1, 2, 3, 4]],\n [4, { total: 5, width: 7 }, [0, 1, 2, 3, 4]]\n ])(\"current:%o, option:%o\", (current, option, expected) => {\n test(`f(${current})=[${expected}]`, () => {\n const result = makePagination(current, option)\n expect(result).toEqual(expected)\n })\n })\n})\n"],"file":"makePagination.test.js"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// first, ..., prev, current, next, ..., last
|
|
2
|
+
var MINIMAL_PAGE_ITEM_COUNT = 7;
|
|
3
|
+
export var makePagination = (current, option) => {
|
|
4
|
+
var {
|
|
5
|
+
width,
|
|
6
|
+
total
|
|
7
|
+
} = option;
|
|
8
|
+
|
|
9
|
+
if (width < MINIMAL_PAGE_ITEM_COUNT) {
|
|
10
|
+
throw new Error("Must allow at least " + MINIMAL_PAGE_ITEM_COUNT + " page items");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (width % 2 === 0) {
|
|
14
|
+
throw new Error("Must allow odd number of page items");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (total < width) {
|
|
18
|
+
return Array.from({
|
|
19
|
+
length: total
|
|
20
|
+
}, (_, i) => i);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var left = Math.max(0, Math.min(total - width, current - Math.floor(width / 2)));
|
|
24
|
+
var items = Array.from({
|
|
25
|
+
length: width
|
|
26
|
+
}, (_, i) => i + left);
|
|
27
|
+
|
|
28
|
+
if (items[0] > 0) {
|
|
29
|
+
items[0] = 0;
|
|
30
|
+
items[1] = "prev-more";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (items[items.length - 1] < total - 1) {
|
|
34
|
+
items[items.length - 1] = total - 1;
|
|
35
|
+
items[items.length - 2] = "next-more";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return items;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=makePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/Pagination/makePagination.ts"],"names":["MINIMAL_PAGE_ITEM_COUNT","makePagination","current","option","width","total","Error","Array","from","length","_","i","left","Math","max","min","floor","items"],"mappings":"AAAA;AACA,IAAMA,uBAAuB,GAAG,CAAhC;AASA,OAAO,IAAMC,cAAc,GAAG,CAACC,OAAD,EAAkBC,MAAlB,KAA0D;AACpF,MAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAmBF,MAAzB;;AACA,MAAIC,KAAK,GAAGJ,uBAAZ,EAAqC;AACjC,UAAM,IAAIM,KAAJ,0BAAiCN,uBAAjC,iBAAN;AACH;;AACD,MAAII,KAAK,GAAG,CAAR,KAAc,CAAlB,EAAqB;AACjB,UAAM,IAAIE,KAAJ,uCAAN;AACH;;AACD,MAAID,KAAK,GAAGD,KAAZ,EAAmB;AACf,WAAOG,KAAK,CAACC,IAAN,CAAW;AAAEC,MAAAA,MAAM,EAAEJ;AAAV,KAAX,EAA8B,CAACK,CAAD,EAAIC,CAAJ,KAAUA,CAAxC,CAAP;AACH;;AACD,MAAMC,IAAI,GAAGC,IAAI,CAACC,GAAL,CAAS,CAAT,EAAYD,IAAI,CAACE,GAAL,CAASV,KAAK,GAAGD,KAAjB,EAAwBF,OAAO,GAAGW,IAAI,CAACG,KAAL,CAAWZ,KAAK,GAAG,CAAnB,CAAlC,CAAZ,CAAb;AACA,MAAMa,KAAY,GAAGV,KAAK,CAACC,IAAN,CAAW;AAAEC,IAAAA,MAAM,EAAEL;AAAV,GAAX,EAA8B,CAACM,CAAD,EAAIC,CAAJ,KAAUA,CAAC,GAAGC,IAA5C,CAArB;;AACA,MAAIK,KAAK,CAAC,CAAD,CAAL,GAAW,CAAf,EAAkB;AACdA,IAAAA,KAAK,CAAC,CAAD,CAAL,GAAW,CAAX;AACAA,IAAAA,KAAK,CAAC,CAAD,CAAL,GAAW,WAAX;AACH;;AACD,MAAIA,KAAK,CAACA,KAAK,CAACR,MAAN,GAAe,CAAhB,CAAL,GAA0BJ,KAAK,GAAG,CAAtC,EAAyC;AACrCY,IAAAA,KAAK,CAACA,KAAK,CAACR,MAAN,GAAe,CAAhB,CAAL,GAA0BJ,KAAK,GAAG,CAAlC;AACAY,IAAAA,KAAK,CAACA,KAAK,CAACR,MAAN,GAAe,CAAhB,CAAL,GAA0B,WAA1B;AACH;;AACD,SAAOQ,KAAP;AACH,CAtBM","sourcesContent":["// first, ..., prev, current, next, ..., last\nconst MINIMAL_PAGE_ITEM_COUNT = 7\n\ninterface MakePaginationOption {\n total: number\n width: number\n}\n\ntype Items = (number | \"next-more\" | \"prev-more\")[]\n\nexport const makePagination = (current: number, option: MakePaginationOption): Items => {\n const { width, total } = option\n if (width < MINIMAL_PAGE_ITEM_COUNT) {\n throw new Error(`Must allow at least ${MINIMAL_PAGE_ITEM_COUNT} page items`)\n }\n if (width % 2 === 0) {\n throw new Error(`Must allow odd number of page items`)\n }\n if (total < width) {\n return Array.from({ length: total }, (_, i) => i)\n }\n const left = Math.max(0, Math.min(total - width, current - Math.floor(width / 2)))\n const items: Items = Array.from({ length: width }, (_, i) => i + left)\n if (items[0] > 0) {\n items[0] = 0\n items[1] = \"prev-more\"\n }\n if (items[items.length - 1] < total - 1) {\n items[items.length - 1] = total - 1\n items[items.length - 2] = \"next-more\"\n }\n return items\n}\n"],"file":"makePagination.js"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { makePagination } from "./makePagination";
|
|
2
|
+
describe("makePagination", () => {
|
|
3
|
+
describe.each([[0, {
|
|
4
|
+
total: 20,
|
|
5
|
+
width: 7
|
|
6
|
+
}, [0, 1, 2, 3, 4, "next-more", 19]], [10, {
|
|
7
|
+
total: 20,
|
|
8
|
+
width: 7
|
|
9
|
+
}, [0, "prev-more", 9, 10, 11, "next-more", 19]], [20, {
|
|
10
|
+
total: 20,
|
|
11
|
+
width: 7
|
|
12
|
+
}, [0, "prev-more", 15, 16, 17, 18, 19]], [0, {
|
|
13
|
+
total: 5,
|
|
14
|
+
width: 7
|
|
15
|
+
}, [0, 1, 2, 3, 4]], [2, {
|
|
16
|
+
total: 5,
|
|
17
|
+
width: 7
|
|
18
|
+
}, [0, 1, 2, 3, 4]], [4, {
|
|
19
|
+
total: 5,
|
|
20
|
+
width: 7
|
|
21
|
+
}, [0, 1, 2, 3, 4]]])("current:%o, option:%o", (current, option, expected) => {
|
|
22
|
+
test("f(" + current + ")=[" + expected + "]", () => {
|
|
23
|
+
var result = makePagination(current, option);
|
|
24
|
+
expect(result).toEqual(expected);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=makePagination.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/Pagination/makePagination.test.ts"],"names":["makePagination","describe","each","total","width","current","option","expected","test","result","expect","toEqual"],"mappings":"AAAA,SAASA,cAAT,QAA+B,kBAA/B;AAEAC,QAAQ,CAAC,gBAAD,EAAmB,MAAM;AAC7BA,EAAAA,QAAQ,CAACC,IAAT,CAAc,CACV,CAAC,CAAD,EAAI;AAAEC,IAAAA,KAAK,EAAE,EAAT;AAAaC,IAAAA,KAAK,EAAE;AAApB,GAAJ,EAA6B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,EAAgB,WAAhB,EAA6B,EAA7B,CAA7B,CADU,EAEV,CAAC,EAAD,EAAK;AAAED,IAAAA,KAAK,EAAE,EAAT;AAAaC,IAAAA,KAAK,EAAE;AAApB,GAAL,EAA8B,CAAC,CAAD,EAAI,WAAJ,EAAiB,CAAjB,EAAoB,EAApB,EAAwB,EAAxB,EAA4B,WAA5B,EAAyC,EAAzC,CAA9B,CAFU,EAGV,CAAC,EAAD,EAAK;AAAED,IAAAA,KAAK,EAAE,EAAT;AAAaC,IAAAA,KAAK,EAAE;AAApB,GAAL,EAA8B,CAAC,CAAD,EAAI,WAAJ,EAAiB,EAAjB,EAAqB,EAArB,EAAyB,EAAzB,EAA6B,EAA7B,EAAiC,EAAjC,CAA9B,CAHU,EAIV,CAAC,CAAD,EAAI;AAAED,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,KAAK,EAAE;AAAnB,GAAJ,EAA4B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,CAA5B,CAJU,EAKV,CAAC,CAAD,EAAI;AAAED,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,KAAK,EAAE;AAAnB,GAAJ,EAA4B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,CAA5B,CALU,EAMV,CAAC,CAAD,EAAI;AAAED,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,KAAK,EAAE;AAAnB,GAAJ,EAA4B,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,CAA5B,CANU,CAAd,EAOG,uBAPH,EAO4B,CAACC,OAAD,EAAUC,MAAV,EAAkBC,QAAlB,KAA+B;AACvDC,IAAAA,IAAI,QAAMH,OAAN,WAAmBE,QAAnB,QAAgC,MAAM;AACtC,UAAME,MAAM,GAAGT,cAAc,CAACK,OAAD,EAAUC,MAAV,CAA7B;AACAI,MAAAA,MAAM,CAACD,MAAD,CAAN,CAAeE,OAAf,CAAuBJ,QAAvB;AACH,KAHG,CAAJ;AAIH,GAZD;AAaH,CAdO,CAAR","sourcesContent":["import { makePagination } from \"./makePagination\"\n\ndescribe(\"makePagination\", () => {\n describe.each([\n [0, { total: 20, width: 7 }, [0, 1, 2, 3, 4, \"next-more\", 19]],\n [10, { total: 20, width: 7 }, [0, \"prev-more\", 9, 10, 11, \"next-more\", 19]],\n [20, { total: 20, width: 7 }, [0, \"prev-more\", 15, 16, 17, 18, 19]],\n [0, { total: 5, width: 7 }, [0, 1, 2, 3, 4]],\n [2, { total: 5, width: 7 }, [0, 1, 2, 3, 4]],\n [4, { total: 5, width: 7 }, [0, 1, 2, 3, 4]]\n ])(\"current:%o, option:%o\", (current, option, expected) => {\n test(`f(${current})=[${expected}]`, () => {\n const result = makePagination(current, option)\n expect(result).toEqual(expected)\n })\n })\n})\n"],"file":"makePagination.test.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matsuri-ui",
|
|
3
|
-
"version": "9.9.
|
|
3
|
+
"version": "9.9.2-alpha.0",
|
|
4
4
|
"repository": "https://github.com/matsuri-tech/matsuri-ui.git",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"resize-observer-polyfill": "^1.5.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@emotion/react": "11.
|
|
40
|
-
"@popperjs/core": "2.
|
|
41
|
-
"@types/react": "17.0.
|
|
42
|
-
"@types/react-dom": "17.0.
|
|
43
|
-
"clsx": "^1.
|
|
44
|
-
"dayjs": "1.
|
|
45
|
-
"react": "17.0.
|
|
46
|
-
"react-dom": "17.0.
|
|
47
|
-
"react-spring": "8.0.
|
|
48
|
-
"relative-time-format": "1.0.
|
|
39
|
+
"@emotion/react": "^11.0.0",
|
|
40
|
+
"@popperjs/core": "^2.0.0",
|
|
41
|
+
"@types/react": "^17.0.0",
|
|
42
|
+
"@types/react-dom": "^17.0.0",
|
|
43
|
+
"clsx": "^1.0.0",
|
|
44
|
+
"dayjs": "^1.0.0",
|
|
45
|
+
"react": "^17.0.0",
|
|
46
|
+
"react-dom": "^17.0.0",
|
|
47
|
+
"react-spring": "^8.0.0",
|
|
48
|
+
"relative-time-format": "^1.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/cli": "7.16.0",
|