@papillonarts/library 0.18.0 → 0.20.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/a11y/index.d.ts.map +1 -1
- package/a11y/index.js +1 -0
- package/array/index.d.ts +17 -16
- package/array/index.d.ts.map +1 -1
- package/array/index.js +39 -29
- package/array/types.d.ts +17 -0
- package/array/types.d.ts.map +1 -0
- package/array/types.js +5 -0
- package/auth/index.d.ts.map +1 -1
- package/number/index.d.ts +2 -2
- package/number/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/sort/index.d.ts +10 -10
- package/sort/index.d.ts.map +1 -1
- package/sort/index.js +17 -16
package/a11y/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/a11y/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/a11y/index.ts"],"names":[],"mappings":"AAIA,wBAAgB,wBAAwB,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,EAAE,KAAK,KAAA,QAK9D"}
|
package/a11y/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.checkAccessibilityIssues = checkAccessibilityIssues;
|
|
7
7
|
// https://github.com/dequelabs/axe-core-npm
|
|
8
8
|
// https://www.npmjs.com/package/@axe-core/react
|
|
9
|
+
// https://www.deque.com/axe/core-documentation/api-documentation/
|
|
9
10
|
|
|
10
11
|
function checkAccessibilityIssues(react, reactDOM, delay) {
|
|
11
12
|
if (process.env.NODE_ENV !== 'production') {
|
package/array/index.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
1
|
+
import { Range, IRangeItem, IIndexRangeItem, ISelectedIndexRangeItem, IObjectSelectedIndexRangeItem } from './types';
|
|
2
|
+
export declare function getCurrentIndex(indexItems: IIndexRangeItem[]): number;
|
|
3
|
+
export declare function getIndexItems<T1 extends IRangeItem, T2 extends IIndexRangeItem>(items: T1[]): T2[];
|
|
4
|
+
export declare function getIndexItemsWithSelected<T1 extends IIndexRangeItem, T2 extends ISelectedIndexRangeItem>(indexItems: T1[], selectedItem: ISelectedIndexRangeItem): T2[];
|
|
5
|
+
export declare function getRandomItemFromArray<T>(array: T[]): T;
|
|
5
6
|
export declare function getRange({ range, indexSeed, valueSeed }: {
|
|
6
|
-
range:
|
|
7
|
+
range: number;
|
|
7
8
|
indexSeed?: number;
|
|
8
9
|
valueSeed?: number;
|
|
9
|
-
}):
|
|
10
|
-
export declare function getSelectedItem({ items }: {
|
|
11
|
-
items:
|
|
12
|
-
}):
|
|
10
|
+
}): Range;
|
|
11
|
+
export declare function getSelectedItem<T extends IObjectSelectedIndexRangeItem>({ items }: {
|
|
12
|
+
items: T[];
|
|
13
|
+
}): T;
|
|
13
14
|
export declare function getSelectedItemText({ items }: {
|
|
14
15
|
items: any;
|
|
15
16
|
}): any;
|
|
16
|
-
export declare function getItemsDefaultSelected({ defaultItems, items }: {
|
|
17
|
-
defaultItems?:
|
|
18
|
-
items?:
|
|
19
|
-
}):
|
|
20
|
-
export declare function getItemsRandomSelected({ items }: {
|
|
21
|
-
items:
|
|
22
|
-
}):
|
|
17
|
+
export declare function getItemsDefaultSelected<T extends IObjectSelectedIndexRangeItem>({ defaultItems, items, }: {
|
|
18
|
+
defaultItems?: T[];
|
|
19
|
+
items?: T[];
|
|
20
|
+
}): T[];
|
|
21
|
+
export declare function getItemsRandomSelected<T extends IObjectSelectedIndexRangeItem>({ items }: {
|
|
22
|
+
items: T[];
|
|
23
|
+
}): T[];
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
package/array/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array/index.ts"],"names":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,CAAC,EAAE,CA2CN;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,6BAA6B,EAAE,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,CAAC,EAAE,CAAA;CAAE,GAAG,CAAC,EAAE,CAgB9G"}
|
package/array/index.js
CHANGED
|
@@ -23,26 +23,34 @@ var _excluded = ["id", "name"],
|
|
|
23
23
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24
24
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
25
|
function getCurrentIndex(indexItems) {
|
|
26
|
-
var _indexItems$
|
|
27
|
-
return (_indexItems$
|
|
26
|
+
var _indexItems$find$inde, _indexItems$find;
|
|
27
|
+
return (_indexItems$find$inde = indexItems === null || indexItems === void 0 || (_indexItems$find = indexItems.find(function (indexItem) {
|
|
28
28
|
return indexItem.isCurrent;
|
|
29
|
-
})
|
|
29
|
+
})) === null || _indexItems$find === void 0 ? void 0 : _indexItems$find.index) !== null && _indexItems$find$inde !== void 0 ? _indexItems$find$inde : -1;
|
|
30
30
|
}
|
|
31
31
|
function getIndexItems(items) {
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
var result = [];
|
|
33
|
+
if (items) {
|
|
34
|
+
var _items$map;
|
|
35
|
+
result = (_items$map = items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
36
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
37
|
+
index: index
|
|
38
|
+
});
|
|
39
|
+
})) !== null && _items$map !== void 0 ? _items$map : [];
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
38
42
|
}
|
|
39
43
|
function getIndexItemsWithSelected(indexItems, selectedItem) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
var result = [];
|
|
45
|
+
if (indexItems) {
|
|
46
|
+
var _indexItems$map;
|
|
47
|
+
result = (_indexItems$map = indexItems === null || indexItems === void 0 ? void 0 : indexItems.map(function (indexItem) {
|
|
48
|
+
return _objectSpread(_objectSpread({}, indexItem), {}, {
|
|
49
|
+
isSelected: indexItem.index === selectedItem.index
|
|
50
|
+
});
|
|
51
|
+
})) !== null && _indexItems$map !== void 0 ? _indexItems$map : [];
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
46
54
|
}
|
|
47
55
|
function getRandomItemFromArray(array) {
|
|
48
56
|
return array === null || array === void 0 ? void 0 : array[Math.floor(Math.random() * (array === null || array === void 0 ? void 0 : array.length))];
|
|
@@ -53,9 +61,7 @@ function getRange(_ref) {
|
|
|
53
61
|
indexSeed = _ref$indexSeed === void 0 ? 0 : _ref$indexSeed,
|
|
54
62
|
_ref$valueSeed = _ref.valueSeed,
|
|
55
63
|
valueSeed = _ref$valueSeed === void 0 ? 0 : _ref$valueSeed;
|
|
56
|
-
return Array(range)
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
.fill().map(function (_, index) {
|
|
64
|
+
return Array(range).fill({}).map(function (_, index) {
|
|
59
65
|
return valueSeed + index + indexSeed;
|
|
60
66
|
});
|
|
61
67
|
}
|
|
@@ -130,15 +136,19 @@ function getItemsRandomSelected(_ref0) {
|
|
|
130
136
|
var name = _ref1.name;
|
|
131
137
|
return name;
|
|
132
138
|
}));
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
var result;
|
|
140
|
+
if (items) {
|
|
141
|
+
result = items.map(function (_ref10) {
|
|
142
|
+
var id = _ref10.id,
|
|
143
|
+
name = _ref10.name,
|
|
144
|
+
rest = (0, _objectWithoutProperties2["default"])(_ref10, _excluded4);
|
|
145
|
+
return _objectSpread({
|
|
146
|
+
id: id,
|
|
147
|
+
href: '#url',
|
|
148
|
+
text: name,
|
|
149
|
+
isSelected: name === randomItem
|
|
150
|
+
}, rest);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return result;
|
|
144
154
|
}
|
package/array/types.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface IObject {
|
|
2
|
+
id?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
}
|
|
5
|
+
export type Range = number[];
|
|
6
|
+
export interface IRangeItem {
|
|
7
|
+
isCurrent?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IIndexRangeItem extends IRangeItem {
|
|
10
|
+
index?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ISelectedIndexRangeItem extends IIndexRangeItem {
|
|
13
|
+
isSelected?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface IObjectSelectedIndexRangeItem extends IObject, ISelectedIndexRangeItem {
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/array/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,KAAK,GAAG,MAAM,EAAE,CAAA;AAE5B,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,6BAA8B,SAAQ,OAAO,EAAE,uBAAuB;CAAG"}
|
package/array/types.js
ADDED
package/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.tsx"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,4CAE5B;AAED,wBAAsB,iDAAiD,CAAC,mBAAmB,KAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.tsx"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,4CAE5B;AAED,wBAAsB,iDAAiD,CAAC,mBAAmB,KAAA,oBA+B1F"}
|
package/number/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare function getRandomDecimal({ min, max, decimal }: {
|
|
2
2
|
min?: number;
|
|
3
|
-
max:
|
|
3
|
+
max: number;
|
|
4
4
|
decimal?: number;
|
|
5
5
|
}): number;
|
|
6
6
|
export declare function getRandomInteger({ min, max }: {
|
|
7
7
|
min?: number;
|
|
8
|
-
max:
|
|
8
|
+
max: number;
|
|
9
9
|
}): number;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/number/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/number/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,EAAE,GAAO,EAAE,GAAG,EAAE,OAAW,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/number/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,EAAE,GAAO,EAAE,GAAG,EAAE,OAAW,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,UAM9G;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAO,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAExF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papillonarts/library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Papillon Arts Library",
|
|
5
5
|
"homepage": "https://github.com/papillonarts/papillonarts/tree/master/packages/library",
|
|
6
6
|
"repository": {
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"build-acceptance": "npm run build",
|
|
39
39
|
"build-release": "npm run build"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "97e22915b6c7962ac185e0b930c5ce707f60ee05"
|
|
42
42
|
}
|
package/sort/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
ascending
|
|
3
|
-
descending
|
|
4
|
-
}
|
|
5
|
-
export declare
|
|
6
|
-
index
|
|
7
|
-
value
|
|
8
|
-
order
|
|
9
|
-
}
|
|
1
|
+
export declare enum SortOrder {
|
|
2
|
+
Ascending = "ascending",
|
|
3
|
+
Descending = "descending"
|
|
4
|
+
}
|
|
5
|
+
export declare enum SortDefault {
|
|
6
|
+
index = 0,
|
|
7
|
+
value = "id",
|
|
8
|
+
order = "ascending"
|
|
9
|
+
}
|
|
10
10
|
export declare function getSort({ currentSort, newSort }: {
|
|
11
11
|
currentSort: any;
|
|
12
12
|
newSort: any;
|
|
13
13
|
}): {
|
|
14
14
|
index: any;
|
|
15
15
|
value: any;
|
|
16
|
-
order:
|
|
16
|
+
order: SortOrder | SortDefault;
|
|
17
17
|
};
|
|
18
18
|
export declare function sortObjects({ sort, objects }: {
|
|
19
19
|
sort: any;
|
package/sort/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sort/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sort/index.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,UAAU,eAAe;CAC1B;AAED,oBAAY,WAAW;IACrB,KAAK,IAAI;IACT,KAAK,OAAO;IACZ,KAAK,cAAsB;CAC5B;AAED,wBAAgB,OAAO,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE;;;CAAA;;;;EAc/C;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;;;CAAA,OAkD5C"}
|
package/sort/index.js
CHANGED
|
@@ -4,20 +4,21 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.SortOrder = exports.SortDefault = void 0;
|
|
7
8
|
exports.getSort = getSort;
|
|
8
|
-
exports.sortDefault = void 0;
|
|
9
9
|
exports.sortObjects = sortObjects;
|
|
10
|
-
exports.sortOrder = void 0;
|
|
11
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
var SortOrder = exports.SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
12
|
+
SortOrder["Ascending"] = "ascending";
|
|
13
|
+
SortOrder["Descending"] = "descending";
|
|
14
|
+
return SortOrder;
|
|
15
|
+
}({});
|
|
16
|
+
var SortDefault = exports.SortDefault = /*#__PURE__*/function (SortDefault) {
|
|
17
|
+
SortDefault[SortDefault["index"] = 0] = "index";
|
|
18
|
+
SortDefault["value"] = "id";
|
|
19
|
+
SortDefault["order"] = "ascending";
|
|
20
|
+
return SortDefault;
|
|
21
|
+
}({});
|
|
21
22
|
function getSort(_ref) {
|
|
22
23
|
var currentSort = _ref.currentSort,
|
|
23
24
|
newSort = _ref.newSort;
|
|
@@ -25,13 +26,13 @@ function getSort(_ref) {
|
|
|
25
26
|
index: newSort.index,
|
|
26
27
|
value: newSort.value,
|
|
27
28
|
order: function () {
|
|
28
|
-
if (currentSort ===
|
|
29
|
-
return
|
|
29
|
+
if (currentSort === SortDefault) {
|
|
30
|
+
return SortDefault.order;
|
|
30
31
|
}
|
|
31
32
|
if (currentSort.index === newSort.index) {
|
|
32
|
-
return currentSort.order ===
|
|
33
|
+
return currentSort.order === SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
|
|
33
34
|
}
|
|
34
|
-
return
|
|
35
|
+
return SortDefault.order;
|
|
35
36
|
}()
|
|
36
37
|
};
|
|
37
38
|
}
|
|
@@ -41,7 +42,7 @@ function sortObjects(_ref2) {
|
|
|
41
42
|
if (!objects) {
|
|
42
43
|
return objects;
|
|
43
44
|
}
|
|
44
|
-
if (sort.order ===
|
|
45
|
+
if (sort.order === SortOrder.Ascending) {
|
|
45
46
|
return objects.sort(function (a, b) {
|
|
46
47
|
var _a$sort$value2, _b$sort$value2, _a$sort$value3, _b$sort$value3;
|
|
47
48
|
switch ((0, _typeof2["default"])(a === null || a === void 0 ? void 0 : a[sort.value])) {
|