namirasoft-site-react 1.4.530 → 1.4.531
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.
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NSSection } from './NSSection';
|
|
3
3
|
import { NSTitle } from './NSTitle';
|
|
4
|
-
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
5
4
|
export function NSSectionTitle(props) {
|
|
6
|
-
return (_jsxs(NSSection, Object.assign({}, props, { children: [_jsx(
|
|
5
|
+
return (_jsxs(NSSection, Object.assign({}, props, { children: [_jsx(NSTitle, { title: props.title }), props.children] })));
|
|
7
6
|
}
|
|
8
7
|
//# sourceMappingURL=NSSectionTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSectionTitle.js","sourceRoot":"","sources":["../../src/components/NSSectionTitle.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"NSSectionTitle.js","sourceRoot":"","sources":["../../src/components/NSSectionTitle.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,MAAM,UAAU,cAAc,CAAC,KAA0B;IAExD,OAAO,CACN,MAAC,SAAS,oBAAK,KAAK,eACnB,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,EAC9B,KAAK,CAAC,QAAQ,KACJ,CACZ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
11
|
+
"version": "1.4.531",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"copy": "copyfiles -u 1 src/**/*.html src/**/*.css src/**/*.svg src/**/*.png src/**/*.jpg dist/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ant-design/icons": "^6.2.
|
|
24
|
+
"@ant-design/icons": "^6.2.5",
|
|
25
25
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
26
26
|
"@babel/plugin-transform-private-property-in-object": "^7.29.7",
|
|
27
27
|
"@types/node": "^25.9.1",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"chart.js": "^4.5.1",
|
|
38
38
|
"copyfiles": "^2.4.1",
|
|
39
39
|
"namirasoft-api-link": "^1.4.22",
|
|
40
|
-
"namirasoft-api-product": "^1.4.
|
|
41
|
-
"namirasoft-core": "^1.4.
|
|
40
|
+
"namirasoft-api-product": "^1.4.53",
|
|
41
|
+
"namirasoft-core": "^1.4.115",
|
|
42
42
|
"namirasoft-schema": "^1.4.29",
|
|
43
43
|
"namirasoft-site": "^1.4.45",
|
|
44
|
-
"namirasoft-site-map": "^1.4.
|
|
44
|
+
"namirasoft-site-map": "^1.4.47",
|
|
45
45
|
"os-browserify": "^0.3.0",
|
|
46
46
|
"path-browserify": "^1.0.1",
|
|
47
47
|
"process": "^0.11.10",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
3
|
import { NSSection } from './NSSection';
|
|
3
4
|
import { NSTitle } from './NSTitle';
|
|
4
|
-
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
5
|
-
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
6
5
|
|
|
7
6
|
export interface NSSectionTitleProps extends IBaseComponentProps
|
|
8
7
|
{
|
|
@@ -14,7 +13,6 @@ export function NSSectionTitle(props: NSSectionTitleProps)
|
|
|
14
13
|
{
|
|
15
14
|
return (
|
|
16
15
|
<NSSection {...props} >
|
|
17
|
-
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
18
16
|
<NSTitle title={props.title} />
|
|
19
17
|
{props.children}
|
|
20
18
|
</NSSection>
|
package/SKILLS.md
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: namirasoft-site-react
|
|
3
|
-
description: Use when working inside the Namirasoft Site React NPM Package or when any Namirasoft portal frontend imports from namirasoft-site-react. Covers all 40+ NSBox* form/display components, NSBoxBuilder, routing, formatters, and Ant Design integration.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Namirasoft Site React Package Skill
|
|
7
|
-
|
|
8
|
-
## Trigger
|
|
9
|
-
Use this skill when working inside `d:\01 - Code Base\Namira\Package\TypeScript\Namirasoft Site React NPM Package` or when any Namirasoft portal frontend imports from `namirasoft-site-react`.
|
|
10
|
-
|
|
11
|
-
## Package Identity
|
|
12
|
-
- **npm name:** `namirasoft-site-react`
|
|
13
|
-
- **Entry point:** `dist/main.js` / React app entry: `src/index.tsx`
|
|
14
|
-
- **Purpose:** React UI component library and application framework for Namirasoft portal interfaces. 40+ `NSBox*` form/display components, routing, data formatting, and portal infrastructure built on Ant Design + Bootstrap.
|
|
15
|
-
|
|
16
|
-
## Key Dependencies
|
|
17
|
-
`react ^18`, `react-dom`, `react-router-dom ^7`, `antd ^6`, `@ant-design/icons ^6`, `react-bootstrap ^2`, `bootstrap`, `chart.js`, `react-chartjs-2`, `axios`, `@uiw/react-json-view`, `namirasoft-core`, `namirasoft-schema`, `namirasoft-site`, `namirasoft-site-map`, `namirasoft-api-product`, `namirasoft-api-link`
|
|
18
|
-
|
|
19
|
-
## Source Structure
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
src/
|
|
23
|
-
├── components/ # 40+ NSBox* components
|
|
24
|
-
├── pages/ # Page-level components
|
|
25
|
-
├── props/ # Prop type interfaces
|
|
26
|
-
├── routing/ # Route definitions
|
|
27
|
-
├── formatter/ # Data formatters
|
|
28
|
-
├── App.tsx # Main application component
|
|
29
|
-
├── main.ts # Module entry (for npm consumers)
|
|
30
|
-
└── index.tsx # React app entry
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## NSBox Component Library
|
|
34
|
-
|
|
35
|
-
All input/display components follow the `NSBox*` naming convention. They are built on top of Ant Design and handle type-specific rendering, validation, and editing.
|
|
36
|
-
|
|
37
|
-
### Boolean
|
|
38
|
-
| Component | Description |
|
|
39
|
-
|-----------|-------------|
|
|
40
|
-
| `NSBoxBoolean` | Toggle/checkbox for boolean values |
|
|
41
|
-
|
|
42
|
-
### Text & String
|
|
43
|
-
| Component | Description |
|
|
44
|
-
|-----------|-------------|
|
|
45
|
-
| `NSBoxString` | Text input |
|
|
46
|
-
| `NSBoxEmail` | Email input with format validation |
|
|
47
|
-
| `NSBoxURL` | URL input |
|
|
48
|
-
| `NSBoxPhone` | Phone number input (E.164) |
|
|
49
|
-
| `NSBoxColor` | Color picker (hex) |
|
|
50
|
-
| `NSBoxFont` | Font name selector |
|
|
51
|
-
| `NSBoxVersion` | SemVer string input |
|
|
52
|
-
| `NSBoxFilePath` | File path input |
|
|
53
|
-
| `NSBoxIPV4` | IPv4 address input |
|
|
54
|
-
| `NSBoxIPV6` | IPv6 address input |
|
|
55
|
-
| `NSBoxIPV4Range` | IPv4 CIDR range input |
|
|
56
|
-
| `NSBoxIPV6Range` | IPv6 CIDR range input |
|
|
57
|
-
|
|
58
|
-
### Numeric
|
|
59
|
-
| Component | Description |
|
|
60
|
-
|-----------|-------------|
|
|
61
|
-
| `NSBoxInteger` | Integer number input |
|
|
62
|
-
| `NSBoxFloat` | Float input |
|
|
63
|
-
| `NSBoxDouble` | Double input |
|
|
64
|
-
| `NSBoxDecimal` | Decimal/arbitrary precision input |
|
|
65
|
-
| `NSBoxBigInt` | BigInt input |
|
|
66
|
-
| `NSBoxMoney` | Currency amount input |
|
|
67
|
-
|
|
68
|
-
### Date & Time
|
|
69
|
-
| Component | Description |
|
|
70
|
-
|-----------|-------------|
|
|
71
|
-
| `NSBoxDate` | Date picker (YYYY-MM-DD) |
|
|
72
|
-
| `NSBoxDateTime` | Date + time picker |
|
|
73
|
-
| `NSBoxTime` | Time picker (HH:mm:ss) |
|
|
74
|
-
| `NSBoxDuration` | Duration input (ISO 8601) |
|
|
75
|
-
| `NSBoxTimeZone` | IANA timezone selector |
|
|
76
|
-
|
|
77
|
-
### Selection
|
|
78
|
-
| Component | Description |
|
|
79
|
-
|-----------|-------------|
|
|
80
|
-
| `NSBoxCombo` | Dropdown/combo box (enum values) |
|
|
81
|
-
| `NSBoxEntity` | Entity reference selector (FK-like dropdown) |
|
|
82
|
-
| `NSBoxEnum` | Enum display/input |
|
|
83
|
-
|
|
84
|
-
### Complex
|
|
85
|
-
| Component | Description |
|
|
86
|
-
|-----------|-------------|
|
|
87
|
-
| `NSBoxArray` | Array of items editor |
|
|
88
|
-
| `NSBoxAny` | Unconstrained value input |
|
|
89
|
-
| `NSBoxBuilder` | Large composite form builder (35KB). Generates entire forms from schema definitions. |
|
|
90
|
-
|
|
91
|
-
## Utilities
|
|
92
|
-
| Export | Description |
|
|
93
|
-
|--------|-------------|
|
|
94
|
-
| `Validator` | Client-side validation (delegates to `namirasoft-schema` JoiValidator) |
|
|
95
|
-
| `EncryptionOperation` | Client-side AES encrypt/decrypt |
|
|
96
|
-
| `Color` | Color manipulation helpers |
|
|
97
|
-
| `CopyToClipboard` | Copy text to clipboard |
|
|
98
|
-
| `ProductCacheService` | Caches product/API metadata on the client side |
|
|
99
|
-
|
|
100
|
-
## Common Usage Patterns
|
|
101
|
-
|
|
102
|
-
### Using an NSBox component
|
|
103
|
-
```tsx
|
|
104
|
-
import { NSBoxString } from 'namirasoft-site-react';
|
|
105
|
-
|
|
106
|
-
function UserForm() {
|
|
107
|
-
const [email, setEmail] = React.useState('');
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<NSBoxEmail
|
|
111
|
-
value={email}
|
|
112
|
-
onChange={setEmail}
|
|
113
|
-
label="Email Address"
|
|
114
|
-
required
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Using NSBoxBuilder (schema-driven forms)
|
|
121
|
-
```tsx
|
|
122
|
-
import { NSBoxBuilder } from 'namirasoft-site-react';
|
|
123
|
-
import { ApplicationSchema } from 'namirasoft-schema';
|
|
124
|
-
|
|
125
|
-
function AutoForm({ schema, data, onChange }) {
|
|
126
|
-
return (
|
|
127
|
-
<NSBoxBuilder
|
|
128
|
-
schema={schema}
|
|
129
|
-
data={data}
|
|
130
|
-
onChange={onChange}
|
|
131
|
-
/>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Using NSBoxCombo (enum dropdown)
|
|
137
|
-
```tsx
|
|
138
|
-
import { NSBoxCombo } from 'namirasoft-site-react';
|
|
139
|
-
|
|
140
|
-
<NSBoxCombo
|
|
141
|
-
value={status}
|
|
142
|
-
onChange={setStatus}
|
|
143
|
-
options={[
|
|
144
|
-
{ label: 'Active', value: 'active' },
|
|
145
|
-
{ label: 'Inactive', value: 'inactive' },
|
|
146
|
-
]}
|
|
147
|
-
label="Status"
|
|
148
|
-
/>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Routing setup
|
|
152
|
-
```tsx
|
|
153
|
-
// src/routing/ defines routes using react-router-dom v7
|
|
154
|
-
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
155
|
-
import { routes } from './routing/routes';
|
|
156
|
-
|
|
157
|
-
const router = createBrowserRouter(routes);
|
|
158
|
-
|
|
159
|
-
function App() {
|
|
160
|
-
return <RouterProvider router={router} />;
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Formatters
|
|
165
|
-
```tsx
|
|
166
|
-
import { formatDate, formatMoney, formatDuration } from 'namirasoft-site-react/formatter';
|
|
167
|
-
|
|
168
|
-
formatDate('2024-01-15'); // → 'Jan 15, 2024'
|
|
169
|
-
formatMoney(12345.67, 'USD'); // → '$12,345.67'
|
|
170
|
-
formatDuration('PT1H30M'); // → '1h 30m'
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## Build Configuration
|
|
174
|
-
Uses `react-app-rewired` to customize CRA build without ejecting. Static assets (CSS, HTML, images) are copied to `dist/` using `copyfiles`.
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
npm run start # dev server (CRA)
|
|
178
|
-
npm run build # production build → dist/
|
|
179
|
-
npm run build:lib # build library module → dist/main.js
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Conventions
|
|
183
|
-
- Always use `NSBox*` components for form inputs — never raw Ant Design/Bootstrap inputs directly.
|
|
184
|
-
- Each `NSBox*` component corresponds to a type schema in `namirasoft-schema` — match them.
|
|
185
|
-
- `NSBoxBuilder` is the canonical way to render schema-driven forms — use it instead of writing manual form layouts when a full schema is available.
|
|
186
|
-
- Component props always include `value`, `onChange`, `label`, and `required` as standard fields.
|
|
187
|
-
- All data display formatting goes through `formatter/` — no ad-hoc `Date.toLocaleDateString()` calls.
|
|
188
|
-
- `ProductCacheService` should be initialized once at app startup, not per-component.
|