@meshmakers/shared-ui 3.3.460 → 3.3.470
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/README.md +255 -27
- package/fesm2022/meshmakers-shared-ui.mjs +120 -113
- package/fesm2022/meshmakers-shared-ui.mjs.map +1 -1
- package/package.json +17 -17
- package/types/meshmakers-shared-ui.d.ts +45 -45
package/README.md
CHANGED
|
@@ -1,52 +1,280 @@
|
|
|
1
1
|
# @meshmakers/shared-ui
|
|
2
2
|
|
|
3
|
-
Angular UI component library for
|
|
3
|
+
Angular UI component library for OctoMesh Platform applications.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Part of the [@meshmakers](https://www.npmjs.com/org/meshmakers) package ecosystem.
|
|
5
|
+
Provides reusable components, dialog services, data sources, pipes, and guards for building consistent UIs across OctoMesh frontend applications.
|
|
8
6
|
|
|
9
7
|
**Note:** This library requires a [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui) license.
|
|
10
8
|
|
|
9
|
+
Part of the [@meshmakers](https://www.npmjs.com/org/meshmakers) package ecosystem.
|
|
10
|
+
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install @meshmakers/shared-ui
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
### Environment Setup
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|-----------|----------|-------------|
|
|
21
|
-
| `ListViewComponent` | `mm-list-view` | Configurable list/grid view with search, pagination |
|
|
22
|
-
| `ConfirmationWindowComponent` | - | Confirmation dialog via `ConfirmationService` |
|
|
23
|
-
| `CronBuilderComponent` | `mm-cron-builder` | Visual cron expression editor |
|
|
24
|
-
| `TreeComponent` | `mm-tree` | Hierarchical tree view |
|
|
25
|
-
| `EntitySelectInputComponent` | `mm-entity-select-input` | Entity autocomplete input |
|
|
26
|
-
| `BaseFormComponent` | `mm-base-form` | Form wrapper with save/cancel |
|
|
27
|
-
| `CopyableTextComponent` | `mm-copyable-text` | Text with copy-to-clipboard |
|
|
19
|
+
Register all services via the environment provider:
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
```typescript
|
|
22
|
+
import { provideMmSharedUi } from '@meshmakers/shared-ui';
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
export const appConfig: ApplicationConfig = {
|
|
25
|
+
providers: [
|
|
26
|
+
provideMmSharedUi(),
|
|
27
|
+
// ...
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
```
|
|
37
31
|
|
|
38
|
-
## Build
|
|
32
|
+
## Build & Test
|
|
39
33
|
|
|
40
34
|
```bash
|
|
35
|
+
# Build
|
|
41
36
|
npm run build:shared-ui
|
|
42
|
-
```
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
# Lint
|
|
39
|
+
npm run lint:shared-ui
|
|
45
40
|
|
|
46
|
-
|
|
41
|
+
# Run tests
|
|
47
42
|
npm test -- --project=@meshmakers/shared-ui --watch=false
|
|
48
43
|
```
|
|
49
44
|
|
|
50
|
-
##
|
|
45
|
+
## Architecture
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
shared-ui/
|
|
49
|
+
├── src/
|
|
50
|
+
│ ├── public-api.ts # Public API exports
|
|
51
|
+
│ └── lib/
|
|
52
|
+
│ ├── list-view/ # Configurable grid/table
|
|
53
|
+
│ │ ├── list-view.component.ts|html|scss
|
|
54
|
+
│ │ └── list-view.model.ts # TableColumn, StatusIconMapping
|
|
55
|
+
│ ├── base-form/ # Form wrapper with save/cancel
|
|
56
|
+
│ │ └── base-form.component.ts|html|scss
|
|
57
|
+
│ ├── base-tree-detail/ # Tree + detail panel layout
|
|
58
|
+
│ │ └── base-tree-detail.component.ts|scss
|
|
59
|
+
│ ├── tree/ # Hierarchical tree view
|
|
60
|
+
│ │ └── tree.component.ts|html|scss
|
|
61
|
+
│ ├── cron-builder/ # Visual cron expression editor
|
|
62
|
+
│ │ ├── cron-builder.component.ts|html|scss
|
|
63
|
+
│ │ ├── cron-builder.models.ts
|
|
64
|
+
│ │ ├── cron-parser.service.ts
|
|
65
|
+
│ │ ├── cron-humanizer.service.ts
|
|
66
|
+
│ │ └── cron-builder.constants.ts
|
|
67
|
+
│ ├── time-range-picker/ # Flexible time range selector
|
|
68
|
+
│ │ ├── time-range-picker.component.ts|html|scss
|
|
69
|
+
│ │ ├── time-range-picker.models.ts
|
|
70
|
+
│ │ └── time-range-utils.ts
|
|
71
|
+
│ ├── copyable-text/ # Text with copy-to-clipboard
|
|
72
|
+
│ │ └── copyable-text.component.ts|html|scss
|
|
73
|
+
│ ├── entity-select-input/ # Entity autocomplete input
|
|
74
|
+
│ │ └── entity-select-input.component.ts
|
|
75
|
+
│ ├── entity-select-dialog/ # Entity selection modal
|
|
76
|
+
│ │ ├── entity-select-dialog.component.ts
|
|
77
|
+
│ │ ├── entity-select-dialog.service.ts
|
|
78
|
+
│ │ └── entity-select-dialog-data-source.ts
|
|
79
|
+
│ ├── confirmation-window/ # Confirmation dialog
|
|
80
|
+
│ │ └── confirmation-window.component.ts|html
|
|
81
|
+
│ ├── input-dialog/ # Text input dialog
|
|
82
|
+
│ │ └── input-dialog.component.ts|html|scss
|
|
83
|
+
│ ├── progress-window/ # Progress dialog
|
|
84
|
+
│ │ ├── progress-window.component.ts|html|scss
|
|
85
|
+
│ │ ├── progress-window.service.ts
|
|
86
|
+
│ │ └── USAGE.md
|
|
87
|
+
│ ├── upload-file-dialog/ # File upload dialog
|
|
88
|
+
│ │ └── upload-file-dialog.component.ts|html
|
|
89
|
+
│ ├── save-as-dialog/ # Save-as dialog
|
|
90
|
+
│ │ ├── save-as-dialog.component.ts
|
|
91
|
+
│ │ ├── save-as-dialog.service.ts
|
|
92
|
+
│ │ └── save-as-dialog-data-source.ts
|
|
93
|
+
│ ├── import-strategy-dialog/ # Import strategy dialog
|
|
94
|
+
│ │ ├── import-strategy-dialog.component.ts|html
|
|
95
|
+
│ │ └── import-strategy-dialog.service.ts
|
|
96
|
+
│ ├── message-details-dialog/ # Message details dialog
|
|
97
|
+
│ │ ├── message-details-dialog.component.ts
|
|
98
|
+
│ │ └── message-details-dialog.service.ts
|
|
99
|
+
│ ├── data-sources/ # Base data source classes
|
|
100
|
+
│ │ ├── data-source-base.ts
|
|
101
|
+
│ │ ├── data-source-typed.ts
|
|
102
|
+
│ │ ├── hierarchy-data-source-base.ts
|
|
103
|
+
│ │ └── hierarchy-data-source.ts
|
|
104
|
+
│ ├── guards/ # Unsaved changes protection
|
|
105
|
+
│ │ ├── unsaved-changes.interface.ts
|
|
106
|
+
│ │ ├── unsaved-changes.guard.ts
|
|
107
|
+
│ │ └── unsaved-changes.directive.ts
|
|
108
|
+
│ ├── directives/
|
|
109
|
+
│ │ └── mm-list-view-data-binding.directive.ts
|
|
110
|
+
│ ├── pipes/
|
|
111
|
+
│ │ ├── pascal-case.pipe.ts
|
|
112
|
+
│ │ └── bytes-to-size.pipe.ts
|
|
113
|
+
│ ├── models/
|
|
114
|
+
│ │ ├── fetchResult.ts # FetchResult, FetchResultTyped<T>
|
|
115
|
+
│ │ ├── confirmation.ts # ConfirmationWindowData, DialogType
|
|
116
|
+
│ │ ├── progressValue.ts # ProgressValue
|
|
117
|
+
│ │ ├── inputDialogResult.ts
|
|
118
|
+
│ │ ├── importStrategyDto.ts
|
|
119
|
+
│ │ └── node-dropped-event.ts
|
|
120
|
+
│ ├── services/
|
|
121
|
+
│ │ ├── confirmation.service.ts
|
|
122
|
+
│ │ ├── file-upload.service.ts
|
|
123
|
+
│ │ ├── input.service.ts
|
|
124
|
+
│ │ ├── notification-display.service.ts
|
|
125
|
+
│ │ └── message-listener.service.ts
|
|
126
|
+
│ └── svg-icons.ts # Kendo SVG icon re-exports
|
|
127
|
+
├── docs/
|
|
128
|
+
│ ├── time-range-picker.md # Time Range Picker guide
|
|
129
|
+
│ └── unsaved-changes-guard.md # Unsaved Changes Guard guide
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Components
|
|
133
|
+
|
|
134
|
+
### ListViewComponent (`mm-list-view`)
|
|
135
|
+
|
|
136
|
+
Configurable data grid with Kendo Grid integration.
|
|
137
|
+
|
|
138
|
+
**Features:** Pagination, sorting, filtering, row selection, search, context menus, action menus, Excel/PDF export, toolbar actions, column types (text, numeric, boolean, date, bytes, status icons, cron expressions).
|
|
139
|
+
|
|
140
|
+
```html
|
|
141
|
+
<mm-list-view
|
|
142
|
+
appMyDataSource
|
|
143
|
+
#dir="appMyDataSource"
|
|
144
|
+
[sortable]="true"
|
|
145
|
+
[rowFilterEnabled]="true"
|
|
146
|
+
[searchTextBoxEnabled]="true"
|
|
147
|
+
[selectable]="{mode: 'single', enabled: true}"
|
|
148
|
+
[pageable]="{buttonCount: 3, pageSizes: [10, 20, 50, 100]}"
|
|
149
|
+
[pageSize]="20"
|
|
150
|
+
[columns]="columns"
|
|
151
|
+
[contextMenuCommandItems]="contextMenu"
|
|
152
|
+
[leftToolbarActions]="toolbarActions"
|
|
153
|
+
(rowClicked)="onRowClicked($event)">
|
|
154
|
+
</mm-list-view>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### BaseFormComponent (`mm-base-form`)
|
|
158
|
+
|
|
159
|
+
Form wrapper with save/cancel buttons, title, validation, and unsaved changes detection.
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<mm-base-form [form]="form" [config]="formConfig" (saveForm)="onSave()" (cancelForm)="onCancel()">
|
|
163
|
+
<!-- Form fields -->
|
|
164
|
+
</mm-base-form>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### CronBuilderComponent (`mm-cron-builder`)
|
|
168
|
+
|
|
169
|
+
Visual cron expression editor with 6-field format support, preset quick-selects, human-readable descriptions, next execution preview, and `ControlValueAccessor` integration.
|
|
170
|
+
|
|
171
|
+
### TimeRangePickerComponent (`mm-time-range-picker`)
|
|
172
|
+
|
|
173
|
+
Flexible time range selector with Year, Quarter, Month, Relative, and Custom modes. Outputs both `Date` objects and ISO 8601 strings.
|
|
174
|
+
|
|
175
|
+
See [Time Range Picker Documentation](docs/time-range-picker.md) for detailed API and examples.
|
|
176
|
+
|
|
177
|
+
### TreeComponent (`mm-tree`)
|
|
178
|
+
|
|
179
|
+
Hierarchical tree view with Kendo TreeView, drag-drop support, and expandable nodes.
|
|
180
|
+
|
|
181
|
+
### CopyableTextComponent (`mm-copyable-text`)
|
|
182
|
+
|
|
183
|
+
Display text with a one-click copy-to-clipboard button.
|
|
184
|
+
|
|
185
|
+
### EntitySelectInputComponent (`mm-entity-select-input`)
|
|
186
|
+
|
|
187
|
+
Autocomplete input for entity selection with dialog fallback.
|
|
188
|
+
|
|
189
|
+
## Dialog Services
|
|
190
|
+
|
|
191
|
+
All complex dialogs are opened via injected services:
|
|
192
|
+
|
|
193
|
+
| Service | Method | Description |
|
|
194
|
+
|---------|--------|-------------|
|
|
195
|
+
| `ConfirmationService` | `showYesNoConfirmationDialog()` | Yes/No confirmation |
|
|
196
|
+
| | `showYesNoCancelConfirmationDialog()` | Yes/No/Cancel with result |
|
|
197
|
+
| | `showOkCancelConfirmationDialog()` | Ok/Cancel confirmation |
|
|
198
|
+
| | `showOkDialog()` | Ok-only information dialog |
|
|
199
|
+
| `InputService` | — | Text input dialog |
|
|
200
|
+
| `FileUploadService` | — | File upload dialog |
|
|
201
|
+
| `ProgressWindowService` | `showDeterminateProgress()` | Progress bar with percentage |
|
|
202
|
+
| | `showIndeterminateProgress()` | Spinning loader |
|
|
203
|
+
| `NotificationDisplayService` | `showSuccess()`, `showError()`, `showWarning()`, `showInfo()` | Toast notifications |
|
|
204
|
+
| `EntitySelectDialogService` | — | Entity selection modal |
|
|
205
|
+
| `SaveAsDialogService` | — | Save-as dialog with path navigation |
|
|
206
|
+
| `ImportStrategyDialogService` | — | Import strategy selection |
|
|
207
|
+
| `MessageDetailsDialogService` | — | Detailed message/error display |
|
|
208
|
+
|
|
209
|
+
See [Progress Window Usage](src/lib/progress-window/USAGE.md) for progress dialog examples.
|
|
210
|
+
|
|
211
|
+
## Data Sources
|
|
212
|
+
|
|
213
|
+
Base classes for data binding with `ListViewComponent`:
|
|
214
|
+
|
|
215
|
+
| Class | Description |
|
|
216
|
+
|-------|-------------|
|
|
217
|
+
| `DataSourceBase` | Abstract base with pagination, filtering, sorting |
|
|
218
|
+
| `DataSourceTyped<T>` | Generic typed data source |
|
|
219
|
+
| `HierarchyDataSourceBase` | Base for tree/hierarchical data |
|
|
220
|
+
| `HierarchyDataSource` | Implementation for tree structures |
|
|
221
|
+
|
|
222
|
+
## Guards & Directives
|
|
223
|
+
|
|
224
|
+
### Unsaved Changes Protection
|
|
225
|
+
|
|
226
|
+
Two-level protection against accidental data loss:
|
|
227
|
+
|
|
228
|
+
| Component | Protects Against |
|
|
229
|
+
|-----------|-----------------|
|
|
230
|
+
| `UnsavedChangesDirective` | Browser back/refresh/close (beforeunload) |
|
|
231
|
+
| `UnsavedChangesGuard` | In-app navigation (Angular Router canDeactivate) |
|
|
232
|
+
| `HasUnsavedChanges` | Interface for components to implement |
|
|
233
|
+
|
|
234
|
+
See [Unsaved Changes Guard Documentation](docs/unsaved-changes-guard.md) for implementation guide.
|
|
235
|
+
|
|
236
|
+
### MmListViewDataBindingDirective
|
|
237
|
+
|
|
238
|
+
Data binding directive for `ListViewComponent`, managing data source and pagination.
|
|
239
|
+
|
|
240
|
+
## Pipes
|
|
241
|
+
|
|
242
|
+
| Pipe | Usage | Example |
|
|
243
|
+
|------|-------|---------|
|
|
244
|
+
| `PascalCasePipe` | `{{ value \| pascalCase }}` | `"my_field"` → `"MyField"` |
|
|
245
|
+
| `BytesToSizePipe` | `{{ value \| bytesToSize }}` | `1048576` → `"1.0 MB"` |
|
|
246
|
+
|
|
247
|
+
## Models
|
|
248
|
+
|
|
249
|
+
| Model | Description |
|
|
250
|
+
|-------|-------------|
|
|
251
|
+
| `FetchResult` / `FetchResultTyped<T>` | Paginated query result wrapper |
|
|
252
|
+
| `TableColumn` / `ColumnDefinition` | Column definitions for ListViewComponent |
|
|
253
|
+
| `StatusIconMapping` / `StatusFieldConfig` | Status icon configuration |
|
|
254
|
+
| `ProgressValue` | Progress status text + percentage |
|
|
255
|
+
| `TimeRange` / `TimeRangeISO` / `TimeRangeSelection` | Time range types |
|
|
256
|
+
| `CronBuilderConfig` / `CronSchedule` / `CronFields` | Cron builder types |
|
|
257
|
+
| `ImportStrategyDto` | Import configuration |
|
|
258
|
+
| `NodeDroppedEvent` | Tree drag-drop event data |
|
|
259
|
+
| `ConfirmationWindowData` / `ConfirmationWindowResult` | Dialog configuration |
|
|
260
|
+
|
|
261
|
+
## Dependencies
|
|
262
|
+
|
|
263
|
+
- **Angular 21** with standalone components and signals
|
|
264
|
+
- **Kendo UI Angular 21** (Grid, Buttons, Dialog, Dropdowns, Inputs, Indicators, Layout, Notifications, TreeView)
|
|
265
|
+
- **@meshmakers/shared-services** (sibling library)
|
|
266
|
+
|
|
267
|
+
## Detailed Documentation
|
|
268
|
+
|
|
269
|
+
- [Time Range Picker](docs/time-range-picker.md) — Full API reference, configuration, examples
|
|
270
|
+
- [Unsaved Changes Guard](docs/unsaved-changes-guard.md) — Implementation guide with checklists
|
|
271
|
+
- [Progress Window Usage](src/lib/progress-window/USAGE.md) — Progress dialog examples, migration from Angular Material
|
|
272
|
+
|
|
273
|
+
## Documentation and Testing Standards
|
|
51
274
|
|
|
52
|
-
|
|
275
|
+
- **All developer documentation must be written in English**
|
|
276
|
+
- **Every code change must include updated documentation** — update README.md, CLAUDE.md, or inline docs when adding, modifying, or removing features
|
|
277
|
+
- **Unit tests and integration tests must be executed** after every code change
|
|
278
|
+
- **Existing tests must be updated** when the behavior of tested code changes
|
|
279
|
+
- **New tests must be added** when new features, components, or services are implemented
|
|
280
|
+
- Never commit code with failing tests
|