ngx-core-components 0.1.1 → 0.1.2
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 +145 -0
- package/fesm2022/ngx-core-components-grid.mjs +740 -107
- package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +203 -60
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +48 -13
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +87 -15
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/grid/data-grid/data-grid.component.d.ts +132 -14
- package/grid/public-api.d.ts +1 -1
- package/inputs/numeric-textbox/numeric-textbox.component.d.ts +6 -2
- package/inputs/time-picker/time-picker.component.d.ts +17 -7
- package/layout/splitter/splitter.component.d.ts +9 -2
- package/package.json +1 -1
- package/public-api.d.ts +2 -2
- package/views/list-view/list-view.component.d.ts +19 -1
- package/views/public-api.d.ts +1 -1
package/README.md
CHANGED
|
@@ -211,6 +211,99 @@ export class MyFormComponent {
|
|
|
211
211
|
}
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
+
### Structured Inputs
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
import { Component, signal } from '@angular/core';
|
|
218
|
+
import { NumericTextBoxComponent, TimePickerComponent } from 'ngx-core-components/inputs';
|
|
219
|
+
|
|
220
|
+
@Component({
|
|
221
|
+
standalone: true,
|
|
222
|
+
imports: [NumericTextBoxComponent, TimePickerComponent],
|
|
223
|
+
template: `
|
|
224
|
+
<ngx-numeric-textbox
|
|
225
|
+
[value]="quantity()"
|
|
226
|
+
label="Quantity"
|
|
227
|
+
[min]="0"
|
|
228
|
+
[max]="25"
|
|
229
|
+
[step]="1"
|
|
230
|
+
(valueChange)="quantity.set($event)"
|
|
231
|
+
/>
|
|
232
|
+
|
|
233
|
+
<ngx-time-picker
|
|
234
|
+
[value]="meetingTime()"
|
|
235
|
+
label="Meeting Time"
|
|
236
|
+
[use12h]="true"
|
|
237
|
+
(timeChange)="meetingTime.set($event)"
|
|
238
|
+
/>
|
|
239
|
+
`,
|
|
240
|
+
})
|
|
241
|
+
export class MyStructuredInputsComponent {
|
|
242
|
+
quantity = signal(3);
|
|
243
|
+
meetingTime = signal('14:30');
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`NumericTextBoxComponent` supports controlled values and keyboard stepping with the up and down arrow keys. `TimePickerComponent` accepts typed input such as `14:30` or `2:30 PM` and normalizes emitted values to `HH:mm`.
|
|
248
|
+
|
|
249
|
+
### List View
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { Component, computed, signal } from '@angular/core';
|
|
253
|
+
import { ListViewComponent, type ListViewPageChangeEvent } from 'ngx-core-components/views';
|
|
254
|
+
|
|
255
|
+
@Component({
|
|
256
|
+
standalone: true,
|
|
257
|
+
imports: [ListViewComponent],
|
|
258
|
+
template: `
|
|
259
|
+
<ngx-list-view
|
|
260
|
+
[items]="filteredPeople()"
|
|
261
|
+
[pageSize]="5"
|
|
262
|
+
[selectable]="true"
|
|
263
|
+
(pageChange)="onPageChange($event)"
|
|
264
|
+
(selectionChange)="selected.set($event.selectedItems)"
|
|
265
|
+
/>
|
|
266
|
+
`,
|
|
267
|
+
})
|
|
268
|
+
export class MyListComponent {
|
|
269
|
+
search = signal('');
|
|
270
|
+
selected = signal<unknown[]>([]);
|
|
271
|
+
people = [
|
|
272
|
+
{ name: 'Alice', dept: 'Engineering' },
|
|
273
|
+
{ name: 'Bob', dept: 'Product' },
|
|
274
|
+
];
|
|
275
|
+
|
|
276
|
+
filteredPeople = computed(() => this.people);
|
|
277
|
+
|
|
278
|
+
onPageChange(event: ListViewPageChangeEvent): void {
|
|
279
|
+
console.log(event.page, event.totalPages);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Splitter
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
import { Component, signal } from '@angular/core';
|
|
288
|
+
import { SplitterComponent } from 'ngx-core-components/layout';
|
|
289
|
+
|
|
290
|
+
@Component({
|
|
291
|
+
standalone: true,
|
|
292
|
+
imports: [SplitterComponent],
|
|
293
|
+
template: `
|
|
294
|
+
<div style="height: 320px; border: 1px solid #e9ecef; overflow: hidden;">
|
|
295
|
+
<ngx-splitter [size]="paneSize()" [min]="180" (sizeChange)="paneSize.set($event)">
|
|
296
|
+
<div pane1>Navigation</div>
|
|
297
|
+
<div pane2>Content</div>
|
|
298
|
+
</ngx-splitter>
|
|
299
|
+
</div>
|
|
300
|
+
`,
|
|
301
|
+
})
|
|
302
|
+
export class MyLayoutComponent {
|
|
303
|
+
paneSize = signal('35%');
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
214
307
|
### Data Grid
|
|
215
308
|
|
|
216
309
|
```typescript
|
|
@@ -240,6 +333,58 @@ export class MyGridComponent {
|
|
|
240
333
|
|
|
241
334
|
This README focuses on the primary Gantt API because it is the largest surface in the package. The demo application under `projects/demo` shows usage and API reference coverage for the other components.
|
|
242
335
|
|
|
336
|
+
### Notable Secondary APIs
|
|
337
|
+
|
|
338
|
+
#### ListView Inputs
|
|
339
|
+
|
|
340
|
+
| Input | Type | Default | Description |
|
|
341
|
+
|-------|------|---------|-------------|
|
|
342
|
+
| `items` | `T[]` | `[]` | Items rendered in the list. |
|
|
343
|
+
| `labelField` | `string` | `'label'` | Field used by the default item renderer. |
|
|
344
|
+
| `selectable` | `boolean` | `true` | Enables row selection. |
|
|
345
|
+
| `multiselect` | `boolean` | `false` | Allows multi-selection. |
|
|
346
|
+
| `loading` | `boolean` | `false` | Shows the loading state. |
|
|
347
|
+
| `pageSize` | `number` | `0` | Enables built-in pagination when greater than `0`. |
|
|
348
|
+
|
|
349
|
+
#### ListView Outputs
|
|
350
|
+
|
|
351
|
+
| Output | Type | Description |
|
|
352
|
+
|--------|------|-------------|
|
|
353
|
+
| `itemClick` | `ListViewItemClickEvent<T>` | Fired when an item is clicked. |
|
|
354
|
+
| `selectionChange` | `ListViewSelectionEvent<T>` | Fired when selected items change. |
|
|
355
|
+
| `pageChange` | `ListViewPageChangeEvent` | Fired when the built-in pager changes pages. |
|
|
356
|
+
|
|
357
|
+
#### NumericTextBox Inputs
|
|
358
|
+
|
|
359
|
+
| Input | Type | Default | Description |
|
|
360
|
+
|-------|------|---------|-------------|
|
|
361
|
+
| `value` | `number` | `0` | Controlled numeric value displayed in the input. |
|
|
362
|
+
| `min` | `number` | `-Infinity` | Lower bound for allowed values. |
|
|
363
|
+
| `max` | `number` | `Infinity` | Upper bound for allowed values. |
|
|
364
|
+
| `step` | `number` | `1` | Increment and decrement amount. |
|
|
365
|
+
|
|
366
|
+
#### TimePicker Inputs
|
|
367
|
+
|
|
368
|
+
| Input | Type | Default | Description |
|
|
369
|
+
|-------|------|---------|-------------|
|
|
370
|
+
| `value` | `string` | `'09:00'` | Controlled time value. Accepts `HH:mm` or `h:mm AM/PM`. |
|
|
371
|
+
| `use12h` | `boolean` | `false` | Shows AM/PM controls while still emitting `HH:mm`. |
|
|
372
|
+
|
|
373
|
+
#### Splitter Inputs
|
|
374
|
+
|
|
375
|
+
| Input | Type | Default | Description |
|
|
376
|
+
|-------|------|---------|-------------|
|
|
377
|
+
| `size` | `string \| number` | `null` | Controlled size of the first pane in pixels or percent. |
|
|
378
|
+
| `initialSize` | `string \| number` | `'50%'` | Initial pane size when uncontrolled. |
|
|
379
|
+
| `min` | `number` | `60` | Minimum size of the first pane in pixels. |
|
|
380
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Split direction. |
|
|
381
|
+
|
|
382
|
+
#### Splitter Outputs
|
|
383
|
+
|
|
384
|
+
| Output | Type | Description |
|
|
385
|
+
|--------|------|-------------|
|
|
386
|
+
| `sizeChange` | `string` | Fired while the divider is dragged. |
|
|
387
|
+
|
|
243
388
|
### Inputs
|
|
244
389
|
|
|
245
390
|
| Input | Type | Default | Description |
|