namirasoft-site-react 1.5.15 → 1.5.16
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.d.ts +1 -1
- package/dist/NSBoxBuilder.d.ts +25 -25
- package/dist/components/NSBanner.d.ts +1 -1
- package/dist/components/NSBarAction.d.ts +1 -1
- package/dist/components/NSBarAlert.d.ts +1 -1
- package/dist/components/NSBarNotification.d.ts +1 -1
- package/dist/components/NSBarTitle.d.ts +1 -1
- package/dist/components/NSBoxBaseCombo.d.ts +1 -1
- package/dist/components/NSBoxBaseLayout.d.ts +1 -1
- package/dist/components/NSBoxBaseLayoutRecursive.d.ts +1 -1
- package/dist/components/NSBoxBoolean.d.ts +1 -1
- package/dist/components/NSBoxBooleans.d.ts +1 -1
- package/dist/components/NSBoxColor.d.ts +1 -1
- package/dist/components/NSBoxCombo.d.ts +1 -1
- package/dist/components/NSBoxDate.d.ts +1 -1
- package/dist/components/NSBoxDateRange.d.ts +1 -1
- package/dist/components/NSBoxDateRangeBase.d.ts +1 -1
- package/dist/components/NSBoxDateTime.d.ts +1 -1
- package/dist/components/NSBoxDateTimeRange.d.ts +1 -1
- package/dist/components/NSBoxDouble.d.ts +1 -1
- package/dist/components/NSBoxDuration.d.ts +1 -1
- package/dist/components/NSBoxDynamic.d.ts +1 -1
- package/dist/components/NSBoxDynamics.d.ts +1 -1
- package/dist/components/NSBoxEmail.d.ts +1 -1
- package/dist/components/NSBoxEntity.d.ts +1 -1
- package/dist/components/NSBoxEnum.d.ts +1 -1
- package/dist/components/NSBoxFile.d.ts +1 -1
- package/dist/components/NSBoxFilePath.d.ts +1 -1
- package/dist/components/NSBoxFont.d.ts +1 -1
- package/dist/components/NSBoxIPV4.d.ts +1 -1
- package/dist/components/NSBoxIPV4Range.d.ts +1 -1
- package/dist/components/NSBoxIPV6.d.ts +1 -1
- package/dist/components/NSBoxIPV6Range.d.ts +1 -1
- package/dist/components/NSBoxInteger.d.ts +1 -1
- package/dist/components/NSBoxMoney.d.ts +1 -1
- package/dist/components/NSBoxOptions.d.ts +1 -1
- package/dist/components/NSBoxPhone.d.ts +1 -1
- package/dist/components/NSBoxRadio.d.ts +1 -1
- package/dist/components/NSBoxSchemaBase.d.ts +1 -1
- package/dist/components/NSBoxSchemaVariable.d.ts +1 -1
- package/dist/components/NSBoxSearch.d.ts +1 -1
- package/dist/components/NSBoxSensitive.d.ts +1 -1
- package/dist/components/NSBoxString.d.ts +1 -1
- package/dist/components/NSBoxTextArea.d.ts +1 -1
- package/dist/components/NSBoxTime.d.ts +1 -1
- package/dist/components/NSBoxTimeRange.d.ts +1 -1
- package/dist/components/NSBoxTimeZone.d.ts +1 -1
- package/dist/components/NSBoxURL.d.ts +1 -1
- package/dist/components/NSBoxVersion.d.ts +1 -1
- package/dist/components/NSButtonBlue.d.ts +1 -1
- package/dist/components/NSButtonGreen.d.ts +1 -1
- package/dist/components/NSButtonRed.d.ts +1 -1
- package/dist/components/NSCard.d.ts +1 -1
- package/dist/components/NSCardScreenshot.d.ts +1 -1
- package/dist/components/NSChartBar.d.ts +1 -1
- package/dist/components/NSChartDoughnut.d.ts +1 -1
- package/dist/components/NSChartLine.d.ts +1 -1
- package/dist/components/NSChartPie.d.ts +1 -1
- package/dist/components/NSChartRange.d.ts +1 -1
- package/dist/components/NSColumn.d.ts +1 -1
- package/dist/components/NSCopy.d.ts +1 -1
- package/dist/components/NSCopyBox.d.ts +1 -1
- package/dist/components/NSDialog.d.ts +1 -1
- package/dist/components/NSDialogBox.d.ts +1 -1
- package/dist/components/NSDialogBoxDate.d.ts +1 -1
- package/dist/components/NSDialogBoxDateTime.d.ts +1 -1
- package/dist/components/NSDialogBoxPhone.d.ts +1 -1
- package/dist/components/NSDialogBoxString.d.ts +1 -1
- package/dist/components/NSDialogDelete.d.ts +1 -1
- package/dist/components/NSDialogInfo.d.ts +1 -1
- package/dist/components/NSDialogPageSelection.d.ts +5 -3
- package/dist/components/NSDialogPageSelection.js +5 -3
- package/dist/components/NSDialogPageSelection.js.map +1 -1
- package/dist/components/NSDownTimer.d.ts +1 -1
- package/dist/components/NSDownload.d.ts +1 -1
- package/dist/components/NSElectronicCard.d.ts +1 -1
- package/dist/components/NSEntityCardBackground.d.ts +1 -1
- package/dist/components/NSFilterBox.d.ts +2 -2
- package/dist/components/NSFilterBoxItems.d.ts +1 -1
- package/dist/components/NSFilterItem.d.ts +1 -1
- package/dist/components/NSFooter.d.ts +1 -1
- package/dist/components/NSGauge.d.ts +1 -1
- package/dist/components/NSGaugeDate.d.ts +1 -1
- package/dist/components/NSGaugeNumber.d.ts +1 -1
- package/dist/components/NSHeader.d.ts +1 -1
- package/dist/components/NSHeaderScreenshot.d.ts +1 -1
- package/dist/components/NSID.d.ts +1 -1
- package/dist/components/NSInfo.d.ts +1 -1
- package/dist/components/NSLabel.d.ts +1 -1
- package/dist/components/NSLabelErrorNotifier.d.ts +1 -1
- package/dist/components/NSLabelSensitive.d.ts +1 -1
- package/dist/components/NSLayout.d.ts +1 -1
- package/dist/components/NSLine.d.ts +1 -1
- package/dist/components/NSLineText.d.ts +1 -1
- package/dist/components/NSLink.d.ts +1 -1
- package/dist/components/NSLinkBlue.d.ts +1 -1
- package/dist/components/NSLinkGreen.d.ts +1 -1
- package/dist/components/NSLinkRed.d.ts +1 -1
- package/dist/components/NSListGrouped.d.ts +1 -1
- package/dist/components/NSListMenu.d.ts +9 -9
- package/dist/components/NSListMenu.js +134 -111
- package/dist/components/NSListMenu.js.map +1 -1
- package/dist/components/NSListProduct.d.ts +1 -1
- package/dist/components/NSLoading.d.ts +1 -1
- package/dist/components/NSMegaMenu.d.ts +1 -1
- package/dist/components/NSMenuAction.d.ts +1 -1
- package/dist/components/NSMenuButton.d.ts +1 -1
- package/dist/components/NSNoData.d.ts +1 -1
- package/dist/components/NSPagination.d.ts +1 -1
- package/dist/components/NSPanel.d.ts +1 -1
- package/dist/components/NSPanelAccordion.d.ts +1 -1
- package/dist/components/NSProductSearch.d.ts +1 -1
- package/dist/components/NSProgressBar.d.ts +1 -1
- package/dist/components/NSRange.d.ts +1 -1
- package/dist/components/NSReorderDialog.d.ts +4 -1
- package/dist/components/NSReorderDialog.js +23 -3
- package/dist/components/NSReorderDialog.js.map +1 -1
- package/dist/components/NSRepeater.d.ts +1 -1
- package/dist/components/NSRepeaterNSBoxSchemaVariable.d.ts +1 -1
- package/dist/components/NSRepeaterNSTag.d.ts +1 -1
- package/dist/components/NSRow.d.ts +1 -1
- package/dist/components/NSSection.d.ts +1 -1
- package/dist/components/NSSectionCards.d.ts +1 -1
- package/dist/components/NSSectionTiles.d.ts +1 -1
- package/dist/components/NSSectionTitle.d.ts +1 -1
- package/dist/components/NSSortDialog.d.ts +1 -1
- package/dist/components/NSSpace.d.ts +1 -1
- package/dist/components/NSSplitter.d.ts +1 -1
- package/dist/components/NSTabPage.d.ts +1 -1
- package/dist/components/NSTable.d.ts +10 -3
- package/dist/components/NSTable.js +190 -28
- package/dist/components/NSTable.js.map +1 -1
- package/dist/components/NSTableChart.d.ts +1 -1
- package/dist/components/NSTag.d.ts +1 -1
- package/dist/components/NSTile.d.ts +1 -1
- package/dist/components/NSTimelineMonthly.d.ts +1 -1
- package/dist/components/NSTitle.d.ts +1 -1
- package/dist/formatter/StringFormatter.d.ts +1 -1
- package/dist/index.css +5 -5
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -1
- package/dist/main.js.map +1 -1
- package/dist/pages/NSImplementing.d.ts +1 -1
- package/dist/pages/NSNotFoundPage.d.ts +1 -1
- package/dist/pages/NSUpdating.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/NSDialogPageSelection.tsx +211 -197
- package/src/components/NSReorderDialog.tsx +37 -7
- package/src/components/NSTable.tsx +226 -33
- package/src/index.css +5 -5
- package/src/main.ts +0 -1
- package/src/components/NSListMenu.tsx +0 -185
|
@@ -5,4 +5,4 @@ export interface NSDialogDeleteProps extends NSDialogInfoProps {
|
|
|
5
5
|
onNo: NSButtonOnClickProps;
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare function NSDialogDelete(props: NSDialogDeleteProps): import("react
|
|
8
|
+
export declare function NSDialogDelete(props: NSDialogDeleteProps): import("react").JSX.Element;
|
|
@@ -4,4 +4,4 @@ export interface NSDialogInfoProps extends NSDialogProps {
|
|
|
4
4
|
description?: string | React.ReactNode;
|
|
5
5
|
show_as_code: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function NSDialogInfo(props: NSDialogInfoProps): import("react
|
|
7
|
+
export declare function NSDialogInfo(props: NSDialogInfoProps): import("react").JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
2
|
export interface NSDialogPageSelectionProps<RowType> {
|
|
3
3
|
current_page: number;
|
|
4
4
|
current_size: number;
|
|
5
5
|
max_page: number;
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
getItems: (page: number, size: number, selected: boolean) => Promise<RowType[]>;
|
|
8
|
-
onFinish: (items: RowType[]) => Promise<void>;
|
|
8
|
+
onFinish: (items: RowType[], expandAll: boolean) => Promise<void>;
|
|
9
9
|
icon?: string;
|
|
10
|
+
showExpandAll?: boolean;
|
|
10
11
|
}
|
|
11
12
|
interface NSDialogPageSelectionState {
|
|
12
13
|
selectedRadio: string;
|
|
@@ -19,11 +20,12 @@ export declare class NSDialogPageSelection<RowType> extends Component<NSDialogPa
|
|
|
19
20
|
private NSBoxBoolean_CustomPage;
|
|
20
21
|
private NSBoxBoolean_AllPage;
|
|
21
22
|
private NSBoxString_Pages;
|
|
23
|
+
private NSBoxBoolean_ExpandAll;
|
|
22
24
|
constructor(props: NSDialogPageSelectionProps<RowType>);
|
|
23
25
|
componentDidMount(): void;
|
|
24
26
|
componentWillUnmount(): void;
|
|
25
27
|
private onClickOutside;
|
|
26
28
|
private handleRadioChange;
|
|
27
|
-
render():
|
|
29
|
+
render(): React.JSX.Element;
|
|
28
30
|
}
|
|
29
31
|
export {};
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
11
|
import { CronOperation } from 'namirasoft-core';
|
|
12
12
|
import { Component, createRef } from 'react';
|
|
13
|
+
import { NSBoxBoolean } from './NSBoxBoolean';
|
|
13
14
|
import { NSBoxRadio } from './NSBoxRadio';
|
|
14
15
|
import { NSBoxString } from './NSBoxString';
|
|
15
16
|
import { NSButtonBlue } from './NSButtonBlue';
|
|
@@ -25,6 +26,7 @@ export class NSDialogPageSelection extends Component {
|
|
|
25
26
|
this.NSBoxBoolean_CustomPage = createRef();
|
|
26
27
|
this.NSBoxBoolean_AllPage = createRef();
|
|
27
28
|
this.NSBoxString_Pages = createRef();
|
|
29
|
+
this.NSBoxBoolean_ExpandAll = createRef();
|
|
28
30
|
this.state = {
|
|
29
31
|
selectedRadio: 'current_page',
|
|
30
32
|
showNoItemError: false
|
|
@@ -58,9 +60,9 @@ export class NSDialogPageSelection extends Component {
|
|
|
58
60
|
catch (error) {
|
|
59
61
|
return error.message;
|
|
60
62
|
}
|
|
61
|
-
} }))] }), this.state.showNoItemError && (_jsxs(_Fragment, { children: [_jsx(NSSpace, { size: NSSpaceSizeType.MINI }), _jsx(NSLabelErrorNotifier, { error: "No items found for the selected option.", clearError: () => this.setState((prev) => (Object.assign(Object.assign({}, prev), { showNoItemError: false }))) })] })), _jsx(NSSpace, { size: NSSpaceSizeType.MEDUIM }), _jsx(NSButtonBlue, { style: { width: "100%" }, title: 'Apply', onClick: {
|
|
63
|
+
} })), this.props.showExpandAll && (_jsx(NSBoxBoolean, { ref: this.NSBoxBoolean_ExpandAll, required: false, defaultValue: false, title: "Print with all rows expanded", hideHeader: true }))] }), this.state.showNoItemError && (_jsxs(_Fragment, { children: [_jsx(NSSpace, { size: NSSpaceSizeType.MINI }), _jsx(NSLabelErrorNotifier, { error: "No items found for the selected option.", clearError: () => this.setState((prev) => (Object.assign(Object.assign({}, prev), { showNoItemError: false }))) })] })), _jsx(NSSpace, { size: NSSpaceSizeType.MEDUIM }), _jsx(NSButtonBlue, { style: { width: "100%" }, title: 'Apply', onClick: {
|
|
62
64
|
action: (onFinished) => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
var _a, _b, _c, _d, _e, _f;
|
|
65
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
64
66
|
try {
|
|
65
67
|
let items = [];
|
|
66
68
|
if ((_a = this.NSBoxBoolean_CurrentPage.current) === null || _a === void 0 ? void 0 : _a.getValue()) {
|
|
@@ -86,7 +88,7 @@ export class NSDialogPageSelection extends Component {
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
if (items.length > 0)
|
|
89
|
-
yield this.props.onFinish(items);
|
|
91
|
+
yield this.props.onFinish(items, ((_g = this.NSBoxBoolean_ExpandAll.current) === null || _g === void 0 ? void 0 : _g.getValue()) === true);
|
|
90
92
|
else
|
|
91
93
|
this.setState((prev) => (Object.assign(Object.assign({}, prev), { showNoItemError: true })));
|
|
92
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSDialogPageSelection.js","sourceRoot":"","sources":["../../src/components/NSDialogPageSelection.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,eAAe,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,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;oDAC7E,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;gDACtB,CAAC;4CACL,CAAC;iDACI,IAAI,MAAA,IAAI,CAAC,oBAAoB,CAAC,OAAO,0CAAE,QAAQ,EAAE,EACtD,CAAC;gDACG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,EAC7C,CAAC;oDACG,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;oDACtE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;gDACtB,CAAC;4CACL,CAAC;4CAED,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gDAChB,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA,MAAA,IAAI,CAAC,sBAAsB,CAAC,OAAO,0CAAE,QAAQ,EAAE,MAAK,IAAI,CAAC,CAAC;;gDAE3F,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iCAAM,IAAI,KAAE,eAAe,EAAE,IAAI,IAAG,CAAC,CAAC;wCACtE,CAAC;wCAAC,OAAO,KAAK,EACd,CAAC;wCACD,CAAC;wCACD,UAAU,EAAE,CAAC;oCACjB,CAAC,CAAA;iCACJ,GAAI,IACP,GACJ,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,mBAAmB,GAAQ,IACnD,CACN,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -4,4 +4,4 @@ export interface NSDownTimerProps extends IBaseComponentProps {
|
|
|
4
4
|
text: string;
|
|
5
5
|
expire_text?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function NSDownTimer(props: NSDownTimerProps): import("react
|
|
7
|
+
export declare function NSDownTimer(props: NSDownTimerProps): import("react").JSX.Element;
|
|
@@ -2,4 +2,4 @@ import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
|
2
2
|
export interface NSDownloadProps extends IBaseComponentProps {
|
|
3
3
|
releaseDate: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function NSDownload(props: NSDownloadProps): import("react
|
|
5
|
+
export declare function NSDownload(props: NSDownloadProps): import("react").JSX.Element;
|
|
@@ -5,4 +5,4 @@ export interface NSElectronicCardProps {
|
|
|
5
5
|
info?: string;
|
|
6
6
|
alt?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function NSElectronicCard(props: NSElectronicCardProps): import("react
|
|
8
|
+
export declare function NSElectronicCard(props: NSElectronicCardProps): import("react").JSX.Element;
|
|
@@ -4,4 +4,4 @@ export interface NSEntityCardBackgroundProps extends IBaseComponentProps {
|
|
|
4
4
|
title: string;
|
|
5
5
|
link?: ILinkProps;
|
|
6
6
|
}
|
|
7
|
-
export declare function NSEntityCardBackground(props: NSEntityCardBackgroundProps): import("react
|
|
7
|
+
export declare function NSEntityCardBackground(props: NSEntityCardBackgroundProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
2
|
import { IBaseComponentProps } from '../props/IBaseComponentProps';
|
|
3
3
|
import { FilterItem, FilterItemColumnType, FilterItemOperator } from 'namirasoft-core';
|
|
4
4
|
export interface NSFilterBoxProps extends IBaseComponentProps {
|
|
@@ -75,6 +75,6 @@ export declare class NSFilterBox extends Component<NSFilterBoxProps, NSFilterBox
|
|
|
75
75
|
private onSelected_Column;
|
|
76
76
|
private onSelected_Operator;
|
|
77
77
|
private onSelected_Value;
|
|
78
|
-
render():
|
|
78
|
+
render(): React.JSX.Element;
|
|
79
79
|
}
|
|
80
80
|
export {};
|
|
@@ -7,5 +7,5 @@ export interface NSFilterBoxItemsProps extends IBaseComponentProps {
|
|
|
7
7
|
onRemoveFilterItem: (item: FilterItem) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare class NSFilterBoxItems extends Component<NSFilterBoxItemsProps> {
|
|
10
|
-
render(): import("react
|
|
10
|
+
render(): import("react").JSX.Element;
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@ interface INSFilterItemProps extends IBaseComponentProps {
|
|
|
6
6
|
removeSelected: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, item: FilterItem) => void;
|
|
7
7
|
}
|
|
8
8
|
export declare class NSFilterItem extends Component<INSFilterItemProps> {
|
|
9
|
-
render(): import("react
|
|
9
|
+
render(): import("react").JSX.Element;
|
|
10
10
|
}
|
|
11
11
|
export {};
|
|
@@ -18,7 +18,7 @@ export declare class NSFooter extends React.Component<NSFooterProps, NSFooterSta
|
|
|
18
18
|
componentDidMount(): void;
|
|
19
19
|
private getFilters;
|
|
20
20
|
private hasChild;
|
|
21
|
-
render():
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
22
|
private render_menu;
|
|
23
23
|
private render_menuItem;
|
|
24
24
|
}
|
|
@@ -12,4 +12,4 @@ export interface NSGaugeDateProps extends IBaseComponentProps {
|
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
noData?: boolean | string;
|
|
14
14
|
}
|
|
15
|
-
export declare function NSGaugeDate(props: NSGaugeDateProps): import("react
|
|
15
|
+
export declare function NSGaugeDate(props: NSGaugeDateProps): import("react").JSX.Element;
|
|
@@ -14,4 +14,4 @@ export interface NSGaugeNumberProps extends IBaseComponentProps {
|
|
|
14
14
|
noData?: boolean | string;
|
|
15
15
|
formatter?: (value: number) => string;
|
|
16
16
|
}
|
|
17
|
-
export declare function NSGaugeNumber(props: NSGaugeNumberProps): import("react
|
|
17
|
+
export declare function NSGaugeNumber(props: NSGaugeNumberProps): import("react").JSX.Element;
|
|
@@ -33,7 +33,7 @@ export declare class NSHeader extends Component<NSHeaderProps, NSHeaderState> {
|
|
|
33
33
|
private getFilters;
|
|
34
34
|
private hasChild;
|
|
35
35
|
handleShowNavbar(): void;
|
|
36
|
-
render(): import("react
|
|
36
|
+
render(): import("react").JSX.Element;
|
|
37
37
|
private render_menu;
|
|
38
38
|
private render_menuItem;
|
|
39
39
|
}
|
|
@@ -5,4 +5,4 @@ export interface NSHeaderScreenshotProps extends IBaseComponentProps {
|
|
|
5
5
|
time: string;
|
|
6
6
|
Countdown: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function NSHeaderScreenshot(props: NSHeaderScreenshotProps): import("react
|
|
8
|
+
export declare function NSHeaderScreenshot(props: NSHeaderScreenshotProps): import("react").JSX.Element;
|
|
@@ -44,5 +44,5 @@ export declare class NSID extends React.Component<NSIDProps, NSIDState> {
|
|
|
44
44
|
constructor(props: NSIDProps);
|
|
45
45
|
componentDidMount(): void;
|
|
46
46
|
reload(): Promise<void>;
|
|
47
|
-
render(): string |
|
|
47
|
+
render(): string | React.JSX.Element;
|
|
48
48
|
}
|
|
@@ -9,5 +9,5 @@ export interface NSLabelProps extends IBaseComponentProps {
|
|
|
9
9
|
export interface NSLabelState {
|
|
10
10
|
}
|
|
11
11
|
export declare class NSLabel extends React.Component<NSLabelProps, NSLabelState> {
|
|
12
|
-
render():
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
13
|
}
|
|
@@ -3,4 +3,4 @@ export interface NSLabelErrorNotifierProps extends IBaseComponentProps {
|
|
|
3
3
|
error?: string;
|
|
4
4
|
clearError: () => void;
|
|
5
5
|
}
|
|
6
|
-
export declare function NSLabelErrorNotifier(props: NSLabelErrorNotifierProps): import("react
|
|
6
|
+
export declare function NSLabelErrorNotifier(props: NSLabelErrorNotifierProps): import("react").JSX.Element;
|
|
@@ -9,5 +9,5 @@ export interface NSLabelSensitiveState {
|
|
|
9
9
|
loading: boolean;
|
|
10
10
|
decrypted_value: string | null;
|
|
11
11
|
}
|
|
12
|
-
export declare function NSLabelSensitive(props: NSLabelSensitiveProps): import("react
|
|
12
|
+
export declare function NSLabelSensitive(props: NSLabelSensitiveProps): import("react").JSX.Element;
|
|
13
13
|
export default NSLabelSensitive;
|
|
@@ -30,4 +30,4 @@ export interface NSLayoutProps extends IBaseComponentProps, NSRouterMakerResult
|
|
|
30
30
|
isLoggedIn: () => boolean;
|
|
31
31
|
onEnterPressed?: () => void;
|
|
32
32
|
}
|
|
33
|
-
export declare function NSLayout(props: NSLayoutProps): import("react
|
|
33
|
+
export declare function NSLayout(props: NSLayoutProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
2
|
export interface NSLineProps extends IBaseComponentProps {
|
|
3
3
|
}
|
|
4
|
-
export declare function NSLine(props: NSLineProps): import("react
|
|
4
|
+
export declare function NSLine(props: NSLineProps): import("react").JSX.Element;
|
|
@@ -2,4 +2,4 @@ import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
|
2
2
|
export interface NSLineTextProps extends IBaseComponentProps {
|
|
3
3
|
title: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function NSLineText(props: NSLineTextProps): import("react
|
|
5
|
+
export declare function NSLineText(props: NSLineTextProps): import("react").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { ILinkProps } from "../props/ILinkProps";
|
|
|
3
3
|
export interface NSLinkProps extends ILinkProps, IBaseComponentProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
export declare function NSLink(props: NSLinkProps): import("react
|
|
6
|
+
export declare function NSLink(props: NSLinkProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { NSLinkProps } from "./NSLink";
|
|
2
|
-
export declare function NSLinkBlue(props: NSLinkProps): import("react
|
|
2
|
+
export declare function NSLinkBlue(props: NSLinkProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { NSLinkProps } from "./NSLink";
|
|
2
|
-
export declare function NSLinkGreen(props: NSLinkProps): import("react
|
|
2
|
+
export declare function NSLinkGreen(props: NSLinkProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { NSLinkProps } from "./NSLink";
|
|
2
|
-
export declare function NSLinkRed(props: NSLinkProps): import("react
|
|
2
|
+
export declare function NSLinkRed(props: NSLinkProps): import("react").JSX.Element;
|
|
@@ -24,6 +24,6 @@ export declare class NSListGrouped<Data> extends Component<NSListGroupedProps<Da
|
|
|
24
24
|
componentDidMount(): void;
|
|
25
25
|
componentWillUnmount(): void;
|
|
26
26
|
handleClickOutside(event: MouseEvent): void;
|
|
27
|
-
render(): import("react
|
|
27
|
+
render(): import("react").JSX.Element;
|
|
28
28
|
}
|
|
29
29
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FilterLinkFullRow } from "namirasoft-api-link";
|
|
2
|
-
export interface NSListMenuProps {
|
|
3
|
-
scope: string;
|
|
4
|
-
name: string;
|
|
5
|
-
isLoggedIn?: () => boolean;
|
|
6
|
-
onError?: (error: Error | string) => void;
|
|
7
|
-
filters?: FilterLinkFullRow[];
|
|
8
|
-
}
|
|
9
|
-
export declare function NSListMenu(props: NSListMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { FilterLinkFullRow } from "namirasoft-api-link";
|
|
2
|
+
export interface NSListMenuProps {
|
|
3
|
+
scope: string;
|
|
4
|
+
name: string;
|
|
5
|
+
isLoggedIn?: () => boolean;
|
|
6
|
+
onError?: (error: Error | string) => void;
|
|
7
|
+
filters?: FilterLinkFullRow[];
|
|
8
|
+
}
|
|
9
|
+
export declare function NSListMenu(props: NSListMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,112 +1,135 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { NamirasoftAPILinkServer } from "namirasoft-api-link";
|
|
3
|
-
import { EnvService } from "namirasoft-core";
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
5
|
-
import { NSCard } from "./NSCard";
|
|
6
|
-
import { NSSection } from "./NSSection";
|
|
7
|
-
import { NSTitle } from "./NSTitle";
|
|
8
|
-
export function NSListMenu(props) {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
const [state, setState] = useState({ filters: (_a = props.filters) !== null && _a !== void 0 ? _a : [] });
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
var _a;
|
|
13
|
-
if (props.filters)
|
|
14
|
-
return;
|
|
15
|
-
let REACT_APP_BASE_URL_API_LINK = new EnvService("REACT_APP_BASE_URL_API_LINK", true).getString();
|
|
16
|
-
let server = new NamirasoftAPILinkServer(REACT_APP_BASE_URL_API_LINK, (_a = props.onError) !== null && _a !== void 0 ? _a : (() => { }));
|
|
17
|
-
server.filter.ListFilterLinks(props.scope, props.name, null, null, null, []).then((filters) => {
|
|
18
|
-
setState({ filters: filters.rows });
|
|
19
|
-
}).catch(() => { });
|
|
20
|
-
}, []);
|
|
21
|
-
const byId = new Map(((_b = state.filters) !== null && _b !== void 0 ? _b : []).map(f => [f.id, f]));
|
|
22
|
-
const pathOf = (url) => {
|
|
23
|
-
if (!url)
|
|
24
|
-
return "";
|
|
25
|
-
try {
|
|
26
|
-
return new URL(url).pathname.replace(/\/+$/, "").toLowerCase();
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
return url.replace(/[?#].*$/, "").replace(/\/+$/, "").toLowerCase();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const baseOf = (path) => path.replace(/\/[^/]*$/, "");
|
|
33
|
-
const parentOf = (f) => f.parent_id != null ? byId.get(f.parent_id) : undefined;
|
|
34
|
-
const nameOf = (f) => { var _a, _b, _c; return (_c = (_a = f.name) !== null && _a !== void 0 ? _a : (_b = f.link) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : ""; };
|
|
35
|
-
const isListChild = (f) => { var _a; return f.name === "List" && pathOf((_a = f.link) === null || _a === void 0 ? void 0 : _a.url).endsWith("/list") && parentOf(f) != null; };
|
|
36
|
-
const isSupport = (f) => {
|
|
37
|
-
var _a, _b, _c;
|
|
38
|
-
let text = [f.name, (_a = f.link) === null || _a === void 0 ? void 0 : _a.name, (_b = parentOf(f)) === null || _b === void 0 ? void 0 : _b.name].filter(Boolean).join(" ").toLowerCase();
|
|
39
|
-
return text.includes("support") || pathOf((_c = f.link) === null || _c === void 0 ? void 0 : _c.url).includes("support");
|
|
40
|
-
};
|
|
41
|
-
const displayOf = (f) => isListChild(f) ? parentOf(f) : f;
|
|
42
|
-
const chainOf = (f) => {
|
|
43
|
-
let chain = [];
|
|
44
|
-
let current = f;
|
|
45
|
-
while (current != null && chain.length < 100) {
|
|
46
|
-
chain.unshift(current);
|
|
47
|
-
current = parentOf(current);
|
|
48
|
-
}
|
|
49
|
-
return chain;
|
|
50
|
-
};
|
|
51
|
-
const rootOf = (f) => chainOf(displayOf(f))[0];
|
|
52
|
-
const subtitleOf = (f) => {
|
|
53
|
-
let chain = chainOf(displayOf(f));
|
|
54
|
-
let rest = chain.slice(1);
|
|
55
|
-
return rest.length > 0 ? rest.map(nameOf).join(" / ") : nameOf(chain[0]);
|
|
56
|
-
};
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
let
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
ans = ans.filter(f =>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
let
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
let
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NamirasoftAPILinkServer } from "namirasoft-api-link";
|
|
3
|
+
import { EnvService } from "namirasoft-core";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { NSCard } from "./NSCard";
|
|
6
|
+
import { NSSection } from "./NSSection";
|
|
7
|
+
import { NSTitle } from "./NSTitle";
|
|
8
|
+
export function NSListMenu(props) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const [state, setState] = useState({ filters: (_a = props.filters) !== null && _a !== void 0 ? _a : [] });
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
var _a;
|
|
13
|
+
if (props.filters)
|
|
14
|
+
return;
|
|
15
|
+
let REACT_APP_BASE_URL_API_LINK = new EnvService("REACT_APP_BASE_URL_API_LINK", true).getString();
|
|
16
|
+
let server = new NamirasoftAPILinkServer(REACT_APP_BASE_URL_API_LINK, (_a = props.onError) !== null && _a !== void 0 ? _a : (() => { }));
|
|
17
|
+
server.filter.ListFilterLinks(props.scope, props.name, null, null, null, []).then((filters) => {
|
|
18
|
+
setState({ filters: filters.rows });
|
|
19
|
+
}).catch(() => { });
|
|
20
|
+
}, []);
|
|
21
|
+
const byId = new Map(((_b = state.filters) !== null && _b !== void 0 ? _b : []).map(f => [f.id, f]));
|
|
22
|
+
const pathOf = (url) => {
|
|
23
|
+
if (!url)
|
|
24
|
+
return "";
|
|
25
|
+
try {
|
|
26
|
+
return new URL(url).pathname.replace(/\/+$/, "").toLowerCase();
|
|
27
|
+
}
|
|
28
|
+
catch (_a) {
|
|
29
|
+
return url.replace(/[?#].*$/, "").replace(/\/+$/, "").toLowerCase();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const baseOf = (path) => path.replace(/\/[^/]*$/, "");
|
|
33
|
+
const parentOf = (f) => f.parent_id != null ? byId.get(f.parent_id) : undefined;
|
|
34
|
+
const nameOf = (f) => { var _a, _b, _c; return (_c = (_a = f.name) !== null && _a !== void 0 ? _a : (_b = f.link) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : ""; };
|
|
35
|
+
const isListChild = (f) => { var _a; return f.name === "List" && pathOf((_a = f.link) === null || _a === void 0 ? void 0 : _a.url).endsWith("/list") && parentOf(f) != null; };
|
|
36
|
+
const isSupport = (f) => {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
let text = [f.name, (_a = f.link) === null || _a === void 0 ? void 0 : _a.name, (_b = parentOf(f)) === null || _b === void 0 ? void 0 : _b.name].filter(Boolean).join(" ").toLowerCase();
|
|
39
|
+
return text.includes("support") || pathOf((_c = f.link) === null || _c === void 0 ? void 0 : _c.url).includes("support");
|
|
40
|
+
};
|
|
41
|
+
const displayOf = (f) => isListChild(f) ? parentOf(f) : f;
|
|
42
|
+
const chainOf = (f) => {
|
|
43
|
+
let chain = [];
|
|
44
|
+
let current = f;
|
|
45
|
+
while (current != null && chain.length < 100) {
|
|
46
|
+
chain.unshift(current);
|
|
47
|
+
current = parentOf(current);
|
|
48
|
+
}
|
|
49
|
+
return chain;
|
|
50
|
+
};
|
|
51
|
+
const rootOf = (f) => chainOf(displayOf(f))[0];
|
|
52
|
+
const subtitleOf = (f) => {
|
|
53
|
+
let chain = chainOf(displayOf(f));
|
|
54
|
+
let rest = chain.slice(1);
|
|
55
|
+
return rest.length > 0 ? rest.map(nameOf).join(" / ") : nameOf(chain[0]);
|
|
56
|
+
};
|
|
57
|
+
const fullTitleOf = (f) => chainOf(displayOf(f)).map(nameOf).join(" / ");
|
|
58
|
+
const descriptionOf = (f) => { var _a, _b; return (_b = (_a = f.link) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : ""; };
|
|
59
|
+
const orderPathOf = (f) => chainOf(displayOf(f)).map(n => n.order);
|
|
60
|
+
const compareOrderPath = (a, b) => {
|
|
61
|
+
let pa = orderPathOf(a);
|
|
62
|
+
let pb = orderPathOf(b);
|
|
63
|
+
let len = Math.min(pa.length, pb.length);
|
|
64
|
+
for (let i = 0; i < len; i++)
|
|
65
|
+
if (pa[i] !== pb[i])
|
|
66
|
+
return pa[i] - pb[i];
|
|
67
|
+
return pa.length - pb.length;
|
|
68
|
+
};
|
|
69
|
+
const getMenuItems = () => {
|
|
70
|
+
var _a, _b, _c, _d, _e;
|
|
71
|
+
let loggedin = (_b = (_a = props.isLoggedIn) === null || _a === void 0 ? void 0 : _a.call(props)) !== null && _b !== void 0 ? _b : false;
|
|
72
|
+
let ans = (_d = (_c = state.filters) === null || _c === void 0 ? void 0 : _c.filter(f => {
|
|
73
|
+
if (f.link) {
|
|
74
|
+
if (loggedin)
|
|
75
|
+
return f.link.private;
|
|
76
|
+
return f.link.public;
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
})) !== null && _d !== void 0 ? _d : [];
|
|
80
|
+
ans = ans.filter(f => { var _a; return (_a = f.link) === null || _a === void 0 ? void 0 : _a.url; });
|
|
81
|
+
ans = ans.filter(f => !isSupport(f));
|
|
82
|
+
let listedBases = new Set();
|
|
83
|
+
for (let f of ans) {
|
|
84
|
+
let path = pathOf((_e = f.link) === null || _e === void 0 ? void 0 : _e.url);
|
|
85
|
+
if (path.endsWith("/list"))
|
|
86
|
+
listedBases.add(baseOf(path));
|
|
87
|
+
}
|
|
88
|
+
ans = ans.filter(f => {
|
|
89
|
+
var _a;
|
|
90
|
+
let path = pathOf((_a = f.link) === null || _a === void 0 ? void 0 : _a.url);
|
|
91
|
+
if (path.endsWith("/new") && listedBases.has(baseOf(path)))
|
|
92
|
+
return false;
|
|
93
|
+
return true;
|
|
94
|
+
});
|
|
95
|
+
ans.sort(compareOrderPath);
|
|
96
|
+
return ans;
|
|
97
|
+
};
|
|
98
|
+
let items = getMenuItems();
|
|
99
|
+
let groups = [];
|
|
100
|
+
for (let f of items) {
|
|
101
|
+
let root = rootOf(f);
|
|
102
|
+
let last = groups[groups.length - 1];
|
|
103
|
+
if (last && last.root.id === root.id)
|
|
104
|
+
last.items.push(f);
|
|
105
|
+
else
|
|
106
|
+
groups.push({ root, items: [f] });
|
|
107
|
+
}
|
|
108
|
+
let blocks = [];
|
|
109
|
+
let singles = [];
|
|
110
|
+
for (let group of groups) {
|
|
111
|
+
if (group.items.length <= 1) {
|
|
112
|
+
singles.push(...group.items);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (singles.length > 0) {
|
|
116
|
+
blocks.push({ type: "singles", items: singles });
|
|
117
|
+
singles = [];
|
|
118
|
+
}
|
|
119
|
+
blocks.push({ type: "group", root: group.root, items: group.items });
|
|
120
|
+
}
|
|
121
|
+
if (singles.length > 0)
|
|
122
|
+
blocks.push({ type: "singles", items: singles });
|
|
123
|
+
return (_jsx("div", { style: { display: "flex", flexDirection: "column", width: "100%", gap: "32px" }, children: blocks.map((block, index) => block.type === "group"
|
|
124
|
+
?
|
|
125
|
+
_jsxs("div", { style: { width: "100%" }, children: [_jsx(NSTitle, { title: nameOf(block.root), style: { marginBottom: 16, fontSize: 32 } }), _jsx(NSSection, { style: { gap: "16px" }, children: block.items.map((filter) => {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
return _jsx(NSCard, { link: { href: (_b = (_a = filter.link) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : "" }, title: subtitleOf(filter), description: descriptionOf(filter) }, filter.id);
|
|
128
|
+
}) })] }, `group-${block.root.id}`)
|
|
129
|
+
:
|
|
130
|
+
_jsx("div", { style: { width: "100%" }, children: _jsx(NSSection, { style: { gap: "16px" }, children: block.items.map((filter) => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
return _jsx(NSCard, { link: { href: (_b = (_a = filter.link) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : "" }, title: fullTitleOf(filter), description: descriptionOf(filter) }, filter.id);
|
|
133
|
+
}) }) }, `singles-${index}`)) }));
|
|
134
|
+
}
|
|
112
135
|
//# sourceMappingURL=NSListMenu.js.map
|