@rvx/ui 0.1.10 → 0.1.12
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/dist/common/debounce.js +2 -2
- package/dist/common/debounce.js.map +1 -1
- package/dist/common/parsers.d.ts +1 -1
- package/dist/common/parsers.js +3 -3
- package/dist/common/parsers.js.map +1 -1
- package/dist/common/theme.d.ts +2 -61
- package/dist/common/trim.js +2 -2
- package/dist/common/trim.js.map +1 -1
- package/dist/components/collapse.js +3 -3
- package/dist/components/collapse.js.map +1 -1
- package/dist/components/dialog.d.ts +3 -1
- package/dist/components/dialog.js +55 -22
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown.js +2 -2
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/layer.js +4 -4
- package/dist/components/layer.js.map +1 -1
- package/dist/components/popout.js +3 -3
- package/dist/components/popout.js.map +1 -1
- package/dist/components/popover.js +2 -2
- package/dist/components/popover.js.map +1 -1
- package/dist/components/scroll-view.js +5 -5
- package/dist/components/scroll-view.js.map +1 -1
- package/dist/components/validation.js +4 -4
- package/dist/components/validation.js.map +1 -1
- package/dist/theme.module.css +29 -4
- package/dist/theme.module.css.map +1 -1
- package/package.json +2 -2
- package/src/common/debounce.tsx +2 -2
- package/src/common/parsers.tsx +4 -4
- package/src/common/theme.tsx +2 -61
- package/src/common/trim.tsx +2 -2
- package/src/components/collapse.tsx +3 -3
- package/src/components/dialog.tsx +61 -26
- package/src/components/dropdown.tsx +2 -2
- package/src/components/layer.tsx +4 -4
- package/src/components/popout.tsx +3 -3
- package/src/components/popover.tsx +2 -2
- package/src/components/scroll-view.tsx +5 -5
- package/src/components/validation.tsx +4 -4
- package/src/theme/base.scss +2 -0
- package/src/theme/components/card.scss +4 -4
- package/src/theme/components/dialog.scss +27 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-view.js","sourceRoot":"","sources":["../../src/components/scroll-view.tsx"],"names":[],"mappings":";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AC,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,CAAC;IAE7C,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "rvx/jsx-runtime";
|
|
2
|
-
import { Context, For, map,
|
|
2
|
+
import { $, Context, For, map, teardown, trigger, untrack } from "rvx";
|
|
3
3
|
import { Queue } from "rvx/async";
|
|
4
4
|
import { Emitter } from "rvx/event";
|
|
5
5
|
import { uniqueId } from "rvx/id";
|
|
@@ -11,8 +11,8 @@ export const VALIDATION = new Context();
|
|
|
11
11
|
export class Validator {
|
|
12
12
|
#queue = new Queue();
|
|
13
13
|
#signalTrigger;
|
|
14
|
-
#rules =
|
|
15
|
-
#invalid =
|
|
14
|
+
#rules = $([]);
|
|
15
|
+
#invalid = $(false);
|
|
16
16
|
constructor() {
|
|
17
17
|
const options = VALIDATION.current;
|
|
18
18
|
this.#signalTrigger = options?.signalTrigger ?? "if-validated";
|
|
@@ -105,7 +105,7 @@ export function validatorFor(target) {
|
|
|
105
105
|
}
|
|
106
106
|
export class ValidationRuleEntry {
|
|
107
107
|
id = uniqueId();
|
|
108
|
-
visible =
|
|
108
|
+
visible = $(false);
|
|
109
109
|
alert = new Emitter();
|
|
110
110
|
message;
|
|
111
111
|
validate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/components/validation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,OAAO,EAAc,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/components/validation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAc,OAAO,EAAc,GAAG,EAAE,GAAG,EAAsB,QAAQ,EAAE,OAAO,EAAe,OAAO,EAAE,MAAM,KAAK,CAAC;AAChI,OAAO,EA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EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE;YACN,KAAK,CAAC,KAAK;YACX,KAAK,EAAE,4BAA4B;SACnC,EACD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,EAAE,EAAE,KAAK,CAAC,EAAE,YAEZ,cAAK,KAAK,EAAE,KAAK,EAAE,kBAAkB,YACpC,KAAC,IAAI,cACH,KAAK,CAAC,QAAQ,GACT,GACF,GACI,CAAC;AACb,CAAC;AAKD,MAAM,UAAU,kBAAkB,CAAC,KAElC;IACA,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,OAAO,KAAC,GAAG,IAAC,IAAI,EAAE,SAAS,CAAC,KAAK,YAC/B,IAAI,CAAC,EAAE,CAAC,KAAC,iBAAiB,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,YACrF,IAAI,CAAC,OAAO,GACM,GACf,CAAC;AACR,CAAC"}
|
package/dist/theme.module.css
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
--space-gap: 0.4285714286rem;
|
|
30
30
|
--layout-transition: .15s ease;
|
|
31
31
|
--color-transition: .1s ease;
|
|
32
|
+
--dialog-fadeout-ms: 150;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
@media (prefers-color-scheme: dark) {
|
|
@@ -226,10 +227,10 @@ body {
|
|
|
226
227
|
@media (prefers-color-scheme: dark) {
|
|
227
228
|
:root {
|
|
228
229
|
--card-default-border: rgb(72, 72, 72);
|
|
229
|
-
--card-info-border: rgb(0,
|
|
230
|
-
--card-success-border: rgb(0,
|
|
231
|
-
--card-warning-border: rgb(
|
|
232
|
-
--card-danger-border: rgb(
|
|
230
|
+
--card-info-border: rgb(0, 192, 255);
|
|
231
|
+
--card-success-border: rgb(0, 255, 128);
|
|
232
|
+
--card-warning-border: rgb(255, 200, 0);
|
|
233
|
+
--card-danger-border: rgb(255, 0, 64);
|
|
233
234
|
color-scheme: dark;
|
|
234
235
|
}
|
|
235
236
|
}
|
|
@@ -407,11 +408,35 @@ body {
|
|
|
407
408
|
grid-template-columns: 1fr auto 1fr;
|
|
408
409
|
grid-template-rows: 3fr auto 4fr;
|
|
409
410
|
overflow: auto;
|
|
411
|
+
transition: opacity var(--layout-transition);
|
|
412
|
+
opacity: 0;
|
|
410
413
|
}
|
|
411
414
|
|
|
415
|
+
.dialog_fadein {
|
|
416
|
+
opacity: 1;
|
|
417
|
+
}
|
|
418
|
+
.dialog_fadein .dialog_body {
|
|
419
|
+
transform: scale(1);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.dialog_fadeout {
|
|
423
|
+
pointer-events: none;
|
|
424
|
+
opacity: 0;
|
|
425
|
+
}
|
|
426
|
+
.dialog_fadeout .dialog_body {
|
|
427
|
+
transform: scale(0.9);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
@media (prefers-reduced-motion) {
|
|
431
|
+
.dialog_body.dialog_body {
|
|
432
|
+
transform: unset;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
412
435
|
.dialog_body {
|
|
413
436
|
grid-row: 2/3;
|
|
414
437
|
grid-column: 2/3;
|
|
438
|
+
transform: scale(0.9);
|
|
439
|
+
transition: transform var(--layout-transition);
|
|
415
440
|
background-color: var(--dialog-bg);
|
|
416
441
|
box-shadow: var(--dialog-shadow);
|
|
417
442
|
border-radius: var(--content-radius);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../src/theme/base.scss","../src/theme/common.scss","../src/theme/components/button.scss","../src/theme/components/card.scss","../src/theme/components/checkbox.scss","../src/theme/components/collapse.scss","../src/theme/components/column.scss","../src/theme/components/control-group.scss","../src/theme/components/dialog.scss","../src/theme/components/dropdown.scss","../src/theme/components/flex-space.scss","../src/theme/components/heading.scss","../src/theme/components/label.scss","../src/theme/components/link.scss","../src/theme/components/page.scss","../src/theme/components/popover.scss","../src/theme/components/radio-buttons.scss","../src/theme/components/row.scss","../src/theme/components/scroll-view.scss","../src/theme/components/text-input.scss","../src/theme/components/text.scss","../src/theme/components/validation.scss","../src/theme/components/value.scss"],"names":[],"mappings":"AASA;EACC;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;ECOA;EACA;EACA;EACA;EDPA;EACA;EACA;EACA;EACA;EACA;ECDA;EACA;EACA;EACA;EDCA;EAEA;EAEA;EACA;EAEA;EACA;;;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/theme/base.scss","../src/theme/common.scss","../src/theme/components/button.scss","../src/theme/components/card.scss","../src/theme/components/checkbox.scss","../src/theme/components/collapse.scss","../src/theme/components/column.scss","../src/theme/components/control-group.scss","../src/theme/components/dialog.scss","../src/theme/components/dropdown.scss","../src/theme/components/flex-space.scss","../src/theme/components/heading.scss","../src/theme/components/label.scss","../src/theme/components/link.scss","../src/theme/components/page.scss","../src/theme/components/popover.scss","../src/theme/components/radio-buttons.scss","../src/theme/components/row.scss","../src/theme/components/scroll-view.scss","../src/theme/components/text-input.scss","../src/theme/components/text.scss","../src/theme/components/validation.scss","../src/theme/components/value.scss"],"names":[],"mappings":"AASA;EACC;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;ECOA;EACA;EACA;EACA;EDPA;EACA;EACA;EACA;EACA;EACA;ECDA;EACA;EACA;EACA;EDCA;EAEA;EAEA;EACA;EAEA;EACA;EAEA;;;AC7BC;EAFD;IANE;IAAA;IAAA;IAUA;;;AD0CH;EACC;EACA;EAEA;;AACA;EALD;IAME;;;;AAIF;EACC;EACA;EACA;EACA;;;AAGD;EACC;;;AC9DC;EAFD;IANE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAUA;;;ACgFH;EACC;EACA;EACA;EACA;EAEA;EAEA;EDnEC,eACC;EAED,gBACC;ECkEF;EACA;;AAGA;EACC;;AAGD;EACC;EACA;;;AAKD;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAdF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAdF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAdF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAdF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAdF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAdF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;;;ADhIC;EAFD;IANE;IAAA;IAAA;IAAA;IAAA;IAUA;;;AEKH;EACC;EACA;EFcC,eACC;EAED,gBACC;;;AEbF;EACC;;;AADD;EACC;;;AADD;EACC;;;AADD;EACC;;;AADD;EACC;;;AC3BF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;EACA;;;AAIF;EACC;EACA;EACA;;;ACtBD;EACC;EACA;EACA;;;AAGD;EACC,YACC;;;AAIF;EACC;IAAO;;EACP;IAAM;;EACN;IAAM;;EACN;IAAK;;;AAGN;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;AAEA;EACC,YACC;;AAIF;EACC;EACA;;;AAIF;EACC;EACA;EACA;EACA;;AAEA;EACC,YACC;;AAKF;EACC;EACA;EACA;;;AC5DF;EACC;EACA;;AAEA;EACC;;AAMD;EACC;;AAGD;EACC;;AAMD;EACC;;;AAKD;EACC;;AACA;EACC;;;AAHF;EACC;;AACA;EACC;;;AC/BH;EACC;EACA;EAEA;;AACA;EACC;;AAGD;EACC;EACA;;AAED;EACC;EACA;;;ANHA;EAFD;IANE;IAAA;IAAA;IAAA;IAUA;;;AOEH;EACC;EACA;EAEA;EAEA;EACA;EACA;EAEA;EAEA;EACA;;;AAGD;EACC;;AACA;EACC;;;AAIF;EACC;EACA;;AACA;EACC;;;AAIF;EACC;IACC;;;AAIF;EACC;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EP5BC,eACC;EAED,gBACC;;;AO4BH;EACC;;;APxDC;EAFD;IANE;IAAA;IAAA;IAAA;IAUA;;;AQEH;EACC;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;ERPC,eACC;EAED,gBACC;;AQMF;EACC;;;AC9CF;EACC;EACA;EACA;;;ACHD;EACC;EACA;;AAEA;EAEC;EACA;EACA;EACA;;;AAIF;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;AAAA;AAAA;EAGC;EACA;EACA;;;AVxBC;EAFD;IANE;IAUA;;;AWPH;EACC;EACA;EAEA;EACA;EACA;;AAEA;EAEC;EACA;EACA;EACA;;;AXRA;EAFD;IANE;IAUA;;;AYPH;EACC;EACA;EAEA;EACA;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;;ACrBF;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AbPC;EAFD;IANE;IAAA;IAAA;IAUA;;;AcDH;EACC;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EdnBC,eACC;EAED,gBACC;;;AevCH;EACC;EACA;EACA;;AAEA;EACC;EACA;;;AAIF;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;;AAIF;EACC;EACA;EACA;;;AC5BD;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AACA;EACC;EACA;;;AALF;EACC;EACA;;AACA;EACC;EACA;;;AhBAD;EAFD;IANE;IAAA;IAUA;;;AiBJH;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;AAAA;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;;;AjBpCC;EAFD;IANE;IAAA;IAAA;IAAA;IAUA;;;AkBEH;EACC;EACA;EACA;EAEA;EAEA;ElBmBC,eACC;EAED,gBACC;EkBrBF;EACA;EACA;EACA;EACA;;AAEA;EACC;;AAGD;EACC;EACA;;;AAIF;EACC;;;AC1CD;EACC;;AAEA;EAEC;EACA;EACA;EACA;;;AnBIA;EAFD;IANE;IAUA;;;AoBPH;EACC;;;AAGD;EACC;;;ACZD;EACC","file":"theme.module.css"}
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"rvx"
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"version": "0.1.
|
|
15
|
+
"version": "0.1.12",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "./dist/index.js",
|
|
18
18
|
"sideEffects": false,
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"./dist/": "./dist/"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"rvx": "^
|
|
31
|
+
"rvx": "^19.0.2"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/common/debounce.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $, Signal, teardown, watchUpdates } from "rvx";
|
|
2
2
|
import { validatorFor } from "../components/validation.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -12,7 +12,7 @@ import { validatorFor } from "../components/validation.js";
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export function debounce<T>(source: Signal<T>, delay: number): Signal<T> {
|
|
15
|
-
const input =
|
|
15
|
+
const input = $(source.value);
|
|
16
16
|
let timer: number | undefined;
|
|
17
17
|
|
|
18
18
|
watchUpdates(input, value => {
|
package/src/common/parsers.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $, Signal, watchUpdates } from "rvx";
|
|
2
2
|
|
|
3
3
|
import { Validator } from "../components/validation.js";
|
|
4
4
|
|
|
@@ -67,7 +67,7 @@ export type ParserMessages<P extends Parser<any, any, any>> = P extends Parser<a
|
|
|
67
67
|
*
|
|
68
68
|
* @example
|
|
69
69
|
* ```tsx
|
|
70
|
-
* const value =
|
|
70
|
+
* const value = $(0);
|
|
71
71
|
*
|
|
72
72
|
* // Format the current value as initial value:
|
|
73
73
|
* <TextInput value={
|
|
@@ -79,10 +79,10 @@ export type ParserMessages<P extends Parser<any, any, any>> = P extends Parser<a
|
|
|
79
79
|
*/
|
|
80
80
|
export function parse<S, P extends Parser<S, any, any>>(source: Signal<S>, parser: P, input?: Signal<ParserInput<P>>): Signal<ParserInput<P>> {
|
|
81
81
|
if (input === undefined) {
|
|
82
|
-
input =
|
|
82
|
+
input = $(parser.format(source.value));
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const invalid =
|
|
85
|
+
const invalid = $<undefined | ParserMessages<P>>(undefined);
|
|
86
86
|
|
|
87
87
|
watchUpdates(source, value => {
|
|
88
88
|
try {
|
package/src/common/theme.tsx
CHANGED
|
@@ -23,21 +23,13 @@ export const THEME = new Context<Theme | undefined>(undefined);
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export interface Theme {
|
|
26
|
-
/** Class for all buttons */
|
|
27
26
|
button?: string;
|
|
28
|
-
/** Additional class for buttons with the "default" variant */
|
|
29
27
|
button_default?: string;
|
|
30
|
-
/** Additional class for buttons with the "primary" variant */
|
|
31
28
|
button_primary?: string;
|
|
32
|
-
/** Additional class for buttons with the "success" variant */
|
|
33
29
|
button_success?: string;
|
|
34
|
-
/** Additional class for buttons with the "danger" variant */
|
|
35
30
|
button_danger?: string;
|
|
36
|
-
/** Additional class for buttons with the "warning" variant */
|
|
37
31
|
button_warning?: string;
|
|
38
|
-
/** Additional class for buttons with the "input" variant */
|
|
39
32
|
button_input?: string;
|
|
40
|
-
/** Additional class for buttons with the "text" variant */
|
|
41
33
|
button_text?: string;
|
|
42
34
|
|
|
43
35
|
card?: string;
|
|
@@ -48,128 +40,77 @@ export interface Theme {
|
|
|
48
40
|
card_warning?: string;
|
|
49
41
|
card_danger?: string;
|
|
50
42
|
|
|
51
|
-
/** Class for all checkbox containing labels */
|
|
52
43
|
checkbox_label?: string;
|
|
53
|
-
/** Class for all checkbox inputs */
|
|
54
44
|
checkbox_input?: string;
|
|
55
|
-
/** Class for checkbox text content. This element may also be a text block. */
|
|
56
45
|
checkbox_content?: string;
|
|
57
46
|
|
|
58
|
-
/** Class for collapses */
|
|
59
47
|
collapse?: string;
|
|
60
|
-
/** Class for collapses that is when it's size has been measured. */
|
|
61
48
|
collapse_sized?: string;
|
|
62
|
-
/** Class for an additional element between the collapse container and the content. If this is undefined, the element is omitted. */
|
|
63
49
|
collapse_view?: string;
|
|
64
|
-
/** Class that is added to collapses to play an alert animation. */
|
|
65
50
|
collapse_alert?: string;
|
|
66
|
-
/** Additional class for visible collapses */
|
|
67
51
|
collapse_visible?: string;
|
|
68
|
-
/** Class for collapse content */
|
|
69
52
|
collapse_content?: string;
|
|
70
53
|
|
|
71
|
-
/** Class for all columns */
|
|
72
54
|
column?: string;
|
|
73
|
-
/** Additional class for columns of content */
|
|
74
55
|
column_content?: string;
|
|
75
|
-
/** Additional class for columns of controls */
|
|
76
56
|
column_control?: string;
|
|
77
57
|
|
|
78
|
-
/** Class for all inline control groups */
|
|
79
58
|
control_group?: string;
|
|
80
59
|
|
|
81
|
-
/** Class for all dialog containers */
|
|
82
60
|
dialog_container?: string;
|
|
83
|
-
/** Class for all dialog bodies */
|
|
84
61
|
dialog_body?: string;
|
|
85
|
-
/** Class for all dialog footers */
|
|
86
62
|
dialog_footer?: string;
|
|
63
|
+
dialog_fadein?: string;
|
|
64
|
+
dialog_fadeout?: string;
|
|
87
65
|
|
|
88
|
-
/** Class for all dropdown roots. */
|
|
89
66
|
dropdown?: string;
|
|
90
|
-
/** Additional class for nested dropdowns. */
|
|
91
67
|
dropdown_expansion?: string;
|
|
92
|
-
/** Class for the dropdown scroll area. */
|
|
93
68
|
dropdown_scroll_area?: string;
|
|
94
|
-
/** Class for the dropdown content. */
|
|
95
69
|
dropdown_content?: string;
|
|
96
|
-
/** Class for all dropdown items. */
|
|
97
70
|
dropdown_item?: string;
|
|
98
|
-
/** Class for the currently active dropdown item. */
|
|
99
71
|
dropdown_item_active?: string;
|
|
100
72
|
|
|
101
|
-
/** Class for growing flex space */
|
|
102
73
|
flex_space?: string;
|
|
103
74
|
|
|
104
|
-
/** Class for all headings which are also semantic elements like h1, h2 etc. */
|
|
105
75
|
heading?: string;
|
|
106
76
|
|
|
107
|
-
/** Class for all labels */
|
|
108
77
|
label?: string;
|
|
109
78
|
|
|
110
|
-
/** Class for all links */
|
|
111
79
|
link?: string;
|
|
112
80
|
|
|
113
|
-
/** Class for all page roots. */
|
|
114
81
|
page?: string;
|
|
115
|
-
/** Class for page scrollbar size compensation elements. */
|
|
116
82
|
page_scrollbar_comp?: string;
|
|
117
|
-
/** Class for the page content column besides the scrollbar size compensation element. */
|
|
118
83
|
page_content_col?: string;
|
|
119
|
-
/** Class for page content roots. */
|
|
120
84
|
page_content?: string;
|
|
121
85
|
|
|
122
|
-
/** Class for all popover roots. */
|
|
123
86
|
popover?: string;
|
|
124
|
-
/** Class for the spike container area. */
|
|
125
87
|
popover_spike_area?: string;
|
|
126
|
-
/** Class for the popover scrollable area. */
|
|
127
88
|
popover_scroll_area?: string;
|
|
128
|
-
/** Class for the spike root. */
|
|
129
89
|
popover_spike?: string;
|
|
130
|
-
/** Class for the popover content. */
|
|
131
90
|
popover_content?: string;
|
|
132
91
|
|
|
133
|
-
/** Class for all radio button columns */
|
|
134
92
|
radio_buttons?: string;
|
|
135
|
-
/** Class for all radio button containing labels */
|
|
136
93
|
radio_button_label?: string;
|
|
137
|
-
/** Class for all radio button inputs */
|
|
138
94
|
radio_button_input?: string;
|
|
139
|
-
/** Class for radio button text content. This element may also be a text block. */
|
|
140
95
|
radio_button_content?: string;
|
|
141
96
|
|
|
142
|
-
/** Class for all rows */
|
|
143
97
|
row?: string;
|
|
144
|
-
/** Additional class for rows of content */
|
|
145
98
|
row_content?: string;
|
|
146
|
-
/** Additional class for rows of controls */
|
|
147
99
|
row_control?: string;
|
|
148
100
|
|
|
149
|
-
/** Class for all scroll view roots */
|
|
150
101
|
scroll_view?: string;
|
|
151
|
-
/** Class for the scrolling area. */
|
|
152
102
|
scroll_view_area?: string;
|
|
153
|
-
/** Class for scroll view content root. */
|
|
154
103
|
scroll_view_content?: string;
|
|
155
|
-
/** Class for scroll view start overflow indicators. */
|
|
156
104
|
scroll_view_indicator_start?: string;
|
|
157
|
-
/** Class for scroll view end overflow indicators. */
|
|
158
105
|
scroll_view_indicator_end?: string;
|
|
159
|
-
/** Class for visible overflow indicators. */
|
|
160
106
|
scroll_view_indicator_visible?: string;
|
|
161
107
|
|
|
162
|
-
/** Class for all text inputs */
|
|
163
108
|
text_input?: string;
|
|
164
109
|
|
|
165
|
-
/** Class for all text blocks */
|
|
166
110
|
text?: string;
|
|
167
111
|
|
|
168
|
-
/** Class for all validation messages */
|
|
169
112
|
validation_message?: string;
|
|
170
|
-
/** Class for all validation message containers. */
|
|
171
113
|
validation_message_container?: string;
|
|
172
114
|
|
|
173
|
-
/** Class for all text values */
|
|
174
115
|
value?: string;
|
|
175
116
|
}
|
package/src/common/trim.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $, Signal, watchUpdates } from "rvx";
|
|
2
2
|
|
|
3
3
|
import { validatorFor } from "../components/validation.js";
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ import { validatorFor } from "../components/validation.js";
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
export function trim(source: Signal<string>): Signal<string> {
|
|
16
|
-
const input =
|
|
16
|
+
const input = $(source.value);
|
|
17
17
|
|
|
18
18
|
watchUpdates(input, value => {
|
|
19
19
|
source.value = value.trim();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassValue, Expression, get, map, optionalString,
|
|
1
|
+
import { $, ClassValue, Expression, get, map, optionalString, StyleValue, teardown } from "rvx";
|
|
2
2
|
import { Event } from "rvx/event";
|
|
3
3
|
import { THEME } from "../common/theme.js";
|
|
4
4
|
import { AriaLive, AriaRelevant } from "../common/types.js";
|
|
@@ -16,8 +16,8 @@ export function Collapse(props: {
|
|
|
16
16
|
}): unknown {
|
|
17
17
|
const theme = THEME.current;
|
|
18
18
|
const visible = map(props.visible, v => v ?? false);
|
|
19
|
-
const alert =
|
|
20
|
-
const size =
|
|
19
|
+
const alert = $(false);
|
|
20
|
+
const size = $<number | undefined>(undefined);
|
|
21
21
|
|
|
22
22
|
const content = <div class={theme?.collapse_content}>
|
|
23
23
|
{props.children}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { captureSelf, ClassValue, Expression, map,
|
|
1
|
+
import { $, captureSelf, ClassValue, Context, created, Expression, map, render, StyleValue, teardown } from "rvx";
|
|
2
2
|
import { TASKS, Tasks } from "rvx/async";
|
|
3
|
+
import { Emitter, Event } from "rvx/event";
|
|
3
4
|
import { uniqueId } from "rvx/id";
|
|
4
5
|
import { FlexSpace, Heading, Row, Text, THEME } from "../index.js";
|
|
5
6
|
import { LAYER, Layer } from "./layer.js";
|
|
@@ -17,34 +18,49 @@ export interface DialogOptions {
|
|
|
17
18
|
cancellable?: boolean;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
export const DIALOG_FADEOUT = new Context<Event<[tasks: Promise<void>[]]> | undefined>();
|
|
22
|
+
|
|
20
23
|
export function showDialog<T = void>(init: DialogInit<T>, options?: DialogOptions): Promise<T> {
|
|
21
24
|
return new Promise<T>((resolve, reject) => {
|
|
22
25
|
captureSelf(dispose => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
const enabled = $(true);
|
|
27
|
+
const fadeout = new Emitter<[tasks: Promise<void>[]]>();
|
|
28
|
+
const view = render(
|
|
29
|
+
<Layer modal enabled={enabled}>
|
|
30
|
+
{() => Context.inject([
|
|
31
|
+
TASKS.with(new Tasks()),
|
|
32
|
+
DIALOG_FADEOUT.with(fadeout.event),
|
|
33
|
+
], () => {
|
|
34
|
+
const dialog: Dialog<T> = {
|
|
35
|
+
resolve(value) {
|
|
36
|
+
dispose();
|
|
37
|
+
resolve(value);
|
|
38
|
+
},
|
|
39
|
+
reject(reason) {
|
|
40
|
+
dispose();
|
|
41
|
+
reject(reason);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
if (options?.cancellable ?? true) {
|
|
45
|
+
LAYER.current!.useHotkey("escape", () => {
|
|
46
|
+
dialog.reject(new DialogAbortError());
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return init(dialog);
|
|
50
|
+
})}
|
|
46
51
|
</Layer>
|
|
47
52
|
);
|
|
53
|
+
view.appendTo(document.body);
|
|
54
|
+
teardown(async () => {
|
|
55
|
+
try {
|
|
56
|
+
enabled.value = false;
|
|
57
|
+
const tasks: Promise<void>[] = [];
|
|
58
|
+
fadeout.emit(tasks);
|
|
59
|
+
await Promise.all(tasks);
|
|
60
|
+
} finally {
|
|
61
|
+
view.detach();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
48
64
|
});
|
|
49
65
|
});
|
|
50
66
|
}
|
|
@@ -82,7 +98,7 @@ export function DialogBody(props: {
|
|
|
82
98
|
head.push(<Text id={descriptionId}>{props.description}</Text>);
|
|
83
99
|
}
|
|
84
100
|
|
|
85
|
-
|
|
101
|
+
const body = <div
|
|
86
102
|
class={[
|
|
87
103
|
theme?.dialog_container,
|
|
88
104
|
props.class,
|
|
@@ -108,7 +124,26 @@ export function DialogBody(props: {
|
|
|
108
124
|
{head}
|
|
109
125
|
{props.children}
|
|
110
126
|
</div>
|
|
111
|
-
</div
|
|
127
|
+
</div> as HTMLElement;
|
|
128
|
+
|
|
129
|
+
created(() => {
|
|
130
|
+
if (theme?.dialog_fadein) {
|
|
131
|
+
body.offsetParent;
|
|
132
|
+
body.classList.add(theme.dialog_fadein);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
DIALOG_FADEOUT.current?.(tasks => {
|
|
137
|
+
if (theme?.dialog_fadeout) {
|
|
138
|
+
body.classList.add(theme.dialog_fadeout);
|
|
139
|
+
}
|
|
140
|
+
const duration = parseInt(getComputedStyle(body).getPropertyValue("--dialog-fadeout-ms"));
|
|
141
|
+
if (Number.isSafeInteger(duration)) {
|
|
142
|
+
tasks.push(new Promise(resolve => setTimeout(resolve, duration)));
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
return body;
|
|
112
147
|
}
|
|
113
148
|
|
|
114
149
|
export function DialogFooter(props: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassValue, Expression, For, get, map, memo, optionalString, render,
|
|
1
|
+
import { $, ClassValue, Expression, For, get, map, memo, optionalString, render, StyleValue, View, watch } from "rvx";
|
|
2
2
|
import { uniqueId } from "rvx/id";
|
|
3
3
|
import { Action, createPassiveActionEvent, handleActionEvent, keyFor, startDelayedHoverOnMouseenter } from "../common/events.js";
|
|
4
4
|
import { THEME } from "../common/theme.js";
|
|
@@ -92,7 +92,7 @@ export function createDropdown(props: {
|
|
|
92
92
|
const theme = THEME.current;
|
|
93
93
|
const layer = LAYER.current!;
|
|
94
94
|
|
|
95
|
-
const activeItem =
|
|
95
|
+
const activeItem = $<DropdownItem | undefined>(undefined);
|
|
96
96
|
const instances = new WeakMap<DropdownItem, {
|
|
97
97
|
id: string;
|
|
98
98
|
children: Popout | undefined;
|
package/src/components/layer.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, Expression, get, Inject, memo,
|
|
1
|
+
import { $, Context, Expression, get, Inject, memo, Signal, teardown, uncapture, untrack, watch } from "rvx";
|
|
2
2
|
|
|
3
3
|
import { Action, handleActionEvent, keyFor } from "../common/events.js";
|
|
4
4
|
|
|
@@ -15,11 +15,11 @@ interface LayerInstance {
|
|
|
15
15
|
|
|
16
16
|
export const LAYER = new Context<LayerHandle | undefined>();
|
|
17
17
|
|
|
18
|
-
const LAYERS =
|
|
18
|
+
const LAYERS = $<LayerInstance[]>([
|
|
19
19
|
{
|
|
20
20
|
roots: [],
|
|
21
21
|
modal: false,
|
|
22
|
-
inert:
|
|
22
|
+
inert: $(false),
|
|
23
23
|
autoFocusFallback: undefined,
|
|
24
24
|
},
|
|
25
25
|
]);
|
|
@@ -79,7 +79,7 @@ export function Layer(props: {
|
|
|
79
79
|
const layer: LayerInstance = {
|
|
80
80
|
roots: [],
|
|
81
81
|
modal: props.modal ?? false,
|
|
82
|
-
inert:
|
|
82
|
+
inert: $(false),
|
|
83
83
|
autoFocusFallback: undefined,
|
|
84
84
|
};
|
|
85
85
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { captureSelf, Context, Expression, get, render,
|
|
1
|
+
import { $, captureSelf, Context, Expression, get, render, teardown, TeardownHook, untrack, View, viewNodes } from "rvx";
|
|
2
2
|
import { Emitter, Event as RvxEvent } from "rvx/event";
|
|
3
3
|
import { PASSIVE_ACTION_EVENT } from "../common/events.js";
|
|
4
4
|
import { axisEquals, Direction, DOWN, flip, getBlockStart, getInlineStart, getSize, getWindowSize, getWindowSpaceAround, INSET, LEFT, RIGHT, ScriptDirection, UP, WritingMode } from "../common/writing-mode.js";
|
|
@@ -138,9 +138,9 @@ export class Popout {
|
|
|
138
138
|
#foreignEvents: string[];
|
|
139
139
|
#instance?: Instance;
|
|
140
140
|
#instanceArgs?: InstanceArgs;
|
|
141
|
-
#visible =
|
|
141
|
+
#visible = $(false);
|
|
142
142
|
#onPlacement = new Emitter<[PopoutPlacementArgs]>();
|
|
143
|
-
#placementState =
|
|
143
|
+
#placementState = $<PopoutPlacementInfo | undefined>(undefined);
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Create a new popout.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassValue, Expression, get, Inject, map, render,
|
|
1
|
+
import { $, ClassValue, Expression, get, Inject, map, render, StyleValue, SVG, watch, XMLNS } from "rvx";
|
|
2
2
|
import { uniqueId } from "rvx/id";
|
|
3
3
|
import { Action } from "../common/events.js";
|
|
4
4
|
import { THEME } from "../common/theme.js";
|
|
@@ -78,7 +78,7 @@ export function createPopover(props: {
|
|
|
78
78
|
content: ({ popout, onPlacement, placement, setSizeReference }) => {
|
|
79
79
|
const theme = THEME.current;
|
|
80
80
|
const layer = LAYER.current!;
|
|
81
|
-
const spikeTransform =
|
|
81
|
+
const spikeTransform = $("");
|
|
82
82
|
|
|
83
83
|
layer.useHotkey("escape", () => {
|
|
84
84
|
popout.hide();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassValue,
|
|
1
|
+
import { $, ClassValue, StyleValue, teardown } from "rvx";
|
|
2
2
|
import { debounceEvent } from "../common/events.js";
|
|
3
3
|
import { THEME } from "../common/theme.js";
|
|
4
4
|
import { axisEquals, DOWN, getBlockStart, getSize, RIGHT, UP, WritingMode } from "../common/writing-mode.js";
|
|
@@ -9,10 +9,10 @@ export function ScrollView(props: {
|
|
|
9
9
|
children?: unknown;
|
|
10
10
|
}): unknown {
|
|
11
11
|
const theme = THEME.current;
|
|
12
|
-
const vertical =
|
|
13
|
-
const scrollbarComp =
|
|
14
|
-
const startIndicator =
|
|
15
|
-
const endIndicator =
|
|
12
|
+
const vertical = $<boolean | undefined>(undefined);
|
|
13
|
+
const scrollbarComp = $(0);
|
|
14
|
+
const startIndicator = $(false);
|
|
15
|
+
const endIndicator = $(false);
|
|
16
16
|
|
|
17
17
|
const content = <div class={theme?.scroll_view_content}>
|
|
18
18
|
{props.children}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassValue, Context, Expression, For, map,
|
|
1
|
+
import { $, ClassValue, Context, Expression, For, map, Signal, StyleValue, teardown, trigger, TriggerPipe, untrack } from "rvx";
|
|
2
2
|
import { Queue } from "rvx/async";
|
|
3
3
|
import { Emitter, Event } from "rvx/event";
|
|
4
4
|
import { uniqueId } from "rvx/id";
|
|
@@ -29,8 +29,8 @@ export interface ValidationOptions {
|
|
|
29
29
|
export class Validator {
|
|
30
30
|
#queue = new Queue();
|
|
31
31
|
#signalTrigger: ValidationSignalTrigger;
|
|
32
|
-
#rules =
|
|
33
|
-
#invalid =
|
|
32
|
+
#rules = $<ValidationRuleEntry[]>([]);
|
|
33
|
+
#invalid = $(false);
|
|
34
34
|
|
|
35
35
|
constructor() {
|
|
36
36
|
const options = VALIDATION.current;
|
|
@@ -176,7 +176,7 @@ export interface ValidationRule {
|
|
|
176
176
|
|
|
177
177
|
export class ValidationRuleEntry {
|
|
178
178
|
readonly id = uniqueId();
|
|
179
|
-
readonly visible =
|
|
179
|
+
readonly visible = $(false);
|
|
180
180
|
readonly alert = new Emitter<[]>();
|
|
181
181
|
readonly message: unknown;
|
|
182
182
|
readonly validate: ValidationRule["validate"];
|