@g9tm/lynxcontrols 2.8.4 → 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/README.md +1 -0
- package/catalog/cards/G9Avatar.md +1 -1
- package/catalog/cards/G9Badge.md +1 -1
- package/catalog/cards/G9Button.md +1 -1
- package/catalog/cards/G9Chip.md +1 -1
- package/catalog/cards/G9ChipStrip.md +1 -1
- package/catalog/cards/G9ContextMenu.md +4 -2
- package/catalog/cards/G9DockLayout.md +17 -0
- package/catalog/cards/G9DragChip.md +10 -0
- package/catalog/cards/G9DragSource.md +17 -0
- package/catalog/cards/G9DropTarget.md +15 -0
- package/catalog/cards/G9EmptyState.md +1 -1
- package/catalog/cards/G9IconButton.md +2 -2
- package/catalog/cards/G9InlineMessage.md +1 -1
- package/catalog/cards/G9KeyCapture.md +10 -0
- package/catalog/cards/G9KeyDiamond.md +15 -0
- package/catalog/cards/G9KeySlider.md +17 -0
- package/catalog/cards/G9Kpi.md +1 -1
- package/catalog/cards/G9ListRow.md +1 -1
- package/catalog/cards/G9LiveBadge.md +1 -1
- package/catalog/cards/G9LiveDot.md +1 -1
- package/catalog/cards/G9ProgressBar.md +1 -1
- package/catalog/cards/G9ProgressRing.md +1 -1
- package/catalog/cards/G9SafeButton.md +1 -1
- package/catalog/cards/G9SafeIconButton.md +2 -2
- package/catalog/cards/G9StatusPill.md +1 -1
- package/catalog/cards/G9StepTracker.md +1 -1
- package/catalog/cards/G9SwitchRow.md +1 -1
- package/catalog/cards/G9Tag.md +1 -1
- package/catalog/catalog.json +2391 -192
- package/catalog/index.md +9 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.jsx +1 -1
- package/dist/commands/keys.d.ts +32 -1
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.jsx +92 -3
- package/dist/desktop/index.d.ts +3 -0
- package/dist/desktop/index.d.ts.map +1 -0
- package/dist/desktop/index.jsx +2 -0
- package/dist/desktop/keys.d.ts +26 -0
- package/dist/desktop/keys.d.ts.map +1 -0
- package/dist/desktop/keys.jsx +30 -0
- package/dist/desktop/window.d.ts +18 -0
- package/dist/desktop/window.d.ts.map +1 -0
- package/dist/desktop/window.jsx +28 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +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/drag-session.d.ts +72 -0
- package/dist/pointer/drag-session.d.ts.map +1 -0
- package/dist/pointer/drag-session.jsx +148 -0
- package/dist/pointer/drag.d.ts +78 -0
- package/dist/pointer/drag.d.ts.map +1 -0
- package/dist/pointer/drag.jsx +186 -0
- package/dist/pointer/index.d.ts +6 -0
- package/dist/pointer/index.d.ts.map +1 -0
- package/dist/pointer/index.jsx +5 -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/pointer/point.d.ts +36 -0
- package/dist/pointer/point.d.ts.map +1 -0
- package/dist/pointer/point.jsx +34 -0
- package/dist/pointer/pointer.css +62 -0
- package/dist/pointer/pointer.css.map +1 -0
- package/dist/pointer/secondary.d.ts +54 -0
- package/dist/pointer/secondary.d.ts.map +1 -0
- package/dist/pointer/secondary.jsx +86 -0
- package/dist/popover/popover.d.ts +26 -2
- package/dist/popover/popover.d.ts.map +1 -1
- package/dist/popover/popover.jsx +47 -20
- 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 +12 -2
- package/skills/g9-lynx-app/SKILL.md +8 -0
- package/skills/g9-lynx-app/references/catalog-index.md +22 -2
- package/skills/g9-lynx-app/references/components/button.md +6 -6
- package/skills/g9-lynx-app/references/components/code-editor.md +19 -0
- package/skills/g9-lynx-app/references/components/code-log.md +19 -0
- package/skills/g9-lynx-app/references/components/datagrid.md +3 -3
- package/skills/g9-lynx-app/references/components/desktop.md +12 -0
- package/skills/g9-lynx-app/references/components/display-1.md +4 -4
- package/skills/g9-lynx-app/references/components/display-2.md +5 -5
- package/skills/g9-lynx-app/references/components/display-3.md +3 -3
- package/skills/g9-lynx-app/references/components/graph.md +19 -0
- 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/list.md +2 -2
- package/skills/g9-lynx-app/references/components/media-1.md +7 -7
- package/skills/g9-lynx-app/references/components/pointer.md +46 -0
- package/skills/g9-lynx-app/references/components/popover.md +4 -2
- 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
- package/skills/g9-lynx-app/references/components/toggle.md +2 -2
|
@@ -4,6 +4,7 @@ import type { NodesRef } from '@lynx-js/types';
|
|
|
4
4
|
import type { G9AnchorRect } from '../anchor/registry.js';
|
|
5
5
|
import { type G9StyleProp } from '../base/control.js';
|
|
6
6
|
import { type G9IconInput } from '../icon/icon.js';
|
|
7
|
+
import { type G9SecondarySource } from '../pointer/secondary.js';
|
|
7
8
|
import { type G9Placement } from './position.js';
|
|
8
9
|
/** An open popover-like overlay, as automation sees it (G9AppPilot's layer model: `popup` layer). */
|
|
9
10
|
export interface G9OpenPopover {
|
|
@@ -124,6 +125,15 @@ export interface G9MenuProps extends Omit<G9PopoverProps, 'children' | 'kind'> {
|
|
|
124
125
|
readonly mode?: 'auto' | 'popover' | 'sheet';
|
|
125
126
|
/** Cancel row text of the action sheet. */
|
|
126
127
|
readonly cancelText?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Opens at this point of the LynxView (2.9.0): where a right click happened (`useG9SecondaryAction`). Wins over
|
|
130
|
+
* `anchorId` / `anchorNode` / `anchorRect`, and a menu at a point is always the popover form (a pointer means a
|
|
131
|
+
* desktop or a mouse) unless `mode` is `'sheet'`.
|
|
132
|
+
*/
|
|
133
|
+
readonly anchorPoint?: {
|
|
134
|
+
readonly x: number;
|
|
135
|
+
readonly y: number;
|
|
136
|
+
};
|
|
127
137
|
}
|
|
128
138
|
/** A menu (G9Hub Menu): a popover by the anchor on wide windows, an action sheet from the bottom on phones. */
|
|
129
139
|
export declare function G9Menu(props: G9MenuProps): ReactNode;
|
|
@@ -147,10 +157,24 @@ export interface G9ContextMenuProps {
|
|
|
147
157
|
readonly onSelect: (key: string) => void;
|
|
148
158
|
readonly title?: string;
|
|
149
159
|
readonly disabled?: boolean;
|
|
150
|
-
|
|
160
|
+
/** Told how it opened (2.9.0): `'touch'` (a long press), `'mouse'` (the right button) or `'keyboard'`. */
|
|
161
|
+
readonly onOpen?: (source: G9SecondarySource) => void;
|
|
162
|
+
/** The right mouse button opens it at the pointer (desktop, the web). Default true. */
|
|
163
|
+
readonly secondaryClick?: boolean;
|
|
164
|
+
/** A long press opens it on touch. Default true. */
|
|
165
|
+
readonly longPress?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* The context-menu key and Shift+F10: `'focus'` (default) when the child has the keyboard focus, `'global'` while
|
|
168
|
+
* mounted (the app's selected item), `'off'`.
|
|
169
|
+
*/
|
|
170
|
+
readonly keyboard?: 'focus' | 'global' | 'off';
|
|
151
171
|
readonly id?: string;
|
|
152
172
|
readonly children?: ReactNode;
|
|
153
173
|
}
|
|
154
|
-
/**
|
|
174
|
+
/**
|
|
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
|
+
* 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).
|
|
178
|
+
*/
|
|
155
179
|
export declare function G9ContextMenu(props: G9ContextMenuProps): ReactNode;
|
|
156
180
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAQ,KAAK,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAC5F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,iBAAiB,CAAC;AAIrF,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAQ,KA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,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,0GAA0G;IAC1G,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACtD,uFAAuF;IACvF,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,oDAAoD;IACpD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAmClE"}
|
package/dist/popover/popover.jsx
CHANGED
|
@@ -9,6 +9,7 @@ import { G9Keycap } from "../display/keycap.jsx";
|
|
|
9
9
|
import { useG9Back, useG9LayerItem } from "../host/hooks.jsx";
|
|
10
10
|
import { G9Icon } from "../icon/icon.jsx";
|
|
11
11
|
import { useG9ListKeyboard } from "../list/keyboard.jsx";
|
|
12
|
+
import { useG9SecondaryAction } from "../pointer/secondary.jsx";
|
|
12
13
|
import { useG9Core, useG9Direction, useG9Layout, useG9SafeInsets, useG9Strings } from "../provider/hooks.jsx";
|
|
13
14
|
import { computePopoverPosition } from "./position.jsx";
|
|
14
15
|
function G9OverlayRoot(props) {
|
|
@@ -274,8 +275,19 @@ const G9MenuList = memo(function(props) {
|
|
|
274
275
|
</view>;
|
|
275
276
|
});
|
|
276
277
|
function G9Menu(props) {
|
|
278
|
+
var _pop_placement;
|
|
277
279
|
const { wide } = useG9Layout();
|
|
278
|
-
const
|
|
280
|
+
const point = props.anchorPoint;
|
|
281
|
+
const pointRect = useMemo(()=>point ? {
|
|
282
|
+
x: point.x,
|
|
283
|
+
y: point.y,
|
|
284
|
+
width: 0,
|
|
285
|
+
height: 0
|
|
286
|
+
} : void 0, [
|
|
287
|
+
null == point ? void 0 : point.x,
|
|
288
|
+
null == point ? void 0 : point.y
|
|
289
|
+
]);
|
|
290
|
+
const sheet = 'sheet' === props.mode || 'popover' !== props.mode && !wide && !point;
|
|
279
291
|
const select = (k)=>{
|
|
280
292
|
props.onSelect(k);
|
|
281
293
|
props.onClose();
|
|
@@ -291,8 +303,11 @@ function G9Menu(props) {
|
|
|
291
303
|
id: `${props.id}_List`
|
|
292
304
|
} : {}}/>
|
|
293
305
|
</G9ActionSheet>;
|
|
294
|
-
const { items: _i, onSelect: _s, title: _t, mode: _m, cancelText: _c, ...pop } = props;
|
|
295
|
-
return <G9Popover {...pop}
|
|
306
|
+
const { items: _i, onSelect: _s, title: _t, mode: _m, cancelText: _c, anchorPoint: _p, ...pop } = props;
|
|
307
|
+
return <G9Popover {...pop} {...pointRect ? {
|
|
308
|
+
anchorRect: pointRect,
|
|
309
|
+
placement: null != (_pop_placement = pop.placement) ? _pop_placement : 'bottom-start'
|
|
310
|
+
} : {}} kind="menu">
|
|
296
311
|
<G9MenuList items={props.items} onSelect={select} keyboard={props.open} {...props.id ? {
|
|
297
312
|
id: `${props.id}_List`
|
|
298
313
|
} : {}}/>
|
|
@@ -337,25 +352,37 @@ function G9ActionSheet(props) {
|
|
|
337
352
|
return null;
|
|
338
353
|
}
|
|
339
354
|
function G9ContextMenu(props) {
|
|
355
|
+
var _props_keyboard;
|
|
340
356
|
const [isOpen, setOpen] = useState(false);
|
|
341
|
-
const [
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
357
|
+
const [at, setAt] = useState(null);
|
|
358
|
+
const secondary = useG9SecondaryAction((a)=>{
|
|
359
|
+
var _props_onOpen;
|
|
360
|
+
setAt({
|
|
361
|
+
rect: a.anchor,
|
|
362
|
+
point: 'mouse' === a.source && 0 === a.anchor.width && 0 === a.anchor.height
|
|
363
|
+
});
|
|
364
|
+
setOpen(true);
|
|
365
|
+
null == (_props_onOpen = props.onOpen) || _props_onOpen.call(props, a.source);
|
|
366
|
+
}, {
|
|
367
|
+
enabled: !props.disabled,
|
|
368
|
+
...false === props.longPress ? {
|
|
369
|
+
longPress: false
|
|
370
|
+
} : {},
|
|
371
|
+
keyboard: null != (_props_keyboard = props.keyboard) ? _props_keyboard : 'focus'
|
|
372
|
+
});
|
|
373
|
+
const { ref, ...bind } = secondary;
|
|
374
|
+
return <view className="g9-context-menu" {...g9IdProps(props.id)} ref={ref} {...false === props.secondaryClick ? {
|
|
375
|
+
...bind,
|
|
376
|
+
bindmousedown: void 0
|
|
377
|
+
} : bind}>
|
|
356
378
|
{props.children}
|
|
357
|
-
<G9Menu open={isOpen} onClose={()=>setOpen(false)} items={props.items} onSelect={props.onSelect} {...
|
|
358
|
-
|
|
379
|
+
<G9Menu open={isOpen} onClose={()=>setOpen(false)} items={props.items} onSelect={props.onSelect} {...at ? at.point ? {
|
|
380
|
+
anchorPoint: {
|
|
381
|
+
x: at.rect.x,
|
|
382
|
+
y: at.rect.y
|
|
383
|
+
}
|
|
384
|
+
} : {
|
|
385
|
+
anchorRect: at.rect
|
|
359
386
|
} : {}} {...props.title ? {
|
|
360
387
|
title: props.title
|
|
361
388
|
} : {}} {...props.id ? {
|
|
@@ -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,qFAAqF;AACrF,MAAM,MAAM,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,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;AACrC;;AAWA;EARE,uBAAu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X,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;EACZ,kBAAkB;EAClB,aA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AdE,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,CAAC,OAAO,CAAC,EAAE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Aa,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",
|
|
@@ -187,6 +187,16 @@
|
|
|
187
187
|
"types": "./dist/popover/index.d.ts",
|
|
188
188
|
"default": "./dist/popover/index.jsx"
|
|
189
189
|
},
|
|
190
|
+
"./pointer": {
|
|
191
|
+
"source": "./src/pointer/index.ts",
|
|
192
|
+
"types": "./dist/pointer/index.d.ts",
|
|
193
|
+
"default": "./dist/pointer/index.jsx"
|
|
194
|
+
},
|
|
195
|
+
"./desktop": {
|
|
196
|
+
"source": "./src/desktop/index.ts",
|
|
197
|
+
"types": "./dist/desktop/index.d.ts",
|
|
198
|
+
"default": "./dist/desktop/index.jsx"
|
|
199
|
+
},
|
|
190
200
|
"./commands": {
|
|
191
201
|
"source": "./src/commands/index.ts",
|
|
192
202
|
"types": "./dist/commands/index.d.ts",
|
|
@@ -234,7 +244,7 @@
|
|
|
234
244
|
"build": "rslib build"
|
|
235
245
|
},
|
|
236
246
|
"dependencies": {
|
|
237
|
-
"@g9tm/lynxcontrols-foundation": "2.
|
|
247
|
+
"@g9tm/lynxcontrols-foundation": "2.10.0"
|
|
238
248
|
},
|
|
239
249
|
"peerDependencies": {
|
|
240
250
|
"@lynx-js/react": ">=0.129.3 <0.130.0",
|
|
@@ -36,6 +36,14 @@ disagree, trust `node_modules/@g9tm/lynxcontrols*/catalog/catalog.json` and the
|
|
|
36
36
|
3. **Use the library before writing your own**: a control, a token (`g9Token('Primary')`) or a culture function
|
|
37
37
|
(`formatNumber`, `toNativeDigits`) exists for most needs; give every control a person or a test acts on an `id`.
|
|
38
38
|
|
|
39
|
+
## Clean up at the end
|
|
40
|
+
|
|
41
|
+
Always (the owner, 2026-12-03: old temp files and test Docker images filled drive C and the machine crashed): every
|
|
42
|
+
temporary thing a task makes is removed before the task is reported done — temp files and folders (`%TEMP%`, `/tmp`,
|
|
43
|
+
scratch packs and tarballs), extra git worktrees, scratch apps, the Docker containers, images, volumes and build cache
|
|
44
|
+
it created, and the processes it started (dev servers, watchers, emulators). Remove only what you made, never another
|
|
45
|
+
session's; say in the report what was removed and what could not be.
|
|
46
|
+
|
|
39
47
|
## How the references are made
|
|
40
48
|
|
|
41
49
|
The hand-written files say how to use the library; `references/catalog-index.md` and `references/components/` are
|