@sydsoft/base 1.43.0 → 1.47.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/dist/esm/_lib/baseFunctions.d.ts +1 -0
- package/dist/esm/_lib/baseFunctions.js +4 -0
- package/dist/esm/_lib/inputMask.js +2 -1
- package/dist/esm/_lib/storage/encData.d.ts +2 -2
- package/dist/esm/_lib/storage/encData.js +15 -10
- package/dist/esm/form/Dialog.d.ts +7 -6
- package/dist/esm/form/Dialog.js +13 -13
- package/dist/esm/form/Input.d.ts +12 -7
- package/dist/esm/form/Input.js +17 -27
- package/dist/esm/form/Label.d.ts +1 -1
- package/dist/esm/form/Label.js +6 -9
- package/dist/esm/form/SearchableInput.d.ts +2 -2
- package/dist/esm/form/SearchableInput.js +45 -23
- package/dist/esm/icon/index.js +7 -4
- package/dist/esm/menu/index.d.ts +30 -4
- package/dist/esm/menu/index.js +30 -10
- package/dist/esm/menu/index.module.css +51 -26
- package/dist/esm/modal/index.module.css +12 -11
- package/dist/esm/popover/index.d.ts +21 -7
- package/dist/esm/popover/index.js +306 -105
- package/dist/esm/popover/index.module.css +89 -0
- package/package.json +1 -1
package/dist/esm/menu/index.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @author : izzetseydaoglu
|
|
5
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
6
|
+
* @version : 2026-02-07 19:31:01
|
|
7
|
+
*/
|
|
8
|
+
import React, { memo, useMemo } from 'react';
|
|
9
|
+
import { Dialog } from '../form';
|
|
10
|
+
import { Popover } from '../popover';
|
|
11
|
+
import Link from 'next/link';
|
|
12
|
+
import styles from './index.module.css';
|
|
7
13
|
export var Menu = memo(function MemoFunction(_a) {
|
|
8
|
-
var menu = _a.menu, className = _a.className, style = _a.style, _b = _a.withIcon, withIcon = _b === void 0 ?
|
|
14
|
+
var menu = _a.menu, className = _a.className, style = _a.style, _b = _a.withIcon, withIcon = _b === void 0 ? 'auto' : _b;
|
|
15
|
+
var withIconComponent = useMemo(function () {
|
|
16
|
+
if (withIcon === true)
|
|
17
|
+
return true;
|
|
18
|
+
if (withIcon === false)
|
|
19
|
+
return false;
|
|
20
|
+
return Object.values(menu).some(function (item) { return 'icon' in item && !!item.icon; });
|
|
21
|
+
}, [menu, withIcon]);
|
|
22
|
+
var withRightComponent = useMemo(function () {
|
|
23
|
+
return Object.values(menu).some(function (item) { return 'rightComponent' in item && !!item.rightComponent; });
|
|
24
|
+
}, [menu]);
|
|
9
25
|
var handleClick = function (item, e) {
|
|
10
26
|
if (!item.onClick)
|
|
11
27
|
return;
|
|
@@ -20,13 +36,17 @@ export var Menu = memo(function MemoFunction(_a) {
|
|
|
20
36
|
item.onClick(e);
|
|
21
37
|
}
|
|
22
38
|
};
|
|
23
|
-
return (_jsx("ul", { className: "smenu ".concat(styles.ul, " ").concat(className ||
|
|
24
|
-
var fullComponent =
|
|
39
|
+
return (_jsx("ul", { className: "smenu ".concat(styles.ul, " ").concat(className || ''), style: style, children: Object.values(menu).map(function (item, key) {
|
|
40
|
+
var _a = item, fullComponent = _a.fullComponent, icon = _a.icon, title = _a.title, rightComponent = _a.rightComponent, seperator = _a.seperator, href = _a.href, style = _a.style, itemProps = _a.itemProps, type = _a.type, items = _a.items, menuProps = _a.menuProps, subMenuPopoverProps = _a.subMenuPopoverProps, other = __rest(_a, ["fullComponent", "icon", "title", "rightComponent", "seperator", "href", "style", "itemProps", "type", "items", "menuProps", "subMenuPopoverProps"]);
|
|
41
|
+
var hasSubmenu = type === 'submenu' && Array.isArray(items) && items.length > 0;
|
|
25
42
|
if (fullComponent)
|
|
26
43
|
return React.cloneElement(fullComponent, { key: key });
|
|
27
44
|
if (seperator)
|
|
28
|
-
return _jsx("li", __assign({ className:
|
|
29
|
-
var Component = (_jsxs(_Fragment, { children: [
|
|
30
|
-
|
|
45
|
+
return _jsx("li", __assign({ className: styles.seperator, style: style }, itemProps, other), key);
|
|
46
|
+
var 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 })] }));
|
|
47
|
+
if (hasSubmenu) {
|
|
48
|
+
return (_jsx(Popover, __assign({ component: _jsx("li", __assign({ style: style }, itemProps, other, { children: Component })), position: "right-top" }, (subMenuPopoverProps || {}), { children: _jsx(Menu, __assign({ menu: items }, (menuProps || {}))) }), key));
|
|
49
|
+
}
|
|
50
|
+
return (_jsx("li", __assign({ style: style, onClick: function (e) { return handleClick(item, e); } }, itemProps, other, { children: href ? _jsx(Link, { href: href, children: Component }) : Component }), key));
|
|
31
51
|
}) }));
|
|
32
52
|
});
|
|
@@ -1,60 +1,61 @@
|
|
|
1
1
|
.ul {
|
|
2
2
|
position: relative;
|
|
3
3
|
width: 100%;
|
|
4
|
-
|
|
5
|
-
box-shadow: 0 2px 4px rgb(0 0 0 / 40%), 0 8px 16px rgb(0 0 0 / 10%);
|
|
6
|
-
border-radius: 8px;
|
|
7
|
-
margin: 0;
|
|
8
|
-
padding: 4px 0;
|
|
4
|
+
max-height: calc(100vh - 94px);
|
|
9
5
|
list-style: none;
|
|
6
|
+
padding: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
background: #fff;
|
|
9
|
+
letter-spacing: 0.2px;
|
|
10
|
+
outline: none;
|
|
11
|
+
border: 1px solid transparent;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
box-shadow: 0 2px 6px 2px rgba(60, 64, 67, 0.15);
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
user-select: none;
|
|
10
16
|
}
|
|
11
|
-
|
|
17
|
+
|
|
18
|
+
.ul > li {
|
|
12
19
|
cursor: pointer;
|
|
13
|
-
padding:
|
|
20
|
+
padding: 2px 6px;
|
|
14
21
|
min-height: 25px;
|
|
15
22
|
}
|
|
16
|
-
.li,
|
|
17
|
-
.li a {
|
|
23
|
+
.ul > li,
|
|
24
|
+
.ul > li a {
|
|
18
25
|
display: flex;
|
|
19
26
|
flex-direction: row;
|
|
20
27
|
flex-wrap: nowrap;
|
|
21
28
|
width: 100%;
|
|
22
29
|
}
|
|
23
|
-
.li a,
|
|
24
|
-
.li a:visited {
|
|
30
|
+
.ul > li a,
|
|
31
|
+
.ul > li a:visited {
|
|
25
32
|
color: inherit;
|
|
26
33
|
text-decoration: none;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
|
-
.li
|
|
30
|
-
display: block;
|
|
31
|
-
border-bottom: 1px #ced0d4 solid;
|
|
32
|
-
margin: 4px;
|
|
33
|
-
padding: 0;
|
|
34
|
-
cursor: default;
|
|
35
|
-
min-height: unset;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.li:first-child {
|
|
36
|
+
.ul > li:first-child {
|
|
39
37
|
margin-top: 5px;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
.li:last-child {
|
|
40
|
+
.ul > li:last-child {
|
|
43
41
|
margin-bottom: 5px;
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
.li:hover {
|
|
44
|
+
.ul > li:hover {
|
|
47
45
|
background: #f0f2f5;
|
|
48
46
|
}
|
|
49
47
|
|
|
48
|
+
.ul > li:global(.spopover_active) {
|
|
49
|
+
background: #e8f0fe;
|
|
50
|
+
}
|
|
51
|
+
|
|
50
52
|
.menuicon {
|
|
51
53
|
display: inline-flex;
|
|
52
54
|
overflow: hidden;
|
|
53
|
-
width:
|
|
55
|
+
width: 30px;
|
|
54
56
|
flex: 0 0 auto;
|
|
55
57
|
align-items: center;
|
|
56
58
|
justify-content: center;
|
|
57
|
-
margin-right: 15px;
|
|
58
59
|
color: #606060;
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -63,5 +64,29 @@
|
|
|
63
64
|
flex: 1;
|
|
64
65
|
align-items: center;
|
|
65
66
|
justify-content: flex-start;
|
|
66
|
-
margin
|
|
67
|
+
margin: 0 10px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.rightmenu {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
flex: 0 0 auto;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
color: #909090;
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
width: 50px;
|
|
78
|
+
}
|
|
79
|
+
.rightmenu span {
|
|
80
|
+
user-select: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.seperator {
|
|
84
|
+
cursor: default !important;
|
|
85
|
+
background: #00000014 !important;
|
|
86
|
+
border: 0;
|
|
87
|
+
height: 1px;
|
|
88
|
+
min-height: 1px !important;
|
|
89
|
+
margin: 4px 0;
|
|
90
|
+
padding: 0 !important;
|
|
91
|
+
display: block !important;
|
|
67
92
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
outline: none;
|
|
12
12
|
}
|
|
13
13
|
.backdrop_open {
|
|
14
|
-
display: flex !important;
|
|
14
|
+
display: flex !important;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.modal {
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
overflow-x: hidden;
|
|
23
23
|
border-radius: 8px;
|
|
24
24
|
background: transparent;
|
|
25
|
-
box-shadow:
|
|
25
|
+
box-shadow:
|
|
26
|
+
rgb(0 0 0 / 32%) 0 4px 8px,
|
|
27
|
+
rgb(0 0 0 / 40%) 0 8px 40px;
|
|
26
28
|
margin: 15px;
|
|
27
29
|
padding: 0;
|
|
28
30
|
z-index: 1;
|
|
@@ -38,8 +40,8 @@
|
|
|
38
40
|
}
|
|
39
41
|
.close_fixed {
|
|
40
42
|
position: absolute;
|
|
41
|
-
top:
|
|
42
|
-
right:
|
|
43
|
+
top: 2px;
|
|
44
|
+
right: 2px;
|
|
43
45
|
z-index: 1000;
|
|
44
46
|
text-align: right;
|
|
45
47
|
border-radius: inherit;
|
|
@@ -47,20 +49,19 @@
|
|
|
47
49
|
|
|
48
50
|
.close {
|
|
49
51
|
position: fixed;
|
|
50
|
-
background: #
|
|
52
|
+
background: linear-gradient(0deg, transparent, #00000026, transparent);
|
|
51
53
|
padding: 8px 10px;
|
|
52
54
|
font-size: 11px;
|
|
53
|
-
transform: translateX(-100%);
|
|
54
|
-
border-radius:
|
|
55
|
-
border-top-left-radius: 0;
|
|
56
|
-
border-bottom-right-radius: 0;
|
|
57
|
-
border-bottom-left-radius: 50%;
|
|
55
|
+
transform: scale(1) translateX(-100%);
|
|
56
|
+
border-radius: none;
|
|
58
57
|
cursor: pointer;
|
|
59
58
|
font-weight: bold;
|
|
60
59
|
text-shadow: 1px 0px 0px #000000;
|
|
60
|
+
transition: all 0.3s ease-in-out;
|
|
61
61
|
}
|
|
62
62
|
.close:hover {
|
|
63
|
-
|
|
63
|
+
transform: scale(1.3) translateX(-85%);
|
|
64
|
+
background: linear-gradient(180deg, transparent, #0000003a, transparent);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
.sbox_header {
|
|
@@ -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 {};
|