feat: remove ts errors of typer-js, autosize, qrcode and sortablejs

master
Katja Lutz 2 years ago
parent 58ff9f2f58
commit c09b0ecb4d

34
package-lock.json generated

@ -1,10 +1,12 @@
{ {
"name": "rappli", "name": "rappli",
"version": "0.0.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "rappli", "name": "rappli",
"version": "0.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"solid-start": "v0.1.0-alpha.89", "solid-start": "v0.1.0-alpha.89",
@ -19,6 +21,8 @@
"@tailwindcss/typography": "^0.5.2", "@tailwindcss/typography": "^0.5.2",
"@thisbeyond/solid-select": "^0.11.0", "@thisbeyond/solid-select": "^0.11.0",
"@types/big.js": "^6.1.3", "@types/big.js": "^6.1.3",
"@types/qrcode": "^1.4.2",
"@types/sortablejs": "^1.13.0",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"autosize": "^5.0.1", "autosize": "^5.0.1",
"big.js": "^6.2.0", "big.js": "^6.2.0",
@ -1915,6 +1919,15 @@
"integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==",
"dev": true "dev": true
}, },
"node_modules/@types/qrcode": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.4.2.tgz",
"integrity": "sha512-7uNT9L4WQTNJejHTSTdaJhfBSCN73xtXaHFyBJ8TSwiLhe4PRuTue7Iph0s2nG9R/ifUaSnGhLUOZavlBEqDWQ==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/resolve": { "node_modules/@types/resolve": {
"version": "1.17.1", "version": "1.17.1",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz",
@ -1923,6 +1936,12 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/sortablejs": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.13.0.tgz",
"integrity": "sha512-C3064MH72iEfeGCYEGCt7FCxXoAXaMPG0QPnstcxvPmbl54erpISu06d++FY37Smja64iWy5L8wOyHHBghWbJQ==",
"dev": true
},
"node_modules/@types/unist": { "node_modules/@types/unist": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz",
@ -9500,6 +9519,15 @@
"integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==",
"dev": true "dev": true
}, },
"@types/qrcode": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.4.2.tgz",
"integrity": "sha512-7uNT9L4WQTNJejHTSTdaJhfBSCN73xtXaHFyBJ8TSwiLhe4PRuTue7Iph0s2nG9R/ifUaSnGhLUOZavlBEqDWQ==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/resolve": { "@types/resolve": {
"version": "1.17.1", "version": "1.17.1",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz",
@ -9508,6 +9536,12 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/sortablejs": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.13.0.tgz",
"integrity": "sha512-C3064MH72iEfeGCYEGCt7FCxXoAXaMPG0QPnstcxvPmbl54erpISu06d++FY37Smja64iWy5L8wOyHHBghWbJQ==",
"dev": true
},
"@types/unist": { "@types/unist": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz",

@ -24,6 +24,8 @@
"@tailwindcss/typography": "^0.5.2", "@tailwindcss/typography": "^0.5.2",
"@thisbeyond/solid-select": "^0.11.0", "@thisbeyond/solid-select": "^0.11.0",
"@types/big.js": "^6.1.3", "@types/big.js": "^6.1.3",
"@types/qrcode": "^1.4.2",
"@types/sortablejs": "^1.13.0",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"autosize": "^5.0.1", "autosize": "^5.0.1",
"big.js": "^6.2.0", "big.js": "^6.2.0",

@ -28,13 +28,13 @@ const QrCode: Component<
return qrcode.toString(value, { return qrcode.toString(value, {
type: "svg", type: "svg",
margin: props.margin, margin: props.margin,
errorCorrectionLevel: props.errorCorrectionLevel, errorCorrectionLevel: props.errorCorrectionLevel as any,
}); });
} }
); );
createEffect(() => { createEffect(() => {
const html = svg(); const html = svg() || "";
requestAnimationFrame(function () { requestAnimationFrame(function () {
ref.innerHTML = html; ref.innerHTML = html;
}); });

@ -72,12 +72,16 @@ export const PositionsSettings: Component = () => {
ghostClass: "sortable-ghost-card", ghostClass: "sortable-ghost-card",
filter: ".drag-disabled", filter: ".drag-disabled",
// forceFallback: true, // forceFallback: true,
onEnd: (evt: any) => { onEnd: (evt) => {
const oldIndex = evt.oldIndex;
const newIndex = evt.newIndex;
if (oldIndex == null || newIndex == null) {
return;
}
setState( setState(
"positions", "positions",
produce((positions: any[]) => { produce((positions: any[]) => {
const oldIndex = evt.oldIndex;
const newIndex = evt.newIndex;
let item = positions[oldIndex]; let item = positions[oldIndex];
positions.splice(oldIndex, 1); positions.splice(oldIndex, 1);
positions.splice(newIndex, 0, unwrap(item)); positions.splice(newIndex, 0, unwrap(item));

@ -3,20 +3,24 @@ import Sortable from "sortablejs";
// https://github.com/SortableJS/Sortable // https://github.com/SortableJS/Sortable
export const sortable = (el: HTMLElement, config: () => any) => { export const sortable = (el: HTMLElement, config: () => Sortable.Options) => {
onMount(function () { onMount(function () {
const config_ = config(); const config_ = config();
const userOnEnd = config_?.onEnd; const userOnEnd = config_?.onEnd;
if (userOnEnd) { if (userOnEnd) {
config_.onEnd = (evt) => { config_.onEnd = (evt) => {
const parent = evt.from; if (evt.oldIndex != null && evt.newIndex != null) {
const oldNextSibling = const parent = evt.from;
parent.children[evt.oldIndex + (evt.oldIndex > evt.newIndex ? 1 : 0)]; const oldNextSibling =
if (oldNextSibling) { parent.children[
parent.insertBefore(evt.item, oldNextSibling); evt.oldIndex + (evt.oldIndex > evt.newIndex ? 1 : 0)
} else { ];
parent.append(evt.item); if (oldNextSibling) {
parent.insertBefore(evt.item, oldNextSibling);
} else {
parent.append(evt.item);
}
} }
userOnEnd(evt); userOnEnd(evt);
@ -34,7 +38,7 @@ export const sortable = (el: HTMLElement, config: () => any) => {
declare module "solid-js" { declare module "solid-js" {
namespace JSX { namespace JSX {
interface Directives { interface Directives {
sortable: any; sortable: Sortable.Options;
} }
} }
} }

2
src/index.d.ts vendored

@ -1,2 +1,4 @@
declare const __APP_VERSION__: string; declare const __APP_VERSION__: string;
declare const __BUILD_TIME__: number; declare const __BUILD_TIME__: number;
declare module "typer-js";
declare module "autosize";

Loading…
Cancel
Save