namirasoft-site-react 1.4.159 → 1.4.161
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/App.js +4 -4
- package/dist/App.js.map +1 -1
- package/dist/Validator.d.ts +2 -2
- package/dist/Validator.js +2 -12
- package/dist/Validator.js.map +1 -1
- package/dist/components/NSBarAction.d.ts +6 -2
- package/dist/components/NSBarAction.js +22 -7
- package/dist/components/NSBarAction.js.map +1 -1
- package/dist/components/NSBoxDate.d.ts +4 -4
- package/dist/components/NSBoxDate.js +15 -5
- package/dist/components/NSBoxDate.js.map +1 -1
- package/dist/components/NSBoxDateTime.js +12 -1
- package/dist/components/NSBoxDateTime.js.map +1 -1
- package/dist/components/NSBoxTime.d.ts +4 -4
- package/dist/components/NSBoxTime.js +5 -6
- package/dist/components/NSBoxTime.js.map +1 -1
- package/dist/components/NSDialog.d.ts +4 -1
- package/dist/components/NSDialog.js +4 -4
- package/dist/components/NSDialog.js.map +1 -1
- package/dist/components/NSDialogDelete.js +1 -1
- package/dist/components/NSDialogDelete.js.map +1 -1
- package/dist/components/NSDialogInfo.js +1 -1
- package/dist/components/NSDialogInfo.js.map +1 -1
- package/dist/components/NSHeader.js +1 -1
- package/dist/components/NSHeader.js.map +1 -1
- package/dist/components/NSHeader.module.css +11 -11
- package/dist/components/NSLayout.d.ts +5 -2
- package/dist/components/NSLayout.js +5 -18
- package/dist/components/NSLayout.js.map +1 -1
- package/dist/components/NSMenuButton.js +1 -1
- package/dist/components/NSMenuButton.js.map +1 -1
- package/dist/components/NSTable.module.css +7 -1
- package/dist/components/NSTile.module.css +0 -1
- package/dist/components/NSTitle.module.css +1 -1
- package/package.json +1 -1
- package/src/App.tsx +10 -41
- package/src/Validator.ts +4 -16
- package/src/components/NSBarAction.tsx +27 -12
- package/src/components/NSBoxDate.tsx +24 -11
- package/src/components/NSBoxDateTime.tsx +15 -1
- package/src/components/NSBoxTime.tsx +10 -11
- package/src/components/NSDialog.tsx +8 -4
- package/src/components/NSDialogDelete.tsx +1 -1
- package/src/components/NSDialogInfo.tsx +1 -5
- package/src/components/NSHeader.module.css +11 -11
- package/src/components/NSHeader.tsx +11 -8
- package/src/components/NSLayout.tsx +9 -22
- package/src/components/NSMenuButton.tsx +1 -1
- package/src/components/NSTable.module.css +7 -1
- package/src/components/NSTile.module.css +0 -1
- package/src/components/NSTitle.module.css +1 -1
|
@@ -4,25 +4,12 @@ import { Fragment } from 'react';
|
|
|
4
4
|
import { NSHeader } from './NSHeader';
|
|
5
5
|
import { NSFooter } from './NSFooter';
|
|
6
6
|
import { NSBarNotification } from './NSBarNotification';
|
|
7
|
-
import { NSBarAction } from './NSBarAction';
|
|
7
|
+
import { NSBarAction, isValidAction } from './NSBarAction';
|
|
8
8
|
import { NSBarTitle } from './NSBarTitle';
|
|
9
9
|
import { NSBarAlert } from './NSBarAlert';
|
|
10
10
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
11
|
-
export const isNotEmptyString = (string) => string && string.trim() !== "";
|
|
12
11
|
export function NSLayout(props) {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
function isValidAction(action) {
|
|
15
|
-
if (action) {
|
|
16
|
-
let hasMenu = false;
|
|
17
|
-
Object.keys(action.menus).forEach(menu => {
|
|
18
|
-
if (menu.length > 0)
|
|
19
|
-
hasMenu = true;
|
|
20
|
-
});
|
|
21
|
-
if ((isNotEmptyString(action.title)) || (isNotEmptyString(action.description)) || hasMenu)
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
26
13
|
let alerts = (_a = props.alerts) !== null && _a !== void 0 ? _a : [];
|
|
27
14
|
alerts = alerts.filter((a) => a.isVisible());
|
|
28
15
|
return (_jsxs("div", { id: props.id, className: `${Styles.ns_container} ${(_b = props.classList) === null || _b === void 0 ? void 0 : _b.join(" ")}`, style: {
|
|
@@ -31,9 +18,9 @@ export function NSLayout(props) {
|
|
|
31
18
|
display: "flex",
|
|
32
19
|
flexDirection: "column",
|
|
33
20
|
justifyContent: "center",
|
|
34
|
-
|
|
35
|
-
backgroundSize: "cover",
|
|
36
|
-
backgroundAttachment: "fixed"
|
|
21
|
+
backgroundImage: (_c = props.background) === null || _c === void 0 ? void 0 : _c.image,
|
|
22
|
+
backgroundSize: (_e = (_d = props.background) === null || _d === void 0 ? void 0 : _d.size) !== null && _e !== void 0 ? _e : "cover",
|
|
23
|
+
backgroundAttachment: (_g = (_f = props.background) === null || _f === void 0 ? void 0 : _f.attachment) !== null && _g !== void 0 ? _g : "fixed"
|
|
37
24
|
}, children: [_jsx(NSHeader, { scope: props.scope, name: "Header", logo: props.logo, header: props.header, isLoggedIn: props.isLoggedIn, notifier: props.notifier }), props.notifications.length !== 0 &&
|
|
38
25
|
_jsx(_Fragment, { children: props.notifications.map((notification, index) => _jsx(Fragment, { children: _jsx(NSBarNotification, Object.assign({}, notification)) }, `NSLayout_fragment_key_${index}`)) }), alerts.length !== 0 && alerts.map((alert, index) => _jsx(NSBarAlert, Object.assign({}, alert), `NSLayout_NSBarAlert_key_${index}`)), isValidAction(props.action) && _jsx(NSBarAction, Object.assign({}, props.action)), props.title &&
|
|
39
26
|
_jsxs(_Fragment, { children: [_jsx(NSSpace, { size: NSSpaceSizeType.MINI }), _jsx(NSBarTitle, Object.assign({}, props.title))] }), _jsx("main", { className: `d-flex flex-column text-white ${Styles.ns_layout_main}`, children: props.children }), _jsx(NSFooter, { scope: props.scope, name: "Footer", logo: props.logo, isLoggedIn: props.isLoggedIn })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSLayout.js","sourceRoot":"","sources":["../../src/components/NSLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY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AC,KAAK,EAClB,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,UAAU,EAAE,KAAK,CAAC,UAAU,GAC3B,IACI,CACP,CAAC;AACH,CAAC"}
|
|
@@ -50,6 +50,6 @@ export function NSMenuButton(props) {
|
|
|
50
50
|
return (_jsx("div", { id: props.id, className: `${Styles.ns_menu_button_container} ${(_g = props.classList) === null || _g === void 0 ? void 0 : _g.join(" ")}`, style: props.style, children: _jsxs("div", { className: Styles.ns_menu_button_group_parrent, children: [_jsx("div", { className: Styles.ns_menu_button_group, children: _jsx("div", { style: { direction: "rtl" }, children: buttons.map(button => (button.href ?
|
|
51
51
|
_jsx("a", { title: button.title, className: Styles.ns_menu_button_menu_item, href: button.href, children: _jsx("img", { src: button.icon, alt: button.title, width: 16, height: 16 }) }) :
|
|
52
52
|
_jsx("button", { title: button.title, className: Styles.ns_menu_button_menu_item, onClick: button.onClick, children: _jsx("img", { src: button.icon, alt: button.title, width: 16, height: 16 }) }))) }) }), state.fullscreen &&
|
|
53
|
-
_jsx(NSDialog, { onClose: () => { onClose(); }, center_dialog: true,
|
|
53
|
+
_jsx(NSDialog, { onClose: () => { onClose(); }, center_dialog: true, closeButton: { out: true }, style: { width: "80%", height: "80%", maxWidth: "100%", maxHeight: "100%" }, children: _jsx(NSBoxTextArea, { ref: textarea, required: false, title: '', hideHeader: true, defaultValue: props.getValue(), onChanged: onChanged, style: { width: "100%", height: "100%", maxWidth: "100%", maxHeight: "100%", zIndex: "999" } }) })] }) }));
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=NSMenuButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSMenuButton.js","sourceRoot":"","sources":["../../src/components/NSMenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE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EAAE,YAE3E,KAAC,aAAa,IACV,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,KAAK,EACf,KAAK,EAAC,EAAE,EACR,UAAU,QACV,YAAY,EAAE,KAAK,CAAC,QAAQ,EAAE,EAC9B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAC/E,GACV,IAEb,GACJ,CACT,CAAC;AACN,CAAC"}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.ns_table tr {
|
|
33
|
-
border-radius:
|
|
33
|
+
border-radius: 0px;
|
|
34
34
|
padding: 16px 8px;
|
|
35
35
|
display: block;
|
|
36
36
|
background-color: rgba(255, 255, 255, 1);
|
|
@@ -152,6 +152,12 @@
|
|
|
152
152
|
gap: 16px;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
@media screen and (min-width: 992px) {
|
|
156
|
+
.ns_table tr {
|
|
157
|
+
border-radius: 8px;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
155
161
|
@media screen and (max-width: 992px) {
|
|
156
162
|
.ns_table td {
|
|
157
163
|
width: auto;
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './App.css';
|
|
2
2
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
3
|
-
import { NSPanel, NSBoxDate, NSSection, NSBoxFile, NSLayout, NSBoxCombo, NSButton, NSFilterBox,
|
|
3
|
+
import { NSPanel, NSBoxDate, NSSection, NSBoxFile, NSLayout, NSBoxCombo, NSButton, NSFilterBox, NSBoxString, NSBoxTime, NSBoxDateTime } from './main';
|
|
4
4
|
import { NSRow } from './components/NSRow';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { FilterItemColumnType } from 'namirasoft-core';
|
|
@@ -20,7 +20,6 @@ export function App()
|
|
|
20
20
|
notifications={[]}
|
|
21
21
|
notifier={{} as any}
|
|
22
22
|
scope=''
|
|
23
|
-
background='url("https://img.freepik.com/free-photo/colorful-abstract-textured-background-design_53876-108265.jpg")'
|
|
24
23
|
alerts={[
|
|
25
24
|
{
|
|
26
25
|
isVisible: () => true,
|
|
@@ -59,14 +58,6 @@ export function App()
|
|
|
59
58
|
>
|
|
60
59
|
<NSSection>
|
|
61
60
|
<NSPanel>
|
|
62
|
-
<NSButton
|
|
63
|
-
onClick={() => { }}
|
|
64
|
-
title='asdasd'
|
|
65
|
-
></NSButton>
|
|
66
|
-
<NSButtonBlue
|
|
67
|
-
onClick={() => { }}
|
|
68
|
-
title='asdasd'
|
|
69
|
-
></NSButtonBlue>
|
|
70
61
|
<NSFilterBox
|
|
71
62
|
getData={async () =>
|
|
72
63
|
{
|
|
@@ -108,8 +99,8 @@ export function App()
|
|
|
108
99
|
}}
|
|
109
100
|
title='Increase'
|
|
110
101
|
></NSButton>
|
|
111
|
-
<
|
|
112
|
-
title='
|
|
102
|
+
<NSBoxString
|
|
103
|
+
title='NSBoxString'
|
|
113
104
|
required
|
|
114
105
|
/>
|
|
115
106
|
<NSRow>
|
|
@@ -117,42 +108,20 @@ export function App()
|
|
|
117
108
|
title='Date'
|
|
118
109
|
required
|
|
119
110
|
/>
|
|
120
|
-
<
|
|
121
|
-
title='
|
|
111
|
+
<NSBoxTime
|
|
112
|
+
title='Time'
|
|
122
113
|
required
|
|
123
114
|
/>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
title='Date'
|
|
127
|
-
required
|
|
128
|
-
/>
|
|
129
|
-
<NSBoxDate
|
|
130
|
-
title='Date'
|
|
131
|
-
required
|
|
132
|
-
/>
|
|
133
|
-
<NSRow>
|
|
134
|
-
<NSBoxFile
|
|
135
|
-
title='Date'
|
|
115
|
+
<NSBoxDateTime
|
|
116
|
+
title='DateTime'
|
|
136
117
|
required
|
|
137
|
-
style={{ width: "100%" }}
|
|
138
118
|
/>
|
|
139
119
|
</NSRow>
|
|
140
120
|
<NSRow>
|
|
141
|
-
<
|
|
142
|
-
title='
|
|
143
|
-
required
|
|
144
|
-
/>
|
|
145
|
-
<NSBoxDate
|
|
146
|
-
title='Date'
|
|
147
|
-
required
|
|
148
|
-
/>
|
|
149
|
-
<NSBoxDate
|
|
150
|
-
title='Date'
|
|
151
|
-
required
|
|
152
|
-
/>
|
|
153
|
-
<NSBoxDate
|
|
154
|
-
title='Date'
|
|
121
|
+
<NSBoxFile
|
|
122
|
+
title='File'
|
|
155
123
|
required
|
|
124
|
+
style={{ width: "100%" }}
|
|
156
125
|
/>
|
|
157
126
|
</NSRow>
|
|
158
127
|
</NSPanel>
|
package/src/Validator.ts
CHANGED
|
@@ -66,30 +66,18 @@ export class Validator
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
static getErrorDate(name: string, value:
|
|
69
|
+
static getErrorDate(name: string, value: string | null | undefined): string | null
|
|
70
70
|
{
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
const dateTime = new Date(value);
|
|
74
|
-
if (isNaN(dateTime.getTime()))
|
|
75
|
-
return `${value} is not a valid Date for ${name}.`;
|
|
76
|
-
}
|
|
77
|
-
return Validator.getError(name, value?.toLocaleDateString(), {
|
|
71
|
+
return Validator.getError(name, value, {
|
|
78
72
|
required: true, regex: {
|
|
79
73
|
name: "Date",
|
|
80
74
|
regex: DateSchema.REGEX
|
|
81
75
|
}
|
|
82
76
|
});
|
|
83
77
|
}
|
|
84
|
-
static getErrorTime(name: string, value:
|
|
78
|
+
static getErrorTime(name: string, value: string | null | undefined): string | null
|
|
85
79
|
{
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
const dateTime = new Date(value);
|
|
89
|
-
if (isNaN(dateTime.getTime()))
|
|
90
|
-
return `${value} is not a valid Time for ${name}.`;
|
|
91
|
-
}
|
|
92
|
-
return Validator.getError(name, value?.toLocaleTimeString(), {
|
|
80
|
+
return Validator.getError(name, value, {
|
|
93
81
|
required: true, regex: {
|
|
94
82
|
name: "Time",
|
|
95
83
|
regex: TimeSchema.REGEX
|
|
@@ -2,13 +2,12 @@ import { useState } from 'react';
|
|
|
2
2
|
import Styles from './NSBarAction.module.css';
|
|
3
3
|
import { NSMenuActionProps, NSMenuAction } from './NSMenuAction';
|
|
4
4
|
import { NSDialogInfo } from './NSDialogInfo';
|
|
5
|
-
import { isNotEmptyString } from './NSLayout';
|
|
6
5
|
|
|
7
6
|
export interface NSBarActionProps
|
|
8
7
|
{
|
|
9
|
-
title
|
|
8
|
+
title?: string;
|
|
10
9
|
description?: string;
|
|
11
|
-
menus
|
|
10
|
+
menus?: { [group: string]: NSMenuActionProps[] };
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export interface NSBarActionState
|
|
@@ -16,27 +15,45 @@ export interface NSBarActionState
|
|
|
16
15
|
show: boolean
|
|
17
16
|
}
|
|
18
17
|
|
|
18
|
+
export function isValidMenu(menus?: { [group: string]: NSMenuActionProps[] })
|
|
19
|
+
{
|
|
20
|
+
let ans = false;
|
|
21
|
+
if (menus)
|
|
22
|
+
Object.keys(menus).forEach(menu =>
|
|
23
|
+
{
|
|
24
|
+
if (menu.length > 0)
|
|
25
|
+
ans = true;
|
|
26
|
+
});
|
|
27
|
+
return ans;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function isValidAction(props?: NSBarActionProps)
|
|
31
|
+
{
|
|
32
|
+
if (props)
|
|
33
|
+
if (props.title?.trim() || props.description?.trim() || isValidMenu(props.menus))
|
|
34
|
+
return true;
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
19
38
|
export function NSBarAction(props: NSBarActionProps)
|
|
20
39
|
{
|
|
21
40
|
const [state, setState] = useState<NSBarActionState>({
|
|
22
41
|
show: false
|
|
23
42
|
})
|
|
24
43
|
|
|
25
|
-
const groups = Object.keys(props.menus);
|
|
26
|
-
|
|
27
44
|
return (
|
|
28
45
|
<>
|
|
29
46
|
<div className={Styles.ns_bar_action_holder}>
|
|
30
47
|
<div className={`container d-flex justify-content-center justify-content-lg-between align-items-center w-100 ${Styles.ns_bar_action_grant_parent}`}>
|
|
31
48
|
{
|
|
32
|
-
(
|
|
49
|
+
(props.title?.trim() || props.description?.trim()) &&
|
|
33
50
|
<div className={`d-lg-flex ${Styles.ns_bar_action_parent}`}>
|
|
34
51
|
{
|
|
35
|
-
|
|
52
|
+
props.title?.trim() &&
|
|
36
53
|
<h1 className={Styles.ns_bar_action_title}>{props.title}</h1>
|
|
37
54
|
}
|
|
38
55
|
{
|
|
39
|
-
|
|
56
|
+
props.description?.trim() &&
|
|
40
57
|
<button className={Styles.ns_bar_action_info_container} onClick={() => setState({ show: true })}>
|
|
41
58
|
<img src='https://static.namirasoft.com/image/concept/info/white-blue.svg' alt='info-icon' width={24} height={24} />
|
|
42
59
|
<span> Info </span>
|
|
@@ -55,12 +72,10 @@ export function NSBarAction(props: NSBarActionProps)
|
|
|
55
72
|
</div>
|
|
56
73
|
}
|
|
57
74
|
{
|
|
58
|
-
|
|
75
|
+
props.menus && isValidMenu(props.menus) &&
|
|
59
76
|
<div className={Styles.ns_bar_action_actions_holder}>
|
|
60
77
|
{
|
|
61
|
-
|
|
62
|
-
<NSMenuAction key={`NSBarAction_NSMenuAction_Key_${index}`} name={group} items={props.menus[group]} />
|
|
63
|
-
)
|
|
78
|
+
Object.keys(props.menus ?? {}).map((group, index) => <NSMenuAction key={`NSBarAction_NSMenuAction_Key_${index}`} name={group} items={(props.menus ?? {})[group]} />)
|
|
64
79
|
}
|
|
65
80
|
</div>
|
|
66
81
|
}
|
|
@@ -9,12 +9,12 @@ import { Validator } from "../Validator";
|
|
|
9
9
|
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
10
10
|
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
11
11
|
|
|
12
|
-
export interface NSBoxDateProps extends IBaseComponentProps, IValidationProps, INSBoxBaseLayoutProps<
|
|
12
|
+
export interface NSBoxDateProps extends IBaseComponentProps, IValidationProps, INSBoxBaseLayoutProps<string, NSBoxDate>
|
|
13
13
|
{ }
|
|
14
14
|
|
|
15
15
|
export interface NSBoxDateState
|
|
16
16
|
{
|
|
17
|
-
value:
|
|
17
|
+
value: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export class NSBoxDate extends React.Component<NSBoxDateProps, NSBoxDateState>
|
|
@@ -23,7 +23,7 @@ export class NSBoxDate extends React.Component<NSBoxDateProps, NSBoxDateState>
|
|
|
23
23
|
constructor(props: NSBoxDateProps)
|
|
24
24
|
{
|
|
25
25
|
super(props);
|
|
26
|
-
this.state = { value: props.defaultValue ??
|
|
26
|
+
this.state = { value: props.defaultValue ?? "" };
|
|
27
27
|
this.getError = this.getError.bind(this);
|
|
28
28
|
this.getValue = this.getValue.bind(this);
|
|
29
29
|
this.setValue = this.setValue.bind(this);
|
|
@@ -31,18 +31,17 @@ export class NSBoxDate extends React.Component<NSBoxDateProps, NSBoxDateState>
|
|
|
31
31
|
getError(): string | null
|
|
32
32
|
{
|
|
33
33
|
return (
|
|
34
|
-
Validator.getError(this.props.title, this.state.value
|
|
34
|
+
Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
35
35
|
Validator.getErrorDate(this.props.title, this.state.value)
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
getValue(checkError: boolean = true):
|
|
38
|
+
getValue(checkError: boolean = true): string
|
|
39
39
|
{
|
|
40
40
|
return NSBoxBaseLayout.checkGetValue(this, checkError, () => this.state.value);
|
|
41
41
|
}
|
|
42
|
-
setValue(value: string
|
|
42
|
+
setValue(value: string, callback?: () => void): void
|
|
43
43
|
{
|
|
44
|
-
|
|
45
|
-
this.setState({ value: date_value }, () =>
|
|
44
|
+
this.setState({ value }, () =>
|
|
46
45
|
{
|
|
47
46
|
if (this.props.onChanged)
|
|
48
47
|
this.props.onChanged(this, callback);
|
|
@@ -55,11 +54,25 @@ export class NSBoxDate extends React.Component<NSBoxDateProps, NSBoxDateState>
|
|
|
55
54
|
let menu = safeMenuMenuItem(this.props, () => { });
|
|
56
55
|
menu.builtin.fullscreen = false;
|
|
57
56
|
|
|
57
|
+
function getFormattedValue(date: string, delimiter_from: string, delimiter_to: string)
|
|
58
|
+
{
|
|
59
|
+
if (date)
|
|
60
|
+
try
|
|
61
|
+
{
|
|
62
|
+
let toks = date.split(delimiter_from);
|
|
63
|
+
let ans = toks[0] + delimiter_to + toks[1].padStart(2, "0") + delimiter_to + toks[2].padStart(2, "0");
|
|
64
|
+
return ans;
|
|
65
|
+
} catch (error)
|
|
66
|
+
{
|
|
67
|
+
}
|
|
68
|
+
return "";
|
|
69
|
+
}
|
|
70
|
+
|
|
58
71
|
return (
|
|
59
72
|
<NSBoxBaseLayout
|
|
60
73
|
ref={this.NSBoxBaseLayout_Main}
|
|
61
74
|
{...this.props}
|
|
62
|
-
getValue={() => this.state.value
|
|
75
|
+
getValue={() => this.state.value}
|
|
63
76
|
setValue={this.setValue}
|
|
64
77
|
menu={menu}
|
|
65
78
|
>
|
|
@@ -69,8 +82,8 @@ export class NSBoxDate extends React.Component<NSBoxDateProps, NSBoxDateState>
|
|
|
69
82
|
type="date"
|
|
70
83
|
className={StylesNSBox.ns_box_input}
|
|
71
84
|
placeholder={this.props.placeholder ?? `Please enter ${this.props.title}`}
|
|
72
|
-
value={this.state.value
|
|
73
|
-
onChange={e => this.setValue(e.target.value)}
|
|
85
|
+
value={getFormattedValue(this.state.value, "/", "-")}
|
|
86
|
+
onChange={e => this.setValue(getFormattedValue(e.target.value, "-", "/"))}
|
|
74
87
|
onClick={() => { if (this.props.onClicked) this.props.onClicked(this); }}
|
|
75
88
|
style={{
|
|
76
89
|
background: `url("https://static.namirasoft.com/image/concept/type/date.png") white no-repeat scroll center right 4px`,
|
|
@@ -60,6 +60,20 @@ export class NSBoxDateTime extends React.Component<NSBoxDateTimeProps, NSBoxDate
|
|
|
60
60
|
let menu = safeMenuMenuItem(this.props, () => { });
|
|
61
61
|
menu.builtin.fullscreen = false;
|
|
62
62
|
|
|
63
|
+
function getFormattedValue(datetime: Date)
|
|
64
|
+
{
|
|
65
|
+
if (datetime)
|
|
66
|
+
try
|
|
67
|
+
{
|
|
68
|
+
let date = datetime.getFullYear().toString().padStart(4, "0") + "-" + (datetime.getMonth() + 1).toString().padStart(2, "0") + "-" + datetime.getDate().toString().padStart(2, "0");
|
|
69
|
+
let time = datetime.getHours().toString().padStart(2, "0") + ":" + datetime.getMinutes().toString().padStart(2, "0");
|
|
70
|
+
return date + "T" + time;
|
|
71
|
+
} catch (error)
|
|
72
|
+
{
|
|
73
|
+
}
|
|
74
|
+
return "";
|
|
75
|
+
}
|
|
76
|
+
|
|
63
77
|
return (
|
|
64
78
|
<NSBoxBaseLayout
|
|
65
79
|
ref={this.NSBoxBaseLayout_Main}
|
|
@@ -74,7 +88,7 @@ export class NSBoxDateTime extends React.Component<NSBoxDateTimeProps, NSBoxDate
|
|
|
74
88
|
type="datetime-local"
|
|
75
89
|
className={StylesNSBox.ns_box_input}
|
|
76
90
|
placeholder={this.props.placeholder ?? `Please enter ${this.props.title}`}
|
|
77
|
-
value={this.state.value
|
|
91
|
+
value={getFormattedValue(this.state.value)}
|
|
78
92
|
onChange={this.onChanged}
|
|
79
93
|
onClick={() => { if (this.props.onClicked) this.props.onClicked(this); }}
|
|
80
94
|
style={{
|
|
@@ -10,12 +10,12 @@ import { Validator } from "../Validator";
|
|
|
10
10
|
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
11
11
|
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
12
12
|
|
|
13
|
-
export interface NSBoxTimeProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<
|
|
13
|
+
export interface NSBoxTimeProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<string, NSBoxTime>
|
|
14
14
|
{ }
|
|
15
15
|
|
|
16
16
|
export interface NSBoxTimeState
|
|
17
17
|
{
|
|
18
|
-
value:
|
|
18
|
+
value: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export class NSBoxTime extends React.Component<NSBoxTimeProps, NSBoxTimeState>
|
|
@@ -24,7 +24,7 @@ export class NSBoxTime extends React.Component<NSBoxTimeProps, NSBoxTimeState>
|
|
|
24
24
|
constructor(props: NSBoxTimeProps)
|
|
25
25
|
{
|
|
26
26
|
super(props);
|
|
27
|
-
this.state = { value: props.defaultValue ??
|
|
27
|
+
this.state = { value: props.defaultValue ?? "" };
|
|
28
28
|
this.getError = this.getError.bind(this);
|
|
29
29
|
this.getValue = this.getValue.bind(this);
|
|
30
30
|
this.setValue = this.setValue.bind(this);
|
|
@@ -32,19 +32,18 @@ export class NSBoxTime extends React.Component<NSBoxTimeProps, NSBoxTimeState>
|
|
|
32
32
|
getError(): string | null
|
|
33
33
|
{
|
|
34
34
|
return (
|
|
35
|
-
Validator.getError(this.props.title, this.state.value
|
|
36
|
-
Validator.getErrorString(this.props.title, this.state.value
|
|
35
|
+
Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
36
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props) ||
|
|
37
37
|
Validator.getErrorTime(this.props.title, this.state.value)
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
getValue(checkError: boolean = true):
|
|
40
|
+
getValue(checkError: boolean = true): string
|
|
41
41
|
{
|
|
42
42
|
return NSBoxBaseLayout.checkGetValue(this, checkError, () => this.state.value);
|
|
43
43
|
}
|
|
44
|
-
setValue(value: string
|
|
44
|
+
setValue(value: string, callback?: () => void): void
|
|
45
45
|
{
|
|
46
|
-
|
|
47
|
-
this.setState({ value: value_date }, () =>
|
|
46
|
+
this.setState({ value }, () =>
|
|
48
47
|
{
|
|
49
48
|
if (this.props.onChanged)
|
|
50
49
|
this.props.onChanged(this, callback);
|
|
@@ -61,7 +60,7 @@ export class NSBoxTime extends React.Component<NSBoxTimeProps, NSBoxTimeState>
|
|
|
61
60
|
<NSBoxBaseLayout
|
|
62
61
|
ref={this.NSBoxBaseLayout_Main}
|
|
63
62
|
{...this.props}
|
|
64
|
-
getValue={() => this.state.value
|
|
63
|
+
getValue={() => this.state.value}
|
|
65
64
|
setValue={() => { }}
|
|
66
65
|
>
|
|
67
66
|
<input
|
|
@@ -70,7 +69,7 @@ export class NSBoxTime extends React.Component<NSBoxTimeProps, NSBoxTimeState>
|
|
|
70
69
|
type="time"
|
|
71
70
|
className={StylesNSBox.ns_box_input}
|
|
72
71
|
placeholder={this.props.placeholder ?? `Please enter ${this.props.title}`}
|
|
73
|
-
value={this.state.value
|
|
72
|
+
value={this.state.value}
|
|
74
73
|
onChange={e => this.setValue(e.target.value)}
|
|
75
74
|
onClick={() => { if (this.props.onClicked) this.props.onClicked(this); }}
|
|
76
75
|
step="5"
|
|
@@ -7,7 +7,10 @@ export interface NSDialogProps extends IBaseComponentProps
|
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
center_dialog?: boolean;
|
|
10
|
-
|
|
10
|
+
closeButton?: {
|
|
11
|
+
show?: boolean;
|
|
12
|
+
out?: boolean;
|
|
13
|
+
}
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
export function NSDialog(props: NSDialogProps)
|
|
@@ -24,12 +27,12 @@ export function NSDialog(props: NSDialogProps)
|
|
|
24
27
|
style={{ ...props.style }}
|
|
25
28
|
>
|
|
26
29
|
{
|
|
27
|
-
|
|
30
|
+
props.closeButton?.show !== false && <div
|
|
28
31
|
onClick={() => props.onClose()}
|
|
29
32
|
style=
|
|
30
33
|
{{
|
|
31
34
|
position: "absolute",
|
|
32
|
-
top:
|
|
35
|
+
top: (props.closeButton?.out) ? "-60px" : "0px",
|
|
33
36
|
right: 0,
|
|
34
37
|
transform: "translate(-40%,40%)",
|
|
35
38
|
cursor: "pointer",
|
|
@@ -38,7 +41,8 @@ export function NSDialog(props: NSDialogProps)
|
|
|
38
41
|
}}
|
|
39
42
|
>
|
|
40
43
|
<img
|
|
41
|
-
src='https://static.namirasoft.com/image/concept/close/blue.svg'
|
|
44
|
+
src={(props.closeButton?.out) ? 'https://static.namirasoft.com/image/concept/close/white.svg' : 'https://static.namirasoft.com/image/concept/close/blue.svg'}
|
|
45
|
+
|
|
42
46
|
alt='close'
|
|
43
47
|
width={24}
|
|
44
48
|
height={24}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.ns_header {
|
|
2
2
|
width: 100%;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
position: sticky;
|
|
4
|
+
top: 0;
|
|
5
|
+
z-index: 110;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.ns_navbar {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
.ns_navbar_content {
|
|
19
19
|
display: flex;
|
|
20
20
|
justify-content: flex-end;
|
|
21
|
-
|
|
21
|
+
align-items: center;
|
|
22
22
|
width: 100%;
|
|
23
23
|
gap: 8px;
|
|
24
24
|
}
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
position: relative;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
.ns_header_icon>
|
|
85
|
-
|
|
84
|
+
.ns_header_icon>img:hover {
|
|
85
|
+
scale: 1.2;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.ns_navbar_items_container {
|
|
@@ -145,10 +145,10 @@
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
@media only screen and (min-width: 1025px) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
.ns_navbar_content {
|
|
149
|
+
justify-content: space-between;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
152
|
.ns_navbar_parent_content {
|
|
153
153
|
padding-right: 1rem;
|
|
154
154
|
padding-left: 1rem;
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
background-color: #ff0000;
|
|
206
206
|
color: rgba(255, 255, 255, 1);
|
|
207
207
|
border-radius: 50%;
|
|
208
|
-
|
|
208
|
+
cursor: pointer;
|
|
209
209
|
font-size: 10px;
|
|
210
210
|
font-weight: 600;
|
|
211
211
|
position: absolute;
|