namirasoft-site-react 1.3.310 → 1.3.313
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/.dockerignore +87 -0
- package/Dockerfile +19 -0
- package/dist/App.d.ts +9 -0
- package/dist/App.js +96 -0
- package/dist/App.js.map +1 -0
- package/dist/CopyToClipboard.d.ts +3 -0
- package/dist/CopyToClipboard.js +7 -0
- package/dist/CopyToClipboard.js.map +1 -0
- package/dist/Validator.d.ts +14 -0
- package/dist/Validator.js +94 -0
- package/dist/Validator.js.map +1 -0
- package/dist/components/NSActionMenu.d.ts +14 -0
- package/dist/components/NSActionMenu.js +33 -0
- package/dist/components/NSActionMenu.js.map +1 -0
- package/dist/components/NSAssistantButton.d.ts +6 -0
- package/dist/components/NSAssistantButton.js +20 -0
- package/dist/components/NSAssistantButton.js.map +1 -0
- package/dist/components/NSBarAction.d.ts +12 -0
- package/dist/components/NSBarAction.js +20 -0
- package/dist/components/NSBarAction.js.map +1 -0
- package/dist/components/NSBarHeroBanner.d.ts +7 -0
- package/dist/components/NSBarHeroBanner.js +8 -0
- package/dist/components/NSBarHeroBanner.js.map +1 -0
- package/dist/components/NSBarNotification.d.ts +21 -0
- package/dist/components/NSBarNotification.js +37 -0
- package/dist/components/NSBarNotification.js.map +1 -0
- package/dist/components/NSBarTitle.d.ts +5 -0
- package/dist/components/NSBarTitle.js +11 -0
- package/dist/components/NSBarTitle.js.map +1 -0
- package/dist/components/NSBoxBoolean.d.ts +23 -0
- package/dist/components/NSBoxBoolean.js +40 -0
- package/dist/components/NSBoxBoolean.js.map +1 -0
- package/dist/components/NSBoxCombo.d.ts +33 -0
- package/dist/components/NSBoxCombo.js +65 -0
- package/dist/components/NSBoxCombo.js.map +1 -0
- package/dist/components/NSBoxDate.d.ts +22 -0
- package/dist/components/NSBoxDate.js +42 -0
- package/dist/components/NSBoxDate.js.map +1 -0
- package/dist/components/NSBoxDateTime.d.ts +22 -0
- package/dist/components/NSBoxDateTime.js +42 -0
- package/dist/components/NSBoxDateTime.js.map +1 -0
- package/dist/components/NSBoxDouble.d.ts +23 -0
- package/dist/components/NSBoxDouble.js +42 -0
- package/dist/components/NSBoxDouble.js.map +1 -0
- package/dist/components/NSBoxDuration.d.ts +24 -0
- package/dist/components/NSBoxDuration.js +43 -0
- package/dist/components/NSBoxDuration.js.map +1 -0
- package/dist/components/NSBoxEmail.d.ts +25 -0
- package/dist/components/NSBoxEmail.js +50 -0
- package/dist/components/NSBoxEmail.js.map +1 -0
- package/dist/components/NSBoxEntity.d.ts +42 -0
- package/dist/components/NSBoxEntity.js +86 -0
- package/dist/components/NSBoxEntity.js.map +1 -0
- package/dist/components/NSBoxEnum.d.ts +19 -0
- package/dist/components/NSBoxEnum.js +46 -0
- package/dist/components/NSBoxEnum.js.map +1 -0
- package/dist/components/NSBoxErrorNotifier.d.ts +6 -0
- package/dist/components/NSBoxErrorNotifier.js +11 -0
- package/dist/components/NSBoxErrorNotifier.js.map +1 -0
- package/dist/components/NSBoxIPV4.d.ts +23 -0
- package/dist/components/NSBoxIPV4.js +45 -0
- package/dist/components/NSBoxIPV4.js.map +1 -0
- package/dist/components/NSBoxIPV6.d.ts +23 -0
- package/dist/components/NSBoxIPV6.js +45 -0
- package/dist/components/NSBoxIPV6.js.map +1 -0
- package/dist/components/NSBoxInteger.d.ts +23 -0
- package/dist/components/NSBoxInteger.js +42 -0
- package/dist/components/NSBoxInteger.js.map +1 -0
- package/dist/components/NSBoxLabel.d.ts +12 -0
- package/dist/components/NSBoxLabel.js +11 -0
- package/dist/components/NSBoxLabel.js.map +1 -0
- package/dist/components/NSBoxOTP.d.ts +9 -0
- package/dist/components/NSBoxOTP.js +34 -0
- package/dist/components/NSBoxOTP.js.map +1 -0
- package/dist/components/NSBoxPassword.d.ts +23 -0
- package/dist/components/NSBoxPassword.js +43 -0
- package/dist/components/NSBoxPassword.js.map +1 -0
- package/dist/components/NSBoxPhone.d.ts +25 -0
- package/dist/components/NSBoxPhone.js +45 -0
- package/dist/components/NSBoxPhone.js.map +1 -0
- package/dist/components/NSBoxPrice.d.ts +23 -0
- package/dist/components/NSBoxPrice.js +42 -0
- package/dist/components/NSBoxPrice.js.map +1 -0
- package/dist/components/NSBoxSearch.d.ts +25 -0
- package/dist/components/NSBoxSearch.js +52 -0
- package/dist/components/NSBoxSearch.js.map +1 -0
- package/dist/components/NSBoxString.d.ts +25 -0
- package/dist/components/NSBoxString.js +48 -0
- package/dist/components/NSBoxString.js.map +1 -0
- package/dist/components/NSBoxTextArea.d.ts +27 -0
- package/dist/components/NSBoxTextArea.js +60 -0
- package/dist/components/NSBoxTextArea.js.map +1 -0
- package/dist/components/NSBoxTime.d.ts +23 -0
- package/dist/components/NSBoxTime.js +44 -0
- package/dist/components/NSBoxTime.js.map +1 -0
- package/dist/components/NSButton.d.ts +9 -0
- package/dist/components/NSButton.js +8 -0
- package/dist/components/NSButton.js.map +1 -0
- package/dist/components/NSButtonBlue.d.ts +2 -0
- package/dist/components/NSButtonBlue.js +11 -0
- package/dist/components/NSButtonBlue.js.map +1 -0
- package/dist/components/NSButtonGreen.d.ts +2 -0
- package/dist/components/NSButtonGreen.js +11 -0
- package/dist/components/NSButtonGreen.js.map +1 -0
- package/dist/components/NSButtonRed.d.ts +2 -0
- package/dist/components/NSButtonRed.js +11 -0
- package/dist/components/NSButtonRed.js.map +1 -0
- package/dist/components/NSCard.d.ts +14 -0
- package/dist/components/NSCard.js +18 -0
- package/dist/components/NSCard.js.map +1 -0
- package/dist/components/NSCopyToClipboard.d.ts +6 -0
- package/dist/components/NSCopyToClipboard.js +12 -0
- package/dist/components/NSCopyToClipboard.js.map +1 -0
- package/dist/components/NSElectronicCard.d.ts +9 -0
- package/dist/components/NSElectronicCard.js +13 -0
- package/dist/components/NSElectronicCard.js.map +1 -0
- package/dist/components/NSEntityBar.d.ts +8 -0
- package/dist/components/NSEntityBar.js +7 -0
- package/dist/components/NSEntityBar.js.map +1 -0
- package/dist/components/NSEntityCardBackground.d.ts +7 -0
- package/dist/components/NSEntityCardBackground.js +9 -0
- package/dist/components/NSEntityCardBackground.js.map +1 -0
- package/dist/components/NSFilterBox.d.ts +61 -0
- package/dist/components/NSFilterBox.js +230 -0
- package/dist/components/NSFilterBox.js.map +1 -0
- package/dist/components/NSFilterBoxDialog.d.ts +12 -0
- package/dist/components/NSFilterBoxDialog.js +17 -0
- package/dist/components/NSFilterBoxDialog.js.map +1 -0
- package/dist/components/NSFilterItem.d.ts +17 -0
- package/dist/components/NSFilterItem.js +30 -0
- package/dist/components/NSFilterItem.js.map +1 -0
- package/dist/components/NSFooter.d.ts +20 -0
- package/dist/components/NSFooter.js +56 -0
- package/dist/components/NSFooter.js.map +1 -0
- package/dist/components/NSGroupedList.d.ts +31 -0
- package/dist/components/NSGroupedList.js +42 -0
- package/dist/components/NSGroupedList.js.map +1 -0
- package/dist/components/NSHeader.d.ts +26 -0
- package/dist/components/NSHeader.js +81 -0
- package/dist/components/NSHeader.js.map +1 -0
- package/dist/components/NSLayout.d.ts +22 -0
- package/dist/components/NSLayout.js +30 -0
- package/dist/components/NSLayout.js.map +1 -0
- package/dist/components/NSLine.d.ts +4 -0
- package/dist/components/NSLine.js +6 -0
- package/dist/components/NSLine.js.map +1 -0
- package/dist/components/NSLink.d.ts +5 -0
- package/dist/components/NSLink.js +7 -0
- package/dist/components/NSLink.js.map +1 -0
- package/dist/components/NSLinkBlue.d.ts +2 -0
- package/dist/components/NSLinkBlue.js +13 -0
- package/dist/components/NSLinkBlue.js.map +1 -0
- package/dist/components/NSLinkGreen.d.ts +2 -0
- package/dist/components/NSLinkGreen.js +6 -0
- package/dist/components/NSLinkGreen.js.map +1 -0
- package/dist/components/NSLinkRed.d.ts +2 -0
- package/dist/components/NSLinkRed.js +6 -0
- package/dist/components/NSLinkRed.js.map +1 -0
- package/dist/components/NSLoading.d.ts +4 -0
- package/dist/components/NSLoading.js +7 -0
- package/dist/components/NSLoading.js.map +1 -0
- package/dist/components/NSModal.d.ts +10 -0
- package/dist/components/NSModal.js +13 -0
- package/dist/components/NSModal.js.map +1 -0
- package/dist/components/NSNoData.d.ts +5 -0
- package/dist/components/NSNoData.js +7 -0
- package/dist/components/NSNoData.js.map +1 -0
- package/dist/components/NSPagination.d.ts +20 -0
- package/dist/components/NSPagination.js +82 -0
- package/dist/components/NSPagination.js.map +1 -0
- package/dist/components/NSPanel.d.ts +7 -0
- package/dist/components/NSPanel.js +7 -0
- package/dist/components/NSPanel.js.map +1 -0
- package/dist/components/NSPrintModal.d.ts +15 -0
- package/dist/components/NSPrintModal.js +35 -0
- package/dist/components/NSPrintModal.js.map +1 -0
- package/dist/components/NSRadioButton.d.ts +5 -0
- package/dist/components/NSRadioButton.js +15 -0
- package/dist/components/NSRadioButton.js.map +1 -0
- package/dist/components/NSSection.d.ts +7 -0
- package/dist/components/NSSection.js +10 -0
- package/dist/components/NSSection.js.map +1 -0
- package/dist/components/NSSectionBars.d.ts +7 -0
- package/dist/components/NSSectionBars.js +10 -0
- package/dist/components/NSSectionBars.js.map +1 -0
- package/dist/components/NSSectionCards.d.ts +13 -0
- package/dist/components/NSSectionCards.js +15 -0
- package/dist/components/NSSectionCards.js.map +1 -0
- package/dist/components/NSSectionTitle.d.ts +7 -0
- package/dist/components/NSSectionTitle.js +8 -0
- package/dist/components/NSSectionTitle.js.map +1 -0
- package/dist/components/NSSpace.d.ts +17 -0
- package/dist/components/NSSpace.js +19 -0
- package/dist/components/NSSpace.js.map +1 -0
- package/dist/components/NSTabPage.d.ts +13 -0
- package/dist/components/NSTabPage.js +9 -0
- package/dist/components/NSTabPage.js.map +1 -0
- package/dist/components/NSTable.d.ts +50 -0
- package/dist/components/NSTable.js +154 -0
- package/dist/components/NSTable.js.map +1 -0
- package/dist/components/NSTable.module.css +3 -3
- package/dist/components/NSTag.d.ts +2 -0
- package/dist/components/NSTag.js +22 -0
- package/dist/components/NSTag.js.map +1 -0
- package/dist/components/NSTitle.d.ts +5 -0
- package/dist/components/NSTitle.js +7 -0
- package/dist/components/NSTitle.js.map +1 -0
- package/dist/components/NSVerification.d.ts +9 -0
- package/dist/components/NSVerification.js +19 -0
- package/dist/components/NSVerification.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +81 -0
- package/dist/main.js +82 -0
- package/dist/main.js.map +1 -0
- package/dist/pages/NSLoginPage.d.ts +6 -0
- package/dist/pages/NSLoginPage.js +8 -0
- package/dist/pages/NSLoginPage.js.map +1 -0
- package/dist/pages/NSNotFoundPage.d.ts +1 -0
- package/dist/pages/NSNotFoundPage.js +7 -0
- package/dist/pages/NSNotFoundPage.js.map +1 -0
- package/dist/props/IBaseComponentProps.d.ts +7 -0
- package/dist/props/IBaseComponentProps.js +2 -0
- package/dist/props/IBaseComponentProps.js.map +1 -0
- package/dist/props/IHeaderIconProps.d.ts +8 -0
- package/dist/props/IHeaderIconProps.js +2 -0
- package/dist/props/IHeaderIconProps.js.map +1 -0
- package/dist/props/IHeaderProps.d.ts +5 -0
- package/dist/props/IHeaderProps.js +2 -0
- package/dist/props/IHeaderProps.js.map +1 -0
- package/dist/props/IImageProps.d.ts +4 -0
- package/dist/props/IImageProps.js +2 -0
- package/dist/props/IImageProps.js.map +1 -0
- package/dist/props/ILinkProps.d.ts +5 -0
- package/dist/props/ILinkProps.js +2 -0
- package/dist/props/ILinkProps.js.map +1 -0
- package/dist/props/IValidationNumberProps.d.ts +4 -0
- package/dist/props/IValidationNumberProps.js +2 -0
- package/dist/props/IValidationNumberProps.js.map +1 -0
- package/dist/props/IValidationProps.d.ts +6 -0
- package/dist/props/IValidationProps.js +2 -0
- package/dist/props/IValidationProps.js.map +1 -0
- package/dist/props/IValidationRegexProps.d.ts +4 -0
- package/dist/props/IValidationRegexProps.js +2 -0
- package/dist/props/IValidationRegexProps.js.map +1 -0
- package/dist/props/IValidationStringProps.d.ts +4 -0
- package/dist/props/IValidationStringProps.js +2 -0
- package/dist/props/IValidationStringProps.js.map +1 -0
- package/dist/routing/INSRouterMaker.d.ts +5 -0
- package/dist/routing/INSRouterMaker.js +2 -0
- package/dist/routing/INSRouterMaker.js.map +1 -0
- package/dist/routing/INSRouterProps.d.ts +4 -0
- package/dist/routing/INSRouterProps.js +2 -0
- package/dist/routing/INSRouterProps.js.map +1 -0
- package/dist/routing/INSRouterState.d.ts +4 -0
- package/dist/routing/INSRouterState.js +2 -0
- package/dist/routing/INSRouterState.js.map +1 -0
- package/dist/routing/NSRouterMaker.d.ts +11 -0
- package/dist/routing/NSRouterMaker.js +23 -0
- package/dist/routing/NSRouterMaker.js.map +1 -0
- package/dist/routing/Notifier.d.ts +16 -0
- package/dist/routing/Notifier.js +68 -0
- package/dist/routing/Notifier.js.map +1 -0
- package/package.json +1 -1
- package/src/components/NSTable.module.css +3 -3
- package/src/components/NSTable.tsx +1 -1
- package/tsconfig.json +7 -8
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
5
|
+
export interface INSBoxBooleanProps extends IBaseComponentProps, IValidationProps, IValidationStringProps {
|
|
6
|
+
title: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
defaultValue?: boolean;
|
|
9
|
+
onChanged?: (e: NSBoxBoolean) => void;
|
|
10
|
+
onClicked?: (e: NSBoxBoolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface INSBoxBooelanState {
|
|
13
|
+
value: boolean;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NSBoxBoolean extends React.Component<INSBoxBooleanProps, INSBoxBooelanState> {
|
|
17
|
+
constructor(props: INSBoxBooleanProps);
|
|
18
|
+
getError(): string | null;
|
|
19
|
+
getValue(): boolean;
|
|
20
|
+
setValue(value: boolean): void;
|
|
21
|
+
private onChanged;
|
|
22
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBoxBoolean.module.css";
|
|
5
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
6
|
+
export class NSBoxBoolean extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
var _a;
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : false };
|
|
11
|
+
this.getValue = this.getValue.bind(this);
|
|
12
|
+
this.setValue = this.setValue.bind(this);
|
|
13
|
+
this.onChanged = this.onChanged.bind(this);
|
|
14
|
+
}
|
|
15
|
+
getError() {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
getValue() {
|
|
19
|
+
let error = this.getError();
|
|
20
|
+
if (error) {
|
|
21
|
+
this.setState({ error });
|
|
22
|
+
throw new Error(error);
|
|
23
|
+
}
|
|
24
|
+
return this.state.value;
|
|
25
|
+
}
|
|
26
|
+
setValue(value) {
|
|
27
|
+
this.setState({ value }, () => {
|
|
28
|
+
if (this.props.onChanged)
|
|
29
|
+
this.props.onChanged(this);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
onChanged(e) {
|
|
33
|
+
this.setValue(e.target.checked);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: _jsxs("div", { className: Styles.ns_checkbox_parent, children: [_jsx("input", { type: "checkbox", name: this.props.name, className: Styles.ns_input, checked: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked }), _jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("label", { className: "ns-font-16-normal", htmlFor: this.props.id, children: this.props.name })] }) }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=NSBoxBoolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxBoolean.js","sourceRoot":"","sources":["../../src/components/NSBoxBoolean.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAI/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiB1D,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAiD;IAExF,YAAY,KAAyB;;QAEpC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,KAAK,EAAE,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,QAAQ;QAEP,OAAO,IAAI,CAAC;IACb,CAAC;IACD,QAAQ;QAEP,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC5B,IAAI,KAAK,EACT;YACC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YACzB,MAAM,IAAI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AAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,YACzD,IAAI,CAAC,KAAK,CAAC,IAAI,GACT,IACH,GACD,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
import { BaseOptionType } from "antd/es/select";
|
|
5
|
+
export interface INSBoxComboOption extends BaseOptionType {
|
|
6
|
+
desc: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
export interface INSBoxComboProps extends IBaseComponentProps, IValidationProps {
|
|
10
|
+
title: string;
|
|
11
|
+
options: INSBoxComboOption[];
|
|
12
|
+
multiple: boolean;
|
|
13
|
+
customClass?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
onChanged?: (e: NSBoxCombo) => void;
|
|
17
|
+
searchable?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface INSBoxComboState {
|
|
20
|
+
value: string | null;
|
|
21
|
+
values: string[];
|
|
22
|
+
error?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class NSBoxCombo extends React.Component<INSBoxComboProps, INSBoxComboState> {
|
|
25
|
+
constructor(props: INSBoxComboProps);
|
|
26
|
+
getError(value: string): string | null;
|
|
27
|
+
getValue(): string | null;
|
|
28
|
+
getValues(): string[];
|
|
29
|
+
setValue(value: string | null): void;
|
|
30
|
+
setValues(values: string[]): void;
|
|
31
|
+
onChange(value: string | null | string[]): void;
|
|
32
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBoxCombo.module.css";
|
|
5
|
+
import { Select, Space } from 'antd';
|
|
6
|
+
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
7
|
+
import { Validator } from "../Validator";
|
|
8
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
9
|
+
export class NSBoxCombo extends React.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = {
|
|
13
|
+
value: null,
|
|
14
|
+
values: [],
|
|
15
|
+
};
|
|
16
|
+
this.getValues = this.getValues.bind(this);
|
|
17
|
+
this.setValues = this.setValues.bind(this);
|
|
18
|
+
this.setValue = this.setValue.bind(this);
|
|
19
|
+
this.getValue = this.getValue.bind(this);
|
|
20
|
+
this.onChange = this.onChange.bind(this);
|
|
21
|
+
}
|
|
22
|
+
getError(value) {
|
|
23
|
+
return (Validator.getError(this.props.title, value, this.props));
|
|
24
|
+
}
|
|
25
|
+
getValue() {
|
|
26
|
+
let error = this.getError(this.state.value || "");
|
|
27
|
+
if (error) {
|
|
28
|
+
this.setState({ error });
|
|
29
|
+
throw new Error(error);
|
|
30
|
+
}
|
|
31
|
+
return this.state.value;
|
|
32
|
+
}
|
|
33
|
+
getValues() {
|
|
34
|
+
this.state.values.forEach(value => {
|
|
35
|
+
let error = this.getError(value || "");
|
|
36
|
+
if (error) {
|
|
37
|
+
this.setState({ error });
|
|
38
|
+
throw new Error(error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return this.state.values;
|
|
42
|
+
}
|
|
43
|
+
setValue(value) {
|
|
44
|
+
this.setState({ value }, () => {
|
|
45
|
+
if (this.props.onChanged)
|
|
46
|
+
this.props.onChanged(this);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
setValues(values) {
|
|
50
|
+
this.setState({ values }, () => {
|
|
51
|
+
if (this.props.onChanged)
|
|
52
|
+
this.props.onChanged(this);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
onChange(value) {
|
|
56
|
+
if (this.props.multiple)
|
|
57
|
+
this.setValues(value);
|
|
58
|
+
else
|
|
59
|
+
this.setValue(value);
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${this.props.customClass}`, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx(Select, { showSearch: this.props.searchable != false ? true : undefined, mode: this.props.multiple ? "multiple" : undefined, className: Styles.ns_input_select, placeholder: this.props.placeholder, onChange: this.onChange, optionLabelProp: "label", options: this.props.options, defaultValue: this.props.defaultValue, optionRender: (option) => (_jsx(Space, { className: Styles.ns_input_select_option, children: option.data.desc })), suffixIcon: _jsx("img", { src: IconSelectBox, alt: "SelectBox Icon" }) }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }) }));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=NSBoxCombo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxCombo.js","sourceRoot":"","sources":["../../src/components/NSBoxCombo.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,s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,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,KAAC,MAAM,IACN,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAC7D,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,MAAM,CAAC,eAAe,EACjC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,eAAe,EAAC,OAAO,EACvB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EACrC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACzB,KAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,sBAAsB,YAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,GACV,CACR,EACD,UAAU,EAAE,cAAK,GAAG,EAAE,aAAa,EAAE,GAAG,EAAC,gBAAgB,GAAG,GAC3D,EACF,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC1F,GACJ,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
export interface INSBoxDateProps extends IBaseComponentProps, IValidationProps {
|
|
5
|
+
title: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onChanged?: (e: NSBoxDate) => void;
|
|
9
|
+
onClicked?: (e: NSBoxDate) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface INSBoxDateState {
|
|
12
|
+
value: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class NSBoxDate extends React.Component<INSBoxDateProps, INSBoxDateState> {
|
|
16
|
+
constructor(props: INSBoxDateProps);
|
|
17
|
+
getError(): string | null;
|
|
18
|
+
getValue(): string;
|
|
19
|
+
setValue(value: string): void;
|
|
20
|
+
private onChanged;
|
|
21
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBoxDate.module.css";
|
|
5
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
export class NSBoxDate extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
var _a;
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
12
|
+
this.setValue = this.setValue.bind(this);
|
|
13
|
+
this.getValue = this.getValue.bind(this);
|
|
14
|
+
this.onChanged = this.onChanged.bind(this);
|
|
15
|
+
}
|
|
16
|
+
getError() {
|
|
17
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
18
|
+
Validator.getErrorDate(this.props.title, this.state.value));
|
|
19
|
+
}
|
|
20
|
+
getValue() {
|
|
21
|
+
let error = this.getError();
|
|
22
|
+
if (error) {
|
|
23
|
+
this.setState({ error });
|
|
24
|
+
throw new Error(error);
|
|
25
|
+
}
|
|
26
|
+
return this.state.value;
|
|
27
|
+
}
|
|
28
|
+
setValue(value) {
|
|
29
|
+
this.setState({ value }, () => {
|
|
30
|
+
if (this.props.onChanged)
|
|
31
|
+
this.props.onChanged(this);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
onChanged(e) {
|
|
35
|
+
this.setValue(e.target.value);
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "date", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=NSBoxDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxDate.js","sourceRoot":"","sources":["../../src/components/NSBoxDate.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiBzC,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,SAA2C;IAE/E,YAAY,KAAsB;;QAEjC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;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,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aACzH,gBAAM,SAAS,EAAE,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,gBACC,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAClC,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
export interface INSBoxDateTimeProps extends IBaseComponentProps, IValidationProps {
|
|
5
|
+
title: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onChanged?: (e: NSBoxDateTime) => void;
|
|
9
|
+
onClicked?: (e: NSBoxDateTime) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface INSBoxDateTimeState {
|
|
12
|
+
value: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class NSBoxDateTime extends React.Component<INSBoxDateTimeProps, INSBoxDateTimeState> {
|
|
16
|
+
constructor(props: INSBoxDateTimeProps);
|
|
17
|
+
getError(): string | null;
|
|
18
|
+
getValue(): string;
|
|
19
|
+
setValue(value: string): void;
|
|
20
|
+
private onChanged;
|
|
21
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBoxDate.module.css";
|
|
5
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
export class NSBoxDateTime extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
var _a;
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
12
|
+
this.setValue = this.setValue.bind(this);
|
|
13
|
+
this.getValue = this.getValue.bind(this);
|
|
14
|
+
this.onChanged = this.onChanged.bind(this);
|
|
15
|
+
}
|
|
16
|
+
getError() {
|
|
17
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
18
|
+
Validator.getErrorDate(this.props.title, this.state.value));
|
|
19
|
+
}
|
|
20
|
+
getValue() {
|
|
21
|
+
let error = this.getError();
|
|
22
|
+
if (error) {
|
|
23
|
+
this.setState({ error });
|
|
24
|
+
throw new Error(error);
|
|
25
|
+
}
|
|
26
|
+
return this.state.value;
|
|
27
|
+
}
|
|
28
|
+
setValue(value) {
|
|
29
|
+
this.setState({ value }, () => {
|
|
30
|
+
if (this.props.onChanged)
|
|
31
|
+
this.props.onChanged(this);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
onChanged(e) {
|
|
35
|
+
this.setValue(e.target.value);
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "datetime-local", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=NSBoxDateTime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxDateTime.js","sourceRoot":"","sources":["../../src/components/NSBoxDateTime.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiBzC,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAmD;IAE3F,YAAY,KAA0B;;QAErC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAA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AE,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,gBACC,IAAI,EAAC,gBAAgB,EACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAClC,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
import { IValidationNumberProps } from "../props/IValidationNumberProps";
|
|
5
|
+
export interface INSBoxDoubleProps extends IBaseComponentProps, IValidationProps, IValidationNumberProps {
|
|
6
|
+
title: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
defaultValue?: number;
|
|
9
|
+
onChanged?: (e: NSBoxDouble) => void;
|
|
10
|
+
onClicked?: (e: NSBoxDouble) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface INSBoxDoubleState {
|
|
13
|
+
value?: number;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NSBoxDouble extends React.Component<INSBoxDoubleProps, INSBoxDoubleState> {
|
|
17
|
+
constructor(props: INSBoxDoubleProps);
|
|
18
|
+
getError(): string | null;
|
|
19
|
+
getValue(): number | undefined;
|
|
20
|
+
setValue(value: number | undefined): void;
|
|
21
|
+
private onChanged;
|
|
22
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBox.module.css";
|
|
5
|
+
import IconInputFloat from '../assets/images/icon-input-float.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
8
|
+
export class NSBoxDouble extends React.Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = { value: props.defaultValue };
|
|
12
|
+
this.setValue = this.setValue.bind(this);
|
|
13
|
+
this.getValue = this.getValue.bind(this);
|
|
14
|
+
this.onChanged = this.onChanged.bind(this);
|
|
15
|
+
}
|
|
16
|
+
getError() {
|
|
17
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
18
|
+
Validator.getErrorNumber(this.props.title, this.state.value, this.props));
|
|
19
|
+
}
|
|
20
|
+
getValue() {
|
|
21
|
+
let error = this.getError();
|
|
22
|
+
if (error) {
|
|
23
|
+
this.setState({ error });
|
|
24
|
+
throw new Error(error);
|
|
25
|
+
}
|
|
26
|
+
return this.state.value;
|
|
27
|
+
}
|
|
28
|
+
setValue(value) {
|
|
29
|
+
this.setState({ value }, () => {
|
|
30
|
+
if (this.props.onChanged)
|
|
31
|
+
this.props.onChanged(this);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
onChanged(e) {
|
|
35
|
+
this.setValue(parseFloat(e.target.value));
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "number", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, inputMode: "decimal", pattern: "[0-9]*[.,]?[0-9]*", style: { background: `url(${IconInputFloat}) white no-repeat scroll center right 16px` } })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=NSBoxDouble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxDouble.js","sourceRoot":"","sources":["../../src/components/NSBoxDouble.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,cAAc,MAAM,uCAAuC,CAAC;AAInE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiB1D,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA+C;IAErF,YAAY,KAAwB;QAEnC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,I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GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aACzH,gBAAM,SAAS,EAAE,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,gBACC,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,SAAS,EAAC,SAAS,EACnB,OAAO,EAAC,mBAAmB,EAC3B,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,cAAc,4CAA4C,EAAE,GACvF,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
import { IValidationNumberProps } from "../props/IValidationNumberProps";
|
|
5
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
6
|
+
export interface INSBoxDurationProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, IValidationNumberProps {
|
|
7
|
+
title: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onChanged?: (e: NSBoxDuration) => void;
|
|
11
|
+
onClicked?: (e: NSBoxDuration) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface INSBoxDurationState {
|
|
14
|
+
value: string;
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class NSBoxDuration extends React.Component<INSBoxDurationProps, INSBoxDurationState> {
|
|
18
|
+
constructor(props: INSBoxDurationProps);
|
|
19
|
+
getError(): string | null;
|
|
20
|
+
getValue(): string;
|
|
21
|
+
setValue(value: string): void;
|
|
22
|
+
private onChanged;
|
|
23
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBox.module.css";
|
|
5
|
+
import IconInputDuration from '../assets/images/icon-input-duration.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
8
|
+
export class NSBoxDuration extends React.Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
var _a;
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
13
|
+
this.getValue = this.getValue.bind(this);
|
|
14
|
+
this.setValue = this.setValue.bind(this);
|
|
15
|
+
this.onChanged = this.onChanged.bind(this);
|
|
16
|
+
}
|
|
17
|
+
getError() {
|
|
18
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
19
|
+
Validator.getErrorDuration(this.props.title, this.state.value));
|
|
20
|
+
}
|
|
21
|
+
getValue() {
|
|
22
|
+
let error = this.getError();
|
|
23
|
+
if (error) {
|
|
24
|
+
this.setState({ error });
|
|
25
|
+
throw new Error(error);
|
|
26
|
+
}
|
|
27
|
+
return this.state.value;
|
|
28
|
+
}
|
|
29
|
+
setValue(value) {
|
|
30
|
+
this.setState({ value }, () => {
|
|
31
|
+
if (this.props.onChanged)
|
|
32
|
+
this.props.onChanged(this);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
onChanged(e) {
|
|
36
|
+
this.setValue(e.target.value);
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
var _a;
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "time", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, step: "2", style: { background: `url(${IconInputDuration}) white no-repeat scroll center right 16px` } })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=NSBoxDuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxDuration.js","sourceRoot":"","sources":["../../src/components/NSBoxDuration.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,iBAAiB,MAAM,0CAA0C,CAAC;AAKzE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiB1D,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAmD;IAE3F,YAAY,KAA0B;;QAErC,KAAK,CAAC,KAAK,CA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C,KAAK,CAAC,CAAC;IAC/B,CAAC;IACQ,MAAM;;QAEd,OAAO,CACN,8BACC,eAAK,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,eAAe,MAAM,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aAC3H,gBAAM,SAAS,EAAE,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,gBACC,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,IAAI,EAAC,GAAG,EACR,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,iBAAiB,4CAA4C,EAAE,GAC1F,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
3
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
4
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
5
|
+
export interface INSBoxEmailProps extends IBaseComponentProps, IValidationProps, IValidationStringProps {
|
|
6
|
+
title: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface INSBoxEmailState {
|
|
12
|
+
value: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
isFullScreen: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class NSBoxEmail extends React.Component<INSBoxEmailProps, INSBoxEmailState> {
|
|
17
|
+
constructor(props: INSBoxEmailProps);
|
|
18
|
+
getError(): string | null;
|
|
19
|
+
getValue(): string;
|
|
20
|
+
setValue(value: string): void;
|
|
21
|
+
private onChanged;
|
|
22
|
+
private toggleFullScreen;
|
|
23
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
}
|
|
25
|
+
export default NSBoxEmail;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBox.module.css";
|
|
5
|
+
import IconInputEmail from '../assets/images/icon-input-email.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
8
|
+
import NSAssistantButton from "./NSAssistantButton";
|
|
9
|
+
export class NSBoxEmail extends React.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
var _a;
|
|
12
|
+
super(props);
|
|
13
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "", isFullScreen: false };
|
|
14
|
+
this.setValue = this.setValue.bind(this);
|
|
15
|
+
this.getValue = this.getValue.bind(this);
|
|
16
|
+
this.onChanged = this.onChanged.bind(this);
|
|
17
|
+
this.toggleFullScreen = this.toggleFullScreen.bind(this);
|
|
18
|
+
}
|
|
19
|
+
getError() {
|
|
20
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
21
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props) ||
|
|
22
|
+
Validator.getErrorEmail(this.props.title, this.state.value));
|
|
23
|
+
}
|
|
24
|
+
getValue() {
|
|
25
|
+
let error = this.getError();
|
|
26
|
+
if (error) {
|
|
27
|
+
this.setState({ error });
|
|
28
|
+
throw new Error(error);
|
|
29
|
+
}
|
|
30
|
+
return this.state.value;
|
|
31
|
+
}
|
|
32
|
+
setValue(value) {
|
|
33
|
+
this.setState({ value });
|
|
34
|
+
}
|
|
35
|
+
onChanged(e) {
|
|
36
|
+
this.setValue(e.target.value);
|
|
37
|
+
if (this.props.onChanged) {
|
|
38
|
+
this.props.onChanged(e);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
toggleFullScreen() {
|
|
42
|
+
this.setState(prevState => ({ isFullScreen: !prevState.isFullScreen }));
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
var _a;
|
|
46
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [_jsxs("span", { className: Styles.ns_input_title, children: [this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title] }), _jsx(NSAssistantButton, { value: this.state.value, setValue: this.setValue })] }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "email", className: Styles.ns_input, placeholder: this.props.placeholder, style: { background: `url(${IconInputEmail}) white no-repeat scroll center right 16px` } }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }) }));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default NSBoxEmail;
|
|
50
|
+
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CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAU,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,IAC5E,EACP,KAAC,iBAAiB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,IAClE,EACN,gBACC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,cAAc,4CAA4C,EAAE,GACvF,EACF,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC1F,GACJ,CACH,CAAC;IACH,CAAC;CACD;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
import { BaseOptionType } from "antd/es/select";
|
|
5
|
+
import { FilterItem } from "namirasoft-core";
|
|
6
|
+
interface INSBoxEntitOption extends BaseOptionType {
|
|
7
|
+
desc: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export interface INSBoxEntityProps<Data> extends IBaseComponentProps, IValidationProps {
|
|
11
|
+
title: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
onChanged?: (e: NSBoxEntity<Data>) => void;
|
|
15
|
+
onClicked?: (e: NSBoxEntity<Data>) => void;
|
|
16
|
+
multiple: boolean;
|
|
17
|
+
getItems: (filters: FilterItem[] | null, page: number | null, size: number | null) => Promise<{
|
|
18
|
+
count: number;
|
|
19
|
+
rows: Data[];
|
|
20
|
+
}>;
|
|
21
|
+
getValue: (item: Data) => string;
|
|
22
|
+
getText: (item: Data) => string;
|
|
23
|
+
}
|
|
24
|
+
export interface INSBoxEntityState<Data> {
|
|
25
|
+
items: Data[] | null;
|
|
26
|
+
items_string: INSBoxEntitOption[] | null;
|
|
27
|
+
value: Data | null;
|
|
28
|
+
values: Data[];
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class NSBoxEntity<Data> extends React.Component<INSBoxEntityProps<Data>, INSBoxEntityState<Data>> {
|
|
32
|
+
constructor(props: INSBoxEntityProps<Data>);
|
|
33
|
+
getError(value: Data | null): string | null;
|
|
34
|
+
getValue(): Data | null;
|
|
35
|
+
getValues(): Data[];
|
|
36
|
+
setValue(value: Data | null): void;
|
|
37
|
+
setValues(values: Data[]): void;
|
|
38
|
+
private onChanged;
|
|
39
|
+
componentDidMount(): void;
|
|
40
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
export {};
|