@dataworkz/crystal 0.1.0-beta.4 → 0.1.0-beta.5

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/index.d.ts CHANGED
@@ -2348,8 +2348,11 @@ declare class DwTooltipIfTruncatedDirective {
2348
2348
  }
2349
2349
 
2350
2350
  type DwTooltipPosition = 'top' | 'bottom' | 'left' | 'right';
2351
- /** `multiline` keeps line breaks (up to 360px), `code` monospace, `error` danger red, `toolbar` a slate chip. */
2352
- type DwTooltipVariant = 'default' | 'multiline' | 'code' | 'error' | 'toolbar';
2351
+ /**
2352
+ * `multiline` keeps line breaks (up to 360px), `code` monospace, `error` danger red, `toolbar` a slate chip, `preview`
2353
+ * a long value shown whole (up to 720 × 340px, then scrolled; pair it with `dwTooltipInteractive`).
2354
+ */
2355
+ type DwTooltipVariant = 'default' | 'multiline' | 'code' | 'error' | 'toolbar' | 'preview';
2353
2356
  /**
2354
2357
  * A tooltip on any element, in crystal's look (PrimeNG's Tooltip underneath, which the app never imports). It opens
2355
2358
  * on hover and focus, above the element unless told otherwise, appended to `<body>` so nothing clips it.
@@ -2545,6 +2548,9 @@ declare class DwSelectComponent<T = unknown> extends DwFormControl<T> {
2545
2548
  readonly size: _angular_core.InputSignal<DwControlSize>;
2546
2549
  /** Fills the width of its container. */
2547
2550
  readonly fluid: _angular_core.InputSignalWithTransform<boolean, unknown>;
2551
+ /** Stacks the list above this z-index (as dw-dialog / dw-drawer / dw-popover's `baseZIndex`), for a select inside a
2552
+ * layer that sets its own z-index, e.g. a page that hosts crystal in a high layer. 0 = PrimeNG's own stacking. */
2553
+ readonly baseZIndex: _angular_core.InputSignal<number>;
2548
2554
  /** Reads as a fixed value, not a control: no arrow, the value in body text. */
2549
2555
  readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
2550
2556
  readonly opened: _angular_core.OutputEmitterRef<void>;
@@ -2555,13 +2561,16 @@ declare class DwSelectComponent<T = unknown> extends DwFormControl<T> {
2555
2561
  protected readonly valueTemplate: _angular_core.Signal<DwSelectValueDirective<any> | undefined>;
2556
2562
  protected readonly footerTemplate: _angular_core.Signal<DwSelectFooterDirective | undefined>;
2557
2563
  protected readonly primeSize: _angular_core.Signal<"small" | "large" | undefined>;
2564
+ protected readonly overlayOptions: _angular_core.Signal<{
2565
+ baseZIndex: number;
2566
+ } | undefined>;
2558
2567
  private readonly prime;
2559
2568
  constructor();
2560
2569
  /** Opens the list (e.g. when an editable select's text is clicked). */
2561
2570
  open(): void;
2562
2571
  close(): void;
2563
2572
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwSelectComponent<any>, never>;
2564
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DwSelectComponent<any>, "dw-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "focused": "focused"; "blurred": "blurred"; }, ["optionTemplate", "valueTemplate", "footerTemplate"], never, true, never>;
2573
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DwSelectComponent<any>, "dw-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "focused": "focused"; "blurred": "blurred"; }, ["optionTemplate", "valueTemplate", "footerTemplate"], never, true, never>;
2565
2574
  }
2566
2575
 
2567
2576
  /**
@@ -2601,6 +2610,9 @@ declare class DwMultiselectComponent<T = unknown> extends DwFormControl<T[]> {
2601
2610
  readonly inputId: _angular_core.InputSignal<string | undefined>;
2602
2611
  readonly size: _angular_core.InputSignal<DwControlSize>;
2603
2612
  readonly fluid: _angular_core.InputSignalWithTransform<boolean, unknown>;
2613
+ /** Stacks the list above this z-index (as dw-dialog / dw-drawer / dw-popover's `baseZIndex`), for a select inside a
2614
+ * layer that sets its own z-index, e.g. a page that hosts crystal in a high layer. 0 = PrimeNG's own stacking. */
2615
+ readonly baseZIndex: _angular_core.InputSignal<number>;
2604
2616
  readonly opened: _angular_core.OutputEmitterRef<void>;
2605
2617
  readonly closed: _angular_core.OutputEmitterRef<void>;
2606
2618
  readonly focused: _angular_core.OutputEmitterRef<void>;
@@ -2608,6 +2620,9 @@ declare class DwMultiselectComponent<T = unknown> extends DwFormControl<T[]> {
2608
2620
  protected readonly optionTemplate: _angular_core.Signal<DwSelectOptionDirective<any> | undefined>;
2609
2621
  protected readonly footerTemplate: _angular_core.Signal<DwSelectFooterDirective | undefined>;
2610
2622
  protected readonly primeSize: _angular_core.Signal<"small" | "large" | undefined>;
2623
+ protected readonly overlayOptions: _angular_core.Signal<{
2624
+ baseZIndex: number;
2625
+ } | undefined>;
2611
2626
  /** PrimeNG reads a null maxSelectedLabels as 0 (summarise everything), so "list them all" is a ceiling no list reaches. */
2612
2627
  protected readonly listAll: number;
2613
2628
  private readonly prime;
@@ -2616,20 +2631,27 @@ declare class DwMultiselectComponent<T = unknown> extends DwFormControl<T[]> {
2616
2631
  open(): void;
2617
2632
  close(): void;
2618
2633
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwMultiselectComponent<any>, never>;
2619
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DwMultiselectComponent<any>, "dw-multiselect", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "showToggleAll": { "alias": "showToggleAll"; "required": false; "isSignal": true; }; "maxSelectedLabels": { "alias": "maxSelectedLabels"; "required": false; "isSignal": true; }; "selectedItemsLabel": { "alias": "selectedItemsLabel"; "required": false; "isSignal": true; }; "display": { "alias": "display"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "focused": "focused"; "blurred": "blurred"; }, ["optionTemplate", "footerTemplate"], never, true, never>;
2634
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DwMultiselectComponent<any>, "dw-multiselect", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "showToggleAll": { "alias": "showToggleAll"; "required": false; "isSignal": true; }; "maxSelectedLabels": { "alias": "maxSelectedLabels"; "required": false; "isSignal": true; }; "selectedItemsLabel": { "alias": "selectedItemsLabel"; "required": false; "isSignal": true; }; "display": { "alias": "display"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "focused": "focused"; "blurred": "blurred"; }, ["optionTemplate", "footerTemplate"], never, true, never>;
2620
2635
  }
2621
2636
 
2622
2637
  /**
2623
- * Crystal's checkbox (PrimeNG's Checkbox underneath, which the app never imports), on/off: its value is a boolean.
2624
- * With a `label` (or projected content) the label sits beside it on one line and toggles it too.
2638
+ * Crystal's checkbox (PrimeNG's Checkbox underneath, which the app never imports). On its own it is on/off: its value
2639
+ * is a boolean. With an `option`, it is one box of a set that fills one array: ticked while the array holds the option,
2640
+ * and clicking adds or removes it (as dw-radio's `option`, for many picks). With a `label` (or projected content) the
2641
+ * label sits beside it on one line and toggles it too.
2625
2642
  *
2626
2643
  * ```html
2627
2644
  * <dw-checkbox label="Remember me" [(ngModel)]="remember" />
2645
+ * @for (f of filters; track f.name) {
2646
+ * <dw-checkbox [option]="f.name" [label]="f.name" [(ngModel)]="selectedFilterNames" />
2647
+ * }
2628
2648
  * <dw-checkbox formControlName="agree">I accept the <a href="/terms">terms</a></dw-checkbox>
2629
2649
  * <dw-checkbox ariaLabel="Select row" [indeterminate]="some" [(value)]="all" />
2630
2650
  * ```
2631
2651
  */
2632
- declare class DwCheckboxComponent extends DwFormControl<boolean> {
2652
+ declare class DwCheckboxComponent<T = boolean> extends DwFormControl<T> {
2653
+ /** Makes this box one of a set: the value is an array, and this box stands for this entry of it. */
2654
+ readonly option: _angular_core.InputSignal<unknown>;
2633
2655
  readonly label: _angular_core.InputSignal<string>;
2634
2656
  /** For a checkbox with no visible label. */
2635
2657
  readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
@@ -2645,8 +2667,8 @@ declare class DwCheckboxComponent extends DwFormControl<boolean> {
2645
2667
  protected readonly primeSize: _angular_core.Signal<"small" | "large" | undefined>;
2646
2668
  private readonly prime;
2647
2669
  constructor();
2648
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwCheckboxComponent, never>;
2649
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DwCheckboxComponent, "dw-checkbox", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "focused": "focused"; "blurred": "blurred"; }, never, ["*"], true, never>;
2670
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwCheckboxComponent<any>, never>;
2671
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DwCheckboxComponent<any>, "dw-checkbox", never, { "option": { "alias": "option"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "focused": "focused"; "blurred": "blurred"; }, never, ["*"], true, never>;
2650
2672
  }
2651
2673
 
2652
2674
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataworkz/crystal",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.5",
4
4
  "description": "Dataworkz core UI for Angular: dw-* components, icons, toasts, design tokens, theme CSS and bundled fonts.",
5
5
  "license": "MIT",
6
6
  "author": "Dataworkz",
@@ -639,6 +639,17 @@ declare const DW_PRIMENG_PT: {
639
639
  };
640
640
  };
641
641
  };
642
+ /**
643
+ * PrimeNG's z-index bases, with tooltips raised to 5000: PrimeNG already stacks a tooltip above the overlays it manages
644
+ * (dialogs, drawers, popovers), and the higher base keeps it above layers that set their own z-index too (a panel or
645
+ * page chrome with `z-index` in CSS), so a tooltip is never hidden under what it describes.
646
+ */
647
+ declare const DW_PRIMENG_Z_INDEX: {
648
+ readonly modal: 1100;
649
+ readonly overlay: 1000;
650
+ readonly menu: 1000;
651
+ readonly tooltip: 5000;
652
+ };
642
653
  /**
643
654
  * PrimeNG with the Dataworkz preset, dark mode on `[data-theme="dark"]`. Pass app-specific PrimeNG settings
644
655
  * (ripple, zIndex, translation…) as `config`; its `theme.options` are merged over crystal's.
@@ -649,4 +660,4 @@ declare const DW_PRIMENG_PT: {
649
660
  */
650
661
  declare function provideCrystalPrimeNG(config?: PrimeNGConfigType): EnvironmentProviders;
651
662
 
652
- export { AZURE_PRIMARY_RAMP, DW_COLOR_SCHEME, DW_DARK_MODE_SELECTOR, DW_PRESET_OVERRIDES, DW_PRIMENG_PT, DW_SELECT_PANEL_SM, DwPreset, provideCrystalPrimeNG };
663
+ export { AZURE_PRIMARY_RAMP, DW_COLOR_SCHEME, DW_DARK_MODE_SELECTOR, DW_PRESET_OVERRIDES, DW_PRIMENG_PT, DW_PRIMENG_Z_INDEX, DW_SELECT_PANEL_SM, DwPreset, provideCrystalPrimeNG };
@@ -339,9 +339,24 @@ body .p-drawer-right {
339
339
  }
340
340
  .p-tooltip.dw-tooltip--multiline .p-tooltip-text { white-space: pre-line; }
341
341
  .p-tooltip.dw-tooltip--error .p-tooltip-text { background: var(--dw-status-danger-fg); color: var(--dw-text-inverse); }
342
+ /* Preview (dwTooltipVariant="preview"): a long value shown whole, up to 720 × 340px, then scrolled; line breaks kept,
343
+ long tokens broken anywhere. Pair it with dwTooltipInteractive so the pointer can scroll it. */
344
+ .p-tooltip.dw-tooltip--preview { width: auto; max-width: min(720px, 68vw); }
345
+ .p-tooltip.dw-tooltip--preview .p-tooltip-text {
346
+ display: inline-block;
347
+ box-sizing: border-box;
348
+ width: max-content;
349
+ max-width: min(720px, 68vw);
350
+ max-height: min(42vh, 340px);
351
+ overflow: auto;
352
+ white-space: pre-wrap;
353
+ overflow-wrap: anywhere;
354
+ font-size: var(--dw-font-size-12);
355
+ line-height: 1.45;
356
+ }
342
357
  .p-tooltip.dw-tooltip--error .p-tooltip-arrow { border-top-color: var(--dw-status-danger-fg); }
343
358
  /* Long code / JSON: wide, scrollable, monospace, wrapped. */
344
- .p-tooltip.dw-tooltip--code { width: min(520px, calc(100vw - 48px)); max-width: min(520px, calc(100vw - 48px)); z-index: 5000; }
359
+ .p-tooltip.dw-tooltip--code { width: min(520px, calc(100vw - 48px)); max-width: min(520px, calc(100vw - 48px)); }
345
360
  .p-tooltip.dw-tooltip--code .p-tooltip-text {
346
361
  display: block;
347
362
  width: 100%;
@@ -5,7 +5,7 @@
5
5
  * Rules: colours only in tokens/primitives.css (everything else uses semantic tokens); font-family only in base.css.
6
6
  */
7
7
  /* PrimeIcons (pi pi-*): crystal's dependency, so an app never installs or loads it itself. Its font is local. */
8
- @import 'primeicons/primeicons.css';
8
+ @import './icons.css';
9
9
  @import './tokens/primitives.css';
10
10
  @import './tokens/semantic.css';
11
11
  @import './tokens/semantic-dark.css';
@@ -0,0 +1,6 @@
1
+ /*
2
+ * @dataworkz/crystal — the PrimeIcons font (`pi pi-*`, `<dw-icon pi>`), shipped as @dataworkz/crystal/styles/icons.css.
3
+ * Crystal depends on primeicons, so an app never installs or loads it itself: crystal.css / crystal-no-fonts.css import
4
+ * this file; an app that imports crystal's styles file by file imports it too. The font files are local (no CDN).
5
+ */
6
+ @import 'primeicons/primeicons.css';