namirasoft-account-react 1.5.13 → 1.5.15
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 +2 -2
- package/dist/FieldCacheService.d.ts +14 -1
- package/dist/FieldCacheService.js +28 -2
- package/dist/FieldCacheService.js.map +1 -1
- package/dist/NSARouterMaker.d.ts +7 -12
- package/dist/NSARouterMaker.js +29 -35
- package/dist/NSARouterMaker.js.map +1 -1
- package/dist/NSARouterMakerProps.d.ts +17 -23
- package/dist/NSARouterMakerResult.d.ts +26 -0
- package/dist/NSARouterMakerResult.js +2 -0
- package/dist/NSARouterMakerResult.js.map +1 -0
- package/dist/NSFRouterMaker.d.ts +10 -0
- package/dist/NSFRouterMaker.js +27 -0
- package/dist/NSFRouterMaker.js.map +1 -0
- package/dist/Router.d.ts +1 -1
- package/dist/Router.js +5 -11
- package/dist/Router.js.map +1 -1
- package/dist/components/NSAAccessListDialog.d.ts +2 -2
- package/dist/components/NSABoxSecret.d.ts +2 -2
- package/dist/components/NSAMasterMenu.d.ts +2 -2
- package/dist/components/NSAMasterMenuItem.d.ts +2 -2
- package/dist/components/NSAMessageListDialog.d.ts +4 -4
- package/dist/components/NSAMessageListDialog.js +2 -2
- package/dist/components/NSAMessageListDialog.js.map +1 -1
- package/dist/components/NSAProductListDialog.d.ts +2 -2
- package/dist/components/NSATable.d.ts +0 -3
- package/dist/components/NSATable.js +3 -34
- package/dist/components/NSATable.js.map +1 -1
- package/dist/components/NSAUserDialog.d.ts +2 -2
- package/dist/components/NSAWorkspaceListDialog.d.ts +2 -2
- package/dist/components/NSFBoxCategoryScope.d.ts +2 -2
- package/dist/components/NSFBoxSlot.d.ts +2 -2
- package/dist/layouts/Actions.d.ts +6 -6
- package/dist/layouts/Actions.js.map +1 -1
- package/dist/layouts/NSALayout.d.ts +2 -7
- package/dist/layouts/NSALayout.js +88 -86
- package/dist/layouts/NSALayout.js.map +1 -1
- package/dist/layouts/NSASectionEdit.d.ts +3 -4
- package/dist/layouts/NSASectionEdit.js.map +1 -1
- package/dist/layouts/NSASectionEditTabPage.d.ts +2 -3
- package/dist/layouts/NSASectionEditTabPage.js +1 -1
- package/dist/layouts/NSASectionEditTabPage.js.map +1 -1
- package/dist/layouts/NSASectionList.d.ts +2 -3
- package/dist/layouts/NSASectionList.js.map +1 -1
- package/dist/layouts/NSASectionView.d.ts +2 -3
- package/dist/layouts/NSASectionView.js.map +1 -1
- package/dist/layouts/NSASectionViewTabMore.d.ts +2 -2
- package/dist/layouts/NSASectionViewTabMore.js +3 -2
- package/dist/layouts/NSASectionViewTabMore.js.map +1 -1
- package/dist/layouts/NSASectionViewTabPage.d.ts +2 -3
- package/dist/layouts/NSASectionViewTabPage.js +1 -1
- package/dist/layouts/NSASectionViewTabPage.js.map +1 -1
- package/dist/main.d.ts +2 -4
- package/dist/main.js +2 -4
- package/dist/main.js.map +1 -1
- package/dist/pages/NSAConsentPage.d.ts +2 -2
- package/dist/pages/NSAEmailVerificationPage.d.ts +2 -2
- package/dist/pages/NSAHomePage.d.ts +3 -3
- package/dist/pages/NSAHomePage.js +5 -5
- package/dist/pages/NSAHomePage.js.map +1 -1
- package/dist/pages/NSAPhoneVerificationPage.d.ts +2 -2
- package/dist/pages/NSAPhoneVerificationPage.js +1 -1
- package/dist/pages/NSAPhoneVerificationPage.js.map +1 -1
- package/dist/pages/NSAVerificationPage.d.ts +3 -3
- package/dist/pages/NSAVerificationPage.js +2 -3
- package/dist/pages/NSAVerificationPage.js.map +1 -1
- package/dist/pages/NSFCategoryEditPage.d.ts +2 -2
- package/dist/pages/NSFCategoryListPage.d.ts +2 -2
- package/dist/pages/NSFCategoryViewPage.d.ts +2 -2
- package/dist/pages/NSFEntities.d.ts +2 -2
- package/dist/pages/NSFEntities.js.map +1 -1
- package/dist/pages/PaymentRequired.d.ts +2 -2
- package/dist/pages/PaymentRequired.js.map +1 -1
- package/package.json +2 -2
- package/src/App.tsx +2 -2
- package/src/FieldCacheService.tsx +85 -0
- package/src/NSARouterMaker.tsx +38 -45
- package/src/NSARouterMakerProps.ts +19 -21
- package/src/NSARouterMakerResult.ts +25 -0
- package/src/NSFRouterMaker.tsx +37 -0
- package/src/Router.tsx +15 -12
- package/src/components/NSAAccessListDialog.tsx +2 -2
- package/src/components/NSABoxSecret.tsx +2 -2
- package/src/components/NSAMasterMenu.tsx +6 -6
- package/src/components/NSAMasterMenuItem.tsx +2 -2
- package/src/components/NSAMessageListDialog.tsx +4 -4
- package/src/components/NSAProductListDialog.tsx +2 -2
- package/src/components/NSATable.tsx +3 -54
- package/src/components/NSAUserDialog.tsx +2 -2
- package/src/components/NSAWorkspaceListDialog.tsx +2 -2
- package/src/components/NSFBoxCategoryScope.tsx +2 -2
- package/src/components/NSFBoxSlot.tsx +2 -2
- package/src/layouts/Actions.ts +6 -6
- package/src/layouts/NSALayout.tsx +159 -161
- package/src/layouts/NSASectionEdit.tsx +3 -4
- package/src/layouts/NSASectionEditTabPage.tsx +3 -4
- package/src/layouts/NSASectionList.tsx +2 -3
- package/src/layouts/NSASectionView.tsx +2 -3
- package/src/layouts/NSASectionViewTabMore.tsx +8 -7
- package/src/layouts/NSASectionViewTabPage.tsx +3 -4
- package/src/main.ts +2 -4
- package/src/pages/NSAConsentPage.tsx +2 -2
- package/src/pages/NSAEmailVerificationPage.tsx +2 -2
- package/src/pages/NSAHomePage.tsx +23 -22
- package/src/pages/NSAPhoneVerificationPage.tsx +3 -3
- package/src/pages/NSAVerificationPage.tsx +4 -5
- package/src/pages/NSFCategoryEditPage.tsx +2 -2
- package/src/pages/NSFCategoryListPage.tsx +2 -2
- package/src/pages/NSFCategoryViewPage.tsx +2 -2
- package/src/pages/NSFEntities.ts +2 -2
- package/src/pages/PaymentRequired.tsx +5 -5
- package/dist/App.css +0 -32
- package/dist/NSARouter.d.ts +0 -16
- package/dist/NSARouter.js +0 -42
- package/dist/NSARouter.js.map +0 -1
- package/dist/NSARouterMakerConfig.d.ts +0 -14
- package/dist/NSARouterMakerConfig.js +0 -2
- package/dist/NSARouterMakerConfig.js.map +0 -1
- package/dist/components/NSAReorderDialog.d.ts +0 -30
- package/dist/components/NSAReorderDialog.js +0 -69
- package/dist/components/NSAReorderDialog.js.map +0 -1
- package/dist/components/NSAReorderDialog.module.css +0 -50
- package/dist/components/NSASortDialog.d.ts +0 -21
- package/dist/components/NSASortDialog.js +0 -61
- package/dist/components/NSASortDialog.js.map +0 -1
- package/dist/layouts/NSARouter.d.ts +0 -16
- package/dist/layouts/NSARouter.js +0 -38
- package/dist/layouts/NSARouter.js.map +0 -1
- package/dist/layouts/NSARouter_Field.d.ts +0 -8
- package/dist/layouts/NSARouter_Field.js +0 -92
- package/dist/layouts/NSARouter_Field.js.map +0 -1
- package/src/App.css +0 -32
- package/src/FieldCacheService.ts +0 -37
- package/src/NSARouter.tsx +0 -69
- package/src/NSARouterMakerConfig.ts +0 -16
- package/src/components/NSAReorderDialog.module.css +0 -50
- package/src/components/NSAReorderDialog.tsx +0 -150
- package/src/components/NSASortDialog.tsx +0 -118
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
2
2
|
import { NSAVerificationPage } from "./NSAVerificationPage";
|
|
3
3
|
|
|
4
|
-
interface NSAEmailVerificationPageProps extends
|
|
4
|
+
interface NSAEmailVerificationPageProps extends NSARouterMakerResult
|
|
5
5
|
{
|
|
6
6
|
callback: string;
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ReactNode, useEffect, useState } from 'react';
|
|
2
|
-
import { SetTimeouService } from 'namirasoft-core';
|
|
3
1
|
import { ProductFullRow } from 'namirasoft-api-product';
|
|
2
|
+
import { SetTimeouService } from 'namirasoft-core';
|
|
4
3
|
import { IBaseComponentProps, NSBox, NSBoxSearch, NSLine, NSListMenu, NSListProduct, NSListProductCardProps, NSLoading, NSSpace, NSSpaceSizeType, NSTitle, ProductCacheService } from 'namirasoft-site-react';
|
|
5
|
-
import {
|
|
4
|
+
import { ReactNode, useEffect, useState } from 'react';
|
|
5
|
+
import { NSARouterMakerResult } from '../NSARouterMakerResult';
|
|
6
6
|
import Styles from './NSAHomePage.module.css';
|
|
7
7
|
|
|
8
|
-
export interface NSAHomePageProps extends IBaseComponentProps,
|
|
8
|
+
export interface NSAHomePageProps extends IBaseComponentProps, NSARouterMakerResult
|
|
9
9
|
{
|
|
10
10
|
custom?: {
|
|
11
11
|
scope?: string;
|
|
@@ -66,18 +66,34 @@ export function NSAHomePage(props: NSAHomePageProps)
|
|
|
66
66
|
height={256}
|
|
67
67
|
/>
|
|
68
68
|
}
|
|
69
|
-
<NSSpace size={NSSpaceSizeType.MICRO} />
|
|
70
69
|
|
|
71
70
|
{props.getChildren?.getChildrenBeforeTitle?.()}
|
|
71
|
+
|
|
72
|
+
<NSSpace size={NSSpaceSizeType.MICRO} />
|
|
72
73
|
<h2>{headline}</h2>
|
|
73
74
|
<NSSpace size={NSSpaceSizeType.MICRO} />
|
|
74
75
|
<p>{description}</p>
|
|
76
|
+
<NSSpace size={NSSpaceSizeType.SMALL} />
|
|
77
|
+
|
|
75
78
|
{props.getChildren?.getChildrenAfterTitle?.()}
|
|
76
79
|
|
|
80
|
+
{props.getChildren?.getChildrenBeforeMenuList?.()}
|
|
81
|
+
<NSListMenu
|
|
82
|
+
scope={scope}
|
|
83
|
+
name="Header"
|
|
84
|
+
isLoggedIn={() => props.account.token_manager.exists()}
|
|
85
|
+
onError={props.notifier.onError}
|
|
86
|
+
/>
|
|
87
|
+
{props.getChildren?.getChildrenAfterMenuList?.()}
|
|
88
|
+
|
|
89
|
+
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
90
|
+
<NSLine />
|
|
91
|
+
<NSSpace size={NSSpaceSizeType.SMALL} />
|
|
92
|
+
|
|
93
|
+
<NSTitle title="Related Products" style={{ fontSize: 32, marginBottom: props.product?.search ? 16 : 32 }} />
|
|
77
94
|
{
|
|
78
95
|
props.product?.search &&
|
|
79
96
|
<>
|
|
80
|
-
<NSSpace size={NSSpaceSizeType.SMALL} />
|
|
81
97
|
<NSBoxSearch
|
|
82
98
|
title=""
|
|
83
99
|
required={false}
|
|
@@ -94,24 +110,9 @@ export function NSAHomePage(props: NSAHomePageProps)
|
|
|
94
110
|
}, 1500);
|
|
95
111
|
}}
|
|
96
112
|
/>
|
|
113
|
+
<NSSpace size={NSSpaceSizeType.SMALL} />
|
|
97
114
|
</>
|
|
98
115
|
}
|
|
99
|
-
<NSSpace size={NSSpaceSizeType.SMALL} />
|
|
100
|
-
|
|
101
|
-
{props.getChildren?.getChildrenBeforeMenuList?.()}
|
|
102
|
-
<NSListMenu
|
|
103
|
-
scope={scope}
|
|
104
|
-
name="Header"
|
|
105
|
-
isLoggedIn={() => props.account.token_manager.exists()}
|
|
106
|
-
onError={props.notifier.onError}
|
|
107
|
-
/>
|
|
108
|
-
{props.getChildren?.getChildrenAfterMenuList?.()}
|
|
109
|
-
|
|
110
|
-
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
111
|
-
<NSLine />
|
|
112
|
-
<NSSpace size={NSSpaceSizeType.SMALL} />
|
|
113
|
-
|
|
114
|
-
<NSTitle title="Related Products" style={{ marginBottom: 32, fontSize: 32 }} />
|
|
115
116
|
<NSListProduct
|
|
116
117
|
scope={scope}
|
|
117
118
|
name="Home"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { NSDialogBoxPhone } from "namirasoft-site-react";
|
|
1
2
|
import { useEffect, useState } from "react";
|
|
2
|
-
import {
|
|
3
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
3
4
|
import { NSAVerificationPage } from "./NSAVerificationPage";
|
|
4
|
-
import { NSDialogBoxPhone } from "namirasoft-site-react";
|
|
5
5
|
|
|
6
|
-
interface NSAPhoneVerificationPageProps extends
|
|
6
|
+
interface NSAPhoneVerificationPageProps extends NSARouterMakerResult
|
|
7
7
|
{
|
|
8
8
|
callback: string;
|
|
9
9
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { BaseServer } from "namirasoft-core";
|
|
2
|
+
import { IBaseComponentProps, NSBoxString, NSButtonBlue, NSRouterMakerResult, NSSection, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
|
|
1
3
|
import React, { createRef, ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { NSSection, NSSpace, NSSpaceSizeType, NSButtonBlue } from 'namirasoft-site-react';
|
|
4
|
-
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
4
|
+
import { NSARouterMakerResult } from '../NSARouterMakerResult';
|
|
5
5
|
import Styles from './NSAVerificationPage.module.css';
|
|
6
|
-
import { BaseServer } from "namirasoft-core";
|
|
7
6
|
|
|
8
|
-
export interface NSAVerificationPageProps extends IBaseComponentProps,
|
|
7
|
+
export interface NSAVerificationPageProps extends IBaseComponentProps, NSRouterMakerResult, NSARouterMakerResult
|
|
9
8
|
{
|
|
10
9
|
contact_type: string;
|
|
11
10
|
contact_value_name: string;
|
|
@@ -2,11 +2,11 @@ import { CategoryInputRow, CategoryRow, CategoryScopeRow, SlotRow } from "namira
|
|
|
2
2
|
import { NSBox, NSBoxString, NSBoxTextArea, NSColumn, NSRow } from "namirasoft-site-react";
|
|
3
3
|
import { Component, createRef } from "react";
|
|
4
4
|
import { NSALayout } from "../layouts/NSALayout";
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
6
6
|
import { NSFRouterProps } from "../NSFRouterProps";
|
|
7
7
|
import { NSFEntities } from "./NSFEntities";
|
|
8
8
|
|
|
9
|
-
export interface NSFCategoryEditPageProps extends
|
|
9
|
+
export interface NSFCategoryEditPageProps extends NSARouterMakerResult, NSFRouterProps
|
|
10
10
|
{
|
|
11
11
|
slot: SlotRow;
|
|
12
12
|
category_scope: CategoryScopeRow;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CategoryScopeRow, SlotRow } from "namirasoft-field";
|
|
2
2
|
import { NSALayout } from "../layouts/NSALayout";
|
|
3
|
-
import {
|
|
3
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
4
4
|
import { NSFRouterProps } from "../NSFRouterProps";
|
|
5
5
|
import { NSFEntities } from "./NSFEntities";
|
|
6
6
|
|
|
7
|
-
export interface NSFCategoryListPageProps extends
|
|
7
|
+
export interface NSFCategoryListPageProps extends NSARouterMakerResult, NSFRouterProps
|
|
8
8
|
{
|
|
9
9
|
slot: SlotRow;
|
|
10
10
|
category_scope: CategoryScopeRow;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CategoryScopeRow, SlotRow } from "namirasoft-field";
|
|
2
2
|
import { NSALayout } from "../layouts/NSALayout";
|
|
3
|
-
import {
|
|
3
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
4
4
|
import { NSFRouterProps } from "../NSFRouterProps";
|
|
5
5
|
import { NSFEntities } from "./NSFEntities";
|
|
6
6
|
|
|
7
|
-
export interface NSFCategoryViewPageProps extends
|
|
7
|
+
export interface NSFCategoryViewPageProps extends NSARouterMakerResult, NSFRouterProps
|
|
8
8
|
{
|
|
9
9
|
slot: SlotRow;
|
|
10
10
|
category_scope: CategoryScopeRow;
|
package/src/pages/NSFEntities.ts
CHANGED
|
@@ -4,13 +4,13 @@ import { CategoryInputRow, CategoryRow, CategoryScopeRow, NamirasoftFieldMetaDat
|
|
|
4
4
|
import { NamirasoftMap } from "namirasoft-site-map";
|
|
5
5
|
import { BaseColumnFormatter, DateTimeFormatter, IDFormatter, StringFormatter, StringFormatterSizeType } from "namirasoft-site-react";
|
|
6
6
|
import { IEntityInfo } from "../IEntityInfo";
|
|
7
|
-
import {
|
|
7
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
8
8
|
import { NSFRouterProps } from "../NSFRouterProps";
|
|
9
9
|
import { NSFRoutes } from "../NSFRoutes";
|
|
10
10
|
|
|
11
11
|
export class NSFEntities
|
|
12
12
|
{
|
|
13
|
-
static category(props:
|
|
13
|
+
static category(props: NSARouterMakerResult & NSFRouterProps, slot: SlotRow, category_scope: CategoryScopeRow): IEntityInfo<CategoryRow, CategoryInputRow>
|
|
14
14
|
{
|
|
15
15
|
let namirasoft = new NamirasoftMap(props.account.token_manager, console.error);
|
|
16
16
|
|
|
@@ -2,9 +2,9 @@ import { Component, cloneElement } from "react";
|
|
|
2
2
|
import { IBaseComponentProps, LinkOperation, NSBox, NSButtonGreen, NSLabel, NSLoading, NSPanel, NSRow, NSSection } from "namirasoft-site-react";
|
|
3
3
|
import { EncodingOperation } from "namirasoft-core";
|
|
4
4
|
import { SubscriptionValidation } from "namirasoft-payment";
|
|
5
|
-
import {
|
|
5
|
+
import { NSARouterMakerResult } from "../NSARouterMakerResult";
|
|
6
6
|
|
|
7
|
-
export interface PaymentRequiredProps extends IBaseComponentProps,
|
|
7
|
+
export interface PaymentRequiredProps extends IBaseComponentProps, NSARouterMakerResult
|
|
8
8
|
{
|
|
9
9
|
tilte: string;
|
|
10
10
|
description: string;
|
|
@@ -59,9 +59,9 @@ export class PaymentRequired extends Component<PaymentRequiredProps, PaymentRequ
|
|
|
59
59
|
onClick={{
|
|
60
60
|
action: () =>
|
|
61
61
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
let callback = EncodingOperation.Base64Encode(window.location.href);
|
|
63
|
+
let link = this.props.payment_offer_url + "?callback=" + callback;
|
|
64
|
+
LinkOperation.open(link);
|
|
65
65
|
},
|
|
66
66
|
showLoading: false
|
|
67
67
|
}}
|
package/dist/App.css
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: inter;
|
|
3
|
-
src: url("../src/assets/fonts/Inter-Regular.ttf");
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
body {
|
|
7
|
-
margin: 0;
|
|
8
|
-
font-family: inter;
|
|
9
|
-
-webkit-font-smoothing: antialiased;
|
|
10
|
-
-moz-osx-font-smoothing: grayscale;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.btn-close {
|
|
15
|
-
background: url(https://static.namirasoft.com/image/concept/close/blue.svg) center/1em auto no-repeat !important;
|
|
16
|
-
opacity: 1 !important;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.nsa_font_16_bold {
|
|
20
|
-
font-size: 16px;
|
|
21
|
-
font-weight: 600;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.nsa_font_13_normal {
|
|
25
|
-
font-size: 13px;
|
|
26
|
-
font-weight: 300;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.nsa_font_12_normal {
|
|
30
|
-
font-size: 12px;
|
|
31
|
-
font-weight: 300;
|
|
32
|
-
}
|
package/dist/NSARouter.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EntityResolveResponseRow } from 'namirasoft-field';
|
|
2
|
-
import { Component, ReactNode } from 'react';
|
|
3
|
-
import { NSARouterMakerProps } from './NSARouterMakerProps';
|
|
4
|
-
export interface NSARoutesProps extends NSARouterMakerProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
interface NSARoutesState {
|
|
8
|
-
rows: EntityResolveResponseRow | null;
|
|
9
|
-
}
|
|
10
|
-
export declare class NSARouter extends Component<NSARoutesProps, NSARoutesState> {
|
|
11
|
-
private cache_field;
|
|
12
|
-
constructor(props: NSARoutesProps);
|
|
13
|
-
componentDidMount(): void;
|
|
14
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
package/dist/NSARouter.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { EnvService } from 'namirasoft-core';
|
|
3
|
-
import { NamirasoftFieldServer, SlotEntityType } from 'namirasoft-field';
|
|
4
|
-
import { NSRoutes } from 'namirasoft-site-react';
|
|
5
|
-
import { Component } from 'react';
|
|
6
|
-
import { Route } from 'react-router-dom';
|
|
7
|
-
import { FieldCacheService } from './FieldCacheService';
|
|
8
|
-
import { NSFRoutes } from './NSFRoutes';
|
|
9
|
-
import { NSFCategoryEditPage } from './pages/NSFCategoryEditPage';
|
|
10
|
-
import { NSFCategoryListPage } from './pages/NSFCategoryListPage';
|
|
11
|
-
import { NSFCategoryViewPage } from './pages/NSFCategoryViewPage';
|
|
12
|
-
export class NSARouter extends Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
this.cache_field = FieldCacheService.get(this.props.account.token_manager, this.props.product_id, this.props.notifier.onError);
|
|
16
|
-
this.state = {
|
|
17
|
-
rows: null,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
componentDidMount() {
|
|
21
|
-
this.cache_field.get().then(rows => {
|
|
22
|
-
this.setState(prev => (Object.assign(Object.assign({}, prev), { rows })));
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
var _a;
|
|
27
|
-
const { rows } = this.state;
|
|
28
|
-
const scope_slots = (_a = rows === null || rows === void 0 ? void 0 : rows.slots.filter(s => s.entity_type === SlotEntityType.CategoryScope)) !== null && _a !== void 0 ? _a : [];
|
|
29
|
-
let pairs = scope_slots.map(slot => ({ slot, category_scope: rows === null || rows === void 0 ? void 0 : rows.category_scopes.find(c => c.id === slot.entity_id) })).filter(i => i.category_scope);
|
|
30
|
-
let REACT_APP_BASE_URL_FIELD = new EnvService("REACT_APP_BASE_URL_FIELD", true).getString();
|
|
31
|
-
let field = new NamirasoftFieldServer(REACT_APP_BASE_URL_FIELD, this.props.account.token_manager, this.props.notifier.onError);
|
|
32
|
-
let servers = { field };
|
|
33
|
-
return (_jsxs(NSRoutes, { children: [this.props.children, pairs.flatMap(({ slot, category_scope }) => [
|
|
34
|
-
_jsx(Route, { path: NSFRoutes.CategoryList(slot.id, slot.name), element: _jsx(NSFCategoryListPage, Object.assign({}, this.props, { servers: servers, slot: slot, category_scope: category_scope })) }, `${slot.id}-category-list`),
|
|
35
|
-
_jsx(Route, { path: NSFRoutes.CategoryNew(slot.id, slot.name), element: _jsx(NSFCategoryEditPage, Object.assign({}, this.props, { servers: servers, isEdit: false, slot: slot, category_scope: category_scope })) }, `${slot.id}-category-new`),
|
|
36
|
-
_jsx(Route, { path: NSFRoutes.CategoryCopy(slot.id, slot.name, ":id"), element: _jsx(NSFCategoryEditPage, Object.assign({}, this.props, { servers: servers, isEdit: false, slot: slot, category_scope: category_scope })) }, `${slot.id}-category-copy`),
|
|
37
|
-
_jsx(Route, { path: NSFRoutes.CategoryEdit(slot.id, slot.name, ":id"), element: _jsx(NSFCategoryEditPage, Object.assign({}, this.props, { servers: servers, isEdit: true, slot: slot, category_scope: category_scope })) }, `${slot.id}-category-edit`),
|
|
38
|
-
_jsx(Route, { path: NSFRoutes.CategoryView(slot.id, slot.name, ":id"), element: _jsx(NSFCategoryViewPage, Object.assign({}, this.props, { servers: servers, slot: slot, category_scope: category_scope })) }, `${slot.id}-category-view`),
|
|
39
|
-
])] }));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=NSARouter.js.map
|
package/dist/NSARouter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NSARouter.js","sourceRoot":"","sources":["../src/NSARouter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAA8C,qBAAqB,EAAE,cAAc,EAAW,MAAM,kBAAkB,CAAC;AAC9H,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO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BACzN,KAAC,KAAK,IAAkC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,KAAC,mBAAmB,oBAAK,IAAI,CAAC,KAAK,IAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,IAAI,IAAlN,GAAG,IAAI,CAAC,EAAE,gBAAgB,CAA4L;oBAClO,KAAC,KAAK,IAAkC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,KAAC,mBAAmB,oBAAK,IAAI,CAAC,KAAK,IAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,IAAI,IAAjN,GAAG,IAAI,CAAC,EAAE,gBAAgB,CAA2L;oBACjO,KAAC,KAAK,IAAkC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,KAAC,mBAAmB,oBAAK,IAAI,CAAC,KAAK,IAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,IAAI,IAAnM,GAAG,IAAI,CAAC,EAAE,gBAAgB,CAA6K;iBACtN,CAAC,IAEC,CACd,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NSARouterMakerProps } from "./NSARouterMakerProps";
|
|
3
|
-
export interface NSARouterMakerConfig {
|
|
4
|
-
onRenderOnLogin(props: NSARouterMakerProps): React.JSX.Element;
|
|
5
|
-
onRenderOnLogout(props: NSARouterMakerProps, banned: boolean): React.JSX.Element;
|
|
6
|
-
renderOnNSALayout(props: NSARouterMakerProps, children: React.JSX.Element): React.JSX.Element;
|
|
7
|
-
getCustomRender?: (props: NSARouterMakerProps) => React.JSX.Element | null;
|
|
8
|
-
requirement: {
|
|
9
|
-
verification: {
|
|
10
|
-
email: boolean;
|
|
11
|
-
phone: boolean;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NSARouterMakerConfig.js","sourceRoot":"","sources":["../src/NSARouterMakerConfig.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TableColumnInfo } from "namirasoft-site-react";
|
|
2
|
-
import { Component } from "react";
|
|
3
|
-
interface ColumnItem {
|
|
4
|
-
key: string;
|
|
5
|
-
text: string;
|
|
6
|
-
checked: boolean;
|
|
7
|
-
}
|
|
8
|
-
interface NSAReorderDialogProps {
|
|
9
|
-
visibleColumnKeys: string[];
|
|
10
|
-
getColumns: () => TableColumnInfo[];
|
|
11
|
-
onCancel: () => void;
|
|
12
|
-
onApply: (orderedKeys: string[]) => void;
|
|
13
|
-
}
|
|
14
|
-
interface NSAReorderDialogState {
|
|
15
|
-
columns: ColumnItem[];
|
|
16
|
-
dragFromIndex: number | null;
|
|
17
|
-
dragOverIndex: number | null;
|
|
18
|
-
}
|
|
19
|
-
export declare class NSAReorderDialog extends Component<NSAReorderDialogProps, NSAReorderDialogState> {
|
|
20
|
-
constructor(props: NSAReorderDialogProps);
|
|
21
|
-
private buildColumnItems;
|
|
22
|
-
private onDragStart;
|
|
23
|
-
private onDragOver;
|
|
24
|
-
private onDrop;
|
|
25
|
-
private onDragEnd;
|
|
26
|
-
private toggleChecked;
|
|
27
|
-
private handleApply;
|
|
28
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { NSBox, NSButtonBlue, NSColumn, NSDialog, NSTitle } from "namirasoft-site-react";
|
|
3
|
-
import { Component } from "react";
|
|
4
|
-
import Styles from "./NSAReorderDialog.module.css";
|
|
5
|
-
export class NSAReorderDialog extends Component {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super(props);
|
|
8
|
-
this.onDragStart = (index) => this.setState({ dragFromIndex: index });
|
|
9
|
-
this.onDragOver = (e, index) => {
|
|
10
|
-
e.preventDefault();
|
|
11
|
-
if (this.state.dragOverIndex !== index)
|
|
12
|
-
this.setState({ dragOverIndex: index });
|
|
13
|
-
};
|
|
14
|
-
this.onDrop = (e, dropIndex) => {
|
|
15
|
-
e.preventDefault();
|
|
16
|
-
const { dragFromIndex, columns } = this.state;
|
|
17
|
-
if (dragFromIndex === null || dragFromIndex === dropIndex) {
|
|
18
|
-
this.setState({ dragFromIndex: null, dragOverIndex: null });
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const next = [...columns];
|
|
22
|
-
const [moved] = next.splice(dragFromIndex, 1);
|
|
23
|
-
next.splice(dropIndex, 0, moved);
|
|
24
|
-
this.setState({ columns: next, dragFromIndex: null, dragOverIndex: null });
|
|
25
|
-
};
|
|
26
|
-
this.onDragEnd = () => this.setState({ dragFromIndex: null, dragOverIndex: null });
|
|
27
|
-
this.toggleChecked = (key) => this.setState(prev => ({
|
|
28
|
-
columns: prev.columns.map(c => c.key === key ? Object.assign(Object.assign({}, c), { checked: !c.checked }) : c)
|
|
29
|
-
}));
|
|
30
|
-
this.handleApply = () => {
|
|
31
|
-
const orderedKeys = this.state.columns.filter(c => c.checked).map(c => c.key);
|
|
32
|
-
this.props.onApply(orderedKeys);
|
|
33
|
-
};
|
|
34
|
-
this.state = {
|
|
35
|
-
columns: this.buildColumnItems(props),
|
|
36
|
-
dragFromIndex: null,
|
|
37
|
-
dragOverIndex: null
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
buildColumnItems(props) {
|
|
41
|
-
const allColumns = props.getColumns();
|
|
42
|
-
const visibleKeys = props.visibleColumnKeys;
|
|
43
|
-
if (visibleKeys.length === 0)
|
|
44
|
-
return allColumns.map(c => ({ key: c.table.name + "." + c.name, text: c.text, checked: true }));
|
|
45
|
-
const visibleItems = visibleKeys
|
|
46
|
-
.map(k => allColumns.find(c => c.table.name + "." + c.name === k))
|
|
47
|
-
.filter(Boolean)
|
|
48
|
-
.map(c => ({ key: c.table.name + "." + c.name, text: c.text, checked: true }));
|
|
49
|
-
const hiddenItems = allColumns
|
|
50
|
-
.filter(c => !visibleKeys.includes(c.table.name + "." + c.name))
|
|
51
|
-
.map(c => ({ key: c.table.name + "." + c.name, text: c.text, checked: false }));
|
|
52
|
-
return [...visibleItems, ...hiddenItems];
|
|
53
|
-
}
|
|
54
|
-
render() {
|
|
55
|
-
const { onCancel } = this.props;
|
|
56
|
-
const { columns, dragFromIndex, dragOverIndex } = this.state;
|
|
57
|
-
return (_jsx(NSDialog, { center_dialog: true, closeButton: { show: true }, onClose: onCancel, style: { minWidth: NSBox.width.double }, children: _jsxs(NSColumn, { classList: ["align-items-center"], children: [_jsx(NSTitle, { title: "Columns", style: { marginBottom: 0, fontSize: 24 } }), _jsx(NSColumn, { classList: ["gap-1"], children: columns.map((col, index) => {
|
|
58
|
-
const isDragging = dragFromIndex === index;
|
|
59
|
-
const isDragOver = dragOverIndex === index && !isDragging;
|
|
60
|
-
let cls = Styles.column_item;
|
|
61
|
-
if (isDragging)
|
|
62
|
-
cls += " " + Styles.column_item_dragging;
|
|
63
|
-
if (isDragOver)
|
|
64
|
-
cls += " " + Styles.column_item_drag_over;
|
|
65
|
-
return (_jsxs("div", { draggable: true, onDragStart: () => this.onDragStart(index), onDragOver: e => this.onDragOver(e, index), onDrop: e => this.onDrop(e, index), onDragEnd: this.onDragEnd, className: cls, children: [_jsx("span", { className: Styles.drag_handle, children: "\u283F" }), _jsx("input", { type: "checkbox", checked: col.checked, onChange: () => this.toggleChecked(col.key), className: Styles.checkbox }), _jsx("span", { className: Styles.column_label, children: col.text })] }, col.key));
|
|
66
|
-
}) }), _jsx(NSButtonBlue, { title: "Apply", onClick: { action: this.handleApply, showLoading: false } })] }) }));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=NSAReorderDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NSAReorderDialog.js","sourceRoot":"","sources":["../../src/components/NSAReorderDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAmB,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAC7C,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAwBnD,MAAM,OAAO,gBAAiB,SAAQ,SAAuD;IAEzF,YAAY,KAA4B;QAEpC,KAAK,CAAC,KAAK,CAAC,CAAC;QA4BT,gBAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzE,eAAU,GAAG,CAAC,CAAY,EAAE,KAAa,EAAE,EAAE;YAEjD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,KAAK,KAAK;gBAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC;QAEM,WAAM,GAAG,CAAC,CAAY,EAAE,SAAiB,EAAE,EAAE;YAEjD,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAC9C,IAAI,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,SAAS,EACzD,CAAC;gBACG,I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MAAM,CAAC,qBAAqB,CAAC;4BAC1D,OAAO,CACH,eAEI,SAAS,QACT,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC1C,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,EAC1C,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,EAClC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,GAAG,aAEd,eAAM,SAAS,EAAE,MAAM,CAAC,WAAW,uBAAU,EAC7C,gBACI,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,GAAG,CAAC,OAAO,EACpB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAC3C,SAAS,EAAE,MAAM,CAAC,QAAQ,GAC5B,EACF,eAAM,SAAS,EAAE,MAAM,CAAC,YAAY,YAAG,GAAG,CAAC,IAAI,GAAQ,KAflD,GAAG,CAAC,GAAG,CAgBV,CACT,CAAC;wBACN,CAAC,CAAC,GAEC,EACX,KAAC,YAAY,IACT,KAAK,EAAC,OAAO,EACb,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,GAC3D,IACK,GACJ,CACd,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
.column_item {
|
|
2
|
-
width: 100%;
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
gap: 10px;
|
|
6
|
-
padding: 8px 12px;
|
|
7
|
-
border-radius: 6px;
|
|
8
|
-
border: 2px solid transparent;
|
|
9
|
-
background-color: rgba(20, 27, 92, 0.04);
|
|
10
|
-
cursor: grab;
|
|
11
|
-
user-select: none;
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
transition: background-color 0.1s, border-color 0.1s;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.column_item:hover {
|
|
17
|
-
background-color: rgba(20, 27, 92, 0.08);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.column_item_dragging {
|
|
21
|
-
opacity: 0.35;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.column_item_drag_over {
|
|
25
|
-
border-color: rgba(20, 27, 92, 0.45);
|
|
26
|
-
border-style: dashed;
|
|
27
|
-
background-color: rgba(20, 27, 92, 0.1);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.drag_handle {
|
|
31
|
-
color: #bbb;
|
|
32
|
-
font-size: 20px;
|
|
33
|
-
line-height: 1;
|
|
34
|
-
cursor: grab;
|
|
35
|
-
flex-shrink: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.checkbox {
|
|
39
|
-
width: 18px;
|
|
40
|
-
height: 18px;
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
margin: 0;
|
|
43
|
-
flex-shrink: 0;
|
|
44
|
-
accent-color: rgba(20, 27, 92, 1);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.column_label {
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
flex: 1;
|
|
50
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SortItem } from "namirasoft-core";
|
|
2
|
-
import { TableColumnInfo } from "namirasoft-site-react";
|
|
3
|
-
import { Component } from "react";
|
|
4
|
-
interface NSASortDialogProps {
|
|
5
|
-
sorts: SortItem[];
|
|
6
|
-
getColumns: () => TableColumnInfo[];
|
|
7
|
-
onCancel: () => void;
|
|
8
|
-
onApply: (sorts: SortItem[] | null) => void;
|
|
9
|
-
}
|
|
10
|
-
interface NSASortDialogState {
|
|
11
|
-
sortEnabled: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare class NSASortDialog extends Component<NSASortDialogProps, NSASortDialogState> {
|
|
14
|
-
private sortBoolRef;
|
|
15
|
-
private sortColumnRef;
|
|
16
|
-
private sortDirectionRef;
|
|
17
|
-
constructor(props: NSASortDialogProps);
|
|
18
|
-
private handleApply;
|
|
19
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { BaseMetaColumn, BaseMetaTable, SortItem } from "namirasoft-core";
|
|
12
|
-
import { NSBoxBaseCombo, NSBoxBoolean, NSBoxCombo, NSButtonBlue, NSColumn, NSDialog, NSTitle } from "namirasoft-site-react";
|
|
13
|
-
import { Component, createRef } from "react";
|
|
14
|
-
export class NSASortDialog extends Component {
|
|
15
|
-
constructor(props) {
|
|
16
|
-
super(props);
|
|
17
|
-
this.sortBoolRef = createRef();
|
|
18
|
-
this.sortColumnRef = createRef();
|
|
19
|
-
this.sortDirectionRef = createRef();
|
|
20
|
-
this.handleApply = () => {
|
|
21
|
-
var _a, _b, _c;
|
|
22
|
-
if (!((_a = this.sortBoolRef.current) === null || _a === void 0 ? void 0 : _a.getValueBool())) {
|
|
23
|
-
this.props.onApply(null);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const column = (_b = this.sortColumnRef.current) === null || _b === void 0 ? void 0 : _b.getDataOne();
|
|
27
|
-
const direction = (_c = this.sortDirectionRef.current) === null || _c === void 0 ? void 0 : _c.getValueOne();
|
|
28
|
-
if (column) {
|
|
29
|
-
const t = new BaseMetaTable(null, column.table.name, column.table.text);
|
|
30
|
-
const c = new BaseMetaColumn(t, column.name, column.text, "", true);
|
|
31
|
-
const sort = new SortItem(t, c, direction === "true");
|
|
32
|
-
this.props.onApply([sort]);
|
|
33
|
-
}
|
|
34
|
-
else
|
|
35
|
-
this.props.onApply(null);
|
|
36
|
-
};
|
|
37
|
-
this.state = { sortEnabled: props.sorts.length > 0 };
|
|
38
|
-
}
|
|
39
|
-
render() {
|
|
40
|
-
var _a, _b;
|
|
41
|
-
const { sorts, getColumns, onCancel } = this.props;
|
|
42
|
-
return (_jsxs(NSDialog, { center_dialog: true, closeButton: { show: true }, onClose: onCancel, children: [_jsx(NSTitle, { title: "Sort", style: { marginBottom: 0, fontSize: 24 } }), _jsxs(NSColumn, { classList: ["align-items-center mt-3"], children: [_jsx(NSBoxBoolean, { ref: this.sortBoolRef, required: true, title: "Sort", hideHeader: true, checked: sorts.length > 0, onChanged: () => this.setState(prev => ({ sortEnabled: !prev.sortEnabled })) }), _jsx(NSBoxBaseCombo, { ref: this.sortColumnRef, title: "Column", required: true, defaultValue: (_a = sorts[0]) === null || _a === void 0 ? void 0 : _a.column.name, getItems: () => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const cs = getColumns();
|
|
44
|
-
return { count: cs.length, rows: cs };
|
|
45
|
-
}), getTitle: c => c.text, getValue: c => c.name, getSort: () => null, multiple: false, disabled: this.state.sortEnabled, menu: {
|
|
46
|
-
builtin: {
|
|
47
|
-
copy: { enabled: false, getValue: () => "" }
|
|
48
|
-
},
|
|
49
|
-
items: []
|
|
50
|
-
} }), _jsx(NSBoxCombo, { ref: this.sortDirectionRef, title: "Direction", required: true, defaultValue: ((_b = sorts[0]) === null || _b === void 0 ? void 0 : _b.ascending) + "", getOptions: () => [
|
|
51
|
-
{ value: "true", title: "Ascending" },
|
|
52
|
-
{ value: "false", title: "Descending" }
|
|
53
|
-
], multiple: false, disabled: this.state.sortEnabled, menu: {
|
|
54
|
-
builtin: {
|
|
55
|
-
copy: { enabled: false, getValue: () => "" }
|
|
56
|
-
},
|
|
57
|
-
items: []
|
|
58
|
-
} }), _jsx(NSButtonBlue, { title: "Apply", onClick: { action: this.handleApply, showLoading: false } })] })] }));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=NSASortDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NSASortDialog.js","sourceRoot":"","sources":["../../src/components/NSASortDialog.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAmB,MAAM,uBAAuB,CAAC;AAC7I,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAe7C,MAAM,OAAO,aAAc,SAAQ,SAAiD;IAMhF,YAAY,KAAyB;QAEjC,KAAK,CAAC,KAAK,CAAC,CAAC;QANT,gBAAW,GAAG,SAAS,EAAgB,CAAC;QACxC,kBAAa,GAAG,SAAS,EAAmC,CAAC;QAC7D,qBAAgB,GAAG,SAAS,EAAc,CAAC;QAQ3C,gBAAW,GAAG,GAAG,EAAE;;YAEvB,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,WAAW,CAAC,OAAO,0CAAE,YAAY,EAAE,CAAA,EAC7C,CAAC;gBACG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACzB,OAAO;YACX,CAAC;YACD,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,aAAa,CAAC,OAAO,0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gCACd,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE;gCACrC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE;6BAC1C,EACD,QAAQ,EAAE,KAAK,EACf,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAChC,IAAI,EAAE;gCACF,OAAO,EAAE;oCACL,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;iCAC/C;gCACD,KAAK,EAAE,EAAE;6BACZ,GACH,EACF,KAAC,YAAY,IACT,KAAK,EAAC,OAAO,EACb,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,GAC3D,IACK,IACJ,CACd,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EntityResolveResponseRow } from 'namirasoft-field';
|
|
2
|
-
import { Component, ReactNode } from 'react';
|
|
3
|
-
import { NSARouterMakerProps } from '../NSARouterMakerProps';
|
|
4
|
-
export interface NSARoutesProps extends NSARouterMakerProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
interface NSARoutesState {
|
|
8
|
-
rows: EntityResolveResponseRow | null;
|
|
9
|
-
}
|
|
10
|
-
export declare class NSARouter extends Component<NSARoutesProps, NSARoutesState> {
|
|
11
|
-
private cache_field;
|
|
12
|
-
constructor(props: NSARoutesProps);
|
|
13
|
-
componentDidMount(): void;
|
|
14
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
}
|
|
16
|
-
export {};
|