@g9tm/lynxcontrols 2.9.0 → 2.10.0
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 +1199 -1
- package/catalog/index.md +4 -1
- package/dist/.tsbuildinfo +1 -1
- 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/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/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/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 };
|
|
@@ -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.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-slider.d.ts","sourceRoot":"","sources":["../../src/range-slider/key-slider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,oBAAoB,CAAC;AAI5B,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAExE,0HAA0H;AAC1H,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAElD,qFA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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,YAAY;AACd;;AASA;EANE,mBAAmB;EACnB,mBAAmB;EACnB,+BAA+B;EAC/B,mCAAmC;EACnC,mBAAmB;EACnB,WAAW;EACX,YAAY;AACd;;AASA;EANE,iBAAiB;AACnB;;AASA;EANE,2CAA2C;EAC3C,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,kBAAkB;EAClB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,QAAQ;AACV;;AASA;EANE,eAAe;EACf,gCAAgC;EAChC,mCAAmC;A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;;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,mCAAmC;EACnC,mBAAmB;EACnB,WAAW;EACX,YAAY;AACd;;AASA;EANE,iBAAiB;AACnB;;AASA;EANE,2CAA2C;EAC3C,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,kBAAkB;EAClB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,QAAQ;AACV;;AASA;EANE,eAAe;EACf,gCAAgC;EAChC,mCAAmC;AACrC;;AAWA;EARE,uBAAuB;EACvB,qBAAqB;EACrB,YAAY;EACZ,YAAY;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,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-slider/range-slider.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAe,iBAAiB,EAAW,MAAM,+BAA+B,CAAC;AAExF,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,gBAAgB,CAAC;AAelE,gDAAgD;AAChD,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AAEH,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB;IACnB,QAAQ,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;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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/lynxcontrols",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "ReactLynx controls and overlay infrastructure: provider/host, sheets, popups, toasts, fields, buttons, pickers, tab view, tab bar, edge panel, swipe rows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"build": "rslib build"
|
|
245
245
|
},
|
|
246
246
|
"dependencies": {
|
|
247
|
-
"@g9tm/lynxcontrols-foundation": "2.
|
|
247
|
+
"@g9tm/lynxcontrols-foundation": "2.10.0"
|
|
248
248
|
},
|
|
249
249
|
"peerDependencies": {
|
|
250
250
|
"@lynx-js/react": ">=0.129.3 <0.130.0",
|
|
@@ -53,7 +53,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
53
53
|
- `@g9tm/lynxcontrols/header`: G9AppBar → `components/header.md`
|
|
54
54
|
- `@g9tm/lynxcontrols/host`: G9CarryContexts, G9Host, G9PageLoadingOverlay → `components/host.md`
|
|
55
55
|
- `@g9tm/lynxcontrols/icon`: G9Art, G9Icon, G9IconSlot, G9Swatch → `components/icon.md`
|
|
56
|
-
- `@g9tm/lynxcontrols/layout`: G9ActionRow, G9Bento, G9Card, G9Columns, G9HScroll, G9Page, G9PlaceScroll, G9SaveBar, G9ScrollSpyBar, G9Section, G9SectionHeader, G9SplitPane, G9UnsavedBar → `components/layout-1.md`, `components/layout-2.md`
|
|
56
|
+
- `@g9tm/lynxcontrols/layout`: G9ActionRow, G9Bento, G9Card, G9Columns, G9DockLayout, G9HScroll, G9Page, G9PlaceScroll, G9SaveBar, G9ScrollSpyBar, G9Section, G9SectionHeader, G9SplitPane, G9UnsavedBar → `components/layout-1.md`, `components/layout-2.md`
|
|
57
57
|
- `@g9tm/lynxcontrols/list`: G9DragList, G9ListRow, G9Pager, G9PullToRefresh, G9SettingsGroup, G9SwitchRow, G9VirtualList → `components/list.md`
|
|
58
58
|
- `@g9tm/lynxcontrols/notifications`: G9NotificationCenter, G9NotificationCenterPanel → `components/notifications.md`
|
|
59
59
|
- `@g9tm/lynxcontrols/orb`: G9FloatingOrb, G9HoldButton → `components/orb.md`
|
|
@@ -63,7 +63,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
63
63
|
- `@g9tm/lynxcontrols/popover`: G9ActionSheet, G9ContextMenu, G9Menu, G9MenuList, G9OverlayRoot, G9Popover, G9Tooltip → `components/popover.md`
|
|
64
64
|
- `@g9tm/lynxcontrols/popup`: G9PopupDragHandle, G9PopupView, PopupFrame, PopupInputForm → `components/popup.md`
|
|
65
65
|
- `@g9tm/lynxcontrols/provider`: G9Activity, G9DirectionScope, G9KeepAlive, G9Provider → `components/provider.md`
|
|
66
|
-
- `@g9tm/lynxcontrols/range-slider`: G9RangeSlider, G9StepSlider → `components/range-slider.md`
|
|
66
|
+
- `@g9tm/lynxcontrols/range-slider`: G9KeyDiamond, G9KeySlider, G9RangeSlider, G9StepSlider → `components/range-slider.md`
|
|
67
67
|
- `@g9tm/lynxcontrols/reader`: G9ReaderSheet, G9ReaderView → `components/reader.md`
|
|
68
68
|
- `@g9tm/lynxcontrols/route`: G9PathNavigator, G9Place → `components/route.md`
|
|
69
69
|
- `@g9tm/lynxcontrols/sheet`: G9LoadableSheetContent, G9ProcessingSheetContent, G9Sheet, G9SheetBackdropScope, G9SheetFooter, G9SheetFooterBar, G9SheetFrame, G9SheetHeader, G9SheetScrollIndicator, G9SheetScrollRegion → `components/sheet.md`
|
|
@@ -117,6 +117,15 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
117
117
|
|
|
118
118
|
## @g9tm/lynxcontrols-studio
|
|
119
119
|
|
|
120
|
+
- `@g9tm/lynxcontrols-studio/color-picker`: G9ColorPicker → `components/studio-color-picker.md`
|
|
121
|
+
- `@g9tm/lynxcontrols-studio/ease-editor`: G9EaseEditor → `components/studio-ease-editor.md`
|
|
122
|
+
- `@g9tm/lynxcontrols-studio/filmstrip`: G9Filmstrip → `components/studio-filmstrip.md`
|
|
123
|
+
- `@g9tm/lynxcontrols-studio/font-picker`: G9FontPicker → `components/studio-font-picker.md`
|
|
124
|
+
- `@g9tm/lynxcontrols-studio/gradient-editor`: G9GradientEditor → `components/studio-gradient-editor.md`
|
|
125
|
+
- `@g9tm/lynxcontrols-studio/history-list`: G9HistoryList, G9JobQueue → `components/studio-history-list.md`
|
|
126
|
+
- `@g9tm/lynxcontrols-studio/media-slot`: G9MediaSlot → `components/studio-media-slot.md`
|
|
120
127
|
- `@g9tm/lynxcontrols-studio/nle-timeline`: G9NleTimeline → `components/studio-nle-timeline.md`
|
|
128
|
+
- `@g9tm/lynxcontrols-studio/option-form`: G9OptionForm → `components/studio-option-form.md`
|
|
121
129
|
- `@g9tm/lynxcontrols-studio/surface`: G9Surface → `components/studio-surface.md`
|
|
122
130
|
- `@g9tm/lynxcontrols-studio/transform-box`: G9TransformBox → `components/studio-transform-box.md`
|
|
131
|
+
- `@g9tm/lynxcontrols-studio/waveform`: G9Waveform → `components/studio-waveform.md`
|
|
@@ -10,10 +10,10 @@ Props:
|
|
|
10
10
|
- `columns`: object[]
|
|
11
11
|
- `data`: NonNullable<T>[]
|
|
12
12
|
- `getId`: (row: T) => void
|
|
13
|
+
- `selection?`: 'none' | 'single' | 'multiple' = "none"
|
|
14
|
+
- `onCellEdit?`: (rowId: string | number, columnId: string, text: string) => void
|
|
13
15
|
- `onEndReached?`: () => void
|
|
14
16
|
- `onRowPress?`: (row: T) => void
|
|
15
|
-
- `
|
|
16
|
-
- `totalsLabel?`: string
|
|
17
|
-
- `empty?`: ReactNode
|
|
17
|
+
- `onSelectionChange?`: (ids: readonly (string | number)[]) => void
|
|
18
18
|
|
|
19
19
|
Example: `<G9DataGrid columns={columns} data={data} getId={getId} />`
|
|
@@ -58,6 +58,24 @@ Props:
|
|
|
58
58
|
|
|
59
59
|
Example: `<G9Columns />`
|
|
60
60
|
|
|
61
|
+
# G9DockLayout
|
|
62
|
+
|
|
63
|
+
`import { G9DockLayout } from '@g9tm/lynxcontrols/layout';`
|
|
64
|
+
|
|
65
|
+
Panes in nested rows and columns (an editor's frame).
|
|
66
|
+
|
|
67
|
+
Props:
|
|
68
|
+
- `layout`: object | object
|
|
69
|
+
- `renderPane`: (id, api) => ReactNode
|
|
70
|
+
- `onChange?`: (sizes: Readonly<Record<string, readonly number[]>>) => void
|
|
71
|
+
- `onCollapsedChange?`: (collapsed: readonly string[]) => void
|
|
72
|
+
- `railLabel?`: string
|
|
73
|
+
- `splitterLabel?`: string
|
|
74
|
+
- `minSizes?`: object = 48
|
|
75
|
+
- `railSize?`: number = 40
|
|
76
|
+
|
|
77
|
+
Example: `<G9DockLayout layout={layout} renderPane={renderPane} />`
|
|
78
|
+
|
|
61
79
|
# G9HScroll
|
|
62
80
|
|
|
63
81
|
`import { G9HScroll } from '@g9tm/lynxcontrols/layout';`
|
|
@@ -168,21 +186,3 @@ Props:
|
|
|
168
186
|
- `action?`: object
|
|
169
187
|
|
|
170
188
|
Example: `<G9SectionHeader title="Label" />`
|
|
171
|
-
|
|
172
|
-
# G9SplitPane
|
|
173
|
-
|
|
174
|
-
`import { G9SplitPane } from '@g9tm/lynxcontrols/layout';`
|
|
175
|
-
|
|
176
|
-
A list beside its detail on wide windows, one of them on phones (G9Hub SplitPane + Navigator).
|
|
177
|
-
|
|
178
|
-
Props:
|
|
179
|
-
- `start`: ReactNode
|
|
180
|
-
- `children?`: ReactNode
|
|
181
|
-
- `size?`: number = 360
|
|
182
|
-
- `phonePane?`: 'start' | 'detail' = "start"
|
|
183
|
-
- `onResize?`: (size: number) => void
|
|
184
|
-
- `fixed?`: boolean
|
|
185
|
-
- `max?`: number
|
|
186
|
-
- `min?`: number
|
|
187
|
-
|
|
188
|
-
Example: `<G9SplitPane start={start} />`
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# `@g9tm/lynxcontrols/layout` (part 2 of 2) (generated)
|
|
2
2
|
|
|
3
|
+
# G9SplitPane
|
|
4
|
+
|
|
5
|
+
`import { G9SplitPane } from '@g9tm/lynxcontrols/layout';`
|
|
6
|
+
|
|
7
|
+
A list beside its detail on wide windows, one of them on phones (G9Hub SplitPane + Navigator).
|
|
8
|
+
|
|
9
|
+
Props:
|
|
10
|
+
- `start`: ReactNode
|
|
11
|
+
- `children?`: ReactNode
|
|
12
|
+
- `size?`: number = 360
|
|
13
|
+
- `phonePane?`: 'start' | 'detail' = "start"
|
|
14
|
+
- `onResize?`: (size: number) => void
|
|
15
|
+
- `fixed?`: boolean
|
|
16
|
+
- `max?`: number
|
|
17
|
+
- `min?`: number
|
|
18
|
+
|
|
19
|
+
Example: `<G9SplitPane start={start} />`
|
|
20
|
+
|
|
3
21
|
# G9UnsavedBar
|
|
4
22
|
|
|
5
23
|
`import { G9UnsavedBar } from '@g9tm/lynxcontrols/layout';`
|
|
@@ -120,19 +120,19 @@ Example: `<G9Captcha labels={labels} onSolution={() => {}} solve={solve} />`
|
|
|
120
120
|
|
|
121
121
|
`import { G9ClipPlayer } from '@g9tm/lynxcontrols-media';`
|
|
122
122
|
|
|
123
|
-
An async video clip (G9Hub item 51, 2.5.8): the poster with its length and a play mark, the app's player in place.
|
|
123
|
+
An async video clip (G9Hub item 51, 2.5.8): the poster with its length and a play mark, the app's player in place; since 2.10.0 a looping muted preview over the poster (`src`) that plays while `playing` or hovered.
|
|
124
124
|
|
|
125
125
|
Props:
|
|
126
|
-
- `seconds`: number
|
|
127
126
|
- `label?`: string
|
|
128
127
|
- `onPlay?`: () => void
|
|
128
|
+
- `onReady?`: () => void
|
|
129
129
|
- `caption?`: string
|
|
130
130
|
- `radius?`: number = 16
|
|
131
131
|
- `player?`: ReactNode
|
|
132
132
|
- `aspect?`: number = 16
|
|
133
|
-
- `
|
|
133
|
+
- `fit?`: 'contain' | 'cover'
|
|
134
134
|
|
|
135
|
-
Example: `<G9ClipPlayer
|
|
135
|
+
Example: `<G9ClipPlayer />`
|
|
136
136
|
|
|
137
137
|
# G9DeviceSettings
|
|
138
138
|
|
|
@@ -163,10 +163,10 @@ Props:
|
|
|
163
163
|
- `onFiles`: (files: readonly G9FileRef[]) => void
|
|
164
164
|
- `children?`: ReactNode
|
|
165
165
|
- `disabled?`: boolean
|
|
166
|
+
- `onDragChange?`: (active: boolean) => void
|
|
167
|
+
- `onReject?`: (reason: G9DropRejectReason, files: readonly G9FileRef[]) => void
|
|
168
|
+
- `buttonLabel?`: string
|
|
166
169
|
- `hint?`: string
|
|
167
|
-
- `accept?`: string
|
|
168
|
-
- `multiple?`: boolean = true
|
|
169
|
-
- `tapToPick?`: boolean
|
|
170
170
|
|
|
171
171
|
Example: `<G9DropZone label="Label" onFiles={() => {}} />`
|
|
172
172
|
|