@neo4j-ndl/react 3.8.34 → 3.8.35
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/lib/cjs/context-menu/ContextMenu.js +1 -1
- package/lib/cjs/slider/stories/index.js +25 -5
- package/lib/cjs/slider/stories/index.js.map +1 -1
- package/lib/cjs/slider/stories/slider-custom-step-length.story.js +31 -0
- package/lib/cjs/slider/stories/slider-custom-step-length.story.js.map +1 -0
- package/lib/cjs/slider/stories/slider-default.story.js +31 -0
- package/lib/cjs/slider/stories/slider-default.story.js.map +1 -0
- package/lib/cjs/slider/stories/slider-disabled.story.js +31 -0
- package/lib/cjs/slider/stories/slider-disabled.story.js.map +1 -0
- package/lib/cjs/slider/stories/slider-range.story.js +2 -2
- package/lib/cjs/slider/stories/slider-range.story.js.map +1 -1
- package/lib/cjs/slider/stories/slider-show-steps.story.js +31 -0
- package/lib/cjs/slider/stories/slider-show-steps.story.js.map +1 -0
- package/lib/cjs/slider/stories/slider-show-values.story.js +31 -0
- package/lib/cjs/slider/stories/slider-show-values.story.js.map +1 -0
- package/lib/cjs/slider/stories/slider-single-controlled.story.js +49 -6
- package/lib/cjs/slider/stories/slider-single-controlled.story.js.map +1 -1
- package/lib/cjs/slider/stories/slider-single.story.js +2 -2
- package/lib/cjs/slider/stories/slider-single.story.js.map +1 -1
- package/lib/cjs/slider/stories/slider.stories.js +76 -7
- package/lib/cjs/slider/stories/slider.stories.js.map +1 -1
- package/lib/esm/context-menu/ContextMenu.js +1 -1
- package/lib/esm/slider/stories/index.js +15 -0
- package/lib/esm/slider/stories/index.js.map +1 -1
- package/lib/esm/slider/stories/slider-custom-step-length.story.js +29 -0
- package/lib/esm/slider/stories/slider-custom-step-length.story.js.map +1 -0
- package/lib/esm/slider/stories/slider-default.story.js +29 -0
- package/lib/esm/slider/stories/slider-default.story.js.map +1 -0
- package/lib/esm/slider/stories/slider-disabled.story.js +29 -0
- package/lib/esm/slider/stories/slider-disabled.story.js.map +1 -0
- package/lib/esm/slider/stories/slider-range.story.js +1 -1
- package/lib/esm/slider/stories/slider-range.story.js.map +1 -1
- package/lib/esm/slider/stories/slider-show-steps.story.js +29 -0
- package/lib/esm/slider/stories/slider-show-steps.story.js.map +1 -0
- package/lib/esm/slider/stories/slider-show-values.story.js +29 -0
- package/lib/esm/slider/stories/slider-show-values.story.js.map +1 -0
- package/lib/esm/slider/stories/slider-single-controlled.story.js +50 -7
- package/lib/esm/slider/stories/slider-single-controlled.story.js.map +1 -1
- package/lib/esm/slider/stories/slider-single.story.js +1 -1
- package/lib/esm/slider/stories/slider-single.story.js.map +1 -1
- package/lib/esm/slider/stories/slider.stories.js +73 -4
- package/lib/esm/slider/stories/slider.stories.js.map +1 -1
- package/lib/types/slider/stories/index.d.ts +10 -0
- package/lib/types/slider/stories/slider-custom-step-length.story.d.ts +23 -0
- package/lib/types/slider/stories/slider-default.story.d.ts +23 -0
- package/lib/types/slider/stories/slider-disabled.story.d.ts +23 -0
- package/lib/types/slider/stories/slider-show-steps.story.d.ts +23 -0
- package/lib/types/slider/stories/slider-show-values.story.d.ts +23 -0
- package/lib/types/slider/stories/slider-single.story.d.ts +1 -0
- package/lib/types/slider/stories/slider.stories.d.ts +7 -1
- package/package.json +1 -1
|
@@ -202,7 +202,7 @@ const MenuComponent = (0, react_2.forwardRef)(function MenuComponent({ children,
|
|
|
202
202
|
isOpen: isDisabled === true ? false : isOpen,
|
|
203
203
|
setActiveIndex,
|
|
204
204
|
setHasFocusInside,
|
|
205
|
-
}, children: (0, jsx_runtime_1.jsx)(react_1.FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { root: portalTarget, children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: isNested ? -1 :
|
|
205
|
+
}, children: (0, jsx_runtime_1.jsx)(react_1.FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { root: portalTarget, children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: isNested ? -1 : 0, returnFocus: !isNested, closeOnFocusOut: true, guards: true, children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ ref: refs.setFloating, className: menuClasses, style: Object.assign({ minWidth: minWidth !== undefined ? `${minWidth}px` : undefined }, floatingStyles) }, getFloatingProps(), { children: children })) }) })) }) })] }));
|
|
206
206
|
});
|
|
207
207
|
const MenuItem = (0, react_2.forwardRef)(function MenuItem({ title, className, style, icon, description, isDisabled, as, onClick, onFocus, htmlAttributes, id, }, forwardedRef) {
|
|
208
208
|
const menu = (0, react_2.useContext)(MenuContext);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SliderCustomStepLengthSource = exports.SliderShowValuesSource = exports.SliderShowStepsSource = exports.SliderDisabledSource = exports.SliderSingleControlledSource = exports.SliderRangeSource = exports.SliderSingleSource = exports.SliderDefaultSource = exports.SliderCustomStepLengthDemo = exports.SliderShowValuesDemo = exports.SliderShowStepsDemo = exports.SliderDisabledDemo = exports.SliderSingleControlledDemo = exports.SliderRangeDemo = exports.SliderSingleDemo = exports.SliderDefaultDemo = void 0;
|
|
2
7
|
/**
|
|
3
8
|
*
|
|
4
9
|
* Copyright (c) "Neo4j"
|
|
@@ -19,22 +24,37 @@
|
|
|
19
24
|
* You should have received a copy of the GNU General Public License
|
|
20
25
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
26
|
*/
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.SliderSingleControlledSource = exports.SliderRangeSource = exports.SliderSingleSource = exports.SliderSingleControlledDemo = exports.SliderRangeDemo = exports.SliderSingleDemo = void 0;
|
|
27
|
+
var slider_default_story_1 = require("./slider-default.story");
|
|
28
|
+
Object.defineProperty(exports, "SliderDefaultDemo", { enumerable: true, get: function () { return __importDefault(slider_default_story_1).default; } });
|
|
27
29
|
var slider_single_story_1 = require("./slider-single.story");
|
|
28
30
|
Object.defineProperty(exports, "SliderSingleDemo", { enumerable: true, get: function () { return __importDefault(slider_single_story_1).default; } });
|
|
29
31
|
var slider_range_story_1 = require("./slider-range.story");
|
|
30
32
|
Object.defineProperty(exports, "SliderRangeDemo", { enumerable: true, get: function () { return __importDefault(slider_range_story_1).default; } });
|
|
31
33
|
var slider_single_controlled_story_1 = require("./slider-single-controlled.story");
|
|
32
34
|
Object.defineProperty(exports, "SliderSingleControlledDemo", { enumerable: true, get: function () { return __importDefault(slider_single_controlled_story_1).default; } });
|
|
35
|
+
var slider_disabled_story_1 = require("./slider-disabled.story");
|
|
36
|
+
Object.defineProperty(exports, "SliderDisabledDemo", { enumerable: true, get: function () { return __importDefault(slider_disabled_story_1).default; } });
|
|
37
|
+
var slider_show_steps_story_1 = require("./slider-show-steps.story");
|
|
38
|
+
Object.defineProperty(exports, "SliderShowStepsDemo", { enumerable: true, get: function () { return __importDefault(slider_show_steps_story_1).default; } });
|
|
39
|
+
var slider_show_values_story_1 = require("./slider-show-values.story");
|
|
40
|
+
Object.defineProperty(exports, "SliderShowValuesDemo", { enumerable: true, get: function () { return __importDefault(slider_show_values_story_1).default; } });
|
|
41
|
+
var slider_custom_step_length_story_1 = require("./slider-custom-step-length.story");
|
|
42
|
+
Object.defineProperty(exports, "SliderCustomStepLengthDemo", { enumerable: true, get: function () { return __importDefault(slider_custom_step_length_story_1).default; } });
|
|
33
43
|
const export_stories_utils_1 = require("@neo4j-ndl/react/_common/export-stories-utils");
|
|
44
|
+
const slider_custom_step_length_story_tsx_raw_1 = __importDefault(require("./slider-custom-step-length.story.tsx?raw"));
|
|
45
|
+
const slider_default_story_tsx_raw_1 = __importDefault(require("./slider-default.story.tsx?raw"));
|
|
46
|
+
const slider_disabled_story_tsx_raw_1 = __importDefault(require("./slider-disabled.story.tsx?raw"));
|
|
34
47
|
const slider_range_story_tsx_raw_1 = __importDefault(require("./slider-range.story.tsx?raw"));
|
|
48
|
+
const slider_show_steps_story_tsx_raw_1 = __importDefault(require("./slider-show-steps.story.tsx?raw"));
|
|
49
|
+
const slider_show_values_story_tsx_raw_1 = __importDefault(require("./slider-show-values.story.tsx?raw"));
|
|
35
50
|
const slider_single_story_tsx_raw_1 = __importDefault(require("./slider-single.story.tsx?raw"));
|
|
36
51
|
const slider_single_controlled_story_tsx_raw_1 = __importDefault(require("./slider-single-controlled.story.tsx?raw"));
|
|
52
|
+
exports.SliderDefaultSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_default_story_tsx_raw_1.default);
|
|
37
53
|
exports.SliderSingleSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_single_story_tsx_raw_1.default);
|
|
38
54
|
exports.SliderRangeSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_range_story_tsx_raw_1.default);
|
|
39
55
|
exports.SliderSingleControlledSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_single_controlled_story_tsx_raw_1.default);
|
|
56
|
+
exports.SliderDisabledSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_disabled_story_tsx_raw_1.default);
|
|
57
|
+
exports.SliderShowStepsSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_show_steps_story_tsx_raw_1.default);
|
|
58
|
+
exports.SliderShowValuesSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_show_values_story_tsx_raw_1.default);
|
|
59
|
+
exports.SliderCustomStepLengthSource = (0, export_stories_utils_1.removeLicenseHeader)(slider_custom_step_length_story_tsx_raw_1.default);
|
|
40
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/slider/stories/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/slider/stories/index.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,+DAAsE;AAA7D,0IAAA,OAAO,OAAqB;AACrC,6DAAoE;AAA3D,wIAAA,OAAO,OAAoB;AACpC,2DAAkE;AAAzD,sIAAA,OAAO,OAAmB;AACnC,mFAAyF;AAAhF,6JAAA,OAAO,OAA8B;AAC9C,iEAAwE;AAA/D,4IAAA,OAAO,OAAsB;AACtC,qEAA2E;AAAlE,+IAAA,OAAO,OAAuB;AACvC,uEAA6E;AAApE,iJAAA,OAAO,OAAwB;AACxC,qFAA0F;AAAjF,8JAAA,OAAO,OAA8B;AAE9C,wFAAoF;AAEpF,wHAAwF;AACxF,kGAAoE;AACpE,oGAAsE;AACtE,8FAAgE;AAChE,wGAAyE;AACzE,0GAA2E;AAC3E,gGAAkE;AAClE,sHAAuF;AAE1E,QAAA,mBAAmB,GAAG,IAAA,0CAAmB,EAAC,sCAAsB,CAAC,CAAC;AAClE,QAAA,kBAAkB,GAAG,IAAA,0CAAmB,EAAC,qCAAqB,CAAC,CAAC;AAChE,QAAA,iBAAiB,GAAG,IAAA,0CAAmB,EAAC,oCAAoB,CAAC,CAAC;AAC9D,QAAA,4BAA4B,GAAG,IAAA,0CAAmB,EAC7D,gDAA+B,CAChC,CAAC;AACW,QAAA,oBAAoB,GAAG,IAAA,0CAAmB,EACrD,uCAAuB,CACxB,CAAC;AACW,QAAA,qBAAqB,GAAG,IAAA,0CAAmB,EACtD,yCAAwB,CACzB,CAAC;AACW,QAAA,sBAAsB,GAAG,IAAA,0CAAmB,EACvD,0CAAyB,CAC1B,CAAC;AACW,QAAA,4BAA4B,GAAG,IAAA,0CAAmB,EAC7D,iDAA+B,CAChC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
|
+
const Component = () => {
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Slider, { minValue: 0, maxValue: 100, step: 10, value: 50, onChange: (newValue) => {
|
|
27
|
+
console.info('onChange', newValue);
|
|
28
|
+
}, showSteps: true, showValues: true }));
|
|
29
|
+
};
|
|
30
|
+
exports.default = Component;
|
|
31
|
+
//# sourceMappingURL=slider-custom-step-length.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-custom-step-length.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-custom-step-length.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,cAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,SAAS,QACT,UAAU,SACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
|
+
const Component = () => {
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Slider, { minValue: 0, maxValue: 100, value: 50, onChange: (newValue) => {
|
|
27
|
+
console.info('onChange', newValue);
|
|
28
|
+
} }));
|
|
29
|
+
};
|
|
30
|
+
exports.default = Component;
|
|
31
|
+
//# sourceMappingURL=slider-default.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-default.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,cAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
|
+
const Component = () => {
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Slider, { minValue: 0, maxValue: 100, step: 10, value: 50, onChange: (newValue) => {
|
|
27
|
+
console.info('onChange', newValue);
|
|
28
|
+
}, isDisabled: true }));
|
|
29
|
+
};
|
|
30
|
+
exports.default = Component;
|
|
31
|
+
//# sourceMappingURL=slider-disabled.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-disabled.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-disabled.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,cAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,UAAU,SACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -21,9 +21,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
21
21
|
* You should have received a copy of the GNU General Public License
|
|
22
22
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
25
|
const Component = () => {
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Slider, { type: "range", values: [10, 50], onChange: (newValue) => {
|
|
27
27
|
console.info('onChange', newValue);
|
|
28
28
|
}, minValue: 0, maxValue: 200, step: 10, isDisabled: false, showSteps: true, showValues: true }));
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-range.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-range.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,
|
|
1
|
+
{"version":3,"file":"slider-range.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-range.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,cAAM,IACL,IAAI,EAAC,OAAO,EACZ,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAChB,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,EAAE,EACR,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,IAAI,EACf,UAAU,EAAE,IAAI,GAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
|
+
const Component = () => {
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Slider, { minValue: 0, maxValue: 100, value: 50, onChange: (newValue) => {
|
|
27
|
+
console.info('onChange', newValue);
|
|
28
|
+
}, showSteps: true }));
|
|
29
|
+
};
|
|
30
|
+
exports.default = Component;
|
|
31
|
+
//# sourceMappingURL=slider-show-steps.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-show-steps.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-show-steps.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,cAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,SAAS,SACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
|
+
const Component = () => {
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Slider, { minValue: 0, maxValue: 100, value: 50, onChange: (newValue) => {
|
|
27
|
+
console.info('onChange', newValue);
|
|
28
|
+
}, showValues: true }));
|
|
29
|
+
};
|
|
30
|
+
exports.default = Component;
|
|
31
|
+
//# sourceMappingURL=slider-show-values.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-show-values.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-show-values.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,cAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,UAAU,SACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -21,13 +21,56 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
21
21
|
* You should have received a copy of the GNU General Public License
|
|
22
22
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
23
|
*/
|
|
24
|
-
const react_1 = require("react");
|
|
25
|
-
const
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
|
+
const react_2 = require("react");
|
|
26
|
+
const MIN_VALUE = 0;
|
|
27
|
+
const MAX_VALUE = 100;
|
|
28
|
+
const STEP = 5;
|
|
29
|
+
const INITIAL_VALUE = 50;
|
|
30
|
+
const getValidationError = (input) => {
|
|
31
|
+
const trimmed = input.trim();
|
|
32
|
+
if (!trimmed) {
|
|
33
|
+
return { error: 'Value is required', isValid: false };
|
|
34
|
+
}
|
|
35
|
+
const numValue = Number(trimmed);
|
|
36
|
+
if (isNaN(numValue)) {
|
|
37
|
+
return { error: 'Please enter a valid number', isValid: false };
|
|
38
|
+
}
|
|
39
|
+
if (!Number.isInteger(numValue)) {
|
|
40
|
+
return { error: 'Please enter a whole number', isValid: false };
|
|
41
|
+
}
|
|
42
|
+
if (numValue < MIN_VALUE) {
|
|
43
|
+
return { error: `Value must be at least ${MIN_VALUE}`, isValid: false };
|
|
44
|
+
}
|
|
45
|
+
if (numValue > MAX_VALUE) {
|
|
46
|
+
return { error: `Value must be at most ${MAX_VALUE}`, isValid: false };
|
|
47
|
+
}
|
|
48
|
+
return { error: undefined, isValid: true };
|
|
49
|
+
};
|
|
26
50
|
const Component = () => {
|
|
27
|
-
const [value, setValue] = (0,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
51
|
+
const [value, setValue] = (0, react_2.useState)(INITIAL_VALUE);
|
|
52
|
+
const [inputValue, setInputValue] = (0, react_2.useState)(String(INITIAL_VALUE));
|
|
53
|
+
const { error, isValid } = getValidationError(inputValue);
|
|
54
|
+
const hasError = !isValid;
|
|
55
|
+
const handleInputChange = (0, react_2.useCallback)((e) => {
|
|
56
|
+
const newInputValue = e.target.value;
|
|
57
|
+
setInputValue(newInputValue);
|
|
58
|
+
if (isValid) {
|
|
59
|
+
setValue(Number(newInputValue));
|
|
60
|
+
}
|
|
61
|
+
}, [setInputValue, setValue, isValid]);
|
|
62
|
+
const handleSliderChange = (0, react_2.useCallback)((newValue) => {
|
|
63
|
+
setValue(newValue);
|
|
64
|
+
setInputValue(String(newValue));
|
|
65
|
+
}, [setInputValue, setValue]);
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-6", children: [(0, jsx_runtime_1.jsx)(react_1.TextInput, { label: "Slider value", helpText: `Enter a value between ${MIN_VALUE} and ${MAX_VALUE}`, isRequired: true, errorText: error, htmlAttributes: {
|
|
67
|
+
max: MAX_VALUE,
|
|
68
|
+
min: MIN_VALUE,
|
|
69
|
+
step: STEP,
|
|
70
|
+
type: 'number',
|
|
71
|
+
}, value: inputValue, onChange: handleInputChange }), (0, jsx_runtime_1.jsx)(react_1.Slider, { type: "single", value: value, onChange: handleSliderChange, minValue: MIN_VALUE, maxValue: MAX_VALUE, step: STEP, showSteps: true, showValues: true, isDisabled: hasError, inputProps: {
|
|
72
|
+
'aria-valuetext': `${value} out of ${MAX_VALUE}`,
|
|
73
|
+
} })] }));
|
|
31
74
|
};
|
|
32
75
|
exports.default = Component;
|
|
33
76
|
//# sourceMappingURL=slider-single-controlled.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-single-controlled.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single-controlled.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,
|
|
1
|
+
{"version":3,"file":"slider-single-controlled.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single-controlled.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4CAAqD;AACrD,iCAA8C;AAE9C,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,IAAI,GAAG,CAAC,CAAC;AACf,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,kBAAkB,GAAG,CACzB,KAAa,EAC4D,EAAE;IAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAE7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACxD,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK,EAAE,6BAA6B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,KAAK,EAAE,6BAA6B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClE,CAAC;IAED,IAAI,QAAQ,GAAG,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,EAAE,0BAA0B,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1E,CAAC;IAED,IAAI,QAAQ,GAAG,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,EAAE,yBAAyB,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzE,CAAC;IAED,OAAO,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AE,SAAS;oBACd,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,QAAQ;iBACf,EACD,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,iBAAiB,GAC3B,EAEF,uBAAC,cAAM,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,IAAI,EACV,SAAS,QACT,UAAU,QACV,UAAU,EAAE,QAAQ,EACpB,UAAU,EAAE;oBACV,gBAAgB,EAAE,GAAG,KAAK,WAAW,SAAS,EAAE;iBACjD,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -21,9 +21,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
21
21
|
* You should have received a copy of the GNU General Public License
|
|
22
22
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
24
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
25
25
|
const Component = () => {
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Slider, { type: "single", value: 100, onChange: (newValue) => {
|
|
27
27
|
console.info('onChange', newValue);
|
|
28
28
|
}, minValue: 0, maxValue: 200, isDisabled: false, step: 10, showSteps: true, showValues: true, inputProps: { 'aria-valuetext': 'percent' } }));
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-single.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"slider-single.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,cAAM,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,IAAI,EACf,UAAU,EAAE,IAAI,EAChB,UAAU,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAC3C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomStepLength = exports.ShowValues = exports.ShowSteps = exports.Disabled = exports.SingleControlled = exports.Range = exports.Single = exports.Default = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
5
|
/**
|
|
2
6
|
*
|
|
3
7
|
* Copyright (c) "Neo4j"
|
|
@@ -18,15 +22,10 @@
|
|
|
18
22
|
* You should have received a copy of the GNU General Public License
|
|
19
23
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
24
|
*/
|
|
21
|
-
|
|
22
|
-
"use strict";
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.SingleControlled = exports.Range = exports.Single = void 0;
|
|
25
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
|
-
const Slider_1 = require("../Slider");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
27
26
|
const _1 = require(".");
|
|
28
27
|
const componentMeta = {
|
|
29
|
-
component:
|
|
28
|
+
component: react_1.Slider,
|
|
30
29
|
parameters: {
|
|
31
30
|
controls: { disable: true },
|
|
32
31
|
},
|
|
@@ -35,6 +34,20 @@ const componentMeta = {
|
|
|
35
34
|
id: 'components-slider',
|
|
36
35
|
};
|
|
37
36
|
exports.default = componentMeta;
|
|
37
|
+
exports.Default = {
|
|
38
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
39
|
+
args: {},
|
|
40
|
+
parameters: {
|
|
41
|
+
docs: {
|
|
42
|
+
source: {
|
|
43
|
+
code: _1.SliderDefaultSource,
|
|
44
|
+
language: 'tsx',
|
|
45
|
+
type: 'code',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
render: () => (0, jsx_runtime_1.jsx)(_1.SliderDefaultDemo, {}),
|
|
50
|
+
};
|
|
38
51
|
exports.Single = {
|
|
39
52
|
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
40
53
|
args: {},
|
|
@@ -77,4 +90,60 @@ exports.SingleControlled = {
|
|
|
77
90
|
},
|
|
78
91
|
render: () => (0, jsx_runtime_1.jsx)(_1.SliderSingleControlledDemo, {}),
|
|
79
92
|
};
|
|
93
|
+
exports.Disabled = {
|
|
94
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
95
|
+
args: {},
|
|
96
|
+
parameters: {
|
|
97
|
+
docs: {
|
|
98
|
+
source: {
|
|
99
|
+
code: _1.SliderDisabledSource,
|
|
100
|
+
language: 'tsx',
|
|
101
|
+
type: 'code',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
render: () => (0, jsx_runtime_1.jsx)(_1.SliderDisabledDemo, {}),
|
|
106
|
+
};
|
|
107
|
+
exports.ShowSteps = {
|
|
108
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
109
|
+
args: {},
|
|
110
|
+
parameters: {
|
|
111
|
+
docs: {
|
|
112
|
+
source: {
|
|
113
|
+
code: _1.SliderShowStepsSource,
|
|
114
|
+
language: 'tsx',
|
|
115
|
+
type: 'code',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
render: () => (0, jsx_runtime_1.jsx)(_1.SliderShowStepsDemo, {}),
|
|
120
|
+
};
|
|
121
|
+
exports.ShowValues = {
|
|
122
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
123
|
+
args: {},
|
|
124
|
+
parameters: {
|
|
125
|
+
docs: {
|
|
126
|
+
source: {
|
|
127
|
+
code: _1.SliderShowValuesSource,
|
|
128
|
+
language: 'tsx',
|
|
129
|
+
type: 'code',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
render: () => (0, jsx_runtime_1.jsx)(_1.SliderShowValuesDemo, {}),
|
|
134
|
+
};
|
|
135
|
+
exports.CustomStepLength = {
|
|
136
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
137
|
+
args: {},
|
|
138
|
+
parameters: {
|
|
139
|
+
docs: {
|
|
140
|
+
source: {
|
|
141
|
+
code: _1.SliderCustomStepLengthSource,
|
|
142
|
+
language: 'tsx',
|
|
143
|
+
type: 'code',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
render: () => (0, jsx_runtime_1.jsx)(_1.SliderCustomStepLengthDemo, {}),
|
|
148
|
+
};
|
|
80
149
|
//# sourceMappingURL=slider.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.stories.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider.stories.tsx"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"slider.stories.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider.stories.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA0C;AAG1C,wBAiBW;AAEX,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,cAAM;IACjB,UAAU,EAAE;QACV,QAAQ,EAA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en: isDisabled === true ? false : isOpen,
|
|
174
174
|
setActiveIndex,
|
|
175
175
|
setHasFocusInside,
|
|
176
|
-
}, children: _jsx(FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && (_jsx(ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => (_jsx(FloatingPortal, { root: portalTarget, children: wrapChildren })), children: _jsx(FloatingFocusManager, { context: context, modal: false, initialFocus: isNested ? -1 :
|
|
176
|
+
}, children: _jsx(FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && (_jsx(ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => (_jsx(FloatingPortal, { root: portalTarget, children: wrapChildren })), children: _jsx(FloatingFocusManager, { context: context, modal: false, initialFocus: isNested ? -1 : 0, returnFocus: !isNested, closeOnFocusOut: true, guards: true, children: _jsx(Component, Object.assign({ ref: refs.setFloating, className: menuClasses, style: Object.assign({ minWidth: minWidth !== undefined ? `${minWidth}px` : undefined }, floatingStyles) }, getFloatingProps(), { children: children })) }) })) }) })] }));
|
|
177
177
|
});
|
|
178
178
|
const MenuItem = forwardRef(function MenuItem({ title, className, style, icon, description, isDisabled, as, onClick, onFocus, htmlAttributes, id, }, forwardedRef) {
|
|
179
179
|
const menu = useContext(MenuContext);
|
|
@@ -18,14 +18,29 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
+
export { default as SliderDefaultDemo } from './slider-default.story';
|
|
21
22
|
export { default as SliderSingleDemo } from './slider-single.story';
|
|
22
23
|
export { default as SliderRangeDemo } from './slider-range.story';
|
|
23
24
|
export { default as SliderSingleControlledDemo } from './slider-single-controlled.story';
|
|
25
|
+
export { default as SliderDisabledDemo } from './slider-disabled.story';
|
|
26
|
+
export { default as SliderShowStepsDemo } from './slider-show-steps.story';
|
|
27
|
+
export { default as SliderShowValuesDemo } from './slider-show-values.story';
|
|
28
|
+
export { default as SliderCustomStepLengthDemo } from './slider-custom-step-length.story';
|
|
24
29
|
import { removeLicenseHeader } from '@neo4j-ndl/react/_common/export-stories-utils';
|
|
30
|
+
import SliderCustomStepLengthSourceRaw from './slider-custom-step-length.story.tsx?raw';
|
|
31
|
+
import SliderDefaultSourceRaw from './slider-default.story.tsx?raw';
|
|
32
|
+
import SliderDisabledSourceRaw from './slider-disabled.story.tsx?raw';
|
|
25
33
|
import SliderRangeSourceRaw from './slider-range.story.tsx?raw';
|
|
34
|
+
import SliderShowStepsSourceRaw from './slider-show-steps.story.tsx?raw';
|
|
35
|
+
import SliderShowValuesSourceRaw from './slider-show-values.story.tsx?raw';
|
|
26
36
|
import SliderSingleSourceRaw from './slider-single.story.tsx?raw';
|
|
27
37
|
import SliderSingleControlledSourceRaw from './slider-single-controlled.story.tsx?raw';
|
|
38
|
+
export const SliderDefaultSource = removeLicenseHeader(SliderDefaultSourceRaw);
|
|
28
39
|
export const SliderSingleSource = removeLicenseHeader(SliderSingleSourceRaw);
|
|
29
40
|
export const SliderRangeSource = removeLicenseHeader(SliderRangeSourceRaw);
|
|
30
41
|
export const SliderSingleControlledSource = removeLicenseHeader(SliderSingleControlledSourceRaw);
|
|
42
|
+
export const SliderDisabledSource = removeLicenseHeader(SliderDisabledSourceRaw);
|
|
43
|
+
export const SliderShowStepsSource = removeLicenseHeader(SliderShowStepsSourceRaw);
|
|
44
|
+
export const SliderShowValuesSource = removeLicenseHeader(SliderShowValuesSourceRaw);
|
|
45
|
+
export const SliderCustomStepLengthSource = removeLicenseHeader(SliderCustomStepLengthSourceRaw);
|
|
31
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/slider/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/slider/stories/index.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,+BAA+B,CAChC,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,uBAAuB,CACxB,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CACtD,wBAAwB,CACzB,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,yBAAyB,CAC1B,CAAC;AACF,MAAM,CAAC,MAAM,4BAA4B,GAAG,mBAAmB,CAC7D,+BAA+B,CAChC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
|
+
const Component = () => {
|
|
24
|
+
return (_jsx(Slider, { minValue: 0, maxValue: 100, step: 10, value: 50, onChange: (newValue) => {
|
|
25
|
+
console.info('onChange', newValue);
|
|
26
|
+
}, showSteps: true, showValues: true }));
|
|
27
|
+
};
|
|
28
|
+
export default Component;
|
|
29
|
+
//# sourceMappingURL=slider-custom-step-length.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-custom-step-length.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-custom-step-length.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,MAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,SAAS,QACT,UAAU,SACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
|
+
const Component = () => {
|
|
24
|
+
return (_jsx(Slider, { minValue: 0, maxValue: 100, value: 50, onChange: (newValue) => {
|
|
25
|
+
console.info('onChange', newValue);
|
|
26
|
+
} }));
|
|
27
|
+
};
|
|
28
|
+
export default Component;
|
|
29
|
+
//# sourceMappingURL=slider-default.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-default.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-default.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,MAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
|
+
const Component = () => {
|
|
24
|
+
return (_jsx(Slider, { minValue: 0, maxValue: 100, step: 10, value: 50, onChange: (newValue) => {
|
|
25
|
+
console.info('onChange', newValue);
|
|
26
|
+
}, isDisabled: true }));
|
|
27
|
+
};
|
|
28
|
+
export default Component;
|
|
29
|
+
//# sourceMappingURL=slider-disabled.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-disabled.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-disabled.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,MAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,UAAU,SACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -19,7 +19,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
19
19
|
* You should have received a copy of the GNU General Public License
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
|
-
import { Slider } from '
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
23
|
const Component = () => {
|
|
24
24
|
return (_jsx(Slider, { type: "range", values: [10, 50], onChange: (newValue) => {
|
|
25
25
|
console.info('onChange', newValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-range.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-range.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"slider-range.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-range.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,OAAO,EACZ,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAChB,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,EAAE,EACR,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,IAAI,EACf,UAAU,EAAE,IAAI,GAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
|
+
const Component = () => {
|
|
24
|
+
return (_jsx(Slider, { minValue: 0, maxValue: 100, value: 50, onChange: (newValue) => {
|
|
25
|
+
console.info('onChange', newValue);
|
|
26
|
+
}, showSteps: true }));
|
|
27
|
+
};
|
|
28
|
+
export default Component;
|
|
29
|
+
//# sourceMappingURL=slider-show-steps.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-show-steps.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-show-steps.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,MAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,SAAS,SACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
|
+
const Component = () => {
|
|
24
|
+
return (_jsx(Slider, { minValue: 0, maxValue: 100, value: 50, onChange: (newValue) => {
|
|
25
|
+
console.info('onChange', newValue);
|
|
26
|
+
}, showValues: true }));
|
|
27
|
+
};
|
|
28
|
+
export default Component;
|
|
29
|
+
//# sourceMappingURL=slider-show-values.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-show-values.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-show-values.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,MAAM,IACL,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,EAAE,EACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,UAAU,SACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) "Neo4j"
|
|
@@ -19,13 +19,56 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
19
19
|
* You should have received a copy of the GNU General Public License
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
22
|
+
import { Slider, TextInput } from '@neo4j-ndl/react';
|
|
23
|
+
import { useCallback, useState } from 'react';
|
|
24
|
+
const MIN_VALUE = 0;
|
|
25
|
+
const MAX_VALUE = 100;
|
|
26
|
+
const STEP = 5;
|
|
27
|
+
const INITIAL_VALUE = 50;
|
|
28
|
+
const getValidationError = (input) => {
|
|
29
|
+
const trimmed = input.trim();
|
|
30
|
+
if (!trimmed) {
|
|
31
|
+
return { error: 'Value is required', isValid: false };
|
|
32
|
+
}
|
|
33
|
+
const numValue = Number(trimmed);
|
|
34
|
+
if (isNaN(numValue)) {
|
|
35
|
+
return { error: 'Please enter a valid number', isValid: false };
|
|
36
|
+
}
|
|
37
|
+
if (!Number.isInteger(numValue)) {
|
|
38
|
+
return { error: 'Please enter a whole number', isValid: false };
|
|
39
|
+
}
|
|
40
|
+
if (numValue < MIN_VALUE) {
|
|
41
|
+
return { error: `Value must be at least ${MIN_VALUE}`, isValid: false };
|
|
42
|
+
}
|
|
43
|
+
if (numValue > MAX_VALUE) {
|
|
44
|
+
return { error: `Value must be at most ${MAX_VALUE}`, isValid: false };
|
|
45
|
+
}
|
|
46
|
+
return { error: undefined, isValid: true };
|
|
47
|
+
};
|
|
24
48
|
const Component = () => {
|
|
25
|
-
const [value, setValue] = useState(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
49
|
+
const [value, setValue] = useState(INITIAL_VALUE);
|
|
50
|
+
const [inputValue, setInputValue] = useState(String(INITIAL_VALUE));
|
|
51
|
+
const { error, isValid } = getValidationError(inputValue);
|
|
52
|
+
const hasError = !isValid;
|
|
53
|
+
const handleInputChange = useCallback((e) => {
|
|
54
|
+
const newInputValue = e.target.value;
|
|
55
|
+
setInputValue(newInputValue);
|
|
56
|
+
if (isValid) {
|
|
57
|
+
setValue(Number(newInputValue));
|
|
58
|
+
}
|
|
59
|
+
}, [setInputValue, setValue, isValid]);
|
|
60
|
+
const handleSliderChange = useCallback((newValue) => {
|
|
61
|
+
setValue(newValue);
|
|
62
|
+
setInputValue(String(newValue));
|
|
63
|
+
}, [setInputValue, setValue]);
|
|
64
|
+
return (_jsxs("div", { className: "n-flex n-flex-col n-gap-token-6", children: [_jsx(TextInput, { label: "Slider value", helpText: `Enter a value between ${MIN_VALUE} and ${MAX_VALUE}`, isRequired: true, errorText: error, htmlAttributes: {
|
|
65
|
+
max: MAX_VALUE,
|
|
66
|
+
min: MIN_VALUE,
|
|
67
|
+
step: STEP,
|
|
68
|
+
type: 'number',
|
|
69
|
+
}, value: inputValue, onChange: handleInputChange }), _jsx(Slider, { type: "single", value: value, onChange: handleSliderChange, minValue: MIN_VALUE, maxValue: MAX_VALUE, step: STEP, showSteps: true, showValues: true, isDisabled: hasError, inputProps: {
|
|
70
|
+
'aria-valuetext': `${value} out of ${MAX_VALUE}`,
|
|
71
|
+
} })] }));
|
|
29
72
|
};
|
|
30
73
|
export default Component;
|
|
31
74
|
//# sourceMappingURL=slider-single-controlled.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-single-controlled.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single-controlled.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"slider-single-controlled.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single-controlled.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,IAAI,GAAG,CAAC,CAAC;AACf,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,kBAAkB,GAAG,CACzB,KAAa,EAC4D,EAAE;IAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAE7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACxD,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK,EAAE,6BAA6B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,KAAK,EAAE,6BAA6B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClE,CAAC;IAED,IAAI,QAAQ,GAAG,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,EAAE,0BAA0B,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1E,CAAC;IAED,IAAI,QAAQ,GAAG,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,EAAE,yBAAyB,SAAS,EAAE,EAAE,OAAO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;oBACd,GAAG,EAAE,SAAS;oBACd,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,QAAQ;iBACf,EACD,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,iBAAiB,GAC3B,EAEF,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,IAAI,EACV,SAAS,QACT,UAAU,QACV,UAAU,EAAE,QAAQ,EACpB,UAAU,EAAE;oBACV,gBAAgB,EAAE,GAAG,KAAK,WAAW,SAAS,EAAE;iBACjD,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -19,7 +19,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
19
19
|
* You should have received a copy of the GNU General Public License
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
|
-
import { Slider } from '
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
23
|
const Component = () => {
|
|
24
24
|
return (_jsx(Slider, { type: "single", value: 100, onChange: (newValue) => {
|
|
25
25
|
console.info('onChange', newValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-single.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"slider-single.story.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider-single.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC,EACD,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,GAAG,EACb,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,IAAI,EACf,UAAU,EAAE,IAAI,EAChB,UAAU,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAC3C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
/**
|
|
2
3
|
*
|
|
3
4
|
* Copyright (c) "Neo4j"
|
|
@@ -18,10 +19,8 @@
|
|
|
18
19
|
* You should have received a copy of the GNU General Public License
|
|
19
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
-
import {
|
|
23
|
-
import { Slider } from '../Slider';
|
|
24
|
-
import { SliderRangeDemo, SliderRangeSource, SliderSingleControlledDemo, SliderSingleControlledSource, SliderSingleDemo, SliderSingleSource, } from '.';
|
|
22
|
+
import { Slider } from '@neo4j-ndl/react';
|
|
23
|
+
import { SliderCustomStepLengthDemo, SliderCustomStepLengthSource, SliderDefaultDemo, SliderDefaultSource, SliderDisabledDemo, SliderDisabledSource, SliderRangeDemo, SliderRangeSource, SliderShowStepsDemo, SliderShowStepsSource, SliderShowValuesDemo, SliderShowValuesSource, SliderSingleControlledDemo, SliderSingleControlledSource, SliderSingleDemo, SliderSingleSource, } from '.';
|
|
25
24
|
const componentMeta = {
|
|
26
25
|
component: Slider,
|
|
27
26
|
parameters: {
|
|
@@ -32,6 +31,20 @@ const componentMeta = {
|
|
|
32
31
|
id: 'components-slider',
|
|
33
32
|
};
|
|
34
33
|
export default componentMeta;
|
|
34
|
+
export const Default = {
|
|
35
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
36
|
+
args: {},
|
|
37
|
+
parameters: {
|
|
38
|
+
docs: {
|
|
39
|
+
source: {
|
|
40
|
+
code: SliderDefaultSource,
|
|
41
|
+
language: 'tsx',
|
|
42
|
+
type: 'code',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
render: () => _jsx(SliderDefaultDemo, {}),
|
|
47
|
+
};
|
|
35
48
|
export const Single = {
|
|
36
49
|
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
37
50
|
args: {},
|
|
@@ -74,4 +87,60 @@ export const SingleControlled = {
|
|
|
74
87
|
},
|
|
75
88
|
render: () => _jsx(SliderSingleControlledDemo, {}),
|
|
76
89
|
};
|
|
90
|
+
export const Disabled = {
|
|
91
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
92
|
+
args: {},
|
|
93
|
+
parameters: {
|
|
94
|
+
docs: {
|
|
95
|
+
source: {
|
|
96
|
+
code: SliderDisabledSource,
|
|
97
|
+
language: 'tsx',
|
|
98
|
+
type: 'code',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
render: () => _jsx(SliderDisabledDemo, {}),
|
|
103
|
+
};
|
|
104
|
+
export const ShowSteps = {
|
|
105
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
106
|
+
args: {},
|
|
107
|
+
parameters: {
|
|
108
|
+
docs: {
|
|
109
|
+
source: {
|
|
110
|
+
code: SliderShowStepsSource,
|
|
111
|
+
language: 'tsx',
|
|
112
|
+
type: 'code',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
render: () => _jsx(SliderShowStepsDemo, {}),
|
|
117
|
+
};
|
|
118
|
+
export const ShowValues = {
|
|
119
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
120
|
+
args: {},
|
|
121
|
+
parameters: {
|
|
122
|
+
docs: {
|
|
123
|
+
source: {
|
|
124
|
+
code: SliderShowValuesSource,
|
|
125
|
+
language: 'tsx',
|
|
126
|
+
type: 'code',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
render: () => _jsx(SliderShowValuesDemo, {}),
|
|
131
|
+
};
|
|
132
|
+
export const CustomStepLength = {
|
|
133
|
+
// @ts-expect-error The args from the full story are not actually used but we get a type issue here
|
|
134
|
+
args: {},
|
|
135
|
+
parameters: {
|
|
136
|
+
docs: {
|
|
137
|
+
source: {
|
|
138
|
+
code: SliderCustomStepLengthSource,
|
|
139
|
+
language: 'tsx',
|
|
140
|
+
type: 'code',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
render: () => _jsx(SliderCustomStepLengthDemo, {}),
|
|
145
|
+
};
|
|
77
146
|
//# sourceMappingURL=slider.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.stories.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider.stories.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"slider.stories.js","sourceRoot":"","sources":["../../../../src/slider/stories/slider.stories.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,GAAG,CAAC;AAEX,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,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19 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
+
export { default as SliderDefaultDemo } from './slider-default.story';
|
|
21
22
|
export { default as SliderSingleDemo } from './slider-single.story';
|
|
22
23
|
export { default as SliderRangeDemo } from './slider-range.story';
|
|
23
24
|
export { default as SliderSingleControlledDemo } from './slider-single-controlled.story';
|
|
25
|
+
export { default as SliderDisabledDemo } from './slider-disabled.story';
|
|
26
|
+
export { default as SliderShowStepsDemo } from './slider-show-steps.story';
|
|
27
|
+
export { default as SliderShowValuesDemo } from './slider-show-values.story';
|
|
28
|
+
export { default as SliderCustomStepLengthDemo } from './slider-custom-step-length.story';
|
|
29
|
+
export declare const SliderDefaultSource: string;
|
|
24
30
|
export declare const SliderSingleSource: string;
|
|
25
31
|
export declare const SliderRangeSource: string;
|
|
26
32
|
export declare const SliderSingleControlledSource: string;
|
|
33
|
+
export declare const SliderDisabledSource: string;
|
|
34
|
+
export declare const SliderShowStepsSource: string;
|
|
35
|
+
export declare const SliderShowValuesSource: string;
|
|
36
|
+
export declare const SliderCustomStepLengthSource: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
+
|
|
21
22
|
import { type StoryObj } from '@storybook/react-vite';
|
|
22
23
|
declare const componentMeta: {
|
|
23
|
-
component: import("../../_common/types").PolymorphicForwardRefExoticComponent<"div", import("
|
|
24
|
+
component: import("../../_common/types").PolymorphicForwardRefExoticComponent<"div", import("@neo4j-ndl/react").SliderProps>;
|
|
24
25
|
parameters: {
|
|
25
26
|
controls: {
|
|
26
27
|
disable: boolean;
|
|
@@ -32,6 +33,11 @@ declare const componentMeta: {
|
|
|
32
33
|
};
|
|
33
34
|
export default componentMeta;
|
|
34
35
|
type Story = StoryObj<typeof componentMeta>;
|
|
36
|
+
export declare const Default: Story;
|
|
35
37
|
export declare const Single: Story;
|
|
36
38
|
export declare const Range: Story;
|
|
37
39
|
export declare const SingleControlled: Story;
|
|
40
|
+
export declare const Disabled: Story;
|
|
41
|
+
export declare const ShowSteps: Story;
|
|
42
|
+
export declare const ShowValues: Story;
|
|
43
|
+
export declare const CustomStepLength: Story;
|