@dataworkz/crystal 0.1.0-beta.3 → 0.1.0-beta.4
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 +13 -0
- package/fesm2022/dataworkz-crystal-icons.mjs +1 -1
- package/fesm2022/dataworkz-crystal-icons.mjs.map +1 -1
- package/fesm2022/dataworkz-crystal-primeng.mjs +2 -2
- package/fesm2022/dataworkz-crystal-primeng.mjs.map +1 -1
- package/fesm2022/dataworkz-crystal.mjs +48 -14
- package/fesm2022/dataworkz-crystal.mjs.map +1 -1
- package/icons/index.d.ts +1 -1
- package/index.d.ts +19 -8
- package/package.json +1 -1
- package/primeng/index.d.ts +2 -2
- package/styles/components/form.css +2 -1
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
|
|
@@ -2358,6 +2358,7 @@ type DwTooltipVariant = 'default' | 'multiline' | 'code' | 'error' | 'toolbar';
|
|
|
2358
2358
|
* <button dwTooltip="Refresh">…</button>
|
|
2359
2359
|
* <span [dwTooltip]="fullName" dwTooltipPosition="bottom" [dwTooltipDelay]="300">{{ shortName }}</span>
|
|
2360
2360
|
* <i dwTooltip="Line one line two" dwTooltipVariant="multiline"></i>
|
|
2361
|
+
* <span [dwTooltip]="token" [dwTooltipInteractive]="true">Token</span> <!-- hover into it to copy -->
|
|
2361
2362
|
* ```
|
|
2362
2363
|
*/
|
|
2363
2364
|
declare class DwTooltipDirective {
|
|
@@ -2366,9 +2367,11 @@ declare class DwTooltipDirective {
|
|
|
2366
2367
|
/** Milliseconds before it opens. */
|
|
2367
2368
|
readonly dwTooltipDelay: _angular_core.InputSignal<number>;
|
|
2368
2369
|
readonly dwTooltipVariant: _angular_core.InputSignal<DwTooltipVariant>;
|
|
2370
|
+
/** Stays open while the pointer moves onto it, so its text can be selected and copied. */
|
|
2371
|
+
readonly dwTooltipInteractive: _angular_core.InputSignal<boolean>;
|
|
2369
2372
|
constructor();
|
|
2370
2373
|
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: {}; }]>;
|
|
2374
|
+
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
2375
|
}
|
|
2373
2376
|
|
|
2374
2377
|
type DwInputSize = 'sm' | 'md' | 'lg';
|
|
@@ -2447,6 +2450,8 @@ declare abstract class DwFormControl<T> implements ControlValueAccessor, OnInit
|
|
|
2447
2450
|
* its `writeValue`, the user's changes and blurs come back. Call from the constructor with the control's viewChild.
|
|
2448
2451
|
* (A second ngModel on the PrimeNG control would write a microtask after the app's, one render behind.)
|
|
2449
2452
|
* `prepare` runs just before each write, for inputs the control reads while writing (a radio's own value).
|
|
2453
|
+
* Only this control's value and what `prepare` reads are tracked: PrimeNG's own signals, which `writeValue` reads and
|
|
2454
|
+
* sets, are not, or a write that changes one would run the effect again, without end.
|
|
2450
2455
|
*/
|
|
2451
2456
|
protected drive<C extends DwPrimeValueAccessor<T>>(prime: () => C | undefined, prepare?: (control: C) => void): void;
|
|
2452
2457
|
/** The control lost focus. */
|
|
@@ -2552,6 +2557,9 @@ declare class DwSelectComponent<T = unknown> extends DwFormControl<T> {
|
|
|
2552
2557
|
protected readonly primeSize: _angular_core.Signal<"small" | "large" | undefined>;
|
|
2553
2558
|
private readonly prime;
|
|
2554
2559
|
constructor();
|
|
2560
|
+
/** Opens the list (e.g. when an editable select's text is clicked). */
|
|
2561
|
+
open(): void;
|
|
2562
|
+
close(): void;
|
|
2555
2563
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwSelectComponent<any>, never>;
|
|
2556
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>;
|
|
2557
2565
|
}
|
|
@@ -2604,6 +2612,9 @@ declare class DwMultiselectComponent<T = unknown> extends DwFormControl<T[]> {
|
|
|
2604
2612
|
protected readonly listAll: number;
|
|
2605
2613
|
private readonly prime;
|
|
2606
2614
|
constructor();
|
|
2615
|
+
/** Opens the list from code. */
|
|
2616
|
+
open(): void;
|
|
2617
|
+
close(): void;
|
|
2607
2618
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DwMultiselectComponent<any>, never>;
|
|
2608
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>;
|
|
2609
2620
|
}
|
|
@@ -3202,8 +3213,8 @@ type DwTheme = 'light' | 'dark';
|
|
|
3202
3213
|
declare const DW_THEME_STORAGE_KEY = "dw-theme";
|
|
3203
3214
|
interface CrystalThemeConfig {
|
|
3204
3215
|
/**
|
|
3205
|
-
* Set `data-theme` on
|
|
3206
|
-
* its
|
|
3216
|
+
* Set `data-theme` on `<html>` at start-up and on every switch. `false` for federated elements: the host page owns
|
|
3217
|
+
* its `<html>`. Default true.
|
|
3207
3218
|
*/
|
|
3208
3219
|
apply?: boolean;
|
|
3209
3220
|
/** Theme used until the viewer picks one. Default 'light'. */
|
|
@@ -3219,13 +3230,13 @@ interface CrystalConfig {
|
|
|
3219
3230
|
declare const DW_CRYSTAL_CONFIG: InjectionToken<CrystalConfig>;
|
|
3220
3231
|
/**
|
|
3221
3232
|
* Light / dark theme switch. The theme is the `data-theme` attribute on
|
|
3222
|
-
*
|
|
3233
|
+
* `<html>`: semantic-dark.css re-points the --dw-* tokens under
|
|
3223
3234
|
* [data-theme="dark"] and PrimeNG's darkModeSelector follows the same
|
|
3224
3235
|
* attribute. The choice is remembered per browser (light until chosen).
|
|
3225
3236
|
*
|
|
3226
3237
|
* `provideCrystal()` applies it once at start-up so a stored dark choice
|
|
3227
3238
|
* doesn't flash light. With `theme.apply: false` (federated elements on a
|
|
3228
|
-
* page crystal doesn't own) it never touches
|
|
3239
|
+
* page crystal doesn't own) it never touches `<html>`.
|
|
3229
3240
|
*/
|
|
3230
3241
|
declare class ThemeService {
|
|
3231
3242
|
private readonly document;
|
|
@@ -3233,7 +3244,7 @@ declare class ThemeService {
|
|
|
3233
3244
|
private readonly storageKey;
|
|
3234
3245
|
private readonly applies;
|
|
3235
3246
|
readonly theme: _angular_core.WritableSignal<DwTheme>;
|
|
3236
|
-
/** Puts the current theme on
|
|
3247
|
+
/** Puts the current theme on `<html>` (unless `theme.apply` is false). */
|
|
3237
3248
|
init(): void;
|
|
3238
3249
|
setTheme(theme: DwTheme): void;
|
|
3239
3250
|
toggle(): void;
|
|
@@ -3245,7 +3256,7 @@ declare class ThemeService {
|
|
|
3245
3256
|
|
|
3246
3257
|
/**
|
|
3247
3258
|
* Crystal's app-level setup: the theme. With `theme.apply` (the default) it puts the stored or
|
|
3248
|
-
* initial theme on
|
|
3259
|
+
* initial theme on `<html>` before the first render, so a dark choice doesn't flash light.
|
|
3249
3260
|
*
|
|
3250
3261
|
* ```ts
|
|
3251
3262
|
* 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: {
|
|
@@ -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. */
|