@agnos-ui/react-bootstrap 0.7.1 → 0.8.0-next.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/components/collapse/collapse.gen.d.ts +4 -0
- package/components/slider/index.cjs +2 -1
- package/components/slider/index.js +5 -4
- package/components/slider/slider.d.ts +9 -1
- package/components/slider/slider.gen.d.ts +87 -0
- package/generated/index.d.ts +1 -0
- package/generated/utils/func.cjs +9 -0
- package/generated/utils/func.d.ts +1 -0
- package/generated/utils/func.js +1 -0
- package/index.cjs +9 -1
- package/index.js +8 -6
- package/package.json +3 -3
- package/{slider-D0knY75x.cjs → slider-DyvRcMCK.cjs} +48 -1
- package/{slider-UQlY3PHn.js → slider-vFEkaZP-.js} +51 -4
|
@@ -134,6 +134,10 @@ export interface CollapseDirectives {
|
|
|
134
134
|
* Directive to apply the collapse.
|
|
135
135
|
*/
|
|
136
136
|
collapseDirective: Directive;
|
|
137
|
+
/**
|
|
138
|
+
* Directive to apply to a trigger;
|
|
139
|
+
*/
|
|
140
|
+
triggerDirective: Directive;
|
|
137
141
|
}
|
|
138
142
|
/**
|
|
139
143
|
* Represents a widget for handling collapse functionality.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const slider = require("../../slider-
|
|
3
|
+
const slider = require("../../slider-DyvRcMCK.cjs");
|
|
4
4
|
exports.Slider = slider.Slider;
|
|
5
5
|
exports.SliderDefaultSlotHandle = slider.SliderDefaultSlotHandle;
|
|
6
6
|
exports.SliderDefaultSlotStructure = slider.SliderDefaultSlotStructure;
|
|
7
|
+
exports.SliderDefaultTick = slider.SliderDefaultTick;
|
|
7
8
|
exports.createSlider = slider.export_createSlider;
|
|
8
9
|
exports.getSliderDefaultConfig = slider.export_getSliderDefaultConfig;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c, S, b, a, d, e } from "../../slider-vFEkaZP-.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
c as Slider,
|
|
4
4
|
S as SliderDefaultSlotHandle,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
b as SliderDefaultSlotStructure,
|
|
6
|
+
a as SliderDefaultTick,
|
|
7
|
+
d as createSlider,
|
|
7
8
|
e as getSliderDefaultConfig
|
|
8
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import type { SliderContext, SliderProps, SliderSlotHandleContext } from './slider.gen';
|
|
2
|
+
import type { SliderContext, SliderProps, SliderSlotHandleContext, SliderSlotTickContext } from './slider.gen';
|
|
3
3
|
/**
|
|
4
4
|
* A functional component that renders a button element with a directive applied to it.
|
|
5
5
|
* The directive is provided through the `slotContext` parameter.
|
|
@@ -8,6 +8,14 @@ import type { SliderContext, SliderProps, SliderSlotHandleContext } from './slid
|
|
|
8
8
|
* @returns A button element with the applied directive.
|
|
9
9
|
*/
|
|
10
10
|
export declare const SliderDefaultSlotHandle: (slotContext: SliderSlotHandleContext) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* A functional component that renders a tick element with a directive applied to it.
|
|
13
|
+
* The directive is provided through the `slotContext` parameter.
|
|
14
|
+
*
|
|
15
|
+
* @param slotContext - The context object containing the directives and item for the slider tick.
|
|
16
|
+
* @returns A tick element with the applied directive.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SliderDefaultTick: (slotContext: SliderSlotTickContext) => import("react/jsx-runtime").JSX.Element;
|
|
11
19
|
/**
|
|
12
20
|
* Renders the default slot structure for the Slider component.
|
|
13
21
|
*
|
|
@@ -31,6 +31,15 @@ export interface SliderSlotHandleContext extends SliderContext {
|
|
|
31
31
|
*/
|
|
32
32
|
item: SliderHandle;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Represents the context for a slider tick slot
|
|
36
|
+
*/
|
|
37
|
+
export interface SliderSlotTickContext extends SliderContext {
|
|
38
|
+
/**
|
|
39
|
+
* tick context
|
|
40
|
+
*/
|
|
41
|
+
tick: SliderTick;
|
|
42
|
+
}
|
|
34
43
|
/**
|
|
35
44
|
* Represents the state of a slider component.
|
|
36
45
|
*/
|
|
@@ -75,6 +84,10 @@ export interface SliderState {
|
|
|
75
84
|
* Check if the slider is interactive, meaning it is not disabled or readonly
|
|
76
85
|
*/
|
|
77
86
|
interactive: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Array of ticks to display on the slider component
|
|
89
|
+
*/
|
|
90
|
+
ticks: SliderTick[];
|
|
78
91
|
/**
|
|
79
92
|
* Minimum value that can be assigned to the slider
|
|
80
93
|
*
|
|
@@ -129,6 +142,12 @@ export interface SliderState {
|
|
|
129
142
|
* @defaultValue `true`
|
|
130
143
|
*/
|
|
131
144
|
showMinMaxLabels: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* If `true` the ticks are displayed on the slider
|
|
147
|
+
*
|
|
148
|
+
* @defaultValue `false`
|
|
149
|
+
*/
|
|
150
|
+
showTicks: boolean;
|
|
132
151
|
/**
|
|
133
152
|
* It `true` slider display is inversed
|
|
134
153
|
*
|
|
@@ -158,6 +177,10 @@ export interface SliderState {
|
|
|
158
177
|
* Slot to change the handlers
|
|
159
178
|
*/
|
|
160
179
|
handle: SlotContent<SliderSlotHandleContext>;
|
|
180
|
+
/**
|
|
181
|
+
* Slot to change the ticks
|
|
182
|
+
*/
|
|
183
|
+
tick: SlotContent<SliderSlotTickContext>;
|
|
161
184
|
}
|
|
162
185
|
/**
|
|
163
186
|
* Represents the properties for the Slider component.
|
|
@@ -205,6 +228,19 @@ export interface SliderProps {
|
|
|
205
228
|
* ```
|
|
206
229
|
*/
|
|
207
230
|
onValuesChange: (values: number[]) => void;
|
|
231
|
+
/**
|
|
232
|
+
* Unit value between the ticks
|
|
233
|
+
* If value is set to `0` the {@link stepSize} is used to space the ticks
|
|
234
|
+
*
|
|
235
|
+
* @defaultValue `0`
|
|
236
|
+
*/
|
|
237
|
+
tickInterval: number;
|
|
238
|
+
/**
|
|
239
|
+
* If `true` the tick values are displayed on the slider
|
|
240
|
+
*
|
|
241
|
+
* @defaultValue `true`
|
|
242
|
+
*/
|
|
243
|
+
showTickValues: boolean;
|
|
208
244
|
/**
|
|
209
245
|
* Minimum value that can be assigned to the slider
|
|
210
246
|
*
|
|
@@ -259,6 +295,12 @@ export interface SliderProps {
|
|
|
259
295
|
* @defaultValue `true`
|
|
260
296
|
*/
|
|
261
297
|
showMinMaxLabels: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* If `true` the ticks are displayed on the slider
|
|
300
|
+
*
|
|
301
|
+
* @defaultValue `false`
|
|
302
|
+
*/
|
|
303
|
+
showTicks: boolean;
|
|
262
304
|
/**
|
|
263
305
|
* It `true` slider display is inversed
|
|
264
306
|
*
|
|
@@ -288,6 +330,10 @@ export interface SliderProps {
|
|
|
288
330
|
* Slot to change the handlers
|
|
289
331
|
*/
|
|
290
332
|
handle: SlotContent<SliderSlotHandleContext>;
|
|
333
|
+
/**
|
|
334
|
+
* Slot to change the ticks
|
|
335
|
+
*/
|
|
336
|
+
tick: SlotContent<SliderSlotTickContext>;
|
|
291
337
|
}
|
|
292
338
|
/**
|
|
293
339
|
* Represents a slider widget component.
|
|
@@ -371,6 +417,35 @@ export interface SliderHandle {
|
|
|
371
417
|
*/
|
|
372
418
|
ariaLabelledBy: string | undefined;
|
|
373
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Represents a tick in a slider component.
|
|
422
|
+
*/
|
|
423
|
+
export interface SliderTick {
|
|
424
|
+
/**
|
|
425
|
+
* CSS classes to be applied on the tick
|
|
426
|
+
*/
|
|
427
|
+
className?: string | null;
|
|
428
|
+
/**
|
|
429
|
+
* Visualized optional explanation of the label
|
|
430
|
+
*/
|
|
431
|
+
legend?: string | null;
|
|
432
|
+
/**
|
|
433
|
+
* Position of the tick in percent
|
|
434
|
+
*/
|
|
435
|
+
position: number;
|
|
436
|
+
/**
|
|
437
|
+
* If `true` the tick has selected style
|
|
438
|
+
*/
|
|
439
|
+
selected: boolean;
|
|
440
|
+
/**
|
|
441
|
+
* Value of the tick
|
|
442
|
+
*/
|
|
443
|
+
value: number;
|
|
444
|
+
/**
|
|
445
|
+
* If `true` the tick label is displayed
|
|
446
|
+
*/
|
|
447
|
+
displayLabel: boolean;
|
|
448
|
+
}
|
|
374
449
|
/**
|
|
375
450
|
* Interface representing various directives used in the slider component.
|
|
376
451
|
*/
|
|
@@ -421,4 +496,16 @@ export interface SliderDirectives {
|
|
|
421
496
|
handleLabelDisplayDirective: Directive<{
|
|
422
497
|
index: number;
|
|
423
498
|
}>;
|
|
499
|
+
/**
|
|
500
|
+
* Directive to apply to the slider tick
|
|
501
|
+
*/
|
|
502
|
+
tickDirective: Directive<{
|
|
503
|
+
tick: SliderTick;
|
|
504
|
+
}>;
|
|
505
|
+
/**
|
|
506
|
+
* Directive to apply to the slider tick label
|
|
507
|
+
*/
|
|
508
|
+
tickLabelDirective: Directive<{
|
|
509
|
+
tick: SliderTick;
|
|
510
|
+
}>;
|
|
424
511
|
}
|
package/generated/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './utils/stores';
|
|
|
7
7
|
export * from './utils/portal';
|
|
8
8
|
export * from './utils/directive';
|
|
9
9
|
export * from './utils/writables';
|
|
10
|
+
export * from './utils/func';
|
|
10
11
|
export * from './services/siblingsInert';
|
|
11
12
|
export * from './services/resizeObserver';
|
|
12
13
|
export * from './services/portal';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const func = require("@agnos-ui/react-headless/utils/func");
|
|
4
|
+
Object.keys(func).forEach((k) => {
|
|
5
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => func[k]
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agnos-ui/react-headless/utils/func';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agnos-ui/react-headless/utils/func";
|
package/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ const pagination = require("./pagination-Bq4Hvm1j.cjs");
|
|
|
8
8
|
const progressbar = require("./progressbar-CnbqCXqH.cjs");
|
|
9
9
|
const rating = require("./rating-BaZTCQi1.cjs");
|
|
10
10
|
const select = require("./select-DHNspXXB.cjs");
|
|
11
|
-
const slider = require("./slider-
|
|
11
|
+
const slider = require("./slider-DyvRcMCK.cjs");
|
|
12
12
|
const toast = require("./toast-CkwIDuRg.cjs");
|
|
13
13
|
const tree = require("./tree-DT261j-0.cjs");
|
|
14
14
|
const types = require("@agnos-ui/react-headless/types");
|
|
@@ -20,6 +20,7 @@ const stores = require("@agnos-ui/react-headless/utils/stores");
|
|
|
20
20
|
const portal = require("@agnos-ui/react-headless/utils/portal");
|
|
21
21
|
const directive = require("@agnos-ui/react-headless/utils/directive");
|
|
22
22
|
const writables = require("@agnos-ui/react-headless/utils/writables");
|
|
23
|
+
const func = require("@agnos-ui/react-headless/utils/func");
|
|
23
24
|
const siblingsInert = require("@agnos-ui/react-headless/services/siblingsInert");
|
|
24
25
|
const resizeObserver = require("@agnos-ui/react-headless/services/resizeObserver");
|
|
25
26
|
const portal$1 = require("@agnos-ui/react-headless/services/portal");
|
|
@@ -77,6 +78,7 @@ exports.getSelectDefaultConfig = select.export_getSelectDefaultConfig;
|
|
|
77
78
|
exports.Slider = slider.Slider;
|
|
78
79
|
exports.SliderDefaultSlotHandle = slider.SliderDefaultSlotHandle;
|
|
79
80
|
exports.SliderDefaultSlotStructure = slider.SliderDefaultSlotStructure;
|
|
81
|
+
exports.SliderDefaultTick = slider.SliderDefaultTick;
|
|
80
82
|
exports.createSlider = slider.export_createSlider;
|
|
81
83
|
exports.getSliderDefaultConfig = slider.export_getSliderDefaultConfig;
|
|
82
84
|
exports.Toast = toast.Toast;
|
|
@@ -142,6 +144,12 @@ Object.keys(writables).forEach((k) => {
|
|
|
142
144
|
get: () => writables[k]
|
|
143
145
|
});
|
|
144
146
|
});
|
|
147
|
+
Object.keys(func).forEach((k) => {
|
|
148
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: () => func[k]
|
|
151
|
+
});
|
|
152
|
+
});
|
|
145
153
|
Object.keys(siblingsInert).forEach((k) => {
|
|
146
154
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
147
155
|
enumerable: true,
|
package/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { N, P, c as c3, a as a5, b as b4, d as d3, e as e5 } from "./pagination-
|
|
|
6
6
|
import { a as a6, P as P2, b as b5, e as e6 } from "./progressbar-Ck20N_ee.js";
|
|
7
7
|
import { R, a as a7, e as e7 } from "./rating-DziC4Tsh.js";
|
|
8
8
|
import { S, a as a8, e as e8 } from "./select-C2jCf6jT.js";
|
|
9
|
-
import {
|
|
9
|
+
import { c as c4, S as S2, b as b6, a as a9, d as d4, e as e9 } from "./slider-vFEkaZP-.js";
|
|
10
10
|
import { a as a10, T, b as b7, e as e10 } from "./toast-BUHjCme7.js";
|
|
11
|
-
import { b as b8, a as a11, D, c as c5, T as T2, d as
|
|
11
|
+
import { b as b8, a as a11, D, c as c5, T as T2, d as d5, e as e11 } from "./tree-BflF5hyD.js";
|
|
12
12
|
export * from "@agnos-ui/react-headless/types";
|
|
13
13
|
export * from "@agnos-ui/react-headless/slot";
|
|
14
14
|
export * from "@agnos-ui/react-headless/config";
|
|
@@ -18,6 +18,7 @@ export * from "@agnos-ui/react-headless/utils/stores";
|
|
|
18
18
|
export * from "@agnos-ui/react-headless/utils/portal";
|
|
19
19
|
export * from "@agnos-ui/react-headless/utils/directive";
|
|
20
20
|
export * from "@agnos-ui/react-headless/utils/writables";
|
|
21
|
+
export * from "@agnos-ui/react-headless/utils/func";
|
|
21
22
|
export * from "@agnos-ui/react-headless/services/siblingsInert";
|
|
22
23
|
export * from "@agnos-ui/react-headless/services/resizeObserver";
|
|
23
24
|
export * from "@agnos-ui/react-headless/services/portal";
|
|
@@ -56,9 +57,10 @@ export {
|
|
|
56
57
|
P2 as ProgressbarDefaultSlotStructure,
|
|
57
58
|
R as Rating,
|
|
58
59
|
S as Select,
|
|
59
|
-
|
|
60
|
+
c4 as Slider,
|
|
60
61
|
S2 as SliderDefaultSlotHandle,
|
|
61
|
-
|
|
62
|
+
b6 as SliderDefaultSlotStructure,
|
|
63
|
+
a9 as SliderDefaultTick,
|
|
62
64
|
a10 as Toast,
|
|
63
65
|
T as ToastDefaultSlotStructure,
|
|
64
66
|
T2 as Tree,
|
|
@@ -73,9 +75,9 @@ export {
|
|
|
73
75
|
b5 as createProgressbar,
|
|
74
76
|
a7 as createRating,
|
|
75
77
|
a8 as createSelect,
|
|
76
|
-
|
|
78
|
+
d4 as createSlider,
|
|
77
79
|
b7 as createToast,
|
|
78
|
-
|
|
80
|
+
d5 as createTree,
|
|
79
81
|
f as factoryCreateAccordion,
|
|
80
82
|
e as getAccordionDefaultConfig,
|
|
81
83
|
e2 as getAlertDefaultConfig,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/react-bootstrap",
|
|
3
3
|
"description": "Bootstrap-based component library for React.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.8.0-next.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@agnos-ui/core-bootstrap": "0.
|
|
53
|
-
"@agnos-ui/react-headless": "0.
|
|
52
|
+
"@agnos-ui/core-bootstrap": "0.8.0-next.0",
|
|
53
|
+
"@agnos-ui/react-headless": "0.8.0-next.0",
|
|
54
54
|
"clsx": "^2.1.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
@@ -10,6 +10,50 @@ const export_createSlider = slider.createSlider;
|
|
|
10
10
|
const SliderDefaultSlotHandle = (slotContext) => {
|
|
11
11
|
return /* @__PURE__ */ jsxRuntime.jsx("button", { ...directive.useDirective(slotContext.directives.handleDirective, { item: slotContext.item }), children: " " });
|
|
12
12
|
};
|
|
13
|
+
const TickLabelDisplay = ({ directive: directive$1, tick }) => {
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { ...directive.useDirective(directive$1, { tick }), children: tick.value });
|
|
15
|
+
};
|
|
16
|
+
const SliderDefaultTick = (slotContext) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17
|
+
slotContext.tick.displayLabel && /* @__PURE__ */ jsxRuntime.jsx(TickLabelDisplay, { directive: slotContext.directives.tickLabelDirective, tick: slotContext.tick }),
|
|
18
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { ...directive.useDirective(slotContext.directives.tickDirective, { tick: slotContext.tick }), children: slotContext.tick.selected ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19
|
+
"svg",
|
|
20
|
+
{
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
style: { width: "var(--bs-slider-tick-secondary-size)", height: "var(--bs-slider-tick-primary-size)" },
|
|
23
|
+
fill: "none",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
+
"circle",
|
|
27
|
+
{
|
|
28
|
+
cx: "50%",
|
|
29
|
+
cy: "50%",
|
|
30
|
+
r: "50%",
|
|
31
|
+
fill: slotContext.state.disabled ? "var(--bs-slider-tick-disabled-color)" : "var(--bs-slider-tick-selected-color)"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "50%", cy: "50%", r: "25%", fill: "white" })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
"svg",
|
|
39
|
+
{
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
style: { width: "var(--bs-slider-tick-secondary-size)", height: "var(--bs-slider-tick-primary-size)" },
|
|
42
|
+
fill: "none",
|
|
43
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
+
"circle",
|
|
45
|
+
{
|
|
46
|
+
cx: "50%",
|
|
47
|
+
cy: "50%",
|
|
48
|
+
r: "45%",
|
|
49
|
+
fill: "white",
|
|
50
|
+
stroke: slotContext.state.disabled ? "var(--bs-slider-tick-disabled-color)" : "var(--bs-slider-tick-neutral-color)",
|
|
51
|
+
strokeWidth: "1.5"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
) })
|
|
56
|
+
] });
|
|
13
57
|
const ProgressDisplay = ({ directive: directive$1, option }) => {
|
|
14
58
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(directive$1, { option }) });
|
|
15
59
|
};
|
|
@@ -38,6 +82,7 @@ const SliderDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.j
|
|
|
38
82
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(slotContext.directives.clickableAreaDirective) }),
|
|
39
83
|
slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsxRuntime.jsx(MinMaxLabels, { ...slotContext }),
|
|
40
84
|
slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(CombinedLabel, { ...slotContext }),
|
|
85
|
+
slotContext.state.ticks.map((tick) => /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.tick, props: { tick, ...slotContext } }, tick.position)),
|
|
41
86
|
slotContext.state.sortedHandles.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
42
87
|
/* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.handle, props: { item, ...slotContext } }),
|
|
43
88
|
slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsxRuntime.jsx(HandleLabelDisplay, { directive: slotContext.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
|
|
@@ -46,12 +91,14 @@ const SliderDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxRuntime.j
|
|
|
46
91
|
function Slider(props) {
|
|
47
92
|
const widgetContext = generated_config.useWidgetWithConfig(export_createSlider, props, "slider", {
|
|
48
93
|
structure: SliderDefaultSlotStructure,
|
|
49
|
-
handle: SliderDefaultSlotHandle
|
|
94
|
+
handle: SliderDefaultSlotHandle,
|
|
95
|
+
tick: SliderDefaultTick
|
|
50
96
|
});
|
|
51
97
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...directive.useDirective(widgetContext.directives.sliderDirective), children: /* @__PURE__ */ jsxRuntime.jsx(slot.Slot, { slotContent: widgetContext.state.structure, props: widgetContext }) });
|
|
52
98
|
}
|
|
53
99
|
exports.Slider = Slider;
|
|
54
100
|
exports.SliderDefaultSlotHandle = SliderDefaultSlotHandle;
|
|
55
101
|
exports.SliderDefaultSlotStructure = SliderDefaultSlotStructure;
|
|
102
|
+
exports.SliderDefaultTick = SliderDefaultTick;
|
|
56
103
|
exports.export_createSlider = export_createSlider;
|
|
57
104
|
exports.export_getSliderDefaultConfig = export_getSliderDefaultConfig;
|
|
@@ -9,6 +9,50 @@ const export_createSlider = createSlider;
|
|
|
9
9
|
const SliderDefaultSlotHandle = (slotContext) => {
|
|
10
10
|
return /* @__PURE__ */ jsx("button", { ...useDirective(slotContext.directives.handleDirective, { item: slotContext.item }), children: " " });
|
|
11
11
|
};
|
|
12
|
+
const TickLabelDisplay = ({ directive, tick }) => {
|
|
13
|
+
return /* @__PURE__ */ jsx("span", { ...useDirective(directive, { tick }), children: tick.value });
|
|
14
|
+
};
|
|
15
|
+
const SliderDefaultTick = (slotContext) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
slotContext.tick.displayLabel && /* @__PURE__ */ jsx(TickLabelDisplay, { directive: slotContext.directives.tickLabelDirective, tick: slotContext.tick }),
|
|
17
|
+
/* @__PURE__ */ jsx("span", { ...useDirective(slotContext.directives.tickDirective, { tick: slotContext.tick }), children: slotContext.tick.selected ? /* @__PURE__ */ jsxs(
|
|
18
|
+
"svg",
|
|
19
|
+
{
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
+
style: { width: "var(--bs-slider-tick-secondary-size)", height: "var(--bs-slider-tick-primary-size)" },
|
|
22
|
+
fill: "none",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
"circle",
|
|
26
|
+
{
|
|
27
|
+
cx: "50%",
|
|
28
|
+
cy: "50%",
|
|
29
|
+
r: "50%",
|
|
30
|
+
fill: slotContext.state.disabled ? "var(--bs-slider-tick-disabled-color)" : "var(--bs-slider-tick-selected-color)"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx("circle", { cx: "50%", cy: "50%", r: "25%", fill: "white" })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
) : /* @__PURE__ */ jsx(
|
|
37
|
+
"svg",
|
|
38
|
+
{
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
+
style: { width: "var(--bs-slider-tick-secondary-size)", height: "var(--bs-slider-tick-primary-size)" },
|
|
41
|
+
fill: "none",
|
|
42
|
+
children: /* @__PURE__ */ jsx(
|
|
43
|
+
"circle",
|
|
44
|
+
{
|
|
45
|
+
cx: "50%",
|
|
46
|
+
cy: "50%",
|
|
47
|
+
r: "45%",
|
|
48
|
+
fill: "white",
|
|
49
|
+
stroke: slotContext.state.disabled ? "var(--bs-slider-tick-disabled-color)" : "var(--bs-slider-tick-neutral-color)",
|
|
50
|
+
strokeWidth: "1.5"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
) })
|
|
55
|
+
] });
|
|
12
56
|
const ProgressDisplay = ({ directive, option }) => {
|
|
13
57
|
return /* @__PURE__ */ jsx("div", { ...useDirective(directive, { option }) });
|
|
14
58
|
};
|
|
@@ -37,6 +81,7 @@ const SliderDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragmen
|
|
|
37
81
|
/* @__PURE__ */ jsx("div", { ...useDirective(slotContext.directives.clickableAreaDirective) }),
|
|
38
82
|
slotContext.state.showMinMaxLabels && /* @__PURE__ */ jsx(MinMaxLabels, { ...slotContext }),
|
|
39
83
|
slotContext.state.showValueLabels && slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(CombinedLabel, { ...slotContext }),
|
|
84
|
+
slotContext.state.ticks.map((tick) => /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.tick, props: { tick, ...slotContext } }, tick.position)),
|
|
40
85
|
slotContext.state.sortedHandles.map((item, i) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
41
86
|
/* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.handle, props: { item, ...slotContext } }),
|
|
42
87
|
slotContext.state.showValueLabels && !slotContext.state.combinedLabelDisplay && /* @__PURE__ */ jsx(HandleLabelDisplay, { directive: slotContext.directives.handleLabelDisplayDirective, index: i, children: /* @__PURE__ */ jsx(Slot, { slotContent: slotContext.state.label, props: { value: slotContext.state.values[i], ...slotContext } }) })
|
|
@@ -45,14 +90,16 @@ const SliderDefaultSlotStructure = (slotContext) => /* @__PURE__ */ jsxs(Fragmen
|
|
|
45
90
|
function Slider(props) {
|
|
46
91
|
const widgetContext = useWidgetWithConfig(export_createSlider, props, "slider", {
|
|
47
92
|
structure: SliderDefaultSlotStructure,
|
|
48
|
-
handle: SliderDefaultSlotHandle
|
|
93
|
+
handle: SliderDefaultSlotHandle,
|
|
94
|
+
tick: SliderDefaultTick
|
|
49
95
|
});
|
|
50
96
|
return /* @__PURE__ */ jsx("div", { ...useDirective(widgetContext.directives.sliderDirective), children: /* @__PURE__ */ jsx(Slot, { slotContent: widgetContext.state.structure, props: widgetContext }) });
|
|
51
97
|
}
|
|
52
98
|
export {
|
|
53
99
|
SliderDefaultSlotHandle as S,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
100
|
+
SliderDefaultTick as a,
|
|
101
|
+
SliderDefaultSlotStructure as b,
|
|
102
|
+
Slider as c,
|
|
103
|
+
export_createSlider as d,
|
|
57
104
|
export_getSliderDefaultConfig as e
|
|
58
105
|
};
|