@knime/kds-components 14.1.1 → 14.2.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/CHANGELOG.md +14 -0
- package/dist/index.css +153 -4
- package/dist/index.js +818 -277
- package/dist/index.js.map +1 -1
- package/dist/src/components/forms/Slider/KdsSlider.vue.d.ts +104 -0
- package/dist/src/components/forms/Slider/KdsSlider.vue.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/enums.d.ts +10 -0
- package/dist/src/components/forms/Slider/enums.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/index.d.ts +4 -0
- package/dist/src/components/forms/Slider/index.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/sliderUtils.d.ts +59 -0
- package/dist/src/components/forms/Slider/sliderUtils.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/types.d.ts +70 -0
- package/dist/src/components/forms/Slider/types.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/useSliderInteraction.d.ts +20 -0
- package/dist/src/components/forms/Slider/useSliderInteraction.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/useSliderScale.d.ts +36 -0
- package/dist/src/components/forms/Slider/useSliderScale.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/useSliderTicks.d.ts +21 -0
- package/dist/src/components/forms/Slider/useSliderTicks.d.ts.map +1 -0
- package/dist/src/components/forms/Slider/useSliderTooltip.d.ts +16 -0
- package/dist/src/components/forms/Slider/useSliderTooltip.d.ts.map +1 -0
- package/dist/src/components/forms/index.d.ts +2 -0
- package/dist/src/components/forms/index.d.ts.map +1 -1
- package/dist/src/components/forms/inputs/NumberInput/numberParser.d.ts.map +1 -1
- package/dist/src/components/forms/selects/Dropdown/DropdownContainer.vue.d.ts.map +1 -1
- package/dist/src/util/countFractionDigits.d.ts +6 -0
- package/dist/src/util/countFractionDigits.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { KdsFormFieldExpose } from '../types';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue?: number;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<({
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
tooltipPrefix?: string;
|
|
11
|
+
tooltipSuffix?: string;
|
|
12
|
+
labelPrefix?: string;
|
|
13
|
+
labelSuffix?: string;
|
|
14
|
+
ticks?: import('./types').KdsSliderTicks;
|
|
15
|
+
pageStep?: number;
|
|
16
|
+
} & {
|
|
17
|
+
description?: string;
|
|
18
|
+
} & {
|
|
19
|
+
label: string;
|
|
20
|
+
ariaLabel?: never;
|
|
21
|
+
} & {
|
|
22
|
+
id?: string;
|
|
23
|
+
} & {
|
|
24
|
+
error?: boolean | undefined;
|
|
25
|
+
subText?: string | undefined;
|
|
26
|
+
validating?: boolean | undefined;
|
|
27
|
+
preserveSubTextSpace?: boolean | undefined;
|
|
28
|
+
} & __VLS_ModelProps) | ({
|
|
29
|
+
min?: number;
|
|
30
|
+
max?: number;
|
|
31
|
+
step?: number;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
tooltipPrefix?: string;
|
|
34
|
+
tooltipSuffix?: string;
|
|
35
|
+
labelPrefix?: string;
|
|
36
|
+
labelSuffix?: string;
|
|
37
|
+
ticks?: import('./types').KdsSliderTicks;
|
|
38
|
+
pageStep?: number;
|
|
39
|
+
} & {
|
|
40
|
+
description?: string;
|
|
41
|
+
} & {
|
|
42
|
+
label?: never;
|
|
43
|
+
ariaLabel: string;
|
|
44
|
+
} & {
|
|
45
|
+
id?: string;
|
|
46
|
+
} & {
|
|
47
|
+
error?: boolean | undefined;
|
|
48
|
+
subText?: string | undefined;
|
|
49
|
+
validating?: boolean | undefined;
|
|
50
|
+
preserveSubTextSpace?: boolean | undefined;
|
|
51
|
+
} & __VLS_ModelProps), KdsFormFieldExpose, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
52
|
+
"update:modelValue": (value: number | undefined) => any;
|
|
53
|
+
}, string, import('vue').PublicProps, Readonly<({
|
|
54
|
+
min?: number;
|
|
55
|
+
max?: number;
|
|
56
|
+
step?: number;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
tooltipPrefix?: string;
|
|
59
|
+
tooltipSuffix?: string;
|
|
60
|
+
labelPrefix?: string;
|
|
61
|
+
labelSuffix?: string;
|
|
62
|
+
ticks?: import('./types').KdsSliderTicks;
|
|
63
|
+
pageStep?: number;
|
|
64
|
+
} & {
|
|
65
|
+
description?: string;
|
|
66
|
+
} & {
|
|
67
|
+
label: string;
|
|
68
|
+
ariaLabel?: never;
|
|
69
|
+
} & {
|
|
70
|
+
id?: string;
|
|
71
|
+
} & {
|
|
72
|
+
error?: boolean | undefined;
|
|
73
|
+
subText?: string | undefined;
|
|
74
|
+
validating?: boolean | undefined;
|
|
75
|
+
preserveSubTextSpace?: boolean | undefined;
|
|
76
|
+
} & __VLS_ModelProps) | ({
|
|
77
|
+
min?: number;
|
|
78
|
+
max?: number;
|
|
79
|
+
step?: number;
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
tooltipPrefix?: string;
|
|
82
|
+
tooltipSuffix?: string;
|
|
83
|
+
labelPrefix?: string;
|
|
84
|
+
labelSuffix?: string;
|
|
85
|
+
ticks?: import('./types').KdsSliderTicks;
|
|
86
|
+
pageStep?: number;
|
|
87
|
+
} & {
|
|
88
|
+
description?: string;
|
|
89
|
+
} & {
|
|
90
|
+
label?: never;
|
|
91
|
+
ariaLabel: string;
|
|
92
|
+
} & {
|
|
93
|
+
id?: string;
|
|
94
|
+
} & {
|
|
95
|
+
error?: boolean | undefined;
|
|
96
|
+
subText?: string | undefined;
|
|
97
|
+
validating?: boolean | undefined;
|
|
98
|
+
preserveSubTextSpace?: boolean | undefined;
|
|
99
|
+
} & __VLS_ModelProps)> & Readonly<{
|
|
100
|
+
"onUpdate:modelValue"?: ((value: number | undefined) => any) | undefined;
|
|
101
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
102
|
+
declare const _default: typeof __VLS_export;
|
|
103
|
+
export default _default;
|
|
104
|
+
//# sourceMappingURL=KdsSlider.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KdsSlider.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/KdsSlider.vue"],"names":[],"mappings":"AAuXA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA6GnD,KAAK,gBAAgB,GAAG;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAqNF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const kdsSliderTickMode: {
|
|
2
|
+
/** No ticks at all. */
|
|
3
|
+
readonly NONE: "none";
|
|
4
|
+
/** A labelled tick at the minimum and the maximum only. */
|
|
5
|
+
readonly MIN_MAX: "minMax";
|
|
6
|
+
/** A labelled tick at every step. */
|
|
7
|
+
readonly EVERY_STEP: "everyStep";
|
|
8
|
+
};
|
|
9
|
+
export declare const kdsSliderTickModes: ("none" | "minMax" | "everyStep")[];
|
|
10
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/enums.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;IAC5B,uBAAuB;;IAEvB,2DAA2D;;IAE3D,qCAAqC;;CAE7B,CAAC;AAEX,eAAO,MAAM,kBAAkB,qCAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAChE,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The most decimal places values in `[min, max]` can carry without floating
|
|
3
|
+
* point noise.
|
|
4
|
+
*/
|
|
5
|
+
export declare const maxDecimalPlaces: (min: number, max: number) => number;
|
|
6
|
+
/**
|
|
7
|
+
* The smallest step values in `[min, max]` can resolve, e.g. `1e-14` for
|
|
8
|
+
* `0..1`. Finer steps would be rounded away.
|
|
9
|
+
*/
|
|
10
|
+
export declare const minStepSize: (min: number, max: number) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether `step` is a usable step size: positive and finite. NaN, 0, negative
|
|
13
|
+
* and infinite steps fall back to the continuous scale.
|
|
14
|
+
*/
|
|
15
|
+
export declare const isUsableStep: (step: number | undefined) => step is number;
|
|
16
|
+
/** Converts a value within `[min, max]` to a percentage clamped to `[0, 100]`. */
|
|
17
|
+
export declare const valueToPercent: (value: number, min: number, max: number) => number;
|
|
18
|
+
/** Converts a percentage within `[0, 100]` to a value within `[min, max]`. */
|
|
19
|
+
export declare const percentToValue: (percent: number, min: number, max: number) => number;
|
|
20
|
+
/**
|
|
21
|
+
* How `snapToStep` picks a grid value: the nearest one, or the next one below
|
|
22
|
+
* (`floor`) or above (`ceil`).
|
|
23
|
+
*/
|
|
24
|
+
export type SnapMode = "nearest" | "floor" | "ceil";
|
|
25
|
+
/**
|
|
26
|
+
* Rounds a non-negative `distance` up to a whole multiple of `step`, at least
|
|
27
|
+
* one step (`10` with step `7` → `14`, `1` with step `5` → `5`). A non-positive
|
|
28
|
+
* `step` returns `distance` unchanged.
|
|
29
|
+
*/
|
|
30
|
+
export declare const roundUpToSteps: (distance: number, step: number) => number;
|
|
31
|
+
/** A step grid anchored at `min`, bounded by `[min, max]`. */
|
|
32
|
+
export type StepGrid = {
|
|
33
|
+
min: number;
|
|
34
|
+
max: number;
|
|
35
|
+
step: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Snaps `value` to the step grid anchored at `min`, cleans floating point noise
|
|
39
|
+
* and clamps the result to `[min, max]`. A non-positive `step` disables
|
|
40
|
+
* snapping and only clamps. In `nearest` mode an off-grid `max` is snapped to
|
|
41
|
+
* when it is nearer than the last grid value.
|
|
42
|
+
*/
|
|
43
|
+
export declare const snapToStep: (value: number, { min, max, step }: StepGrid, mode?: SnapMode) => number;
|
|
44
|
+
/**
|
|
45
|
+
* Builds the list of step values from `min` to `max`. Falls back to
|
|
46
|
+
* just the bounds (`[min, max]`) when the configuration would produce more than
|
|
47
|
+
* `limit` values.
|
|
48
|
+
*/
|
|
49
|
+
export declare const buildStepValues: (min: number, max: number, step: number, limit?: number) => number[];
|
|
50
|
+
/**
|
|
51
|
+
* Builds `count` evenly spaced values from `min` to `max`. Rounds values
|
|
52
|
+
* based on slider step size.
|
|
53
|
+
*/
|
|
54
|
+
export declare const buildEvenlySpacedValues: (min: number, max: number, count: number, step?: number) => number[];
|
|
55
|
+
/**
|
|
56
|
+
* Snaps each value to the nearest grid value and drops the duplicates.
|
|
57
|
+
*/
|
|
58
|
+
export declare const snapValuesToSteps: (values: number[], grid: StepGrid) => number[];
|
|
59
|
+
//# sourceMappingURL=sliderUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliderUtils.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/sliderUtils.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAA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AQ,KACb,MAAM,EAAkE,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { KdsFormFieldProps } from '../types';
|
|
2
|
+
import { kdsSliderTickMode } from './enums';
|
|
3
|
+
/**
|
|
4
|
+
* Slider tick modes for automatic tick calculation.
|
|
5
|
+
*/
|
|
6
|
+
export type KdsSliderTickMode = (typeof kdsSliderTickMode)[keyof typeof kdsSliderTickMode];
|
|
7
|
+
/**
|
|
8
|
+
* How the slider renders labelled ticks. Either one of the named modes or a
|
|
9
|
+
* positive integer for a fixed number of evenly spaced labelled ticks. On a
|
|
10
|
+
* stepped scale those ticks snap to the nearest step, so they only label
|
|
11
|
+
* values the knob can reach: they may be unevenly spaced, and ticks landing on
|
|
12
|
+
* the same step merge.
|
|
13
|
+
*/
|
|
14
|
+
export type KdsSliderTicks = KdsSliderTickMode | number;
|
|
15
|
+
type KdsSliderCommonProps = {
|
|
16
|
+
/**
|
|
17
|
+
* Minimum value of the scale. When it is not smaller than `max`, the slider shows
|
|
18
|
+
* an error and is disabled.
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
min?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum value of the scale.
|
|
24
|
+
* @default 100
|
|
25
|
+
*/
|
|
26
|
+
max?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Step size. When set, the knob snaps from step to step. Value precision is 15
|
|
29
|
+
* significant digits, so step size has a minimum based on the range:
|
|
30
|
+
* `1e-14` for `0` to `1`, `1e-11` up to `1000`.
|
|
31
|
+
* When omitted, the scale is continuous and the knob moves
|
|
32
|
+
* freely between `min` and `max`.
|
|
33
|
+
*/
|
|
34
|
+
step?: number;
|
|
35
|
+
/** Disable all interaction and render the slider greyed out. */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Text placed before the value in the tooltip, e.g. a currency symbol `"$ "`.
|
|
39
|
+
*/
|
|
40
|
+
tooltipPrefix?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Text placed after the value in the tooltip, e.g. a unit `" %"` or `" kg"`.
|
|
43
|
+
*/
|
|
44
|
+
tooltipSuffix?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Text placed before the value in the tick labels, e.g. a currency
|
|
47
|
+
* symbol `"$ "`.
|
|
48
|
+
*/
|
|
49
|
+
labelPrefix?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Text placed after the value in the tick labels, e.g. a unit `" %"`
|
|
52
|
+
* or `" kg"`.
|
|
53
|
+
*/
|
|
54
|
+
labelSuffix?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Which labelled ticks to render. Defaults to `"everyStep"` for a stepped
|
|
57
|
+
* scale and `"minMax"` for a continuous scale.
|
|
58
|
+
*/
|
|
59
|
+
ticks?: KdsSliderTicks;
|
|
60
|
+
/**
|
|
61
|
+
* Increment used by the `Page Up` / `Page Down` keys. Defaults to roughly 10%
|
|
62
|
+
* of the range. On a stepped scale the knob always moves in whole multiples of
|
|
63
|
+
* `step`: the page step is rounded up to the next multiple, so a value smaller
|
|
64
|
+
* than `step` moves one step.
|
|
65
|
+
*/
|
|
66
|
+
pageStep?: number;
|
|
67
|
+
};
|
|
68
|
+
export type KdsSliderProps = KdsSliderCommonProps & KdsFormFieldProps;
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAExD,KAAK,oBAAoB,GAAG;IAC1B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ref, ShallowRef } from 'vue';
|
|
2
|
+
import { useSliderScale } from './useSliderScale';
|
|
3
|
+
type UseSliderInteractionOptions = {
|
|
4
|
+
scale: ReturnType<typeof useSliderScale>;
|
|
5
|
+
disabled: Readonly<Ref<boolean>>;
|
|
6
|
+
trackElement: Readonly<ShallowRef<HTMLElement | null>>;
|
|
7
|
+
knobElement: Readonly<ShallowRef<HTMLElement | null>>;
|
|
8
|
+
};
|
|
9
|
+
/** Pointer and keyboard interaction of the slider knob. */
|
|
10
|
+
export declare const useSliderInteraction: ({ scale, disabled, trackElement, knobElement, }: UseSliderInteractionOptions) => {
|
|
11
|
+
focusKnob: (options?: FocusOptions) => void | undefined;
|
|
12
|
+
suppressFocusRing: Ref<boolean, boolean>;
|
|
13
|
+
onTrackPointerdown: (event: PointerEvent) => void;
|
|
14
|
+
onTrackPointermove: (event: PointerEvent) => void;
|
|
15
|
+
endDrag: (event: PointerEvent) => void;
|
|
16
|
+
onKnobKeydown: (event: KeyboardEvent) => void;
|
|
17
|
+
onKnobBlur: () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=useSliderInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSliderInteraction.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/useSliderInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAAc,MAAM,KAAK,CAAC;AAK5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOvD,KAAK,2BAA2B,GAAG;IACjC,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IACzC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACjC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;IACvD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;CACvD,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,GAAI,iDAKlC,2BAA2B;0BAIC,YAAY;;gCAqFN,YAAY;;qBAWvB,YAAY;2BAqBN,aAAa;;CAyC5C,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
type UseSliderScaleOptions = {
|
|
3
|
+
min: Readonly<Ref<number>>;
|
|
4
|
+
max: Readonly<Ref<number>>;
|
|
5
|
+
step: Readonly<Ref<number | undefined>>;
|
|
6
|
+
pageStep: Readonly<Ref<number | undefined>>;
|
|
7
|
+
tooltipPrefix: Readonly<Ref<string | undefined>>;
|
|
8
|
+
tooltipSuffix: Readonly<Ref<string | undefined>>;
|
|
9
|
+
labelPrefix: Readonly<Ref<string | undefined>>;
|
|
10
|
+
labelSuffix: Readonly<Ref<string | undefined>>;
|
|
11
|
+
model: Ref<number | undefined>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The slider's numeric scale: clamps the model value onto `[min, max]`, snaps to
|
|
15
|
+
* the step grid and formats positions for display.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useSliderScale: ({ min, max, step, pageStep, tooltipPrefix, tooltipSuffix, labelPrefix, labelSuffix, model, }: UseSliderScaleOptions) => {
|
|
18
|
+
isStepped: import('vue').ComputedRef<boolean>;
|
|
19
|
+
domainMin: import('vue').ComputedRef<number>;
|
|
20
|
+
domainMax: import('vue').ComputedRef<number>;
|
|
21
|
+
snapStep: import('vue').ComputedRef<number>;
|
|
22
|
+
keyStep: import('vue').ComputedRef<number>;
|
|
23
|
+
pageStepValue: import('vue').ComputedRef<number>;
|
|
24
|
+
value: import('vue').ComputedRef<number>;
|
|
25
|
+
shownValue: import('vue').ComputedRef<number>;
|
|
26
|
+
isOutOfRange: import('vue').ComputedRef<boolean>;
|
|
27
|
+
isRangeInvalid: import('vue').ComputedRef<boolean>;
|
|
28
|
+
percent: import('vue').ComputedRef<number>;
|
|
29
|
+
percentOf: (position: number) => number;
|
|
30
|
+
display: (position: number) => string;
|
|
31
|
+
displayLabel: (position: number) => string;
|
|
32
|
+
setValue: (rawValue: number) => void;
|
|
33
|
+
moveBy: (delta: number) => void;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=useSliderScale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSliderScale.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/useSliderScale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAC;AAoBzC,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3B,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACxC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC5C,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACjD,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACjD,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC/C,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC/C,KAAK,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,8FAU5B,qBAAqB;;;;;;;;;;;;0BA2EO,MAAM;wBASR,MAAM,KAAG,MAAM;6BAIV,MAAM,KAAG,MAAM;yBAGnB,MAAM;oBAeX,MAAM;CAmC9B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { KdsSliderTicks } from './types';
|
|
3
|
+
import { useSliderScale } from './useSliderScale';
|
|
4
|
+
type Tick = {
|
|
5
|
+
position: number;
|
|
6
|
+
percent: number;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
type UseSliderTicksOptions = {
|
|
10
|
+
scale: ReturnType<typeof useSliderScale>;
|
|
11
|
+
ticks: Readonly<Ref<KdsSliderTicks | undefined>>;
|
|
12
|
+
trackWidth: Readonly<Ref<number>>;
|
|
13
|
+
};
|
|
14
|
+
/** Labelled ticks below the rail, plus dense minor ticks on continuous scales. */
|
|
15
|
+
export declare const useSliderTicks: ({ scale, ticks, trackWidth, }: UseSliderTicksOptions) => {
|
|
16
|
+
labelledTicks: import('vue').ComputedRef<Tick[]>;
|
|
17
|
+
minorTicks: import('vue').ComputedRef<number[]>;
|
|
18
|
+
showTickLabel: (index: number) => boolean;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useSliderTicks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSliderTicks.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/useSliderTicks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAC;AAUzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvD,KAAK,IAAI,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IACzC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC;IACjD,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACnC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,cAAc,GAAI,+BAI5B,qBAAqB;;;2BAgEQ,MAAM,KAAG,OAAO;CAsB/C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { useSliderScale } from './useSliderScale';
|
|
3
|
+
type UseSliderTooltipOptions = {
|
|
4
|
+
scale: ReturnType<typeof useSliderScale>;
|
|
5
|
+
tooltipElement: Readonly<Ref<HTMLElement | null>>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The always-visible value tooltip.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useSliderTooltip: ({ scale, tooltipElement, }: UseSliderTooltipOptions) => {
|
|
11
|
+
text: import('vue').ComputedRef<string>;
|
|
12
|
+
center: import('vue').ComputedRef<string>;
|
|
13
|
+
width: import('vue').ComputedRef<string>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=useSliderTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSliderTooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Slider/useSliderTooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAC;AAGzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IACzC,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,4BAG9B,uBAAuB;;;;CAazB,CAAC"}
|
|
@@ -21,6 +21,8 @@ export * from './ToggleSwitch';
|
|
|
21
21
|
export type * from './ToggleSwitch';
|
|
22
22
|
export * from './RadioButton';
|
|
23
23
|
export type * from './RadioButton';
|
|
24
|
+
export * from './Slider';
|
|
25
|
+
export type * from './Slider';
|
|
24
26
|
export * from './inputs';
|
|
25
27
|
export type * from './inputs';
|
|
26
28
|
export * from './FileSelector';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D;;;;;GAKG;AACH,OAAO,EAAE,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C9B,mBAAmB,eAAe,CAAC;AAEnC,cAAc,UAAU,CAAC;AACzB,mBAAmB,UAAU,CAAC;AAE9B,cAAc,UAAU,CAAC;AACzB,mBAAmB,UAAU,CAAC;AAE9B,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,gBAAgB,CAAC;AAEpC,cAAc,YAAY,CAAC;AAC3B,mBAAmB,YAAY,CAAC;AAEhC,cAAc,WAAW,CAAC;AAC1B,mBAAmB,WAAW,CAAC;AAE/B,cAAc,uBAAuB,CAAC;AACtC,mBAAmB,uBAAuB,CAAC;AAE3C,cAAc,2BAA2B,CAAC;AAC1C,mBAAmB,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberParser.d.ts","sourceRoot":"","sources":["../../../../../../src/components/forms/inputs/NumberInput/numberParser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"numberParser.d.ts","sourceRoot":"","sources":["../../../../../../src/components/forms/inputs/NumberInput/numberParser.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C;;;OAGG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACxC,CAAC;AAMF,eAAO,MAAM,qBAAqB,GAAI,QAAQ;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,KAAG,eAgLH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownContainer.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/forms/selects/Dropdown/DropdownContainer.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DropdownContainer.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/forms/selects/Dropdown/DropdownContainer.vue"],"names":[],"mappings":"AA6KA,OAAO,KAAK,EAAE,sBAAsB,EAAqB,MAAM,SAAS,CAAC;AAEzE,KAAK,WAAW,GAAG,sBAAsB,CAAC;AA8F1C,KAAK,gBAAgB,GAAG;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAgJxD,QAAA,MAAM,YAAY;;;;;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number of digits after the decimal point, also for values in exponent
|
|
3
|
+
* notation (`1e-7` → 7, `1.23e-4` → 6, `1e+3` → 0). Non-finite values give 0.
|
|
4
|
+
*/
|
|
5
|
+
export declare const countFractionDigits: (value: number) => number;
|
|
6
|
+
//# sourceMappingURL=countFractionDigits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countFractionDigits.d.ts","sourceRoot":"","sources":["../../../src/util/countFractionDigits.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,WA2BhD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/kds-components",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.0",
|
|
4
4
|
"description": "Package containing basic Vue components of the KNIME Design System",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"vue": "~3.5.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@knime/kds-styles": "^14.
|
|
39
|
-
"@knime/utils": "^
|
|
38
|
+
"@knime/kds-styles": "^14.2.0",
|
|
39
|
+
"@knime/utils": "^4.0.0",
|
|
40
40
|
"consola": "^3.4.2",
|
|
41
41
|
"motion": "^12.42.2",
|
|
42
42
|
"temporal-polyfill": "^1.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@knime/kds-code-editor": "^14.
|
|
46
|
-
"@knime/kds-table": "^14.
|
|
45
|
+
"@knime/kds-code-editor": "^14.2.0",
|
|
46
|
+
"@knime/kds-table": "^14.2.0",
|
|
47
47
|
"@storybook/vue3-vite": "^10.6.2",
|
|
48
48
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
49
49
|
"@vue/test-utils": "^2.4.11",
|