namirasoft-site-react 1.4.165 → 1.4.167
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 -37
- package/dist/App.js.map +1 -1
- package/dist/NSBoxBuilder.d.ts +54 -0
- package/dist/NSBoxBuilder.js +313 -0
- package/dist/NSBoxBuilder.js.map +1 -0
- package/dist/Validator.d.ts +1 -1
- package/dist/Validator.js +13 -3
- package/dist/Validator.js.map +1 -1
- package/dist/components/INSBox.d.ts +6 -0
- package/dist/components/INSBox.js +2 -0
- package/dist/components/INSBox.js.map +1 -0
- package/dist/components/NSBox.js.map +1 -1
- package/dist/components/NSBoxBaseCombo.d.ts +13 -10
- package/dist/components/NSBoxBaseCombo.js +96 -65
- package/dist/components/NSBoxBaseCombo.js.map +1 -1
- package/dist/components/NSBoxBaseLayout.d.ts +2 -2
- package/dist/components/NSBoxBaseLayout.js +3 -2
- package/dist/components/NSBoxBaseLayout.js.map +1 -1
- package/dist/components/NSBoxBaseLayoutRecursive.d.ts +13 -0
- package/dist/components/NSBoxBaseLayoutRecursive.js +38 -0
- package/dist/components/NSBoxBaseLayoutRecursive.js.map +1 -0
- package/dist/components/NSBoxBoolean.d.ts +11 -10
- package/dist/components/NSBoxBoolean.js +31 -29
- package/dist/components/NSBoxBoolean.js.map +1 -1
- package/dist/components/NSBoxBooleans.js +5 -6
- package/dist/components/NSBoxBooleans.js.map +1 -1
- package/dist/components/NSBoxColor.d.ts +20 -0
- package/dist/components/NSBoxColor.js +47 -0
- package/dist/components/NSBoxColor.js.map +1 -0
- package/dist/components/NSBoxCombo.d.ts +10 -5
- package/dist/components/NSBoxCombo.js +34 -13
- package/dist/components/NSBoxCombo.js.map +1 -1
- package/dist/components/NSBoxDate.d.ts +6 -4
- package/dist/components/NSBoxDate.js +12 -8
- package/dist/components/NSBoxDate.js.map +1 -1
- package/dist/components/NSBoxDateTime.d.ts +6 -5
- package/dist/components/NSBoxDateTime.js +14 -13
- package/dist/components/NSBoxDateTime.js.map +1 -1
- package/dist/components/NSBoxDouble.d.ts +8 -6
- package/dist/components/NSBoxDouble.js +13 -13
- package/dist/components/NSBoxDouble.js.map +1 -1
- package/dist/components/NSBoxDuration.d.ts +6 -5
- package/dist/components/NSBoxDuration.js +13 -13
- package/dist/components/NSBoxDuration.js.map +1 -1
- package/dist/components/NSBoxDynamic.d.ts +20 -0
- package/dist/components/NSBoxDynamic.js +36 -0
- package/dist/components/NSBoxDynamic.js.map +1 -0
- package/dist/components/NSBoxEmail.d.ts +6 -5
- package/dist/components/NSBoxEmail.js +16 -13
- package/dist/components/NSBoxEmail.js.map +1 -1
- package/dist/components/NSBoxEntity.d.ts +10 -5
- package/dist/components/NSBoxEntity.js +34 -13
- package/dist/components/NSBoxEntity.js.map +1 -1
- package/dist/components/NSBoxEnum.d.ts +12 -5
- package/dist/components/NSBoxEnum.js +48 -15
- package/dist/components/NSBoxEnum.js.map +1 -1
- package/dist/components/NSBoxFile.d.ts +0 -1
- package/dist/components/NSBoxFile.js +1 -7
- package/dist/components/NSBoxFile.js.map +1 -1
- package/dist/components/NSBoxFilePath.d.ts +20 -0
- package/dist/components/NSBoxFilePath.js +47 -0
- package/dist/components/NSBoxFilePath.js.map +1 -0
- package/dist/components/NSBoxFont.d.ts +20 -0
- package/dist/components/NSBoxFont.js +47 -0
- package/dist/components/NSBoxFont.js.map +1 -0
- package/dist/components/NSBoxIPV4.d.ts +6 -5
- package/dist/components/NSBoxIPV4.js +13 -13
- package/dist/components/NSBoxIPV4.js.map +1 -1
- package/dist/components/NSBoxIPV4Range.d.ts +20 -0
- package/dist/components/NSBoxIPV4Range.js +47 -0
- package/dist/components/NSBoxIPV4Range.js.map +1 -0
- package/dist/components/NSBoxIPV6.d.ts +6 -5
- package/dist/components/NSBoxIPV6.js +13 -13
- package/dist/components/NSBoxIPV6.js.map +1 -1
- package/dist/components/NSBoxIPV6Range.d.ts +20 -0
- package/dist/components/NSBoxIPV6Range.js +47 -0
- package/dist/components/NSBoxIPV6Range.js.map +1 -0
- package/dist/components/NSBoxInteger.d.ts +6 -5
- package/dist/components/NSBoxInteger.js +13 -13
- package/dist/components/NSBoxInteger.js.map +1 -1
- package/dist/components/NSBoxMoney.d.ts +8 -6
- package/dist/components/NSBoxMoney.js +14 -13
- package/dist/components/NSBoxMoney.js.map +1 -1
- package/dist/components/NSBoxPassword.d.ts +6 -5
- package/dist/components/NSBoxPassword.js +12 -14
- package/dist/components/NSBoxPassword.js.map +1 -1
- package/dist/components/NSBoxPhone.d.ts +6 -4
- package/dist/components/NSBoxPhone.js +12 -7
- package/dist/components/NSBoxPhone.js.map +1 -1
- package/dist/components/NSBoxRadio.d.ts +3 -2
- package/dist/components/NSBoxRadio.js +12 -14
- package/dist/components/NSBoxRadio.js.map +1 -1
- package/dist/components/NSBoxSchemaBase.d.ts +39 -0
- package/dist/components/NSBoxSchemaBase.js +327 -0
- package/dist/components/NSBoxSchemaBase.js.map +1 -0
- package/dist/components/NSBoxSchemaBase.module.css +18 -0
- package/dist/components/NSBoxSchemaVariable.d.ts +32 -0
- package/dist/components/NSBoxSchemaVariable.js +127 -0
- package/dist/components/NSBoxSchemaVariable.js.map +1 -0
- package/dist/components/NSBoxSchemaVariable.module.css +17 -0
- package/dist/components/NSBoxSearch.d.ts +6 -5
- package/dist/components/NSBoxSearch.js +16 -12
- package/dist/components/NSBoxSearch.js.map +1 -1
- package/dist/components/NSBoxString.d.ts +6 -5
- package/dist/components/NSBoxString.js +16 -12
- package/dist/components/NSBoxString.js.map +1 -1
- package/dist/components/NSBoxTextArea.d.ts +6 -5
- package/dist/components/NSBoxTextArea.js +16 -21
- package/dist/components/NSBoxTextArea.js.map +1 -1
- package/dist/components/NSBoxTime.d.ts +6 -4
- package/dist/components/NSBoxTime.js +13 -9
- package/dist/components/NSBoxTime.js.map +1 -1
- package/dist/components/NSBoxTimeZone.d.ts +20 -0
- package/dist/components/NSBoxTimeZone.js +47 -0
- package/dist/components/NSBoxTimeZone.js.map +1 -0
- package/dist/components/NSBoxURL.d.ts +20 -0
- package/dist/components/NSBoxURL.js +48 -0
- package/dist/components/NSBoxURL.js.map +1 -0
- package/dist/components/NSBoxVersion.d.ts +20 -0
- package/dist/components/NSBoxVersion.js +47 -0
- package/dist/components/NSBoxVersion.js.map +1 -0
- package/dist/components/NSDialog.module.css +3 -2
- package/dist/components/NSFilterBox.js +4 -2
- package/dist/components/NSFilterBox.js.map +1 -1
- package/dist/components/NSLine.js.map +1 -1
- package/dist/components/NSLine.module.css +1 -0
- package/dist/components/NSMenuButton.d.ts +14 -5
- package/dist/components/NSMenuButton.js +21 -12
- package/dist/components/NSMenuButton.js.map +1 -1
- package/dist/components/NSPagination.js +2 -2
- package/dist/components/NSPagination.js.map +1 -1
- package/dist/components/NSPanel.module.css +1 -0
- package/dist/components/NSRepeater.d.ts +18 -10
- package/dist/components/NSRepeater.js +75 -39
- package/dist/components/NSRepeater.js.map +1 -1
- package/dist/components/NSRepeaterNSBoxSchemaVariable.d.ts +23 -0
- package/dist/components/NSRepeaterNSBoxSchemaVariable.js +50 -0
- package/dist/components/NSRepeaterNSBoxSchemaVariable.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/props/IValidationPrecisionProps.d.ts +3 -0
- package/dist/props/IValidationPrecisionProps.js +2 -0
- package/dist/props/IValidationPrecisionProps.js.map +1 -0
- package/dist/props/IValidationProps.d.ts +2 -0
- package/package.json +6 -6
- package/src/App.tsx +7 -82
- package/src/NSBoxBuilder.tsx +850 -0
- package/src/Validator.ts +16 -4
- package/src/components/INSBox.tsx +7 -0
- package/src/components/NSBox.tsx +1 -0
- package/src/components/NSBoxBaseCombo.tsx +110 -75
- package/src/components/NSBoxBaseLayout.tsx +4 -7
- package/src/components/NSBoxBaseLayoutRecursive.tsx +55 -0
- package/src/components/NSBoxBoolean.tsx +40 -41
- package/src/components/NSBoxBooleans.tsx +4 -7
- package/src/components/NSBoxColor.tsx +88 -0
- package/src/components/NSBoxCombo.tsx +36 -15
- package/src/components/NSBoxDate.tsx +18 -14
- package/src/components/NSBoxDateTime.tsx +20 -21
- package/src/components/NSBoxDouble.tsx +23 -23
- package/src/components/NSBoxDuration.tsx +19 -20
- package/src/components/NSBoxDynamic.tsx +56 -0
- package/src/components/NSBoxEmail.tsx +23 -25
- package/src/components/NSBoxEntity.tsx +36 -15
- package/src/components/NSBoxEnum.tsx +51 -16
- package/src/components/NSBoxFile.tsx +1 -11
- package/src/components/NSBoxFilePath.tsx +88 -0
- package/src/components/NSBoxFont.tsx +88 -0
- package/src/components/NSBoxIPV4.tsx +19 -20
- package/src/components/NSBoxIPV4Range.tsx +88 -0
- package/src/components/NSBoxIPV6.tsx +19 -20
- package/src/components/NSBoxIPV6Range.tsx +88 -0
- package/src/components/NSBoxInteger.tsx +19 -20
- package/src/components/NSBoxMoney.tsx +25 -22
- package/src/components/NSBoxPassword.tsx +18 -21
- package/src/components/NSBoxPhone.tsx +16 -14
- package/src/components/NSBoxRadio.tsx +16 -24
- package/src/components/NSBoxSchemaBase.module.css +18 -0
- package/src/components/NSBoxSchemaBase.tsx +523 -0
- package/src/components/NSBoxSchemaVariable.module.css +17 -0
- package/src/components/NSBoxSchemaVariable.tsx +247 -0
- package/src/components/NSBoxSearch.tsx +24 -19
- package/src/components/NSBoxString.tsx +26 -19
- package/src/components/NSBoxTextArea.tsx +24 -19
- package/src/components/NSBoxTime.tsx +19 -14
- package/src/components/NSBoxTimeZone.tsx +88 -0
- package/src/components/NSBoxURL.tsx +89 -0
- package/src/components/NSBoxVersion.tsx +88 -0
- package/src/components/NSDialog.module.css +3 -2
- package/src/components/NSFilterBox.tsx +6 -2
- package/src/components/NSLine.module.css +1 -0
- package/src/components/NSLine.tsx +1 -3
- package/src/components/NSMenuButton.tsx +28 -11
- package/src/components/NSPagination.tsx +2 -3
- package/src/components/NSPanel.module.css +1 -0
- package/src/components/NSRepeater.tsx +91 -47
- package/src/components/NSRepeaterNSBoxSchemaVariable.tsx +90 -0
- package/src/main.ts +1 -0
- package/src/props/IValidationPrecisionProps.ts +4 -0
- package/src/props/IValidationProps.ts +2 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.ns_box_schema_base_required_withoutname {
|
|
2
|
+
flex-grow: 1;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@media only screen and (min-width: 768px) {
|
|
7
|
+
.ns_box_schema_base_type {
|
|
8
|
+
width: 176px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ns_box_schema_base_name {
|
|
12
|
+
flex-grow: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ns_box_schema_base_required_withname {
|
|
16
|
+
width: 100px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
5
|
+
import { INSBoxBaseLayoutProps } from "./NSBoxBaseLayout";
|
|
6
|
+
import { INSBox } from "./INSBox";
|
|
7
|
+
import { BaseVariableSchema } from "namirasoft-schema";
|
|
8
|
+
import { NSBoxBaseLayoutRecursive } from "./NSBoxBaseLayoutRecursive";
|
|
9
|
+
export interface NSBoxSchemaVariableProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<BaseVariableSchema, NSBoxSchemaVariable> {
|
|
10
|
+
depth?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface NSBoxSchemaVariableState {
|
|
13
|
+
show_value: BaseVariableSchema | null;
|
|
14
|
+
show_error: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare class NSBoxSchemaVariable extends React.Component<NSBoxSchemaVariableProps, NSBoxSchemaVariableState> implements INSBox {
|
|
17
|
+
private service;
|
|
18
|
+
private NSBoxString_Name;
|
|
19
|
+
private NSBoxString_Default;
|
|
20
|
+
private NSBoxBoolean_Multiple;
|
|
21
|
+
private NSBoxSchemaBase_Type;
|
|
22
|
+
private NSBoxTextArea_Value;
|
|
23
|
+
private NSBoxDynamic_Value;
|
|
24
|
+
NSBoxBaseLayoutRecursive_Main: React.RefObject<NSBoxBaseLayoutRecursive>;
|
|
25
|
+
constructor(props: NSBoxSchemaVariableProps);
|
|
26
|
+
isEmpty(value: BaseVariableSchema | null): boolean;
|
|
27
|
+
getError(): string | null;
|
|
28
|
+
getValue(checkError?: boolean): BaseVariableSchema | null;
|
|
29
|
+
setValue(value: BaseVariableSchema | null, callback?: () => void): void;
|
|
30
|
+
private onChanged;
|
|
31
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { createRef } from "react";
|
|
4
|
+
import Styles from "./NSBoxSchemaVariable.module.css";
|
|
5
|
+
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
6
|
+
import { NSRow } from "./NSRow";
|
|
7
|
+
import { NSBoxString } from "./NSBoxString";
|
|
8
|
+
import { BaseVariableSchema } from "namirasoft-schema";
|
|
9
|
+
import { NSBoxSchemaBase } from "./NSBoxSchemaBase";
|
|
10
|
+
import { NSBoxBaseLayoutRecursive } from "./NSBoxBaseLayoutRecursive";
|
|
11
|
+
import { NSDialog } from "./NSDialog";
|
|
12
|
+
import { NSBoxDynamic } from "./NSBoxDynamic";
|
|
13
|
+
import { NSBoxBoolean } from "./NSBoxBoolean";
|
|
14
|
+
import { NSSpace, NSSpaceSizeType } from "./NSSpace";
|
|
15
|
+
import { NSLine } from "./NSLine";
|
|
16
|
+
import { NSTitle } from "./NSTitle";
|
|
17
|
+
import { NSButtonBlue } from "./NSButtonBlue";
|
|
18
|
+
import { NSBoxTextArea } from "./NSBoxTextArea";
|
|
19
|
+
import { NSBox } from "./NSBox";
|
|
20
|
+
import { SetTimeouService } from "namirasoft-core";
|
|
21
|
+
export class NSBoxSchemaVariable extends React.Component {
|
|
22
|
+
constructor(props) {
|
|
23
|
+
super(props);
|
|
24
|
+
this.service = new SetTimeouService();
|
|
25
|
+
this.NSBoxString_Name = createRef();
|
|
26
|
+
this.NSBoxString_Default = createRef();
|
|
27
|
+
this.NSBoxBoolean_Multiple = createRef();
|
|
28
|
+
this.NSBoxSchemaBase_Type = createRef();
|
|
29
|
+
this.NSBoxTextArea_Value = createRef();
|
|
30
|
+
this.NSBoxDynamic_Value = createRef();
|
|
31
|
+
this.NSBoxBaseLayoutRecursive_Main = createRef();
|
|
32
|
+
this.state = { show_value: null, show_error: null };
|
|
33
|
+
this.isEmpty = this.isEmpty.bind(this);
|
|
34
|
+
this.getError = this.getError.bind(this);
|
|
35
|
+
this.getValue = this.getValue.bind(this);
|
|
36
|
+
this.setValue = this.setValue.bind(this);
|
|
37
|
+
this.onChanged = this.onChanged.bind(this);
|
|
38
|
+
}
|
|
39
|
+
isEmpty(value) {
|
|
40
|
+
if (value)
|
|
41
|
+
if (value.name || value.type || value.defaultValue)
|
|
42
|
+
return false;
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
getError() {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
getValue(checkError = true) {
|
|
49
|
+
return NSBoxBaseLayoutRecursive.checkGetValue(this, checkError, () => {
|
|
50
|
+
var _a, _b, _c, _d, _e, _f;
|
|
51
|
+
let name = (_a = this.NSBoxString_Name.current) === null || _a === void 0 ? void 0 : _a.getValue(checkError);
|
|
52
|
+
let type = (_b = this.NSBoxSchemaBase_Type.current) === null || _b === void 0 ? void 0 : _b.getValue(checkError);
|
|
53
|
+
let defaultValue = (_d = (_c = this.NSBoxString_Default.current) === null || _c === void 0 ? void 0 : _c.getValue(checkError)) !== null && _d !== void 0 ? _d : "";
|
|
54
|
+
let multiple = (_f = (_e = this.NSBoxBoolean_Multiple.current) === null || _e === void 0 ? void 0 : _e.getValue(checkError)) !== null && _f !== void 0 ? _f : false;
|
|
55
|
+
if (name && type) {
|
|
56
|
+
let ans = new BaseVariableSchema(name, type, defaultValue);
|
|
57
|
+
if (multiple)
|
|
58
|
+
ans.tags["multiple"] = "true";
|
|
59
|
+
return ans;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
setValue(value, callback) {
|
|
65
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
66
|
+
(_a = this.NSBoxString_Name.current) === null || _a === void 0 ? void 0 : _a.setValue((_b = value === null || value === void 0 ? void 0 : value.name) !== null && _b !== void 0 ? _b : null);
|
|
67
|
+
(_c = this.NSBoxSchemaBase_Type.current) === null || _c === void 0 ? void 0 : _c.setValue((_d = value === null || value === void 0 ? void 0 : value.type) !== null && _d !== void 0 ? _d : null);
|
|
68
|
+
(_e = this.NSBoxString_Default.current) === null || _e === void 0 ? void 0 : _e.setValue((_f = value === null || value === void 0 ? void 0 : value.defaultValue) !== null && _f !== void 0 ? _f : null);
|
|
69
|
+
(_g = this.NSBoxBoolean_Multiple.current) === null || _g === void 0 ? void 0 : _g.setValue((value === null || value === void 0 ? void 0 : value.tags["multiple"]) === "true");
|
|
70
|
+
(_j = (_h = this.props).onChanged) === null || _j === void 0 ? void 0 : _j.call(_h, this);
|
|
71
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
72
|
+
}
|
|
73
|
+
onChanged() {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
(_b = (_a = this.props).onChanged) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
let menu = safeMenuMenuItem(this.props, (items) => {
|
|
80
|
+
items.push({
|
|
81
|
+
title: "Variable",
|
|
82
|
+
icon: "https://static.namirasoft.com/image/concept/detail/blue.svg",
|
|
83
|
+
onClick: () => {
|
|
84
|
+
try {
|
|
85
|
+
let value = this.getValue(true);
|
|
86
|
+
this.setState({ show_value: value });
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
return (_jsxs(NSBoxBaseLayoutRecursive, Object.assign({ ref: this.NSBoxBaseLayoutRecursive_Main, id: this.props.id }, this.props, { depth: (_a = this.props.depth) !== null && _a !== void 0 ? _a : 0, menu: menu, children: [_jsxs(NSRow, { children: [_jsx(NSBoxString, { ref: this.NSBoxString_Name, required: true, title: "Name", onChanged: this.onChanged, classList: [Styles.ns_box_schema_variable_name] }), _jsx(NSBoxString, { ref: this.NSBoxString_Default, required: false, title: "Default", onChanged: this.onChanged, classList: [Styles.ns_box_schema_variable_default] }), _jsx(NSBoxBoolean, { ref: this.NSBoxBoolean_Multiple, required: true, title: "Multiple", onChanged: this.onChanged, classList: [Styles.ns_box_schema_variable_multiple] })] }), _jsx(NSBoxSchemaBase, { ref: this.NSBoxSchemaBase_Type, required: true, title: "Type", onChanged: this.onChanged, style: { width: "100%" }, depth: ((_b = this.props.depth) !== null && _b !== void 0 ? _b : 0) + 1 }), this.state.show_value &&
|
|
94
|
+
_jsxs(NSDialog, { center_dialog: true, onClose: () => this.setState({ show_value: null }), children: [_jsx(NSTitle, { title: "Output" }), _jsx(NSBoxDynamic, { ref: this.NSBoxDynamic_Value, title: this.state.show_value.name, variable: this.state.show_value, style: { width: "100%", height: "100%" } }), _jsx(NSSpace, { size: NSSpaceSizeType.LARGE }), _jsx(NSLine, {}), this.state.show_error === "" &&
|
|
95
|
+
_jsx(NSTitle, { title: "It's valid", style: { color: "green" } }), this.state.show_error &&
|
|
96
|
+
_jsx(NSTitle, { title: "It's Not valid", style: { color: "red" } }), _jsxs(NSRow, { children: [_jsx(NSButtonBlue, { title: 'Get Value', onClick: () => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
try {
|
|
99
|
+
let value = (_a = this.NSBoxDynamic_Value.current) === null || _a === void 0 ? void 0 : _a.getValue(false);
|
|
100
|
+
(_b = this.NSBoxTextArea_Value.current) === null || _b === void 0 ? void 0 : _b.setValue(value !== null && value !== void 0 ? value : "");
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
alert(error);
|
|
104
|
+
}
|
|
105
|
+
} }), _jsx(NSButtonBlue, { title: 'Set Value', onClick: () => {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
try {
|
|
108
|
+
let value = (_a = this.NSBoxTextArea_Value.current) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
109
|
+
(_b = this.NSBoxDynamic_Value.current) === null || _b === void 0 ? void 0 : _b.setValue(value !== null && value !== void 0 ? value : null);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
alert(error);
|
|
113
|
+
}
|
|
114
|
+
} }), _jsx(NSButtonBlue, { title: 'Check Error', onClick: () => {
|
|
115
|
+
var _a;
|
|
116
|
+
try {
|
|
117
|
+
(_a = this.NSBoxDynamic_Value.current) === null || _a === void 0 ? void 0 : _a.getValue(true);
|
|
118
|
+
this.setState({ show_error: "" });
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
this.setState({ show_error: error.message });
|
|
122
|
+
}
|
|
123
|
+
this.service.setTimeoutIfNotCalledAgain(() => this.setState({ show_error: null }), 3000);
|
|
124
|
+
} })] }), _jsx(NSBoxTextArea, { ref: this.NSBoxTextArea_Value, title: 'Value', required: false, style: { width: NSBox.width.triple } })] })] })));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=NSBoxSchemaVariable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxSchemaVariable.js","sourceRoot":"","sources":["../../src/components/NSBoxSchemaVariable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,M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CAAC,OAAO,EAAE,CAAC,CAAC;4CACzD,CAAC;4CACD,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;wCAC1F,CAAC,GACA,IACK,EAER,KAAC,aAAa,IACb,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAC7B,KAAK,EAAC,OAAO,EACb,QAAQ,EAAE,KAAK,EACf,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,GACpB,IACP,KAEc,CAC3B,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.ns_box_schema_variable_default {
|
|
2
|
+
flex-grow: 1;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@media only screen and (min-width: 768px) {
|
|
6
|
+
.ns_box_schema_variable_name {
|
|
7
|
+
width: 192px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ns_box_schema_variable_default {
|
|
11
|
+
width: 100px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ns_box_schema_variable_multiple {
|
|
15
|
+
width: 100px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -3,6 +3,7 @@ import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
|
3
3
|
import { IValidationProps } from "../props/IValidationProps";
|
|
4
4
|
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
5
5
|
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
6
|
+
import { INSBox } from "./INSBox";
|
|
6
7
|
export interface NSBoxSearchProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<string, NSBoxSearch> {
|
|
7
8
|
title: string;
|
|
8
9
|
placeholder?: string;
|
|
@@ -12,15 +13,15 @@ export interface NSBoxSearchProps extends IBaseComponentProps, IValidationProps,
|
|
|
12
13
|
onClicked?: (e: NSBoxSearch) => void;
|
|
13
14
|
}
|
|
14
15
|
export interface NSBoxSearchState {
|
|
15
|
-
value: string;
|
|
16
|
+
value: string | null;
|
|
16
17
|
}
|
|
17
|
-
export declare class NSBoxSearch extends React.Component<NSBoxSearchProps, NSBoxSearchState> {
|
|
18
|
+
export declare class NSBoxSearch extends React.Component<NSBoxSearchProps, NSBoxSearchState> implements INSBox {
|
|
18
19
|
input: React.RefObject<HTMLInputElement>;
|
|
19
20
|
NSBoxBaseLayout_Main: React.RefObject<NSBoxBaseLayout>;
|
|
20
21
|
constructor(props: NSBoxSearchProps);
|
|
22
|
+
isEmpty(value: string): boolean;
|
|
21
23
|
getError(): string | null;
|
|
22
|
-
getValue(checkError?: boolean): string;
|
|
23
|
-
setValue(value: string, callback?: () => void): void;
|
|
24
|
-
private onChanged;
|
|
24
|
+
getValue(checkError?: boolean): string | null;
|
|
25
|
+
setValue(value: string | null, callback?: () => void): void;
|
|
25
26
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
}
|
|
@@ -5,17 +5,23 @@ import { Validator } from "../Validator";
|
|
|
5
5
|
import StylesNSBox from "./NSBox.module.css";
|
|
6
6
|
import { NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
7
7
|
import { NamingConvention } from "namirasoft-core";
|
|
8
|
+
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
8
9
|
export class NSBoxSearch extends React.Component {
|
|
9
10
|
constructor(props) {
|
|
10
11
|
var _a;
|
|
11
12
|
super(props);
|
|
12
13
|
this.input = createRef();
|
|
13
14
|
this.NSBoxBaseLayout_Main = createRef();
|
|
14
|
-
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a :
|
|
15
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : null };
|
|
16
|
+
this.isEmpty = this.isEmpty.bind(this);
|
|
15
17
|
this.getError = this.getError.bind(this);
|
|
16
18
|
this.getValue = this.getValue.bind(this);
|
|
17
19
|
this.setValue = this.setValue.bind(this);
|
|
18
|
-
|
|
20
|
+
}
|
|
21
|
+
isEmpty(value) {
|
|
22
|
+
if ((value !== null && value !== void 0 ? value : "").trim())
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
19
25
|
}
|
|
20
26
|
getError() {
|
|
21
27
|
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
@@ -26,19 +32,17 @@ export class NSBoxSearch extends React.Component {
|
|
|
26
32
|
}
|
|
27
33
|
setValue(value, callback) {
|
|
28
34
|
this.setState({ value }, () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
callback();
|
|
35
|
+
var _a, _b;
|
|
36
|
+
(_b = (_a = this.props).onChanged) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
37
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
33
38
|
});
|
|
34
39
|
}
|
|
35
|
-
onChanged(e) {
|
|
36
|
-
this.setValue(e.target.value);
|
|
37
|
-
}
|
|
38
40
|
render() {
|
|
39
|
-
var _a;
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
var _a, _b;
|
|
42
|
+
let menu = safeMenuMenuItem(this.props, () => { });
|
|
43
|
+
menu.builtin.copy = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; } };
|
|
44
|
+
menu.builtin.fullscreen = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; }, setValue: this.setValue };
|
|
45
|
+
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, children: _jsx("input", { ref: this.input, id: this.props.id, name: this.props.name, type: "text", className: StylesNSBox.ns_box_input, placeholder: (_a = this.props.placeholder) !== null && _a !== void 0 ? _a : `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`, value: (_b = this.state.value) !== null && _b !== void 0 ? _b : "", onChange: e => this.setValue(e.target.value), onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, style: {
|
|
42
46
|
background: `url(${"https://static.namirasoft.com/image/concept/search/blue.svg"}) white no-repeat scroll center right 4px`,
|
|
43
47
|
backgroundSize: "24px",
|
|
44
48
|
} }) })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxSearch.js","sourceRoot":"","sources":["../../src/components/NSBoxSearch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"NSBoxSearch.js","sourceRoot":"","sources":["../../src/components/NSBoxSearch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAiBlD,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA6C;IAInF,YAAY,KAAuB;;QAElC,KAAK,CAAC,KAAK,CAAC,CAAC;QAJd,UAAK,GAAG,SAAS,EAAoB,CAAC;QACtC,yBAAoB,GAAG,SAAS,EAAmB,CAAC;QAInD,IAAI,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C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,OAAO,EAAE,GAAG,EAAE,eAAG,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,SAAS,mDAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE;oBACN,UAAU,EAAE,OAAO,6DAA6D,2CAA2C;oBAC3H,cAAc,EAAE,MAAM;iBACtB,GACA,IACe,CAClB,CAAC;IACH,CAAC;CACD"}
|
|
@@ -3,17 +3,18 @@ import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
|
3
3
|
import { IValidationProps } from "../props/IValidationProps";
|
|
4
4
|
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
5
5
|
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
6
|
+
import { INSBox } from "./INSBox";
|
|
6
7
|
export interface NSBoxStringProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<string, NSBoxString> {
|
|
7
8
|
}
|
|
8
9
|
export interface NSBoxStringState {
|
|
9
|
-
value: string;
|
|
10
|
+
value: string | null;
|
|
10
11
|
}
|
|
11
|
-
export declare class NSBoxString extends React.Component<NSBoxStringProps, NSBoxStringState> {
|
|
12
|
+
export declare class NSBoxString extends React.Component<NSBoxStringProps, NSBoxStringState> implements INSBox {
|
|
12
13
|
NSBoxBaseLayout_Main: React.RefObject<NSBoxBaseLayout>;
|
|
13
14
|
constructor(props: NSBoxStringProps);
|
|
15
|
+
isEmpty(value: string): boolean;
|
|
14
16
|
getError(): string | null;
|
|
15
|
-
getValue(checkError?: boolean): string;
|
|
16
|
-
setValue(value: string, callback?: () => void): void;
|
|
17
|
-
private onChanged;
|
|
17
|
+
getValue(checkError?: boolean): string | null;
|
|
18
|
+
setValue(value: string | null, callback?: () => void): void;
|
|
18
19
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
}
|
|
@@ -5,16 +5,22 @@ import { Validator } from "../Validator";
|
|
|
5
5
|
import StylesNSBox from "./NSBox.module.css";
|
|
6
6
|
import { NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
7
7
|
import { NamingConvention } from "namirasoft-core";
|
|
8
|
+
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
8
9
|
export class NSBoxString extends React.Component {
|
|
9
10
|
constructor(props) {
|
|
10
11
|
var _a;
|
|
11
12
|
super(props);
|
|
12
13
|
this.NSBoxBaseLayout_Main = createRef();
|
|
13
|
-
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a :
|
|
14
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : null };
|
|
15
|
+
this.isEmpty = this.isEmpty.bind(this);
|
|
14
16
|
this.getError = this.getError.bind(this);
|
|
15
17
|
this.getValue = this.getValue.bind(this);
|
|
16
18
|
this.setValue = this.setValue.bind(this);
|
|
17
|
-
|
|
19
|
+
}
|
|
20
|
+
isEmpty(value) {
|
|
21
|
+
if ((value !== null && value !== void 0 ? value : "").trim())
|
|
22
|
+
return false;
|
|
23
|
+
return true;
|
|
18
24
|
}
|
|
19
25
|
getError() {
|
|
20
26
|
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
@@ -25,19 +31,17 @@ export class NSBoxString extends React.Component {
|
|
|
25
31
|
}
|
|
26
32
|
setValue(value, callback) {
|
|
27
33
|
this.setState({ value }, () => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
callback();
|
|
34
|
+
var _a, _b;
|
|
35
|
+
(_b = (_a = this.props).onChanged) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
36
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
32
37
|
});
|
|
33
38
|
}
|
|
34
|
-
onChanged(e) {
|
|
35
|
-
this.setValue(e.target.value);
|
|
36
|
-
}
|
|
37
39
|
render() {
|
|
38
|
-
var _a;
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
var _a, _b;
|
|
41
|
+
let menu = safeMenuMenuItem(this.props, () => { });
|
|
42
|
+
menu.builtin.copy = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; } };
|
|
43
|
+
menu.builtin.fullscreen = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; }, setValue: this.setValue };
|
|
44
|
+
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, children: _jsx("input", { id: this.props.id, name: this.props.name, type: "text", className: StylesNSBox.ns_box_input, placeholder: (_a = this.props.placeholder) !== null && _a !== void 0 ? _a : `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`, value: (_b = this.state.value) !== null && _b !== void 0 ? _b : "", onChange: e => this.setValue(e.target.value), onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, minLength: this.props.min_length, maxLength: this.props.max_length, style: {
|
|
41
45
|
background: `url("https://static.namirasoft.com/image/concept/type/string.png") white no-repeat scroll center right 4px`,
|
|
42
46
|
backgroundSize: "24px"
|
|
43
47
|
} }) })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxString.js","sourceRoot":"","sources":["../../src/components/NSBoxString.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"NSBoxString.js","sourceRoot":"","sources":["../../src/components/NSBoxString.tsx"],"names":[],"mappings":"AAAA,YAAY,CA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EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,WAAW,CAAC,YAAY,EACnC,WAAW,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,WAAW,mCAAI,gBAAgB,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,EAC3I,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,EAAE,EAC7B,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,OAAO,EAAE,GAAG,EAAE,eAAG,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,SAAS,mDAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAChD,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAChC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAChC,KAAK,EAAE;oBACN,UAAU,EAAE,4GAA4G;oBACxH,cAAc,EAAE,MAAM;iBACtB,GACA,IACe,CAClB,CAAC;IACH,CAAC;CACD"}
|
|
@@ -3,20 +3,21 @@ import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
|
3
3
|
import { IValidationProps } from "../props/IValidationProps";
|
|
4
4
|
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
5
5
|
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
6
|
+
import { INSBox } from "./INSBox";
|
|
6
7
|
export interface NSBoxTextAreaProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<string, NSBoxTextArea> {
|
|
7
8
|
cols?: number;
|
|
8
9
|
rows?: number;
|
|
9
10
|
}
|
|
10
11
|
export interface NSBoxTextAreaState {
|
|
11
|
-
value: string;
|
|
12
|
+
value: string | null;
|
|
12
13
|
}
|
|
13
|
-
export declare class NSBoxTextArea extends React.Component<NSBoxTextAreaProps, NSBoxTextAreaState> {
|
|
14
|
+
export declare class NSBoxTextArea extends React.Component<NSBoxTextAreaProps, NSBoxTextAreaState> implements INSBox {
|
|
14
15
|
NSBoxBaseLayout_Main: React.RefObject<NSBoxBaseLayout>;
|
|
15
16
|
textarea: React.RefObject<HTMLTextAreaElement>;
|
|
16
17
|
constructor(props: NSBoxTextAreaProps);
|
|
18
|
+
isEmpty(value: string): boolean;
|
|
17
19
|
getError(): string | null;
|
|
18
|
-
getValue(checkError?: boolean): string;
|
|
19
|
-
setValue(value: string, callback?: () => void): void;
|
|
20
|
-
private onChanged;
|
|
20
|
+
getValue(checkError?: boolean): string | null;
|
|
21
|
+
setValue(value: string | null, callback?: () => void): void;
|
|
21
22
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
3
|
import React, { createRef } from "react";
|
|
13
4
|
import Styles from "./NSBoxTextArea.module.css";
|
|
14
5
|
import { Validator } from "../Validator";
|
|
15
6
|
import { NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
16
7
|
import { NamingConvention } from "namirasoft-core";
|
|
8
|
+
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
17
9
|
export class NSBoxTextArea extends React.Component {
|
|
18
10
|
constructor(props) {
|
|
19
11
|
var _a;
|
|
20
12
|
super(props);
|
|
21
13
|
this.NSBoxBaseLayout_Main = createRef();
|
|
22
14
|
this.textarea = createRef();
|
|
23
|
-
this.
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
15
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : null };
|
|
16
|
+
this.isEmpty = this.isEmpty.bind(this);
|
|
27
17
|
this.getError = this.getError.bind(this);
|
|
28
18
|
this.getValue = this.getValue.bind(this);
|
|
29
19
|
this.setValue = this.setValue.bind(this);
|
|
30
|
-
|
|
20
|
+
}
|
|
21
|
+
isEmpty(value) {
|
|
22
|
+
if ((value !== null && value !== void 0 ? value : "").trim())
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
31
25
|
}
|
|
32
26
|
getError() {
|
|
33
27
|
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
@@ -38,16 +32,17 @@ export class NSBoxTextArea extends React.Component {
|
|
|
38
32
|
}
|
|
39
33
|
setValue(value, callback) {
|
|
40
34
|
this.setState({ value }, () => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
callback();
|
|
35
|
+
var _a, _b;
|
|
36
|
+
(_b = (_a = this.props).onChanged) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
37
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
45
38
|
});
|
|
46
39
|
}
|
|
47
40
|
render() {
|
|
48
|
-
var _a, _b;
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
let menu = safeMenuMenuItem(this.props, () => { });
|
|
43
|
+
menu.builtin.copy = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; } };
|
|
44
|
+
menu.builtin.fullscreen = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; }, setValue: this.setValue };
|
|
45
|
+
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, children: _jsx("textarea", { ref: this.textarea, id: this.props.id, name: this.props.name, cols: this.props.cols, rows: (_a = this.props.rows) !== null && _a !== void 0 ? _a : 5, value: (_b = this.state.value) !== null && _b !== void 0 ? _b : "", className: Styles.ns_box_text_area, placeholder: (_c = this.props.placeholder) !== null && _c !== void 0 ? _c : `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`, onChange: e => this.setValue(e.target.value), onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, style: {
|
|
51
46
|
height: "100%",
|
|
52
47
|
background: `url("https://static.namirasoft.com/image/concept/type/string.png") white no-repeat scroll top right 4px `,
|
|
53
48
|
backgroundPositionY: "4px",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxTextArea.js","sourceRoot":"","sources":["../../src/components/NSBoxTextArea.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"NSBoxTextArea.js","sourceRoot":"","sources":["../../src/components/NSBoxTextArea.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAIhD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE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AC,EAC1B,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,EAAE,EAC7B,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAClC,WAAW,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,WAAW,mCAAI,gBAAgB,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,EAC3I,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,OAAO,EAAE,GAAG,EAAE,eAAG,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,SAAS,mDAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE;oBACN,MAAM,EAAE,MAAM;oBACd,UAAU,EAAE,0GAA0G;oBACtH,mBAAmB,EAAE,KAAK;oBAC1B,cAAc,EAAE,MAAM;iBACtB,GACA,IACe,CAClB,CAAC;IACH,CAAC;CACD"}
|
|
@@ -4,16 +4,18 @@ import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
|
4
4
|
import { IValidationProps } from "../props/IValidationProps";
|
|
5
5
|
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
6
6
|
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
7
|
+
import { INSBox } from "./INSBox";
|
|
7
8
|
export interface NSBoxTimeProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<string, NSBoxTime> {
|
|
8
9
|
}
|
|
9
10
|
export interface NSBoxTimeState {
|
|
10
|
-
value: string;
|
|
11
|
+
value: string | null;
|
|
11
12
|
}
|
|
12
|
-
export declare class NSBoxTime extends React.Component<NSBoxTimeProps, NSBoxTimeState> {
|
|
13
|
+
export declare class NSBoxTime extends React.Component<NSBoxTimeProps, NSBoxTimeState> implements INSBox {
|
|
13
14
|
NSBoxBaseLayout_Main: React.RefObject<NSBoxBaseLayout>;
|
|
14
15
|
constructor(props: NSBoxTimeProps);
|
|
16
|
+
isEmpty(value: string): boolean;
|
|
15
17
|
getError(): string | null;
|
|
16
|
-
getValue(checkError?: boolean): string;
|
|
17
|
-
setValue(value: string, callback?: () => void): void;
|
|
18
|
+
getValue(checkError?: boolean): string | null;
|
|
19
|
+
setValue(value: string | null, callback?: () => void): void;
|
|
18
20
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
}
|
|
@@ -12,11 +12,17 @@ export class NSBoxTime extends React.Component {
|
|
|
12
12
|
var _a;
|
|
13
13
|
super(props);
|
|
14
14
|
this.NSBoxBaseLayout_Main = createRef();
|
|
15
|
-
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a :
|
|
15
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : null };
|
|
16
|
+
this.isEmpty = this.isEmpty.bind(this);
|
|
16
17
|
this.getError = this.getError.bind(this);
|
|
17
18
|
this.getValue = this.getValue.bind(this);
|
|
18
19
|
this.setValue = this.setValue.bind(this);
|
|
19
20
|
}
|
|
21
|
+
isEmpty(value) {
|
|
22
|
+
if ((value !== null && value !== void 0 ? value : "").trim())
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
20
26
|
getError() {
|
|
21
27
|
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
22
28
|
Validator.getErrorString(this.props.title, this.state.value, this.props) ||
|
|
@@ -27,18 +33,16 @@ export class NSBoxTime extends React.Component {
|
|
|
27
33
|
}
|
|
28
34
|
setValue(value, callback) {
|
|
29
35
|
this.setState({ value }, () => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
callback();
|
|
36
|
+
var _a, _b;
|
|
37
|
+
(_b = (_a = this.props).onChanged) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
38
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
34
39
|
});
|
|
35
40
|
}
|
|
36
41
|
render() {
|
|
37
|
-
var _a;
|
|
42
|
+
var _a, _b;
|
|
38
43
|
let menu = safeMenuMenuItem(this.props, () => { });
|
|
39
|
-
menu.builtin.
|
|
40
|
-
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, {
|
|
41
|
-
this.props.onClicked(this); }, step: "5", style: {
|
|
44
|
+
menu.builtin.copy = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; } };
|
|
45
|
+
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, children: _jsx("input", { id: this.props.id, name: this.props.name, type: "time", className: StylesNSBox.ns_box_input, placeholder: (_a = this.props.placeholder) !== null && _a !== void 0 ? _a : `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`, value: (_b = this.state.value) !== null && _b !== void 0 ? _b : "", onChange: e => this.setValue(e.target.value), onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, step: "5", style: {
|
|
42
46
|
background: `url("https://static.namirasoft.com/image/concept/type/time.png") white no-repeat scroll center right 4px`,
|
|
43
47
|
backgroundSize: "24px",
|
|
44
48
|
paddingRight: "7px"
|