@neovici/cosmoz-utils 5.14.0 → 5.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const applyMove: <T>(list: T[], from: number, to: number) =>
|
|
1
|
+
export declare const applyMove: <T>(list: T[], from: number, to: number) => T[];
|
|
2
2
|
export declare const useDragItems: (onMove?: ((from: number, to: number) => void) | undefined) => {
|
|
3
3
|
onDown: (e: MouseEvent) => void;
|
|
4
4
|
onDragStart: (e: DragEvent) => void;
|
|
@@ -4,6 +4,7 @@ import { parse } from '../number';
|
|
|
4
4
|
export const applyMove = (list, from, to) => {
|
|
5
5
|
const newList = list.slice();
|
|
6
6
|
newList.splice(to + (from >= to ? 0 : -1), 0, newList.splice(from, 1)[0]);
|
|
7
|
+
return newList;
|
|
7
8
|
};
|
|
8
9
|
export const useDragItems = (onMove) => {
|
|
9
10
|
const meta = useMeta({
|
package/dist/string.d.ts
ADDED
package/dist/string.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const ucfirst = (text) => text.charAt(0).toUpperCase() + text.slice(1);
|
|
2
|
+
export const lcfirst = (text) => text.charAt(0).toLowerCase() + text.slice(1);
|
|
3
|
+
export const capitalize = (text) => text
|
|
4
|
+
?.trim()
|
|
5
|
+
.split(/\s+/u)
|
|
6
|
+
.map((w) => ucfirst(w))
|
|
7
|
+
.join(' ');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-utils",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.15.0",
|
|
4
4
|
"description": "Date, money and template management functions commonly needed in Cosmoz views.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polymer",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"./money": "./dist/money.js",
|
|
61
61
|
"./promise": "./dist/promise.js",
|
|
62
62
|
"./object": "./dist/object.js",
|
|
63
|
+
"./string": "./dist/string.js",
|
|
63
64
|
"./tag": "./dist/tag.js",
|
|
64
65
|
"./template": "./dist/template.js",
|
|
65
66
|
"./reduce": "./dist/reduce/index.js",
|