@devjuliovilla/jv-ui 1.7.1 → 1.9.0
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 +91 -2
- package/fesm2022/devjuliovilla-jv-ui.mjs +2520 -876
- package/fesm2022/devjuliovilla-jv-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/jv-theme.css +135 -135
- package/types/devjuliovilla-jv-ui.d.ts +309 -24
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ export class App {}
|
|
|
42
42
|
| Category | Components |
|
|
43
43
|
|---|---|
|
|
44
44
|
| Buttons | `JvButton`, `JvButtonGroup`, `JvIconButton` |
|
|
45
|
-
| Forms | `JvInput`, `JvTextarea`, `JvSelect`, `JvCheckbox`, `JvRadio`, `JvSwitch`, `JvFormContainer` |
|
|
45
|
+
| Forms | `JvInput`, `JvTextarea`, `JvCode`, `JvSelect`, `JvCheckbox`, `JvRadio`, `JvSwitch`, `JvFormContainer` |
|
|
46
46
|
| Data Grid | `JvGrid` — full-featured data table (see below) |
|
|
47
47
|
| Containers | `JvCard`, `JvSection`, `JvDivider` |
|
|
48
48
|
| List | `JvList`, `JvListItem` — list with title, description, icons, badges, and interactive items |
|
|
@@ -337,6 +337,95 @@ export class ProfileComponent {
|
|
|
337
337
|
}
|
|
338
338
|
```
|
|
339
339
|
|
|
340
|
+
## Code API
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
import { JvCodeComponent } from '@devjuliovilla/jv-ui';
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
| Input | Type | Default | Description |
|
|
347
|
+
|---|---|---|---|
|
|
348
|
+
| `code` | `string` | — | Code or text content to render |
|
|
349
|
+
| `language` | `string` | `''` | Optional language badge |
|
|
350
|
+
| `title` | `string` | `''` | Optional header title |
|
|
351
|
+
| `font` | `'jetbrains-mono' \| 'fira-code' \| 'cascadia' \| 'consolas' \| 'system'` | `'jetbrains-mono'` | Mono font preset for the rendered block |
|
|
352
|
+
| `editable` | `boolean` | `false` | Renders a textarea-style editing surface instead of read-only preview |
|
|
353
|
+
| `width` | `string` | `'100%'` | CSS width applied to the component |
|
|
354
|
+
| `height` | `string` | `'auto'` | CSS height for the editable surface or minimum preview height |
|
|
355
|
+
|
|
356
|
+
Use `JvCode` for read-only payloads or long single-line content where horizontal scrolling should be preserved instead of wrapping.
|
|
357
|
+
The library does not bundle font files. `JvCode` references common mono families and will use any web font you load at the application level.
|
|
358
|
+
|
|
359
|
+
When `editable` is enabled, `JvCode` emits `codeChange` on every edit so the parent can keep the source text in sync.
|
|
360
|
+
|
|
361
|
+
### Example
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
import { Component } from '@angular/core';
|
|
365
|
+
import { JvCodeComponent } from '@devjuliovilla/jv-ui';
|
|
366
|
+
|
|
367
|
+
@Component({
|
|
368
|
+
selector: 'app-payload-preview',
|
|
369
|
+
standalone: true,
|
|
370
|
+
imports: [JvCodeComponent],
|
|
371
|
+
template: `
|
|
372
|
+
<jv-code
|
|
373
|
+
[code]="payload"
|
|
374
|
+
language="json"
|
|
375
|
+
title="HTTP payload preview"
|
|
376
|
+
font="fira-code"
|
|
377
|
+
[editable]="true"
|
|
378
|
+
width="100%"
|
|
379
|
+
height="18rem"
|
|
380
|
+
(codeChange)="payload = $event"
|
|
381
|
+
/>
|
|
382
|
+
`,
|
|
383
|
+
})
|
|
384
|
+
export class PayloadPreviewComponent {
|
|
385
|
+
payload = '{"status":"ok"}';
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
If you want hosted fonts without shipping them in your package, load them at the app level, for example:
|
|
390
|
+
|
|
391
|
+
```css
|
|
392
|
+
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## Confirm Dialog Labels
|
|
396
|
+
|
|
397
|
+
`JvDialogService.confirm()` already supports `confirmLabel` and `cancelLabel` overrides per dialog. If you omit them, the defaults come from the active translation dictionary using `dialog.confirm` and `dialog.cancel`.
|
|
398
|
+
|
|
399
|
+
This lets you either:
|
|
400
|
+
|
|
401
|
+
- override labels directly for a specific action like `Guardar evento` / `Descartar cambios`
|
|
402
|
+
- or register translated defaults in your i18n dictionary for each supported language
|
|
403
|
+
|
|
404
|
+
Example with business copy:
|
|
405
|
+
|
|
406
|
+
```typescript
|
|
407
|
+
const confirmed = await dialogService.confirm({
|
|
408
|
+
title: 'Guardar evento',
|
|
409
|
+
message: 'Se aplicaran cambios a la agenda del equipo.',
|
|
410
|
+
confirmLabel: 'Guardar evento',
|
|
411
|
+
cancelLabel: 'Descartar cambios',
|
|
412
|
+
tone: 'primary',
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
if (confirmed) {
|
|
416
|
+
saveEvent();
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Example using translated defaults from your dictionary:
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
await dialogService.confirm({
|
|
424
|
+
message: 'This action will publish the current draft.',
|
|
425
|
+
tone: 'primary',
|
|
426
|
+
});
|
|
427
|
+
```
|
|
428
|
+
|
|
340
429
|
## Icon System
|
|
341
430
|
|
|
342
431
|
```typescript
|
|
@@ -420,7 +509,7 @@ The library includes basic responsive behavior:
|
|
|
420
509
|
- **Flex-wrap** is used extensively for natural overflow handling
|
|
421
510
|
- **Dialog** and **Toast** constrain width with `min()` to never exceed the viewport
|
|
422
511
|
|
|
423
|
-
## Services
|
|
512
|
+
## Services
|
|
424
513
|
|
|
425
514
|
| Service | Import Path | Description |
|
|
426
515
|
|---|---|---|
|