matsuri-ui 9.9.1 → 10.0.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/README.md +1 -1
- 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 +20 -14
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
|
+
## [10.0.0](https://github.com/matsuri-tech/matsuri-ui/compare/v9.9.1...v10.0.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)
|
package/README.md
CHANGED
|
@@ -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": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"repository": "https://github.com/matsuri-tech/matsuri-ui.git",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"node_modules"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@emotion/react": "^11.7.0",
|
|
29
28
|
"@material-ui/core": "^4.12.3",
|
|
30
29
|
"@material-ui/icons": "^4.11.2",
|
|
31
30
|
"@popperjs/core": "^2.11.0",
|
|
@@ -37,15 +36,21 @@
|
|
|
37
36
|
},
|
|
38
37
|
"peerDependencies": {
|
|
39
38
|
"@emotion/react": "11.1.4",
|
|
40
|
-
"@popperjs/core": "2.9.2",
|
|
41
39
|
"@types/react": "17.0.34",
|
|
42
40
|
"@types/react-dom": "17.0.11",
|
|
43
|
-
"clsx": "^1.1.1",
|
|
44
|
-
"dayjs": "1.10.4",
|
|
45
41
|
"react": "17.0.2",
|
|
46
|
-
"react-dom": "17.0.2"
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
"react-dom": "17.0.2"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"@types/react": {
|
|
46
|
+
"optional": true
|
|
47
|
+
},
|
|
48
|
+
"@emotion/react": {
|
|
49
|
+
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"@emotion/styled": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
49
54
|
},
|
|
50
55
|
"devDependencies": {
|
|
51
56
|
"@babel/cli": "7.16.0",
|
|
@@ -54,37 +59,38 @@
|
|
|
54
59
|
"@babel/preset-react": "7.16.0",
|
|
55
60
|
"@babel/preset-typescript": "^7.16.0",
|
|
56
61
|
"@emotion/babel-preset-css-prop": "11.2.0",
|
|
62
|
+
"@emotion/react": "11.1.4",
|
|
57
63
|
"@storybook/addon-essentials": "^6.4.4",
|
|
58
64
|
"@storybook/addon-links": "6.4.4",
|
|
59
65
|
"@storybook/react": "6.4.4",
|
|
60
66
|
"@testing-library/react": "12.1.2",
|
|
61
67
|
"@types/jest": "27.0.3",
|
|
62
|
-
"@types/react": "17.0.34",
|
|
63
68
|
"@types/react-dom": "17.0.11",
|
|
64
|
-
"@types/react-router": "5.1.17",
|
|
65
69
|
"@types/react-router-dom": "5.3.2",
|
|
70
|
+
"@types/react-router": "5.1.17",
|
|
66
71
|
"@types/react-transition-group": "4.4.4",
|
|
72
|
+
"@types/react": "17.0.34",
|
|
67
73
|
"@typescript-eslint/eslint-plugin": "4.33.0",
|
|
68
74
|
"@typescript-eslint/parser": "4.33.0",
|
|
69
75
|
"concurrently": "^6.4.0",
|
|
70
|
-
"eslint": "7.32.0",
|
|
71
76
|
"eslint-config-prettier": "8.3.0",
|
|
72
|
-
"eslint-plugin-react": "7.27.1",
|
|
73
77
|
"eslint-plugin-react-hooks": "4.3.0",
|
|
78
|
+
"eslint-plugin-react": "7.27.1",
|
|
74
79
|
"eslint-plugin-sort-imports-es6-autofix": "0.6.0",
|
|
80
|
+
"eslint": "7.32.0",
|
|
75
81
|
"husky": "^7.0.4",
|
|
76
82
|
"jest": "27.4.3",
|
|
77
83
|
"lint-staged": "12.1.2",
|
|
78
84
|
"next": "12.0.4",
|
|
79
85
|
"npm-run-all": "4.1.5",
|
|
80
86
|
"prettier": "2.5.0",
|
|
81
|
-
"react": "17.0.2",
|
|
82
87
|
"react-docgen-typescript-loader": "3.7.2",
|
|
83
88
|
"react-dom": "17.0.2",
|
|
84
|
-
"react-router": "5.2.1",
|
|
85
89
|
"react-router-dom": "5.3.0",
|
|
90
|
+
"react-router": "5.2.1",
|
|
86
91
|
"react-table": "7.7.0",
|
|
87
92
|
"react-transition-group": "4.4.2",
|
|
93
|
+
"react": "17.0.2",
|
|
88
94
|
"ress": "^4.0.0",
|
|
89
95
|
"rimraf": "3.0.2",
|
|
90
96
|
"standard-version": "9.3.2",
|