@codeleap/web 1.1.0 → 1.1.4
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/dist/components/PageRouter/Router.js +1 -1
- package/dist/components/PageRouter/Router.js.map +1 -1
- package/dist/components/PageRouter/index.js +1 -1
- package/dist/components/PageRouter/index.js.map +1 -1
- package/package.json +3 -2
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -3
- package/.turbo/turbo-build.log +0 -2
- package/src/components/ActivityIndicator/index.tsx +0 -55
- package/src/components/ActivityIndicator/styles.ts +0 -18
- package/src/components/Button.tsx +0 -67
- package/src/components/CenterWrapper.tsx +0 -24
- package/src/components/Checkbox/index.tsx +0 -47
- package/src/components/Checkbox/styles.ts +0 -57
- package/src/components/ContentView.tsx +0 -48
- package/src/components/Drawer.tsx +0 -114
- package/src/components/FileInput.tsx +0 -48
- package/src/components/FlatList.tsx +0 -77
- package/src/components/HorizontalScroll.tsx +0 -24
- package/src/components/Icon.tsx +0 -29
- package/src/components/Link.tsx +0 -51
- package/src/components/Modal/index.tsx +0 -150
- package/src/components/Modal/styles.ts +0 -49
- package/src/components/Overlay.tsx +0 -25
- package/src/components/PageRouter/Menu.tsx +0 -49
- package/src/components/PageRouter/MenuItem.tsx +0 -57
- package/src/components/PageRouter/Router.tsx +0 -23
- package/src/components/PageRouter/index.tsx +0 -81
- package/src/components/RadioInput/index.tsx +0 -72
- package/src/components/RadioInput/styles.ts +0 -57
- package/src/components/Select.tsx +0 -60
- package/src/components/Slider.tsx +0 -14
- package/src/components/Text.tsx +0 -27
- package/src/components/TextInput.tsx +0 -223
- package/src/components/Tooltip.tsx +0 -138
- package/src/components/Touchable.tsx +0 -47
- package/src/components/View.tsx +0 -54
- package/src/components/index.ts +0 -23
- package/src/index.ts +0 -4
- package/src/lib/hooks.ts +0 -59
- package/src/lib/logger.ts +0 -15
- package/src/lib/utils/cookies.ts +0 -19
- package/src/lib/utils/index.ts +0 -4
- package/src/lib/utils/pollyfils/scroll.ts +0 -59
- package/src/lib/utils/stopPropagation.ts +0 -17
- package/src/types/utility.ts +0 -4
- package/tsconfig.json +0 -42
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// native smooth scrolling for Chrome, Firefox & Opera
|
|
2
|
-
// @see: https://caniuse.com/#feat=css-scroll-behavior
|
|
3
|
-
const nativeSmoothScrollTo = elem => {
|
|
4
|
-
window.scroll({
|
|
5
|
-
behavior: 'smooth',
|
|
6
|
-
left: 0,
|
|
7
|
-
top: elem.getBoundingClientRect().top + window.pageYOffset,
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// polyfilled smooth scrolling for IE, Edge & Safari
|
|
12
|
-
const smoothScrollTo = (to, duration) => {
|
|
13
|
-
const element = document.scrollingElement || document.documentElement,
|
|
14
|
-
start = element.scrollTop,
|
|
15
|
-
change = to - start,
|
|
16
|
-
startDate = +new Date();
|
|
17
|
-
|
|
18
|
-
// t = current time
|
|
19
|
-
// b = start value
|
|
20
|
-
// c = change in value
|
|
21
|
-
// d = duration
|
|
22
|
-
const easeInOutQuad = (t, b, c, d) => {
|
|
23
|
-
t /= d/2;
|
|
24
|
-
if (t < 1) return c/2*t*t + b;
|
|
25
|
-
t--;
|
|
26
|
-
return -c/2 * (t*(t-2) - 1) + b;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const animateScroll = () => {
|
|
30
|
-
const currentDate = +new Date();
|
|
31
|
-
const currentTime = currentDate - startDate;
|
|
32
|
-
element.scrollTop = parseInt(easeInOutQuad(currentTime, start, change, duration));
|
|
33
|
-
if (currentTime < duration) {
|
|
34
|
-
requestAnimationFrame(animateScroll);
|
|
35
|
-
} else {
|
|
36
|
-
element.scrollTop = to;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
animateScroll();
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// detect support for the behavior property in ScrollOptions
|
|
43
|
-
const supportsNativeSmoothScroll = 'scrollBehavior' in document.documentElement.style;
|
|
44
|
-
|
|
45
|
-
// smooth scrolling stub
|
|
46
|
-
export const scrollToElem = elemSelector => {
|
|
47
|
-
if (!elemSelector) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const elem = document.querySelector(elemSelector);
|
|
52
|
-
if (elem) {
|
|
53
|
-
if (supportsNativeSmoothScroll) {
|
|
54
|
-
nativeSmoothScrollTo(elem);
|
|
55
|
-
} else {
|
|
56
|
-
smoothScrollTo(elem.offsetTop, 600);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AnyFunction } from '@codeleap/common'
|
|
2
|
-
|
|
3
|
-
export function stopPropagation(event:any){
|
|
4
|
-
const tryCalls = [
|
|
5
|
-
event?.stopPropagation,
|
|
6
|
-
event?.preventDefault,
|
|
7
|
-
event.nativeEvent?.stopImmediatePropagation as AnyFunction,
|
|
8
|
-
]
|
|
9
|
-
|
|
10
|
-
for (const call of tryCalls){
|
|
11
|
-
try {
|
|
12
|
-
call()
|
|
13
|
-
} catch (e){
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
package/src/types/utility.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
4
|
-
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
5
|
-
"target": "ES5",
|
|
6
|
-
"lib": [
|
|
7
|
-
"ESNext",
|
|
8
|
-
"DOM"
|
|
9
|
-
],
|
|
10
|
-
"jsx": "react-jsx",
|
|
11
|
-
"jsxImportSource": "@emotion/react",
|
|
12
|
-
/* Modules */
|
|
13
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */ /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
14
|
-
"allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
15
|
-
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
|
16
|
-
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
17
|
-
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
18
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
|
19
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
20
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
21
|
-
|
|
22
|
-
/* Type Checking */
|
|
23
|
-
"skipLibCheck": true,
|
|
24
|
-
"outDir": "./dist",
|
|
25
|
-
"declaration": true,
|
|
26
|
-
"sourceMap": true
|
|
27
|
-
},
|
|
28
|
-
"include": [
|
|
29
|
-
"**/*.ts",
|
|
30
|
-
"**/*.tsx",
|
|
31
|
-
],
|
|
32
|
-
"exclude": [
|
|
33
|
-
"node_modules",
|
|
34
|
-
"**/*.stories.tsx",
|
|
35
|
-
"dist/**/*"
|
|
36
|
-
],
|
|
37
|
-
"typedocOptions": {
|
|
38
|
-
"entryPoints": ["src/index.ts"],
|
|
39
|
-
"out": "docs",
|
|
40
|
-
"name": "CodeLeap web lib"
|
|
41
|
-
}
|
|
42
|
-
}
|