@dataworkz/crystal 0.1.0-beta.3 → 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/CHANGELOG.md +31 -0
- package/fesm2022/dataworkz-crystal-icons.mjs +1 -1
- package/fesm2022/dataworkz-crystal-icons.mjs.map +1 -1
- package/fesm2022/dataworkz-crystal-primeng.mjs +10 -3
- package/fesm2022/dataworkz-crystal-primeng.mjs.map +1 -1
- package/fesm2022/dataworkz-crystal.mjs +79 -24
- package/fesm2022/dataworkz-crystal.mjs.map +1 -1
- package/icons/index.d.ts +1 -1
- package/index.d.ts +50 -17
- package/package.json +1 -1
- package/primeng/index.d.ts +14 -3
- package/styles/components/form.css +2 -1
- package/styles/components/overlay.css +16 -1
- package/styles/crystal-no-fonts.css +1 -1
- package/styles/icons.css +6 -0
package/icons/index.d.ts
CHANGED
|
@@ -176,7 +176,7 @@ type DwPrimeIcon = "address-book" | "align-center" | "align-justify" | "align-le
|
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* The Dataworkz glyphs (what PrimeIcons lacks: hand, brain, workflow…), one file each in
|
|
179
|
-
* `icons/svg/glyphs/<name>.svg`, drawn in currentColor. Render with
|
|
179
|
+
* `icons/svg/glyphs/<name>.svg`, drawn in currentColor. Render with `<dw-icon name="hand" />`, or pass `dwi-hand` to
|
|
180
180
|
* the `icon` input of dw-nav-list, dw-rail-tabs or dw-chip. Markup is crystal-owned constants, so it is safe to bind
|
|
181
181
|
* as HTML.
|
|
182
182
|
*
|
package/index.d.ts
CHANGED
|
@@ -599,7 +599,7 @@ declare class DwMeterComponent {
|
|
|
599
599
|
* "Show deprecated" beside a list's search, "Tree view" beside a tree's. Controlled: it shows
|
|
600
600
|
* `checked` and emits the flipped value; the host decides.
|
|
601
601
|
*
|
|
602
|
-
* A button with role="checkbox" rather than a
|
|
602
|
+
* A button with role="checkbox" rather than a `<label>`-wrapped `<input>`: a label-wrapped input
|
|
603
603
|
* forwards a synthetic click to the input, which bubbles back to the label and double-fires.
|
|
604
604
|
*
|
|
605
605
|
* ```html
|
|
@@ -2348,8 +2348,11 @@ declare class DwTooltipIfTruncatedDirective {
|
|
|
2348
2348
|
}
|
|
2349
2349
|
|
|
2350
2350
|
type DwTooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
2351
|
-
/**
|
|
2352
|
-
|
|
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.
|
|
@@ -2358,6 +2361,7 @@ type DwTooltipVariant = 'default' | 'multiline' | 'code' | 'error' | 'toolbar';
|
|
|
2358
2361
|
* <button dwTooltip="Refresh">…</button>
|
|
2359
2362
|
* <span [dwTooltip]="fullName" dwTooltipPosition="bottom" [dwTooltipDelay]="300">{{ shortName }}</span>
|
|
2360
2363
|
* <i dwTooltip="Line one line two" dwTooltipVariant="multiline"></i>
|
|
2364
|
+
* <span [dwTooltip]="token" [dwTooltipInteractive]="true">Token</span> <!-- hover into it to copy -->
|
|
2361
2365
|
* ```
|
|
2362
2366
|
*/
|
|
2363
2367
|
declare class DwTooltipDirective {
|
|
@@ -2366,9 +2370,11 @@ declare class DwTooltipDirective {
|
|
|
2366
2370
|
/** Milliseconds before it opens. */
|
|
2367
2371
|
readonly dwTooltipDelay: _angular_core.InputSignal<number>;
|
|
2368
2372
|
readonly dwTooltipVariant: _angular_core.InputSignal<DwTooltipVariant>;
|
|
2373
|
+
/** Stays open while the pointer moves onto it, so its text can be selected and copied. */
|
|
2374
|
+
readonly dwTooltipInteractive: _angular_core.InputSignal<boolean>;
|
|
2369
2375
|
constructor();
|
|
2370
2376
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwTooltipDirective, never>;
|
|
2371
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DwTooltipDirective, "[dwTooltip]", never, { "dwTooltipPosition": { "alias": "dwTooltipPosition"; "required": false; "isSignal": true; }; "dwTooltipDelay": { "alias": "dwTooltipDelay"; "required": false; "isSignal": true; }; "dwTooltipVariant": { "alias": "dwTooltipVariant"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.Tooltip; inputs: { "pTooltip": "dwTooltip"; "tooltipDisabled": "dwTooltipDisabled"; }; outputs: {}; }]>;
|
|
2377
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DwTooltipDirective, "[dwTooltip]", never, { "dwTooltipPosition": { "alias": "dwTooltipPosition"; "required": false; "isSignal": true; }; "dwTooltipDelay": { "alias": "dwTooltipDelay"; "required": false; "isSignal": true; }; "dwTooltipVariant": { "alias": "dwTooltipVariant"; "required": false; "isSignal": true; }; "dwTooltipInteractive": { "alias": "dwTooltipInteractive"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.Tooltip; inputs: { "pTooltip": "dwTooltip"; "tooltipDisabled": "dwTooltipDisabled"; }; outputs: {}; }]>;
|
|
2372
2378
|
}
|
|
2373
2379
|
|
|
2374
2380
|
type DwInputSize = 'sm' | 'md' | 'lg';
|
|
@@ -2447,6 +2453,8 @@ declare abstract class DwFormControl<T> implements ControlValueAccessor, OnInit
|
|
|
2447
2453
|
* its `writeValue`, the user's changes and blurs come back. Call from the constructor with the control's viewChild.
|
|
2448
2454
|
* (A second ngModel on the PrimeNG control would write a microtask after the app's, one render behind.)
|
|
2449
2455
|
* `prepare` runs just before each write, for inputs the control reads while writing (a radio's own value).
|
|
2456
|
+
* Only this control's value and what `prepare` reads are tracked: PrimeNG's own signals, which `writeValue` reads and
|
|
2457
|
+
* sets, are not, or a write that changes one would run the effect again, without end.
|
|
2450
2458
|
*/
|
|
2451
2459
|
protected drive<C extends DwPrimeValueAccessor<T>>(prime: () => C | undefined, prepare?: (control: C) => void): void;
|
|
2452
2460
|
/** The control lost focus. */
|
|
@@ -2540,6 +2548,9 @@ declare class DwSelectComponent<T = unknown> extends DwFormControl<T> {
|
|
|
2540
2548
|
readonly size: _angular_core.InputSignal<DwControlSize>;
|
|
2541
2549
|
/** Fills the width of its container. */
|
|
2542
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>;
|
|
2543
2554
|
/** Reads as a fixed value, not a control: no arrow, the value in body text. */
|
|
2544
2555
|
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
2545
2556
|
readonly opened: _angular_core.OutputEmitterRef<void>;
|
|
@@ -2550,10 +2561,16 @@ declare class DwSelectComponent<T = unknown> extends DwFormControl<T> {
|
|
|
2550
2561
|
protected readonly valueTemplate: _angular_core.Signal<DwSelectValueDirective<any> | undefined>;
|
|
2551
2562
|
protected readonly footerTemplate: _angular_core.Signal<DwSelectFooterDirective | undefined>;
|
|
2552
2563
|
protected readonly primeSize: _angular_core.Signal<"small" | "large" | undefined>;
|
|
2564
|
+
protected readonly overlayOptions: _angular_core.Signal<{
|
|
2565
|
+
baseZIndex: number;
|
|
2566
|
+
} | undefined>;
|
|
2553
2567
|
private readonly prime;
|
|
2554
2568
|
constructor();
|
|
2569
|
+
/** Opens the list (e.g. when an editable select's text is clicked). */
|
|
2570
|
+
open(): void;
|
|
2571
|
+
close(): void;
|
|
2555
2572
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwSelectComponent<any>, never>;
|
|
2556
|
-
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>;
|
|
2557
2574
|
}
|
|
2558
2575
|
|
|
2559
2576
|
/**
|
|
@@ -2593,6 +2610,9 @@ declare class DwMultiselectComponent<T = unknown> extends DwFormControl<T[]> {
|
|
|
2593
2610
|
readonly inputId: _angular_core.InputSignal<string | undefined>;
|
|
2594
2611
|
readonly size: _angular_core.InputSignal<DwControlSize>;
|
|
2595
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>;
|
|
2596
2616
|
readonly opened: _angular_core.OutputEmitterRef<void>;
|
|
2597
2617
|
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
2598
2618
|
readonly focused: _angular_core.OutputEmitterRef<void>;
|
|
@@ -2600,25 +2620,38 @@ declare class DwMultiselectComponent<T = unknown> extends DwFormControl<T[]> {
|
|
|
2600
2620
|
protected readonly optionTemplate: _angular_core.Signal<DwSelectOptionDirective<any> | undefined>;
|
|
2601
2621
|
protected readonly footerTemplate: _angular_core.Signal<DwSelectFooterDirective | undefined>;
|
|
2602
2622
|
protected readonly primeSize: _angular_core.Signal<"small" | "large" | undefined>;
|
|
2623
|
+
protected readonly overlayOptions: _angular_core.Signal<{
|
|
2624
|
+
baseZIndex: number;
|
|
2625
|
+
} | undefined>;
|
|
2603
2626
|
/** PrimeNG reads a null maxSelectedLabels as 0 (summarise everything), so "list them all" is a ceiling no list reaches. */
|
|
2604
2627
|
protected readonly listAll: number;
|
|
2605
2628
|
private readonly prime;
|
|
2606
2629
|
constructor();
|
|
2630
|
+
/** Opens the list from code. */
|
|
2631
|
+
open(): void;
|
|
2632
|
+
close(): void;
|
|
2607
2633
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwMultiselectComponent<any>, never>;
|
|
2608
|
-
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>;
|
|
2609
2635
|
}
|
|
2610
2636
|
|
|
2611
2637
|
/**
|
|
2612
|
-
* Crystal's checkbox (PrimeNG's Checkbox underneath, which the app never imports)
|
|
2613
|
-
*
|
|
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.
|
|
2614
2642
|
*
|
|
2615
2643
|
* ```html
|
|
2616
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
|
+
* }
|
|
2617
2648
|
* <dw-checkbox formControlName="agree">I accept the <a href="/terms">terms</a></dw-checkbox>
|
|
2618
2649
|
* <dw-checkbox ariaLabel="Select row" [indeterminate]="some" [(value)]="all" />
|
|
2619
2650
|
* ```
|
|
2620
2651
|
*/
|
|
2621
|
-
declare class DwCheckboxComponent extends DwFormControl<
|
|
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>;
|
|
2622
2655
|
readonly label: _angular_core.InputSignal<string>;
|
|
2623
2656
|
/** For a checkbox with no visible label. */
|
|
2624
2657
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
@@ -2634,8 +2667,8 @@ declare class DwCheckboxComponent extends DwFormControl<boolean> {
|
|
|
2634
2667
|
protected readonly primeSize: _angular_core.Signal<"small" | "large" | undefined>;
|
|
2635
2668
|
private readonly prime;
|
|
2636
2669
|
constructor();
|
|
2637
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwCheckboxComponent
|
|
2638
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DwCheckboxComponent
|
|
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>;
|
|
2639
2672
|
}
|
|
2640
2673
|
|
|
2641
2674
|
/**
|
|
@@ -3202,8 +3235,8 @@ type DwTheme = 'light' | 'dark';
|
|
|
3202
3235
|
declare const DW_THEME_STORAGE_KEY = "dw-theme";
|
|
3203
3236
|
interface CrystalThemeConfig {
|
|
3204
3237
|
/**
|
|
3205
|
-
* Set `data-theme` on
|
|
3206
|
-
* its
|
|
3238
|
+
* Set `data-theme` on `<html>` at start-up and on every switch. `false` for federated elements: the host page owns
|
|
3239
|
+
* its `<html>`. Default true.
|
|
3207
3240
|
*/
|
|
3208
3241
|
apply?: boolean;
|
|
3209
3242
|
/** Theme used until the viewer picks one. Default 'light'. */
|
|
@@ -3219,13 +3252,13 @@ interface CrystalConfig {
|
|
|
3219
3252
|
declare const DW_CRYSTAL_CONFIG: InjectionToken<CrystalConfig>;
|
|
3220
3253
|
/**
|
|
3221
3254
|
* Light / dark theme switch. The theme is the `data-theme` attribute on
|
|
3222
|
-
*
|
|
3255
|
+
* `<html>`: semantic-dark.css re-points the --dw-* tokens under
|
|
3223
3256
|
* [data-theme="dark"] and PrimeNG's darkModeSelector follows the same
|
|
3224
3257
|
* attribute. The choice is remembered per browser (light until chosen).
|
|
3225
3258
|
*
|
|
3226
3259
|
* `provideCrystal()` applies it once at start-up so a stored dark choice
|
|
3227
3260
|
* doesn't flash light. With `theme.apply: false` (federated elements on a
|
|
3228
|
-
* page crystal doesn't own) it never touches
|
|
3261
|
+
* page crystal doesn't own) it never touches `<html>`.
|
|
3229
3262
|
*/
|
|
3230
3263
|
declare class ThemeService {
|
|
3231
3264
|
private readonly document;
|
|
@@ -3233,7 +3266,7 @@ declare class ThemeService {
|
|
|
3233
3266
|
private readonly storageKey;
|
|
3234
3267
|
private readonly applies;
|
|
3235
3268
|
readonly theme: _angular_core.WritableSignal<DwTheme>;
|
|
3236
|
-
/** Puts the current theme on
|
|
3269
|
+
/** Puts the current theme on `<html>` (unless `theme.apply` is false). */
|
|
3237
3270
|
init(): void;
|
|
3238
3271
|
setTheme(theme: DwTheme): void;
|
|
3239
3272
|
toggle(): void;
|
|
@@ -3245,7 +3278,7 @@ declare class ThemeService {
|
|
|
3245
3278
|
|
|
3246
3279
|
/**
|
|
3247
3280
|
* Crystal's app-level setup: the theme. With `theme.apply` (the default) it puts the stored or
|
|
3248
|
-
* initial theme on
|
|
3281
|
+
* initial theme on `<html>` before the first render, so a dark choice doesn't flash light.
|
|
3249
3282
|
*
|
|
3250
3283
|
* ```ts
|
|
3251
3284
|
* providers: [provideCrystal(), provideCrystalPrimeNG()] // an app
|
package/package.json
CHANGED
package/primeng/index.d.ts
CHANGED
|
@@ -608,7 +608,7 @@ declare const DW_PRESET_OVERRIDES: {
|
|
|
608
608
|
/** Dataworkz PrimeNG preset: Aura retargeted to the design system. */
|
|
609
609
|
declare const DwPreset: _primeuix_themes_types.Preset<_primeuix_themes_aura_base.AuraBaseDesignTokens>;
|
|
610
610
|
|
|
611
|
-
/** PrimeNG's dark mode follows the attribute ThemeService (and provideCrystal()) put on
|
|
611
|
+
/** PrimeNG's dark mode follows the attribute ThemeService (and provideCrystal()) put on `<html>`. */
|
|
612
612
|
declare const DW_DARK_MODE_SELECTOR = "[data-theme=\"dark\"]";
|
|
613
613
|
/** Panel class that sizes a select's option list for a small trigger (components/form.css). */
|
|
614
614
|
declare const DW_SELECT_PANEL_SM = "dw-select-panel--sm";
|
|
@@ -617,7 +617,7 @@ type SizedInstance = {
|
|
|
617
617
|
};
|
|
618
618
|
/**
|
|
619
619
|
* Crystal's pass-through defaults: a small `p-select` / `p-multiselect` gets small options even when its list is
|
|
620
|
-
* appended to
|
|
620
|
+
* appended to `<body>` (where CSS can't see the trigger).
|
|
621
621
|
*/
|
|
622
622
|
declare const DW_PRIMENG_PT: {
|
|
623
623
|
readonly select: {
|
|
@@ -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 };
|
|
@@ -232,7 +232,8 @@ dw-field.dw-field--inline:has(.dw-field__control :is(.p-inputtext-sm, .p-textare
|
|
|
232
232
|
.dw-field__control > p-multiselect,
|
|
233
233
|
.dw-field__control > p-inputnumber,
|
|
234
234
|
.dw-field__control > p-datepicker,
|
|
235
|
-
.dw-field__control > p-autocomplete
|
|
235
|
+
.dw-field__control > p-autocomplete,
|
|
236
|
+
.dw-field__control > :is(dw-select, dw-multiselect, dw-number-input) { width: 100%; }
|
|
236
237
|
.dw-field__error { display: inline-flex; align-items: center; gap: var(--dw-space-1); }
|
|
237
238
|
/* Field errors are text only (the red text and border carry the state): no leading icon, even in
|
|
238
239
|
hand-written error lines. */
|
|
@@ -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));
|
|
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 '
|
|
8
|
+
@import './icons.css';
|
|
9
9
|
@import './tokens/primitives.css';
|
|
10
10
|
@import './tokens/semantic.css';
|
|
11
11
|
@import './tokens/semantic-dark.css';
|
package/styles/icons.css
ADDED
|
@@ -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';
|