@sydsoft/base 1.44.0 → 1.48.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/README.md +8 -1
- package/dist/esm/_lib/baseFunctions.js +25 -38
- package/dist/esm/_lib/inputMask.js +66 -68
- package/dist/esm/_lib/listFunctions.js +12 -13
- package/dist/esm/_lib/storage/cookies.js +20 -21
- package/dist/esm/_lib/storage/encData.js +19 -21
- package/dist/esm/_lib/storage/localStorage.js +10 -10
- package/dist/esm/_lib/storage/sessionStorage.js +10 -10
- package/dist/esm/_lib/useInterval.js +5 -5
- package/dist/esm/alert/index.js +28 -30
- package/dist/esm/box/Box.js +6 -7
- package/dist/esm/box/BoxContent.js +2 -4
- package/dist/esm/box/BoxFooter.js +6 -4
- package/dist/esm/box/BoxHeader.js +6 -5
- package/dist/esm/countDown/index.js +28 -33
- package/dist/esm/dateTime/index.js +25 -31
- package/dist/esm/form/Button.js +28 -22
- package/dist/esm/form/Checkbox.js +7 -8
- package/dist/esm/form/Dialog.d.ts +7 -6
- package/dist/esm/form/Dialog.js +51 -38
- package/dist/esm/form/Form.js +3 -5
- package/dist/esm/form/FormOlustur.js +15 -17
- package/dist/esm/form/Input.d.ts +12 -7
- package/dist/esm/form/Input.js +68 -77
- package/dist/esm/form/Label.d.ts +1 -1
- package/dist/esm/form/Label.js +5 -10
- package/dist/esm/form/SearchableInput.js +77 -89
- package/dist/esm/form/UploadBase.js +30 -32
- package/dist/esm/grid/index.js +40 -41
- package/dist/esm/icon/icons.js +1 -1
- package/dist/esm/icon/index.js +21 -10
- package/dist/esm/index.module.css +89 -0
- package/dist/esm/menu/index.d.ts +30 -4
- package/dist/esm/menu/index.js +32 -14
- package/dist/esm/modal/index.js +14 -16
- package/dist/esm/popover/index.d.ts +21 -7
- package/dist/esm/popover/index.js +320 -119
- package/dist/esm/tooltip/index.js +117 -34
- package/package.json +12 -6
- package/dist/esm/alert/index.module.css +0 -119
- package/dist/esm/grid/index.module.css +0 -805
- package/dist/esm/menu/index.module.css +0 -67
- package/dist/esm/modal/index.module.css +0 -76
- /package/dist/esm/{box/Box.module.css → Box.module.css} +0 -0
- /package/dist/esm/{form/styles → styles}/Button.module.css +0 -0
- /package/dist/esm/{form/styles → styles}/Input.module.css +0 -0
- /package/dist/esm/{form/styles → styles}/Label.module.css +0 -0
- /package/dist/esm/{form/styles → styles}/SearchableInput.module.css +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.popover {
|
|
2
|
+
position: fixed;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
z-index: 10000;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
visibility: hidden;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
transition: opacity 160ms ease;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.noFade {
|
|
14
|
+
transition: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.visible {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
visibility: visible;
|
|
20
|
+
pointer-events: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.closing {
|
|
24
|
+
opacity: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.arrow::after {
|
|
28
|
+
content: "";
|
|
29
|
+
position: absolute;
|
|
30
|
+
border-width: 5px;
|
|
31
|
+
border-style: solid;
|
|
32
|
+
width: 0;
|
|
33
|
+
height: 0;
|
|
34
|
+
border-color: var(--popover-arrow-color, #757575);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.arrow.top::after {
|
|
38
|
+
top: 100%;
|
|
39
|
+
border-color: var(--popover-arrow-color, #757575) transparent transparent transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.arrow.bottom::after {
|
|
43
|
+
bottom: 100%;
|
|
44
|
+
border-color: transparent transparent var(--popover-arrow-color, #757575) transparent;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.arrow.left::after {
|
|
48
|
+
left: 100%;
|
|
49
|
+
margin-left: -1px;
|
|
50
|
+
border-color: transparent transparent transparent var(--popover-arrow-color, #757575);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.arrow.right::after {
|
|
54
|
+
right: 100%;
|
|
55
|
+
margin-right: -1px;
|
|
56
|
+
border-color: transparent var(--popover-arrow-color, #757575) transparent transparent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.arrow.top.alignStart::after,
|
|
60
|
+
.arrow.bottom.alignStart::after {
|
|
61
|
+
left: 12px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.arrow.top.alignCenter::after,
|
|
65
|
+
.arrow.bottom.alignCenter::after {
|
|
66
|
+
left: 50%;
|
|
67
|
+
transform: translateX(-50%);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.arrow.top.alignEnd::after,
|
|
71
|
+
.arrow.bottom.alignEnd::after {
|
|
72
|
+
right: 12px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.arrow.left.alignStart::after,
|
|
76
|
+
.arrow.right.alignStart::after {
|
|
77
|
+
top: 12px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.arrow.left.alignCenter::after,
|
|
81
|
+
.arrow.right.alignCenter::after {
|
|
82
|
+
top: 50%;
|
|
83
|
+
transform: translateY(-50%);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.arrow.left.alignEnd::after,
|
|
87
|
+
.arrow.right.alignEnd::after {
|
|
88
|
+
bottom: 12px;
|
|
89
|
+
}
|
package/dist/esm/menu/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-07 19:31:01
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { propsDialog } from '../form';
|
|
8
|
+
import { PopoverConfigBaseProps } from '../popover';
|
|
3
9
|
interface BaseProps {
|
|
4
10
|
style?: React.CSSProperties;
|
|
5
11
|
itemProps?: any;
|
|
@@ -26,18 +32,38 @@ interface FullComponentProps extends BaseProps {
|
|
|
26
32
|
interface ItemComponentProps extends BaseProps {
|
|
27
33
|
seperator?: false;
|
|
28
34
|
fullComponent?: never;
|
|
35
|
+
type?: never;
|
|
29
36
|
title: string;
|
|
30
37
|
icon?: React.ReactNode;
|
|
38
|
+
rightComponent?: React.ReactNode;
|
|
31
39
|
href?: string;
|
|
32
40
|
onClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
|
|
33
41
|
dialog?: propsDialog;
|
|
34
42
|
}
|
|
35
|
-
|
|
43
|
+
interface SubMenuProps extends BaseProps {
|
|
44
|
+
type: 'submenu';
|
|
45
|
+
title: string;
|
|
46
|
+
items: typeMenu[];
|
|
47
|
+
icon?: React.ReactNode;
|
|
48
|
+
subMenuPopoverProps?: PopoverConfigBaseProps;
|
|
49
|
+
rightComponent?: React.ReactNode;
|
|
50
|
+
menuProps?: {
|
|
51
|
+
className?: string;
|
|
52
|
+
style?: React.CSSProperties;
|
|
53
|
+
withIcon?: boolean | 'auto';
|
|
54
|
+
};
|
|
55
|
+
seperator?: never;
|
|
56
|
+
fullComponent?: never;
|
|
57
|
+
href?: never;
|
|
58
|
+
onClick?: never;
|
|
59
|
+
dialog?: never;
|
|
60
|
+
}
|
|
61
|
+
export type typeMenu = SeperatorProps | FullComponentProps | ItemComponentProps | SubMenuProps;
|
|
36
62
|
interface Props {
|
|
37
63
|
menu: typeMenu[];
|
|
38
64
|
className?: string;
|
|
39
65
|
style?: React.CSSProperties;
|
|
40
|
-
withIcon?: boolean;
|
|
66
|
+
withIcon?: boolean | 'auto';
|
|
41
67
|
}
|
|
42
68
|
export declare const Menu: React.NamedExoticComponent<Props>;
|
|
43
69
|
export {};
|
package/dist/esm/menu/index.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @author : izzetseydaoglu
|
|
4
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
5
|
+
* @version : 2026-02-07 19:31:01
|
|
6
|
+
*/
|
|
7
|
+
import React, { memo, useMemo } from 'react';
|
|
8
|
+
import { Dialog } from '../form';
|
|
9
|
+
import { Popover } from '../popover';
|
|
10
|
+
import Link from 'next/link';
|
|
11
|
+
import styles from './index.module.css';
|
|
12
|
+
export const Menu = memo(function MemoFunction({ menu, className, style, withIcon = 'auto' }) {
|
|
13
|
+
const withIconComponent = useMemo(() => {
|
|
14
|
+
if (withIcon === true)
|
|
15
|
+
return true;
|
|
16
|
+
if (withIcon === false)
|
|
17
|
+
return false;
|
|
18
|
+
return Object.values(menu).some((item) => 'icon' in item && !!item.icon);
|
|
19
|
+
}, [menu, withIcon]);
|
|
20
|
+
const withRightComponent = useMemo(() => {
|
|
21
|
+
return Object.values(menu).some((item) => 'rightComponent' in item && !!item.rightComponent);
|
|
22
|
+
}, [menu]);
|
|
23
|
+
const handleClick = (item, e) => {
|
|
10
24
|
if (!item.onClick)
|
|
11
25
|
return;
|
|
12
26
|
if (item.dialog) {
|
|
13
|
-
Dialog(
|
|
27
|
+
Dialog({ ...item.dialog }).then((result) => {
|
|
14
28
|
if (result && item.onClick) {
|
|
15
29
|
item.onClick(e);
|
|
16
30
|
}
|
|
@@ -20,13 +34,17 @@ export var Menu = memo(function MemoFunction(_a) {
|
|
|
20
34
|
item.onClick(e);
|
|
21
35
|
}
|
|
22
36
|
};
|
|
23
|
-
return (_jsx("ul", { className:
|
|
24
|
-
|
|
37
|
+
return (_jsx("ul", { className: `smenu ${styles.ul} ${className || ''}`, style: style, children: Object.values(menu).map((item, key) => {
|
|
38
|
+
const { fullComponent, icon, title, rightComponent, seperator, href, style, itemProps, type, items, menuProps, subMenuPopoverProps, ...other } = item;
|
|
39
|
+
const hasSubmenu = type === 'submenu' && Array.isArray(items) && items.length > 0;
|
|
25
40
|
if (fullComponent)
|
|
26
41
|
return React.cloneElement(fullComponent, { key: key });
|
|
27
42
|
if (seperator)
|
|
28
|
-
return _jsx("li",
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
return _jsx("li", { className: styles.seperator, style: style, ...itemProps, ...other }, key);
|
|
44
|
+
const Component = (_jsxs(_Fragment, { children: [withIconComponent && _jsx("div", { className: styles.menuicon, children: icon }), _jsx("div", { className: styles.menutitle, children: title }), withRightComponent && _jsx("div", { className: styles.rightmenu, children: rightComponent })] }));
|
|
45
|
+
if (hasSubmenu) {
|
|
46
|
+
return (_jsx(Popover, { component: _jsx("li", { style: style, ...itemProps, ...other, children: Component }), position: "right-top", ...(subMenuPopoverProps || {}), children: _jsx(Menu, { menu: items, ...(menuProps || {}) }) }, key));
|
|
47
|
+
}
|
|
48
|
+
return (_jsx("li", { style: style, onClick: (e) => handleClick(item, e), ...itemProps, ...other, children: href ? _jsx(Link, { href: href, children: Component }) : Component }, key));
|
|
31
49
|
}) }));
|
|
32
50
|
});
|
package/dist/esm/modal/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
/**
|
|
4
3
|
* Copyright (c) 2023
|
|
@@ -8,59 +7,58 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
7
|
import { memo, useEffect, useRef, useState } from "react";
|
|
9
8
|
import ReactDOM from "react-dom";
|
|
10
9
|
import styles from "./index.module.css";
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
useEffect(function () {
|
|
10
|
+
export const Modal = memo(function MemoFunction({ refModal = null, children, open = false, close, keepMounted = false, fullScreen = false, hideBackdrop = true, hideEsc = false, hideCloseButton = false, modalStyle, backdropStyle, vertialAlign = "center", horizontalAlign = "center" }) {
|
|
11
|
+
const [modalDiv, setModalDiv] = useState(null);
|
|
12
|
+
const ref = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
16
14
|
if (refModal)
|
|
17
15
|
refModal.current = ref.current;
|
|
18
16
|
}, [ref.current]);
|
|
19
|
-
|
|
17
|
+
const onClose = () => {
|
|
20
18
|
if (close)
|
|
21
19
|
close();
|
|
22
20
|
};
|
|
23
|
-
|
|
21
|
+
const checkHideBackDrop = (e) => {
|
|
24
22
|
if (open && ref.current && !ref.current.contains(e.target))
|
|
25
23
|
onClose();
|
|
26
24
|
};
|
|
27
|
-
|
|
25
|
+
const checkESC = (e) => {
|
|
28
26
|
if (e.keyCode === 27 || e.key === "Escape" || e.code === "Escape")
|
|
29
27
|
onClose();
|
|
30
28
|
};
|
|
31
|
-
useEffect(
|
|
29
|
+
useEffect(() => {
|
|
32
30
|
if (open) {
|
|
33
31
|
if (hideBackdrop)
|
|
34
32
|
window.addEventListener("mousedown", checkHideBackDrop);
|
|
35
33
|
if (hideEsc)
|
|
36
34
|
window.addEventListener("keydown", checkESC);
|
|
37
35
|
}
|
|
38
|
-
return
|
|
36
|
+
return () => {
|
|
39
37
|
if (hideBackdrop)
|
|
40
38
|
window.removeEventListener("mousedown", checkHideBackDrop);
|
|
41
39
|
if (hideEsc)
|
|
42
40
|
window.removeEventListener("keydown", checkESC);
|
|
43
41
|
};
|
|
44
42
|
});
|
|
45
|
-
useEffect(
|
|
43
|
+
useEffect(() => {
|
|
46
44
|
if (!modalDiv) {
|
|
47
|
-
|
|
45
|
+
const modalDivCheck = document.getElementById("smodal");
|
|
48
46
|
if (modalDivCheck) {
|
|
49
47
|
setModalDiv(modalDivCheck);
|
|
50
48
|
}
|
|
51
49
|
else {
|
|
52
|
-
|
|
50
|
+
const div = document.createElement("div");
|
|
53
51
|
div.setAttribute("id", "smodal");
|
|
54
52
|
document.body.appendChild(div);
|
|
55
53
|
setModalDiv(div);
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
return
|
|
56
|
+
return () => {
|
|
59
57
|
onClose();
|
|
60
58
|
};
|
|
61
59
|
}, []);
|
|
62
60
|
if ((!keepMounted && !open) || typeof window === "undefined")
|
|
63
61
|
return null;
|
|
64
|
-
|
|
62
|
+
const Component = (_jsx("div", { className: `${styles.backdrop} ${open ? styles.backdrop_open : ""}`, style: { alignItems: vertialAlign, justifyContent: horizontalAlign, ...backdropStyle }, children: _jsxs("div", { ref: ref, className: `smodal ${styles.modal} ${fullScreen ? styles.fullscreen : ""}`, style: modalStyle, children: [!hideCloseButton && (_jsx("div", { className: `close ${styles.close_fixed}`, children: _jsx("div", { className: styles.close, onClick: onClose, children: "\u2715" }) })), children] }) }));
|
|
65
63
|
return modalDiv ? ReactDOM.createPortal(Component, modalDiv) : null;
|
|
66
64
|
});
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 16:12:35
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
type PopoverPosition = 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-center' | 'left-bottom' | 'right' | 'right-top' | 'right-center' | 'right-bottom';
|
|
8
|
+
type ArrowColor = 'auto' | string;
|
|
9
|
+
export interface PopoverConfigBaseProps {
|
|
10
|
+
position?: PopoverPosition;
|
|
7
11
|
removeWhenClickInside?: boolean;
|
|
12
|
+
hideBackdrop?: boolean;
|
|
8
13
|
arrow?: boolean;
|
|
9
14
|
distance?: number;
|
|
15
|
+
fade?: boolean;
|
|
16
|
+
arrowColor?: ArrowColor;
|
|
17
|
+
hover?: boolean;
|
|
18
|
+
hoverCloseDelay?: number;
|
|
19
|
+
keepMounted?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface PopoverProps extends PopoverConfigBaseProps {
|
|
22
|
+
component: any;
|
|
23
|
+
children: React.ReactNode;
|
|
10
24
|
}
|
|
11
|
-
export declare const Popover: React.NamedExoticComponent<
|
|
25
|
+
export declare const Popover: React.NamedExoticComponent<PopoverProps>;
|
|
12
26
|
export {};
|