@g9tm/lynxcontrols 2.9.0 → 2.10.1
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/catalog/cards/G9DockLayout.md +17 -0
- package/catalog/cards/G9KeyDiamond.md +15 -0
- package/catalog/cards/G9KeySlider.md +17 -0
- package/catalog/catalog.json +1249 -7
- package/catalog/index.md +4 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/hooks.d.ts.map +1 -1
- package/dist/anchor/hooks.jsx +1 -1
- package/dist/base/control.d.ts +9 -0
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +14 -1
- package/dist/base/index.d.ts +1 -1
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +1 -1
- package/dist/base/press.d.ts +16 -1
- package/dist/base/press.d.ts.map +1 -1
- package/dist/base/press.jsx +29 -3
- package/dist/base/text-of.d.ts +10 -0
- package/dist/base/text-of.d.ts.map +1 -0
- package/dist/base/text-of.jsx +26 -0
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +6 -2
- package/dist/display/figures.d.ts +1 -1
- package/dist/display/figures.d.ts.map +1 -1
- package/dist/display/figures.jsx +2 -2
- package/dist/display/motion-figures.d.ts +5 -2
- package/dist/display/motion-figures.d.ts.map +1 -1
- package/dist/display/motion-figures.jsx +4 -4
- package/dist/layout/containers.d.ts +6 -1
- package/dist/layout/containers.d.ts.map +1 -1
- package/dist/layout/containers.jsx +7 -2
- package/dist/layout/dock.css +90 -0
- package/dist/layout/dock.css.map +1 -0
- package/dist/layout/dock.d.ts +86 -0
- package/dist/layout/dock.d.ts.map +1 -0
- package/dist/layout/dock.jsx +272 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.jsx +1 -0
- package/dist/list/virtual-list.d.ts +11 -1
- package/dist/list/virtual-list.d.ts.map +1 -1
- package/dist/list/virtual-list.jsx +36 -7
- package/dist/pointer/index.d.ts +1 -0
- package/dist/pointer/index.d.ts.map +1 -1
- package/dist/pointer/index.jsx +1 -0
- package/dist/pointer/pad.d.ts +57 -0
- package/dist/pointer/pad.d.ts.map +1 -0
- package/dist/pointer/pad.jsx +111 -0
- package/dist/popover/popover.d.ts +3 -1
- package/dist/popover/popover.d.ts.map +1 -1
- package/dist/popover/popover.jsx +4 -2
- package/dist/range-slider/index.d.ts +1 -0
- package/dist/range-slider/index.d.ts.map +1 -1
- package/dist/range-slider/index.jsx +1 -0
- package/dist/range-slider/key-slider.d.ts +50 -0
- package/dist/range-slider/key-slider.d.ts.map +1 -0
- package/dist/range-slider/key-slider.jsx +51 -0
- package/dist/range-slider/range-slider.css +48 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.d.ts +16 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -1
- package/dist/range-slider/range-slider.jsx +26 -10
- package/dist/sheet/sizing.d.ts +3 -3
- package/dist/shell/shell.css +6 -1
- package/dist/shell/shell.css.map +1 -1
- package/dist/shell/shell.d.ts.map +1 -1
- package/dist/shell/shell.jsx +13 -7
- package/dist/tab-bar/tab-bar.d.ts +2 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +7 -3
- package/package.json +2 -2
- package/skills/g9-lynx-app/references/catalog-index.md +11 -2
- package/skills/g9-lynx-app/references/components/datagrid.md +3 -3
- package/skills/g9-lynx-app/references/components/layout-1.md +18 -18
- package/skills/g9-lynx-app/references/components/layout-2.md +18 -0
- package/skills/g9-lynx-app/references/components/media-1.md +7 -7
- package/skills/g9-lynx-app/references/components/projects.md +1 -1
- package/skills/g9-lynx-app/references/components/range-slider.md +34 -0
- package/skills/g9-lynx-app/references/components/studio-color-picker.md +19 -0
- package/skills/g9-lynx-app/references/components/studio-ease-editor.md +19 -0
- package/skills/g9-lynx-app/references/components/studio-filmstrip.md +19 -0
- package/skills/g9-lynx-app/references/components/studio-font-picker.md +19 -0
- package/skills/g9-lynx-app/references/components/studio-gradient-editor.md +19 -0
- package/skills/g9-lynx-app/references/components/studio-history-list.md +34 -0
- package/skills/g9-lynx-app/references/components/studio-media-slot.md +19 -0
- package/skills/g9-lynx-app/references/components/studio-option-form.md +19 -0
- package/skills/g9-lynx-app/references/components/studio-waveform.md +19 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useRef } from "@lynx-js/react";
|
|
2
|
+
import { measureNode } from "../anchor/measure.jsx";
|
|
3
|
+
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
4
|
+
import { g9PointerPoint } from "./point.jsx";
|
|
5
|
+
const finite = (v)=>'number' == typeof v && Number.isFinite(v);
|
|
6
|
+
const clamp01 = (v)=>v < 0 ? 0 : v > 1 ? 1 : v;
|
|
7
|
+
function g9ViewPoint(e) {
|
|
8
|
+
if (!e) return null;
|
|
9
|
+
if (e.detail && finite(e.detail.x) && finite(e.detail.y)) return {
|
|
10
|
+
x: e.detail.x,
|
|
11
|
+
y: e.detail.y
|
|
12
|
+
};
|
|
13
|
+
if (finite(e.x) && finite(e.y)) return {
|
|
14
|
+
x: e.x,
|
|
15
|
+
y: e.y
|
|
16
|
+
};
|
|
17
|
+
return g9PointerPoint(e);
|
|
18
|
+
}
|
|
19
|
+
function g9PadPoint(point, rect) {
|
|
20
|
+
const x = point.x - rect.x;
|
|
21
|
+
const y = point.y - rect.y;
|
|
22
|
+
return {
|
|
23
|
+
x,
|
|
24
|
+
y,
|
|
25
|
+
width: rect.width,
|
|
26
|
+
height: rect.height,
|
|
27
|
+
fx: rect.width > 0 ? clamp01(x / rect.width) : 0,
|
|
28
|
+
fy: rect.height > 0 ? clamp01(y / rect.height) : 0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function useG9PadDrag(options) {
|
|
32
|
+
const node = useRef(null);
|
|
33
|
+
const rect = useRef(null);
|
|
34
|
+
const drag = useRef(null);
|
|
35
|
+
const emit = useStableCallback((phase)=>{
|
|
36
|
+
const d = drag.current;
|
|
37
|
+
const r = rect.current;
|
|
38
|
+
if (!d || !r) return;
|
|
39
|
+
if ('start' !== phase && !d.started) options.onDrag(g9PadPoint(d.last, r), 'start');
|
|
40
|
+
d.started = true;
|
|
41
|
+
options.onDrag(g9PadPoint(d.last, r), phase);
|
|
42
|
+
});
|
|
43
|
+
const measure = ()=>{
|
|
44
|
+
measureNode(node.current).then((r)=>{
|
|
45
|
+
if (!r) return;
|
|
46
|
+
const before = rect.current;
|
|
47
|
+
rect.current = r;
|
|
48
|
+
const d = drag.current;
|
|
49
|
+
if (!d) return;
|
|
50
|
+
if (d.ended) {
|
|
51
|
+
emit('end');
|
|
52
|
+
drag.current = null;
|
|
53
|
+
} else if (d.started) {
|
|
54
|
+
if (!before || before.x !== r.x || before.y !== r.y) emit('move');
|
|
55
|
+
} else emit('start');
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const begin = (e, mouse)=>{
|
|
59
|
+
if (false === options.enabled) return;
|
|
60
|
+
const p = g9ViewPoint(e);
|
|
61
|
+
if (!p) return;
|
|
62
|
+
drag.current = {
|
|
63
|
+
last: p,
|
|
64
|
+
started: false,
|
|
65
|
+
mouse
|
|
66
|
+
};
|
|
67
|
+
if (rect.current) emit('start');
|
|
68
|
+
measure();
|
|
69
|
+
};
|
|
70
|
+
const move = (e, mouse)=>{
|
|
71
|
+
const d = drag.current;
|
|
72
|
+
if (!d || d.mouse !== mouse || d.ended) return;
|
|
73
|
+
if (mouse && finite(e.buttons) && 0 === e.buttons) return end(e, mouse);
|
|
74
|
+
const p = g9ViewPoint(e);
|
|
75
|
+
if (!p) return;
|
|
76
|
+
d.last = p;
|
|
77
|
+
emit('move');
|
|
78
|
+
};
|
|
79
|
+
const end = (e, mouse)=>{
|
|
80
|
+
const d = drag.current;
|
|
81
|
+
if (!d || d.mouse !== mouse) return;
|
|
82
|
+
const p = g9ViewPoint(e);
|
|
83
|
+
if (p) d.last = p;
|
|
84
|
+
if (!rect.current) {
|
|
85
|
+
d.ended = true;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
emit('end');
|
|
89
|
+
drag.current = null;
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
ref: (n)=>{
|
|
93
|
+
node.current = n;
|
|
94
|
+
},
|
|
95
|
+
bindlayoutchange: (e)=>{
|
|
96
|
+
var _e_detail, _e_detail1, _options_onSize;
|
|
97
|
+
const w = null == (_e_detail = e.detail) ? void 0 : _e_detail.width;
|
|
98
|
+
const h = null == (_e_detail1 = e.detail) ? void 0 : _e_detail1.height;
|
|
99
|
+
if (finite(w) && finite(h)) null == (_options_onSize = options.onSize) || _options_onSize.call(options, w, h);
|
|
100
|
+
measure();
|
|
101
|
+
},
|
|
102
|
+
bindtouchstart: (e)=>begin(e, false),
|
|
103
|
+
bindtouchmove: (e)=>move(e, false),
|
|
104
|
+
bindtouchend: (e)=>end(e, false),
|
|
105
|
+
bindtouchcancel: (e)=>end(e, false),
|
|
106
|
+
bindmousedown: (e)=>begin(e, true),
|
|
107
|
+
bindmousemove: (e)=>move(e, true),
|
|
108
|
+
bindmouseup: (e)=>end(e, true)
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export { g9PadPoint, g9ViewPoint, useG9PadDrag };
|
|
@@ -174,7 +174,9 @@ export interface G9ContextMenuProps {
|
|
|
174
174
|
/**
|
|
175
175
|
* A context menu on its child (G9Hub ContextMenu, a message, a row): a long press on touch (a light haptic, the menu by
|
|
176
176
|
* the child), the right mouse button on a desktop (the menu at the pointer, 2.9.0) and the context-menu key or
|
|
177
|
-
* Shift+F10 (the menu by the child).
|
|
177
|
+
* Shift+F10 (the menu by the child). The menu mounts on the first open, so a grid of cells holds no menus until one is
|
|
178
|
+
* asked for; for one menu over many cells, give each cell `useG9SecondaryAction` and open a single `G9Menu` at its
|
|
179
|
+
* anchor.
|
|
178
180
|
*/
|
|
179
181
|
export declare function G9ContextMenu(props: G9ContextMenuProps): ReactNode;
|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AAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAwClE"}
|
package/dist/popover/popover.jsx
CHANGED
|
@@ -354,6 +354,7 @@ function G9ActionSheet(props) {
|
|
|
354
354
|
function G9ContextMenu(props) {
|
|
355
355
|
var _props_keyboard;
|
|
356
356
|
const [isOpen, setOpen] = useState(false);
|
|
357
|
+
const [opened, setOpened] = useState(false);
|
|
357
358
|
const [at, setAt] = useState(null);
|
|
358
359
|
const secondary = useG9SecondaryAction((a)=>{
|
|
359
360
|
var _props_onOpen;
|
|
@@ -362,6 +363,7 @@ function G9ContextMenu(props) {
|
|
|
362
363
|
point: 'mouse' === a.source && 0 === a.anchor.width && 0 === a.anchor.height
|
|
363
364
|
});
|
|
364
365
|
setOpen(true);
|
|
366
|
+
setOpened(true);
|
|
365
367
|
null == (_props_onOpen = props.onOpen) || _props_onOpen.call(props, a.source);
|
|
366
368
|
}, {
|
|
367
369
|
enabled: !props.disabled,
|
|
@@ -376,7 +378,7 @@ function G9ContextMenu(props) {
|
|
|
376
378
|
bindmousedown: void 0
|
|
377
379
|
} : bind}>
|
|
378
380
|
{props.children}
|
|
379
|
-
<G9Menu open={isOpen} onClose={()=>setOpen(false)} items={props.items} onSelect={props.onSelect} {...at ? at.point ? {
|
|
381
|
+
{opened ? <G9Menu open={isOpen} onClose={()=>setOpen(false)} items={props.items} onSelect={props.onSelect} {...at ? at.point ? {
|
|
380
382
|
anchorPoint: {
|
|
381
383
|
x: at.rect.x,
|
|
382
384
|
y: at.rect.y
|
|
@@ -387,7 +389,7 @@ function G9ContextMenu(props) {
|
|
|
387
389
|
title: props.title
|
|
388
390
|
} : {}} {...props.id ? {
|
|
389
391
|
id: `${props.id}_Menu`
|
|
390
|
-
} : {}}/>
|
|
392
|
+
} : {}}/> : null}
|
|
391
393
|
</view>;
|
|
392
394
|
}
|
|
393
395
|
export { G9ActionSheet, G9ContextMenu, G9Menu, G9MenuList, G9OverlayRoot, G9Popover, g9Popovers, menuLevel, useG9OpenOverlay };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { G9KeyDiamond, type G9KeyDiamondProps, G9KeySlider, type G9KeySliderProps, type G9KeyState, type G9ValuePhase, } from './key-slider.js';
|
|
1
2
|
export { coerceSliderRange, formatSliderValue, roundHalfEven, sliderBounds, sliderRatio, sliderValueAt, snapSliderValue, } from './math.js';
|
|
2
3
|
export { G9RangeSlider, type G9RangeSliderProps, type G9SliderBand, type G9SliderMark, g9SliderMetrics, sliderKeyStep, } from './range-slider.js';
|
|
3
4
|
export { G9StepSlider, type G9StepSliderProps } from './step-slider.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/range-slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/range-slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { G9KeyDiamond, G9KeySlider } from "./key-slider.jsx";
|
|
1
2
|
export { coerceSliderRange, formatSliderValue, roundHalfEven, sliderBounds, sliderRatio, sliderValueAt, snapSliderValue } from "./math.jsx";
|
|
2
3
|
export { G9RangeSlider, g9SliderMetrics, sliderKeyStep } from "./range-slider.jsx";
|
|
3
4
|
export { G9StepSlider } from "./step-slider.jsx";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ReactNode } from '@lynx-js/react';
|
|
2
|
+
import './range-slider.css';
|
|
3
|
+
import { type G9RangeSliderProps } from './range-slider.js';
|
|
4
|
+
/** A diamond's state: `none` (the value has no keys), `keys` (it has keys, none here), `here` (a key at the playhead). */
|
|
5
|
+
export type G9KeyState = 'none' | 'keys' | 'here';
|
|
6
|
+
/** Where a value change comes from: `drag` while it moves, `end` when it settles. */
|
|
7
|
+
export type G9ValuePhase = 'drag' | 'end';
|
|
8
|
+
/** Props of {@link G9KeyDiamond}. */
|
|
9
|
+
export interface G9KeyDiamondProps {
|
|
10
|
+
readonly state: G9KeyState;
|
|
11
|
+
/** A tap (no handler: drawn only). */
|
|
12
|
+
readonly onPress?: () => void;
|
|
13
|
+
readonly id?: string;
|
|
14
|
+
/** Its spoken name («Keyframe»). The state is said as its value. */
|
|
15
|
+
readonly accessibilityLabel?: string;
|
|
16
|
+
/** The words of each state, spoken as the value. Default `—`, `◇`, `◆`. */
|
|
17
|
+
readonly stateWords?: Readonly<Partial<Record<G9KeyState, string>>>;
|
|
18
|
+
/** Drawn size (dp). Default 14; the touch target is at least 32. */
|
|
19
|
+
readonly size?: number;
|
|
20
|
+
readonly disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* An editor's keyframe diamond: hollow and quiet with no keys, hollow with a dot in the primary colour when the value
|
|
24
|
+
* has keys elsewhere, solid primary with a key at the playhead.
|
|
25
|
+
*/
|
|
26
|
+
export declare function G9KeyDiamond(props: G9KeyDiamondProps): ReactNode;
|
|
27
|
+
/** Props of {@link G9KeySlider}. */
|
|
28
|
+
export interface G9KeySliderProps extends Omit<G9RangeSliderProps, 'mode' | 'rangeStart' | 'rangeEnd' | 'defaultRangeStart' | 'defaultRangeEnd' | 'onRangeChange' | 'minimumStart' | 'leading' | 'onValueChange'> {
|
|
29
|
+
/** The value (controlled), or `defaultValue`. */
|
|
30
|
+
readonly value?: number;
|
|
31
|
+
/** Every change with its phase: `drag` while it moves, `end` once it settles (the drag's end, a key press). */
|
|
32
|
+
readonly onChange?: (value: number, phase: G9ValuePhase) => void;
|
|
33
|
+
/** The diamond's state; absent: no diamond. */
|
|
34
|
+
readonly keyState?: G9KeyState;
|
|
35
|
+
/** The diamond's tap. */
|
|
36
|
+
readonly onDiamond?: () => void;
|
|
37
|
+
/** The diamond's spoken name. Default the slider's `label`. */
|
|
38
|
+
readonly diamondLabel?: string;
|
|
39
|
+
/** The diamond's words per state (spoken). */
|
|
40
|
+
readonly diamondWords?: Readonly<Partial<Record<G9KeyState, string>>>;
|
|
41
|
+
/** A node before the diamond (an icon); the diamond stays next to the track. */
|
|
42
|
+
readonly leading?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A one-thumb slider with a keyframe diamond at its reading start and an optional second row (`below`, a modulator):
|
|
46
|
+
* the inspector's numeric property. Everything G9RangeSlider takes still works (`label`, `showValueInLabel`, `step`,
|
|
47
|
+
* `marks`, `formatValue`, `trailing`, `helperText`); the ids are `<id>` (the slider) and `<id>_Key` (the diamond).
|
|
48
|
+
*/
|
|
49
|
+
export declare function G9KeySlider(props: G9KeySliderProps): ReactNode;
|
|
50
|
+
//# sourceMappingURL=key-slider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KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+GAA+G;IAC/G,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACjE,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAC/B,yBAAyB;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,+DAA+D;IAC/D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,8CAA8C;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACtE,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAmC9D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { G9RangeSliderMode } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import "./range-slider.css";
|
|
3
|
+
import { g9IdProps, g9RowStyle } from "../base/control.jsx";
|
|
4
|
+
import { G9Art } from "../icon/icon.jsx";
|
|
5
|
+
import { useG9Direction } from "../provider/hooks.jsx";
|
|
6
|
+
import { G9RangeSlider } from "./range-slider.jsx";
|
|
7
|
+
const OUTLINE = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 1.6 L14.4 8 L8 14.4 L1.6 8 Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>';
|
|
8
|
+
const DOTTED = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 1.6 L14.4 8 L8 14.4 L1.6 8 Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/><path d="M8 5.6 L10.4 8 L8 10.4 L5.6 8 Z" fill="currentColor"/></svg>';
|
|
9
|
+
const SOLID = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 1.6 L14.4 8 L8 14.4 L1.6 8 Z" fill="currentColor" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>';
|
|
10
|
+
function G9KeyDiamond(props) {
|
|
11
|
+
var _props_size, _props_stateWords, _words_props_state, _props_accessibilityLabel;
|
|
12
|
+
const size = null != (_props_size = props.size) ? _props_size : 14;
|
|
13
|
+
const svg = 'here' === props.state ? SOLID : 'keys' === props.state ? DOTTED : OUTLINE;
|
|
14
|
+
const color = 'none' === props.state ? 'var(--g9-text-tertiary)' : 'var(--g9-primary)';
|
|
15
|
+
const words = null != (_props_stateWords = props.stateWords) ? _props_stateWords : {};
|
|
16
|
+
const value = null != (_words_props_state = words[props.state]) ? _words_props_state : 'here' === props.state ? '◆' : 'keys' === props.state ? '◇' : '—';
|
|
17
|
+
const pressable = void 0 !== props.onPress && true !== props.disabled;
|
|
18
|
+
return <view {...g9IdProps(props.id)} className={`g9-key-diamond g9-key-diamond--${props.state}${props.disabled ? ' g9-key-diamond--disabled' : ''}`} {...pressable ? {
|
|
19
|
+
catchtap: ()=>{
|
|
20
|
+
var _props_onPress;
|
|
21
|
+
return null == (_props_onPress = props.onPress) ? void 0 : _props_onPress.call(props);
|
|
22
|
+
}
|
|
23
|
+
} : {}} accessibility-element={true} accessibility-traits={pressable ? 'button' : 'image'} accessibility-label={null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : ''} accessibility-value={value}>
|
|
24
|
+
<G9Art svg={svg} height={size} color={color}/>
|
|
25
|
+
</view>;
|
|
26
|
+
}
|
|
27
|
+
function G9KeySlider(props) {
|
|
28
|
+
var _ref, _ref1;
|
|
29
|
+
const { onChange, keyState, onDiamond, diamondLabel, diamondWords, leading, onValueCommit, ...rest } = props;
|
|
30
|
+
const dir = useG9Direction();
|
|
31
|
+
const diamond = void 0 !== keyState ? <G9KeyDiamond state={keyState} {...onDiamond ? {
|
|
32
|
+
onPress: onDiamond
|
|
33
|
+
} : {}} {...props.id ? {
|
|
34
|
+
id: `${props.id}_Key`
|
|
35
|
+
} : {}} accessibilityLabel={null != (_ref = null != (_ref1 = null != diamondLabel ? diamondLabel : props.label) ? _ref1 : props.accessibilityLabel) ? _ref : ''} {...diamondWords ? {
|
|
36
|
+
stateWords: diamondWords
|
|
37
|
+
} : {}} {...props.disabled ? {
|
|
38
|
+
disabled: true
|
|
39
|
+
} : {}}/> : null;
|
|
40
|
+
const lead = void 0 !== leading && diamond ? <view className="g9-key-slider__lead" style={g9RowStyle(dir)}>
|
|
41
|
+
{leading}
|
|
42
|
+
{diamond}
|
|
43
|
+
</view> : null != diamond ? diamond : leading;
|
|
44
|
+
return <G9RangeSlider {...rest} mode={G9RangeSliderMode.Single} {...null != lead ? {
|
|
45
|
+
leading: lead
|
|
46
|
+
} : {}} onValueChange={(v)=>null == onChange ? void 0 : onChange(v, 'drag')} onValueCommit={(v)=>{
|
|
47
|
+
null == onValueCommit || onValueCommit(v);
|
|
48
|
+
null == onChange || onChange(v, 'end');
|
|
49
|
+
}}/>;
|
|
50
|
+
}
|
|
51
|
+
export { G9KeyDiamond, G9KeySlider };
|
|
@@ -271,5 +271,53 @@
|
|
|
271
271
|
font-family: var(--g9-font-text-700);
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
.g9-slider-row {
|
|
275
|
+
align-items: center;
|
|
276
|
+
column-gap: 4px;
|
|
277
|
+
display: flex;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.g9-slider-row__main {
|
|
281
|
+
flex-direction: column;
|
|
282
|
+
flex: 1 1 0;
|
|
283
|
+
min-width: 0;
|
|
284
|
+
display: flex;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.g9-slider-row__adorn {
|
|
288
|
+
flex-shrink: 0;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
align-items: center;
|
|
291
|
+
display: flex;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.g9-slider-field__below {
|
|
295
|
+
flex-direction: column;
|
|
296
|
+
padding: 0 16px 4px;
|
|
297
|
+
display: flex;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.g9-key-diamond {
|
|
301
|
+
border-radius: 8px;
|
|
302
|
+
justify-content: center;
|
|
303
|
+
align-items: center;
|
|
304
|
+
min-width: 32px;
|
|
305
|
+
min-height: 32px;
|
|
306
|
+
display: flex;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.g9-key-diamond:active {
|
|
310
|
+
background-color: var(--g9-surface-container-high);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.g9-key-diamond--disabled {
|
|
314
|
+
opacity: .4;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.g9-key-slider__lead {
|
|
318
|
+
align-items: center;
|
|
319
|
+
display: flex;
|
|
320
|
+
}
|
|
321
|
+
|
|
274
322
|
|
|
275
323
|
/*# sourceMappingURL=range-slider.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/range-slider/range-slider.css"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,uBAAuB;EACvB,kBAAkB;EAClB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAKA;EAFE,2BAA2B;EAC3B,iBAAiB;AACnB;;AAKA;EAFE,YAAY;AACd;;AAKA;EAFE,uBAAuB;EACvB,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,2CAA2C;EAC3C,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,kBAAkB;AACpB;;AAOA;EAJE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;AACX;;AASA;EANE,WAAW;EACX,YAA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cA;EAXE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;EAC/B,eAAe;AACjB;;AAeA;EAZE,sBAAsB;EACtB,mBAAmB;EACnB,WAAW;EACX,aAAa;AACf;;AAeA;EAZE,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAeA;EAZE,mBAAmB;AACrB;;AAeA;EAZE,2BAA2B;AAC7B;;AAeA;EAZE,kDAAkD;EAClD,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,UAAU;EACV,WAAW;AACb;;AAeA;EAZE,WAAW;EACX,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAiBA;EAdE,2CAA2C;EAC3C,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,mCAAmC;AACrC;;AAiBA;EAdE,mCAAmC;AACrC;;AAiBA;EAdE,sBAAsB;AACxB;;AAiBA;EAdE,8BAA8B;EAC9B,WAAW;EACX,eAAe;EACf,aAAa;AACf;;AAiBA;EAdE,mBAAmB;AACrB;;AAiBA;EAdE,2BAA2B;AAC7B;;AAiBA;EAdE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;AAChC;;AAiBA;EAdE,+BAA+B;EAC/B,gBAAgB;EAChB,oCAAoC;AACtC","sourcesContent":[".g9-slider {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding-left: 16px;\n padding-right: 16px;\n}\n\n/* MAUI G9RangeSliderDrawable with labels: the track's centre at SliderTrackY (52) of the 104 dp canvas — the room above\n is the drag tooltip's — and the end labels SliderLabelGap (18) under the thumb. Centring the column put the track at\n ~34 dp, 18 dp higher than MAUI's. */\n.g9-slider--labels {\n justify-content: flex-start;\n padding-top: 38px;\n}\n\n.g9-slider--disabled {\n opacity: 0.38;\n}\n\n.g9-slider__root {\n height: 28px;\n display: flex;\n justify-content: center;\n}\n\n/* lynx-ui SliderTrack: a 28 px flex row holding this view (the visible track) next to the fill and the thumbs, which\n position against the 28 px row. The track takes the row's width; the fill is the 8 px band at its centre. */\n.g9-slider__track {\n position: relative;\n flex: 1;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-surface-variant);\n}\n\n.g9-slider__fill {\n position: absolute;\n top: 10px;\n left: 0px;\n right: 0px;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-primary);\n}\n\n/* A `bands` stretch: the fill's band, under it. */\n.g9-slider__band {\n position: absolute;\n top: 10px;\n height: 8px;\n border-radius: 4px;\n}\n\n/* lynx-ui SliderThumb centres this view on the value (top 50 %, translate -50 %). */\n.g9-slider__thumb {\n width: 28px;\n height: 28px;\n}\n\n.g9-slider__thumb-dot {\n width: 28px;\n height: 28px;\n border-radius: 14px;\n border-width: 2.5px;\n border-style: solid;\n border-color: var(--g9-primary);\n background-color: var(--g9-surface);\n}\n\n.g9-slider__thumb-dot--active {\n border-width: 3px;\n}\n\n.g9-slider__tooltip {\n position: absolute;\n top: 4px;\n height: 26px;\n margin-left: -21px;\n min-width: 42px;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 13px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-inverse-surface);\n}\n\n.g9-slider__tooltip-text {\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-inverse-on-surface);\n}\n\n/* MAUI 1.4.9 ShowThumbValues: each value above its thumb, always — a 100 px box centred on the thumb, its text at the\n box's bottom 18 px above the thumb (track 52 − radius 14 − gap 18 − 18 = 2 from the top), 12 px TextSecondary. */\n.g9-slider__thumb-value {\n position: absolute;\n top: 2px;\n width: 100px;\n height: 18px;\n margin-left: -50px;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n}\n\n.g9-slider__thumb-value-text {\n font-size: 12px;\n font-family: var(--g9-font-text);\n text-align: center;\n color: var(--g9-text-secondary);\n}\n\n.g9-slider__labels {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 18px;\n}\n\n.g9-slider__label {\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n/* `marks` (2.5.7): a 4 dp tick on the track's band at each point, on-primary over the chosen part. */\n.g9-slider__tick {\n position: absolute;\n top: 12px;\n width: 4px;\n height: 4px;\n margin-left: -2px;\n border-radius: 2px;\n background-color: var(--g9-on-surface-variant);\n opacity: 0.6;\n}\n\n.g9-slider__tick--on {\n background-color: var(--g9-on-primary);\n opacity: 0.85;\n}\n\n/* The marks' words, where the edge labels were: each in a 96 dp box centred on its point of the track's width. */\n.g9-slider__marks {\n position: relative;\n height: 16px;\n margin-top: 18px;\n}\n\n.g9-slider__mark {\n position: absolute;\n top: 0px;\n width: 96px;\n margin-left: -48px;\n display: flex;\n justify-content: center;\n}\n\n.g9-slider__mark-text {\n text-align: center;\n}\n\n/* `label` / `helperText` (2.5.7): the title row and the line under it, level with the track's ends. */\n.g9-slider-field {\n display: flex;\n flex-direction: column;\n}\n\n.g9-slider-field__head {\n display: flex;\n align-items: center;\n column-gap: 8px;\n padding: 0px 16px;\n}\n\n.g9-slider-field__label {\n flex: 1 1 auto;\n min-width: 0px;\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-slider-field__value {\n flex-shrink: 0;\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-primary);\n}\n\n.g9-slider-field__helper {\n padding: 0px 16px;\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n/* G9StepSlider: dots on a rail, the chosen one larger */\n.g9-step-slider {\n display: flex;\n flex-direction: column;\n align-self: stretch;\n width: 100%;\n}\n\n.g9-step-slider__row {\n position: relative;\n display: flex;\n width: 100%;\n height: 28px;\n align-items: center;\n}\n\n.g9-step-slider__row--ltr {\n flex-direction: row;\n}\n\n.g9-step-slider__row--rtl {\n flex-direction: row-reverse;\n}\n\n.g9-step-slider__rail {\n position: absolute;\n left: 11px;\n right: 11px;\n top: 11px;\n height: 6px;\n border-radius: 3px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-step-slider__seg {\n display: flex;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n height: 28px;\n align-items: center;\n justify-content: center;\n}\n\n.g9-step-slider__dot {\n width: 14px;\n height: 14px;\n border-radius: 7px;\n background-color: var(--g9-outline-variant);\n transition: transform 140ms ease-out;\n}\n\n.g9-step-slider__dot--on {\n background-color: var(--g9-primary);\n}\n\n.g9-step-slider__dot--current {\n transform: scale(1.85);\n}\n\n.g9-step-slider__labels {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-top: 2px;\n}\n\n.g9-step-slider__labels--ltr {\n flex-direction: row;\n}\n\n.g9-step-slider__labels--rtl {\n flex-direction: row-reverse;\n}\n\n.g9-step-slider__label {\n font-size: 11px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n}\n\n.g9-step-slider__label--current {\n font-weight: 700;\n color: var(--g9-text-secondary);\n font-family: var(--g9-font-text-700);\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://./src/range-slider/range-slider.css"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,uBAAuB;EACvB,kBAAkB;EAClB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAKA;EAFE,2BAA2B;EAC3B,iBAAiB;AACnB;;AAKA;EAFE,YAAY;AACd;;AAKA;EAFE,uBAAuB;EACvB,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,2CAA2C;EAC3C,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,kBAAkB;AACpB;;AAOA;EAJE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;AACX;;AASA;EANE,WAAW;EACX,YAAY;AACd;;AASA;EANE,mBAAmB;EACnB,mBAAmB;EACnB,+BAA+B;EAC/B,m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AAeA;EAZE,sBAAsB;EACtB,mBAAmB;EACnB,WAAW;EACX,aAAa;AACf;;AAeA;EAZE,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAeA;EAZE,mBAAmB;AACrB;;AAeA;EAZE,2BAA2B;AAC7B;;AAeA;EAZE,kDAAkD;EAClD,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,UAAU;EACV,WAAW;AACb;;AAeA;EAZE,WAAW;EACX,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAiBA;EAdE,2CAA2C;EAC3C,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,mCAAmC;AACrC;;AAiBA;EAdE,mCAAmC;AACrC;;AAiBA;EAdE,sBAAsB;AACxB;;AAiBA;EAdE,8BAA8B;EAC9B,WAAW;EACX,eAAe;EACf,aAAa;AACf;;AAiBA;EAdE,mBAAmB;AACrB;;AAiBA;EAdE,2BAA2B;AAC7B;;AAiBA;EAdE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;AAChC;;AAiBA;EAdE,+BAA+B;EAC/B,gBAAgB;EAChB,oCAAoC;AACtC;;AAkBA;EAfE,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAkBA;EAfE,sBAAsB;EACtB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAoBA;EAjBE,cAAc;EACd,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAoBA;EAjBE,sBAAsB;EACtB,mBAAmB;EACnB,aAAa;AACf;;AAqBA;EAlBE,kBAAkB;EAClB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,gBAAgB;EAChB,aAAa;AACf;;AAqBA;EAlBE,kDAAkD;AACpD;;AAqBA;EAlBE,WAAW;AACb;;AAqBA;EAlBE,mBAAmB;EACnB,aAAa;AACf","sourcesContent":[".g9-slider {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding-left: 16px;\n padding-right: 16px;\n}\n\n/* MAUI G9RangeSliderDrawable with labels: the track's centre at SliderTrackY (52) of the 104 dp canvas — the room above\n is the drag tooltip's — and the end labels SliderLabelGap (18) under the thumb. Centring the column put the track at\n ~34 dp, 18 dp higher than MAUI's. */\n.g9-slider--labels {\n justify-content: flex-start;\n padding-top: 38px;\n}\n\n.g9-slider--disabled {\n opacity: 0.38;\n}\n\n.g9-slider__root {\n height: 28px;\n display: flex;\n justify-content: center;\n}\n\n/* lynx-ui SliderTrack: a 28 px flex row holding this view (the visible track) next to the fill and the thumbs, which\n position against the 28 px row. The track takes the row's width; the fill is the 8 px band at its centre. */\n.g9-slider__track {\n position: relative;\n flex: 1;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-surface-variant);\n}\n\n.g9-slider__fill {\n position: absolute;\n top: 10px;\n left: 0px;\n right: 0px;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-primary);\n}\n\n/* A `bands` stretch: the fill's band, under it. */\n.g9-slider__band {\n position: absolute;\n top: 10px;\n height: 8px;\n border-radius: 4px;\n}\n\n/* lynx-ui SliderThumb centres this view on the value (top 50 %, translate -50 %). */\n.g9-slider__thumb {\n width: 28px;\n height: 28px;\n}\n\n.g9-slider__thumb-dot {\n width: 28px;\n height: 28px;\n border-radius: 14px;\n border-width: 2.5px;\n border-style: solid;\n border-color: var(--g9-primary);\n background-color: var(--g9-surface);\n}\n\n.g9-slider__thumb-dot--active {\n border-width: 3px;\n}\n\n.g9-slider__tooltip {\n position: absolute;\n top: 4px;\n height: 26px;\n margin-left: -21px;\n min-width: 42px;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 13px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-inverse-surface);\n}\n\n.g9-slider__tooltip-text {\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-inverse-on-surface);\n}\n\n/* MAUI 1.4.9 ShowThumbValues: each value above its thumb, always — a 100 px box centred on the thumb, its text at the\n box's bottom 18 px above the thumb (track 52 − radius 14 − gap 18 − 18 = 2 from the top), 12 px TextSecondary. */\n.g9-slider__thumb-value {\n position: absolute;\n top: 2px;\n width: 100px;\n height: 18px;\n margin-left: -50px;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n}\n\n.g9-slider__thumb-value-text {\n font-size: 12px;\n font-family: var(--g9-font-text);\n text-align: center;\n color: var(--g9-text-secondary);\n}\n\n.g9-slider__labels {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 18px;\n}\n\n.g9-slider__label {\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n/* `marks` (2.5.7): a 4 dp tick on the track's band at each point, on-primary over the chosen part. */\n.g9-slider__tick {\n position: absolute;\n top: 12px;\n width: 4px;\n height: 4px;\n margin-left: -2px;\n border-radius: 2px;\n background-color: var(--g9-on-surface-variant);\n opacity: 0.6;\n}\n\n.g9-slider__tick--on {\n background-color: var(--g9-on-primary);\n opacity: 0.85;\n}\n\n/* The marks' words, where the edge labels were: each in a 96 dp box centred on its point of the track's width. */\n.g9-slider__marks {\n position: relative;\n height: 16px;\n margin-top: 18px;\n}\n\n.g9-slider__mark {\n position: absolute;\n top: 0px;\n width: 96px;\n margin-left: -48px;\n display: flex;\n justify-content: center;\n}\n\n.g9-slider__mark-text {\n text-align: center;\n}\n\n/* `label` / `helperText` (2.5.7): the title row and the line under it, level with the track's ends. */\n.g9-slider-field {\n display: flex;\n flex-direction: column;\n}\n\n.g9-slider-field__head {\n display: flex;\n align-items: center;\n column-gap: 8px;\n padding: 0px 16px;\n}\n\n.g9-slider-field__label {\n flex: 1 1 auto;\n min-width: 0px;\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-slider-field__value {\n flex-shrink: 0;\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-primary);\n}\n\n.g9-slider-field__helper {\n padding: 0px 16px;\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n/* G9StepSlider: dots on a rail, the chosen one larger */\n.g9-step-slider {\n display: flex;\n flex-direction: column;\n align-self: stretch;\n width: 100%;\n}\n\n.g9-step-slider__row {\n position: relative;\n display: flex;\n width: 100%;\n height: 28px;\n align-items: center;\n}\n\n.g9-step-slider__row--ltr {\n flex-direction: row;\n}\n\n.g9-step-slider__row--rtl {\n flex-direction: row-reverse;\n}\n\n.g9-step-slider__rail {\n position: absolute;\n left: 11px;\n right: 11px;\n top: 11px;\n height: 6px;\n border-radius: 3px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-step-slider__seg {\n display: flex;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n height: 28px;\n align-items: center;\n justify-content: center;\n}\n\n.g9-step-slider__dot {\n width: 14px;\n height: 14px;\n border-radius: 7px;\n background-color: var(--g9-outline-variant);\n transition: transform 140ms ease-out;\n}\n\n.g9-step-slider__dot--on {\n background-color: var(--g9-primary);\n}\n\n.g9-step-slider__dot--current {\n transform: scale(1.85);\n}\n\n.g9-step-slider__labels {\n display: flex;\n width: 100%;\n justify-content: space-between;\n margin-top: 2px;\n}\n\n.g9-step-slider__labels--ltr {\n flex-direction: row;\n}\n\n.g9-step-slider__labels--rtl {\n flex-direction: row-reverse;\n}\n\n.g9-step-slider__label {\n font-size: 11px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n}\n\n.g9-step-slider__label--current {\n font-weight: 700;\n color: var(--g9-text-secondary);\n font-family: var(--g9-font-text-700);\n}\n\n/* 2.10.0: a node beside the slider (leading / trailing), centred on the track, and a row under it */\n.g9-slider-row {\n display: flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.g9-slider-row__main {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n min-width: 0px;\n}\n\n.g9-slider-row__adorn {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.g9-slider-field__below {\n display: flex;\n flex-direction: column;\n padding: 0px 16px 4px 16px;\n}\n\n/* 2.10.0: G9KeySlider's diamond (G9KeyDiamond) */\n.g9-key-diamond {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 32px;\n min-height: 32px;\n border-radius: 8px;\n}\n\n.g9-key-diamond:active {\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-key-diamond--disabled {\n opacity: 0.4;\n}\n\n.g9-key-slider__lead {\n display: flex;\n align-items: center;\n}\n"],"sourceRoot":""}
|
|
@@ -80,6 +80,22 @@ export interface G9RangeSliderProps {
|
|
|
80
80
|
* labels when any mark has one; shown only with `showLabels`).
|
|
81
81
|
*/
|
|
82
82
|
readonly marks?: readonly G9SliderMark[];
|
|
83
|
+
/** A logical id (2.10.0): the slider carries its safe form (`#Inspector_Opacity`), so a test or a pilot acts on it. */
|
|
84
|
+
readonly id?: string;
|
|
85
|
+
/**
|
|
86
|
+
* A node at the reading start of the slider, centred on its track (2.10.0): a keyframe diamond, an icon, a lock. It
|
|
87
|
+
* takes its own presses.
|
|
88
|
+
*/
|
|
89
|
+
readonly leading?: ReactNode;
|
|
90
|
+
/** A node at the reading end of the slider, centred on its track (2.10.0): a reset button, a value field. */
|
|
91
|
+
readonly trailing?: ReactNode;
|
|
92
|
+
/** A second row under the slider, above `helperText` (2.10.0): a modulator, a curve, a range's own controls. */
|
|
93
|
+
readonly below?: ReactNode;
|
|
94
|
+
/**
|
|
95
|
+
* A change settled (2.10.0): a drag's end (as `onDragCompleted`) and also each arrow-key step, which has no drag — the
|
|
96
|
+
* one place to commit an undo step. The single value, or the range end.
|
|
97
|
+
*/
|
|
98
|
+
readonly onValueCommit?: (value: number) => void;
|
|
83
99
|
}
|
|
84
100
|
/** A point of a {@link G9RangeSlider}'s scale (`marks`). */
|
|
85
101
|
export interface G9SliderMark {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-slider.d.ts","sourceRoot":"","sources":["../../src/range-sl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QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,iGAAiG;AACjG,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,OAAO,GACX,MAAM,GAAG,IAAI,CAUf;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CA0NlE"}
|
|
@@ -2,7 +2,7 @@ import "./range-slider.css";
|
|
|
2
2
|
import { G9RangeSliderMode, formatColor, lighten } from "@g9tm/lynxcontrols-foundation";
|
|
3
3
|
import { SliderIndicator, SliderRoot, SliderThumb, SliderTrack } from "@lynx-js/lynx-ui-slider";
|
|
4
4
|
import { useRef, useState } from "@lynx-js/react";
|
|
5
|
-
import { g9RowStyle, g9TextStart } from "../base/control.jsx";
|
|
5
|
+
import { g9IdProps, g9RowStyle, g9TextStart } from "../base/control.jsx";
|
|
6
6
|
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
7
7
|
import { useG9Culture, useG9Direction, useG9Theme } from "../provider/hooks.jsx";
|
|
8
8
|
import { coerceSliderRange, formatSliderValue, isLogTrack, sliderBounds, sliderRatio, sliderValueAt, snapLogValue, snapSliderValue } from "./math.jsx";
|
|
@@ -125,11 +125,12 @@ function G9RangeSlider(props) {
|
|
|
125
125
|
index: 1
|
|
126
126
|
});
|
|
127
127
|
const onCommit = ()=>{
|
|
128
|
-
var _l_shown;
|
|
129
|
-
var _l_props_onDragCompleted, _l_props;
|
|
128
|
+
var _l_shown, _l_shown1;
|
|
129
|
+
var _l_props_onDragCompleted, _l_props, _l_props_onValueCommit, _l_props1;
|
|
130
130
|
setDragging(null);
|
|
131
131
|
const l = latest.current;
|
|
132
132
|
null == (_l_props_onDragCompleted = (_l_props = l.props).onDragCompleted) || _l_props_onDragCompleted.call(_l_props, null != (_l_shown = l.shown) ? _l_shown : l.shownRange[1]);
|
|
133
|
+
null == (_l_props_onValueCommit = (_l_props1 = l.props).onValueCommit) || _l_props_onValueCommit.call(_l_props1, null != (_l_shown1 = l.shown) ? _l_shown1 : l.shownRange[1]);
|
|
133
134
|
};
|
|
134
135
|
const onKey = (e)=>{
|
|
135
136
|
var _ref;
|
|
@@ -138,15 +139,23 @@ function G9RangeSlider(props) {
|
|
|
138
139
|
const key = null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.key) ? _ref : '';
|
|
139
140
|
if (single) {
|
|
140
141
|
const next = sliderKeyStep(key, shown, min, max, step, rtl);
|
|
141
|
-
if (null !== next)
|
|
142
|
+
if (null !== next) {
|
|
143
|
+
var _props_onValueCommit;
|
|
144
|
+
applySingle(next);
|
|
145
|
+
null == (_props_onValueCommit = props.onValueCommit) || _props_onValueCommit.call(props, next);
|
|
146
|
+
}
|
|
142
147
|
return;
|
|
143
148
|
}
|
|
144
149
|
const [s, end] = shownRange;
|
|
145
150
|
const next = sliderKeyStep(key, end, min, max, step, rtl);
|
|
146
|
-
if (null !== next)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
if (null !== next) {
|
|
152
|
+
var _props_onValueCommit1;
|
|
153
|
+
applyRange([
|
|
154
|
+
Math.min(s, next),
|
|
155
|
+
Math.max(s, next)
|
|
156
|
+
]);
|
|
157
|
+
null == (_props_onValueCommit1 = props.onValueCommit) || _props_onValueCommit1.call(props, Math.max(s, next));
|
|
158
|
+
}
|
|
150
159
|
};
|
|
151
160
|
const sliderValue = single ? ratioOf(shown) : [
|
|
152
161
|
ratioOf(shownRange[0]),
|
|
@@ -159,7 +168,7 @@ function G9RangeSlider(props) {
|
|
|
159
168
|
<view className={`g9-slider__thumb-dot${dragging && dragging.index === index ? ' g9-slider__thumb-dot--active' : ''}`}/>
|
|
160
169
|
</SliderThumb>;
|
|
161
170
|
const spokenValue = single ? fmt(shown) : `${fmt(shownRange[0])} – ${fmt(shownRange[1])}`;
|
|
162
|
-
const
|
|
171
|
+
const bare = <view {...g9IdProps(props.id)} className={`g9-slider${labels ? ' g9-slider--labels' : ' g9-slider--compact'}${props.disabled ? ' g9-slider--disabled' : ''}${props.className ? ` ${props.className}` : ''}`} style={{
|
|
163
172
|
height: `${labels ? g9SliderMetrics.height : g9SliderMetrics.heightCompact}px`
|
|
164
173
|
}} accessibility-element={true} accessibility-label={null != (_ref1 = null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.label) ? _ref1 : ''} accessibility-value={spokenValue} bindkeydown={onKey}>
|
|
165
174
|
{labels && dragging && !thumbValues ? <view className="g9-slider__tooltip" style={{
|
|
@@ -214,8 +223,14 @@ function G9RangeSlider(props) {
|
|
|
214
223
|
<text className="g9-slider__label">{fmt(rtl ? bounds.min : bounds.max)}</text>
|
|
215
224
|
</view> : null}
|
|
216
225
|
</view>;
|
|
217
|
-
if (void 0 === props.label && void 0 === props.helperText) return slider;
|
|
218
226
|
const dir = rtl ? 'rtl' : 'ltr';
|
|
227
|
+
const adorned = void 0 !== props.leading || void 0 !== props.trailing;
|
|
228
|
+
const slider = adorned ? <view className="g9-slider-row" style={g9RowStyle(dir)}>
|
|
229
|
+
{void 0 !== props.leading ? <view className="g9-slider-row__adorn">{props.leading}</view> : null}
|
|
230
|
+
<view className="g9-slider-row__main">{bare}</view>
|
|
231
|
+
{void 0 !== props.trailing ? <view className="g9-slider-row__adorn">{props.trailing}</view> : null}
|
|
232
|
+
</view> : bare;
|
|
233
|
+
if (void 0 === props.label && void 0 === props.helperText && void 0 === props.below) return slider;
|
|
219
234
|
return <view className="g9-slider-field">
|
|
220
235
|
{void 0 !== props.label ? <view className="g9-slider-field__head" style={g9RowStyle(dir)}>
|
|
221
236
|
<text className="g9-slider-field__label" style={g9TextStart(dir)}>
|
|
@@ -224,6 +239,7 @@ function G9RangeSlider(props) {
|
|
|
224
239
|
{props.showValueInLabel ? <text className="g9-slider-field__value">{spokenValue}</text> : null}
|
|
225
240
|
</view> : null}
|
|
226
241
|
{slider}
|
|
242
|
+
{void 0 !== props.below ? <view className="g9-slider-field__below">{props.below}</view> : null}
|
|
227
243
|
{void 0 !== props.helperText ? <text className="g9-slider-field__helper" style={g9TextStart(dir)}>
|
|
228
244
|
{props.helperText}
|
|
229
245
|
</text> : null}
|
package/dist/sheet/sizing.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface G9SheetLayout {
|
|
|
50
50
|
* detent from `currentState`. The MAUI quirks (a hidden 100 dp detent under `[medium, large]`, a peek-only sheet that
|
|
51
51
|
* may expand) are not carried over: the detents are exactly `states` (docs/sheets.md "deliberate differences").
|
|
52
52
|
*/
|
|
53
|
-
export declare function resolveSheetLayout(options: G9SheetOptions, hostHeight: number, platform?: "
|
|
53
|
+
export declare function resolveSheetLayout(options: G9SheetOptions, hostHeight: number, platform?: "windows" | "android" | "ios" | "macos" | "unknown"): G9SheetLayout;
|
|
54
54
|
/** Clamps a measured fit body height: `[80, cap]`, or `[180, cap]` while loading (MAUI fit engine). */
|
|
55
55
|
export declare function clampFitHeight(natural: number, cap: number, loading: boolean): number;
|
|
56
56
|
/**
|
|
@@ -67,7 +67,7 @@ export declare function backdropCardTransform(visibleRatio: number, threshold?:
|
|
|
67
67
|
* The visible share of the host a detent sheet covers: its resting height when known, else its opening detent
|
|
68
68
|
* (peek = peek height, medium = half ratio, large = full ratio; `expandedFitsContent` large counts as the fit cap).
|
|
69
69
|
*/
|
|
70
|
-
export declare function sheetVisibleRatio(options: G9SheetOptions, hostHeight: number, restingHeightPx: number | null, platform?: "
|
|
70
|
+
export declare function sheetVisibleRatio(options: G9SheetOptions, hostHeight: number, restingHeightPx: number | null, platform?: "windows" | "android" | "ios" | "macos" | "unknown"): number;
|
|
71
71
|
/** How far a receded parent sheet sinks: `max(24, visible × 0.25)` (MAUI stack recede). */
|
|
72
72
|
export declare function parentRecedeOffset(visibleHeight: number): number;
|
|
73
73
|
/** Top padding of a full-screen sheet (MAUI safe-area rule). */
|
|
@@ -91,5 +91,5 @@ export declare function sheetSurfaceBottomPadding(options: G9SheetOptions, botto
|
|
|
91
91
|
*/
|
|
92
92
|
export declare function scaledSheetDuration(durationMs: number, traversedRatio: number, sizeScaled: boolean): number;
|
|
93
93
|
/** Platform size constraints of the sheet surface (MAUI Android/Windows options, applied where they belong). */
|
|
94
|
-
export declare function platformSheetConstraints(options: G9SheetOptions, platform?: "
|
|
94
|
+
export declare function platformSheetConstraints(options: G9SheetOptions, platform?: "windows" | "android" | "ios" | "macos" | "unknown"): Record<string, string>;
|
|
95
95
|
//# sourceMappingURL=sizing.d.ts.map
|
package/dist/shell/shell.css
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
display: flex;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
.g9-side-nav__item--on {
|
|
119
|
+
.g9-side-nav__item--on, .g9-side-nav__item:active {
|
|
120
120
|
background-color: var(--g9-primary-container);
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -175,6 +175,7 @@
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.g9-rail__item {
|
|
178
|
+
border-radius: 16px;
|
|
178
179
|
flex-direction: column;
|
|
179
180
|
align-items: center;
|
|
180
181
|
row-gap: 4px;
|
|
@@ -182,6 +183,10 @@
|
|
|
182
183
|
display: flex;
|
|
183
184
|
}
|
|
184
185
|
|
|
186
|
+
.g9-rail__item:active {
|
|
187
|
+
background-color: var(--g9-primary-container);
|
|
188
|
+
}
|
|
189
|
+
|
|
185
190
|
.g9-rail__pill {
|
|
186
191
|
border-radius: 16px;
|
|
187
192
|
justify-content: center;
|