@fluentui/react-slider 9.0.0-beta.3 → 9.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +269 -1
- package/CHANGELOG.md +70 -2
- package/dist/react-slider.d.ts +33 -142
- package/lib/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.js +7 -7
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.types.d.ts +26 -55
- package/lib/components/Slider/Slider.types.js.map +1 -1
- package/lib/components/Slider/index.d.ts +2 -2
- package/lib/components/Slider/index.js +2 -2
- package/lib/components/Slider/index.js.map +1 -1
- package/lib/components/Slider/renderSlider.d.ts +1 -1
- package/lib/components/Slider/renderSlider.js +10 -8
- package/lib/components/Slider/renderSlider.js.map +1 -1
- package/lib/components/Slider/useSlider.d.ts +2 -6
- package/lib/components/Slider/useSlider.js +50 -80
- package/lib/components/Slider/useSlider.js.map +1 -1
- package/lib/components/Slider/useSliderState.d.ts +1 -2
- package/lib/components/Slider/useSliderState.js +49 -184
- package/lib/components/Slider/useSliderState.js.map +1 -1
- package/lib/components/Slider/useSliderStyles.d.ts +10 -30
- package/lib/components/Slider/useSliderStyles.js +151 -305
- package/lib/components/Slider/useSliderStyles.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Slider.js +1 -1
- package/lib-commonjs/Slider.js.map +1 -1
- package/lib-commonjs/components/Slider/Slider.js +8 -8
- package/lib-commonjs/components/Slider/Slider.js.map +1 -1
- package/lib-commonjs/components/Slider/Slider.types.d.ts +26 -55
- package/lib-commonjs/components/Slider/Slider.types.js.map +1 -1
- package/lib-commonjs/components/Slider/index.d.ts +2 -2
- package/lib-commonjs/components/Slider/index.js +12 -6
- package/lib-commonjs/components/Slider/index.js.map +1 -1
- package/lib-commonjs/components/Slider/renderSlider.d.ts +1 -1
- package/lib-commonjs/components/Slider/renderSlider.js +14 -14
- package/lib-commonjs/components/Slider/renderSlider.js.map +1 -1
- package/lib-commonjs/components/Slider/useSlider.d.ts +2 -6
- package/lib-commonjs/components/Slider/useSlider.js +53 -84
- package/lib-commonjs/components/Slider/useSlider.js.map +1 -1
- package/lib-commonjs/components/Slider/useSliderState.d.ts +1 -2
- package/lib-commonjs/components/Slider/useSliderState.js +53 -191
- package/lib-commonjs/components/Slider/useSliderState.js.map +1 -1
- package/lib-commonjs/components/Slider/useSliderStyles.d.ts +10 -30
- package/lib-commonjs/components/Slider/useSliderStyles.js +154 -308
- package/lib-commonjs/components/Slider/useSliderStyles.js.map +1 -1
- package/lib-commonjs/index.d.ts +0 -1
- package/lib-commonjs/index.js +1 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +12 -14
- package/lib/RangedSlider.d.ts +0 -1
- package/lib/RangedSlider.js +0 -2
- package/lib/RangedSlider.js.map +0 -1
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -12
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/RangedSlider/RangedSlider.d.ts +0 -6
- package/lib/components/RangedSlider/RangedSlider.js +0 -15
- package/lib/components/RangedSlider/RangedSlider.js.map +0 -1
- package/lib/components/RangedSlider/RangedSlider.types.d.ts +0 -53
- package/lib/components/RangedSlider/RangedSlider.types.js +0 -2
- package/lib/components/RangedSlider/RangedSlider.types.js.map +0 -1
- package/lib/components/RangedSlider/index.d.ts +0 -6
- package/lib/components/RangedSlider/index.js +0 -7
- package/lib/components/RangedSlider/index.js.map +0 -1
- package/lib/components/RangedSlider/renderRangedSlider.d.ts +0 -5
- package/lib/components/RangedSlider/renderRangedSlider.js +0 -20
- package/lib/components/RangedSlider/renderRangedSlider.js.map +0 -1
- package/lib/components/RangedSlider/useRangedSlider.d.ts +0 -6
- package/lib/components/RangedSlider/useRangedSlider.js +0 -116
- package/lib/components/RangedSlider/useRangedSlider.js.map +0 -1
- package/lib/components/RangedSlider/useRangedSliderState.d.ts +0 -2
- package/lib/components/RangedSlider/useRangedSliderState.js +0 -271
- package/lib/components/RangedSlider/useRangedSliderState.js.map +0 -1
- package/lib/components/RangedSlider/useRangedSliderStyles.d.ts +0 -4
- package/lib/components/RangedSlider/useRangedSliderStyles.js +0 -92
- package/lib/components/RangedSlider/useRangedSliderStyles.js.map +0 -1
- package/lib/utils/calculateSteps.d.ts +0 -5
- package/lib/utils/calculateSteps.js +0 -27
- package/lib/utils/calculateSteps.js.map +0 -1
- package/lib/utils/findClosestThumb.d.ts +0 -4
- package/lib/utils/findClosestThumb.js +0 -7
- package/lib/utils/findClosestThumb.js.map +0 -1
- package/lib/utils/getKeydownValue.d.ts +0 -6
- package/lib/utils/getKeydownValue.js +0 -35
- package/lib/utils/getKeydownValue.js.map +0 -1
- package/lib/utils/getMarkPercent.d.ts +0 -12
- package/lib/utils/getMarkPercent.js +0 -27
- package/lib/utils/getMarkPercent.js.map +0 -1
- package/lib/utils/getMarkValues.d.ts +0 -13
- package/lib/utils/getMarkValues.js +0 -29
- package/lib/utils/getMarkValues.js.map +0 -1
- package/lib/utils/getPercent.d.ts +0 -8
- package/lib/utils/getPercent.js +0 -11
- package/lib/utils/getPercent.js.map +0 -1
- package/lib/utils/index.d.ts +0 -9
- package/lib/utils/index.js +0 -10
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/on.d.ts +0 -11
- package/lib/utils/on.js +0 -17
- package/lib/utils/on.js.map +0 -1
- package/lib/utils/renderMarks.d.ts +0 -13
- package/lib/utils/renderMarks.js +0 -31
- package/lib/utils/renderMarks.js.map +0 -1
- package/lib/utils/validateRangedThumbValues.d.ts +0 -4
- package/lib/utils/validateRangedThumbValues.js +0 -13
- package/lib/utils/validateRangedThumbValues.js.map +0 -1
- package/lib-commonjs/RangedSlider.d.ts +0 -1
- package/lib-commonjs/RangedSlider.js +0 -10
- package/lib-commonjs/RangedSlider.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -23
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/RangedSlider/RangedSlider.d.ts +0 -6
- package/lib-commonjs/components/RangedSlider/RangedSlider.js +0 -26
- package/lib-commonjs/components/RangedSlider/RangedSlider.js.map +0 -1
- package/lib-commonjs/components/RangedSlider/RangedSlider.types.d.ts +0 -53
- package/lib-commonjs/components/RangedSlider/RangedSlider.types.js +0 -6
- package/lib-commonjs/components/RangedSlider/RangedSlider.types.js.map +0 -1
- package/lib-commonjs/components/RangedSlider/index.d.ts +0 -6
- package/lib-commonjs/components/RangedSlider/index.js +0 -20
- package/lib-commonjs/components/RangedSlider/index.js.map +0 -1
- package/lib-commonjs/components/RangedSlider/renderRangedSlider.d.ts +0 -5
- package/lib-commonjs/components/RangedSlider/renderRangedSlider.js +0 -32
- package/lib-commonjs/components/RangedSlider/renderRangedSlider.js.map +0 -1
- package/lib-commonjs/components/RangedSlider/useRangedSlider.d.ts +0 -6
- package/lib-commonjs/components/RangedSlider/useRangedSlider.js +0 -128
- package/lib-commonjs/components/RangedSlider/useRangedSlider.js.map +0 -1
- package/lib-commonjs/components/RangedSlider/useRangedSliderState.d.ts +0 -2
- package/lib-commonjs/components/RangedSlider/useRangedSliderState.js +0 -286
- package/lib-commonjs/components/RangedSlider/useRangedSliderState.js.map +0 -1
- package/lib-commonjs/components/RangedSlider/useRangedSliderStyles.d.ts +0 -4
- package/lib-commonjs/components/RangedSlider/useRangedSliderStyles.js +0 -104
- package/lib-commonjs/components/RangedSlider/useRangedSliderStyles.js.map +0 -1
- package/lib-commonjs/utils/calculateSteps.d.ts +0 -5
- package/lib-commonjs/utils/calculateSteps.js +0 -37
- package/lib-commonjs/utils/calculateSteps.js.map +0 -1
- package/lib-commonjs/utils/findClosestThumb.d.ts +0 -4
- package/lib-commonjs/utils/findClosestThumb.js +0 -16
- package/lib-commonjs/utils/findClosestThumb.js.map +0 -1
- package/lib-commonjs/utils/getKeydownValue.d.ts +0 -6
- package/lib-commonjs/utils/getKeydownValue.js +0 -45
- package/lib-commonjs/utils/getKeydownValue.js.map +0 -1
- package/lib-commonjs/utils/getMarkPercent.d.ts +0 -12
- package/lib-commonjs/utils/getMarkPercent.js +0 -36
- package/lib-commonjs/utils/getMarkPercent.js.map +0 -1
- package/lib-commonjs/utils/getMarkValues.d.ts +0 -13
- package/lib-commonjs/utils/getMarkValues.js +0 -39
- package/lib-commonjs/utils/getMarkValues.js.map +0 -1
- package/lib-commonjs/utils/getPercent.d.ts +0 -8
- package/lib-commonjs/utils/getPercent.js +0 -20
- package/lib-commonjs/utils/getPercent.js.map +0 -1
- package/lib-commonjs/utils/index.d.ts +0 -9
- package/lib-commonjs/utils/index.js +0 -26
- package/lib-commonjs/utils/index.js.map +0 -1
- package/lib-commonjs/utils/on.d.ts +0 -11
- package/lib-commonjs/utils/on.js +0 -26
- package/lib-commonjs/utils/on.js.map +0 -1
- package/lib-commonjs/utils/renderMarks.d.ts +0 -13
- package/lib-commonjs/utils/renderMarks.js +0 -42
- package/lib-commonjs/utils/renderMarks.js.map +0 -1
- package/lib-commonjs/utils/validateRangedThumbValues.d.ts +0 -4
- package/lib-commonjs/utils/validateRangedThumbValues.js +0 -23
- package/lib-commonjs/utils/validateRangedThumbValues.js.map +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getMarkValue = void 0;
|
|
7
|
-
|
|
8
|
-
var getPercent_1 = /*#__PURE__*/require("./getPercent");
|
|
9
|
-
/**
|
|
10
|
-
* Gets the current percentage position for the marks with relative to the rail.
|
|
11
|
-
*
|
|
12
|
-
* Example
|
|
13
|
-
* - `Rail: width = 100px`
|
|
14
|
-
* - `Marks: [0, 25, 50, 75, 100]`
|
|
15
|
-
* - `getMarkValue: 0%, 25%, 50%, 75%, 100%`
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var getMarkValue = function (marks, min, max, step) {
|
|
20
|
-
var valueArray = []; // 1. We receive a boolean: mark for every step.
|
|
21
|
-
|
|
22
|
-
if (typeof marks === 'boolean' && marks === true) {
|
|
23
|
-
for (var i = 0; i < (max - min) / step + 1; i++) {
|
|
24
|
-
valueArray.push(getPercent_1.getPercent(min + step * i, min, max));
|
|
25
|
-
}
|
|
26
|
-
} else if (Array.isArray(marks) && marks.length > 0) {
|
|
27
|
-
return marks.map(function (marksItem) {
|
|
28
|
-
return typeof marksItem === 'number' ? // 2. We receive an array with numbers: mark for every value in array.
|
|
29
|
-
getPercent_1.getPercent(min + marksItem, min, max) : // 3. We receive an array with objects containing numbers and strings:
|
|
30
|
-
// mark and label for every value + string in each object.
|
|
31
|
-
getPercent_1.getPercent(min + marksItem.value, min, max);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return valueArray;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
exports.getMarkValue = getMarkValue;
|
|
39
|
-
//# sourceMappingURL=getMarkValues.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/getMarkValues.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAEA;;;;;;;AAOG;;;AACI,IAAM,YAAY,GAAG,UAC1B,KAD0B,EAE1B,GAF0B,EAG1B,GAH0B,EAI1B,IAJ0B,EAId;AAEZ,MAAM,UAAU,GAAa,EAA7B,CAFY,CAIZ;;AACA,MAAI,OAAO,KAAP,KAAiB,SAAjB,IAA8B,KAAK,KAAK,IAA5C,EAAkD;AAChD,SAAK,IAAI,CAAC,GAAG,CAAb,EAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAP,IAAc,IAAd,GAAqB,CAAzC,EAA4C,CAAC,EAA7C,EAAiD;AAC/C,MAAA,UAAU,CAAC,IAAX,CAAgB,YAAA,CAAA,UAAA,CAAW,GAAG,GAAG,IAAI,GAAG,CAAxB,EAA2B,GAA3B,EAAgC,GAAhC,CAAhB;AACD;AACF,GAJD,MAIO,IAAI,KAAK,CAAC,OAAN,CAAc,KAAd,KAAwB,KAAK,CAAC,MAAN,GAAe,CAA3C,EAA8C;AACnD,WAAO,KAAK,CAAC,GAAN,CAAU,UAAA,SAAA,EAAS;AACxB,aAAA,OAAO,SAAP,KAAqB,QAArB,GACI;AACA,MAAA,YAAA,CAAA,UAAA,CAAW,GAAG,GAAG,SAAjB,EAA4B,GAA5B,EAAiC,GAAjC,CAFJ,GAGI;AACA;AACA,MAAA,YAAA,CAAA,UAAA,CAAW,GAAG,GAAG,SAAS,CAAC,KAA3B,EAAkC,GAAlC,EAAuC,GAAvC,CALJ;AAK+C,KAN1C,CAAP;AAQD;;AACD,SAAO,UAAP;AACD,CAxBM;;AAAM,OAAA,CAAA,YAAA,GAAY,YAAZ","sourceRoot":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the current percent of specified value between a min and max
|
|
3
|
-
*
|
|
4
|
-
* @param value - the value to find the percent
|
|
5
|
-
* @param min - the lowest valid value
|
|
6
|
-
* @param max - the highest valid value
|
|
7
|
-
*/
|
|
8
|
-
export declare const getPercent: (value: number, min: number, max: number) => number;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getPercent = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Gets the current percent of specified value between a min and max
|
|
9
|
-
*
|
|
10
|
-
* @param value - the value to find the percent
|
|
11
|
-
* @param min - the lowest valid value
|
|
12
|
-
* @param max - the highest valid value
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
var getPercent = function (value, min, max) {
|
|
16
|
-
return max === min ? 0 : (value - min) / (max - min) * 100;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
exports.getPercent = getPercent;
|
|
20
|
-
//# sourceMappingURL=getPercent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/getPercent.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;;AACI,IAAM,UAAU,GAAG,UAAC,KAAD,EAAgB,GAAhB,EAA6B,GAA7B,EAAwC;AAChE,SAAO,GAAG,KAAK,GAAR,GAAc,CAAd,GAAmB,CAAC,KAAK,GAAG,GAAT,KAAiB,GAAG,GAAG,GAAvB,CAAD,GAAgC,GAAzD;AACD,CAFM;;AAAM,OAAA,CAAA,UAAA,GAAU,UAAV","sourceRoot":""}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './calculateSteps';
|
|
2
|
-
export * from './findClosestThumb';
|
|
3
|
-
export * from './getKeydownValue';
|
|
4
|
-
export * from './getMarkPercent';
|
|
5
|
-
export * from './getMarkValues';
|
|
6
|
-
export * from './getPercent';
|
|
7
|
-
export * from './on';
|
|
8
|
-
export * from './renderMarks';
|
|
9
|
-
export * from './validateRangedThumbValues';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
-
|
|
9
|
-
tslib_1.__exportStar(require("./calculateSteps"), exports);
|
|
10
|
-
|
|
11
|
-
tslib_1.__exportStar(require("./findClosestThumb"), exports);
|
|
12
|
-
|
|
13
|
-
tslib_1.__exportStar(require("./getKeydownValue"), exports);
|
|
14
|
-
|
|
15
|
-
tslib_1.__exportStar(require("./getMarkPercent"), exports);
|
|
16
|
-
|
|
17
|
-
tslib_1.__exportStar(require("./getMarkValues"), exports);
|
|
18
|
-
|
|
19
|
-
tslib_1.__exportStar(require("./getPercent"), exports);
|
|
20
|
-
|
|
21
|
-
tslib_1.__exportStar(require("./on"), exports);
|
|
22
|
-
|
|
23
|
-
tslib_1.__exportStar(require("./renderMarks"), exports);
|
|
24
|
-
|
|
25
|
-
tslib_1.__exportStar(require("./validateRangedThumbValues"), exports);
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,MAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,6BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adds and removes a given event listener on an element.
|
|
3
|
-
*
|
|
4
|
-
* @param element the element to listen to.
|
|
5
|
-
* @param eventName the event to watch.
|
|
6
|
-
* @param callback the callback to call when the eventName is triggered.
|
|
7
|
-
* @param useCapture whether the events should be dispatched to the callback first before other EventTargets.
|
|
8
|
-
*
|
|
9
|
-
* This should be replaced with a `useEvent` hook.
|
|
10
|
-
*/
|
|
11
|
-
export declare const on: <T>(element: Element | Window | Document, eventName: string, callback: (ev: T) => void, useCapture?: boolean | undefined) => () => void;
|
package/lib-commonjs/utils/on.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.on = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Adds and removes a given event listener on an element.
|
|
9
|
-
*
|
|
10
|
-
* @param element the element to listen to.
|
|
11
|
-
* @param eventName the event to watch.
|
|
12
|
-
* @param callback the callback to call when the eventName is triggered.
|
|
13
|
-
* @param useCapture whether the events should be dispatched to the callback first before other EventTargets.
|
|
14
|
-
*
|
|
15
|
-
* This should be replaced with a `useEvent` hook.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
var on = function (element, eventName, callback, useCapture) {
|
|
19
|
-
element.addEventListener(eventName, callback, useCapture);
|
|
20
|
-
return function () {
|
|
21
|
-
return element.removeEventListener(eventName, callback, useCapture);
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
exports.on = on;
|
|
26
|
-
//# sourceMappingURL=on.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/on.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;AASG;;AACI,IAAM,EAAE,GAAG,UAChB,OADgB,EAEhB,SAFgB,EAGhB,QAHgB,EAIhB,UAJgB,EAII;AAEpB,EAAA,OAAO,CAAC,gBAAR,CAAyB,SAAzB,EAAqC,QAArC,EAAkF,UAAlF;AACA,SAAO,YAAA;AAAM,WAAA,OAAO,CAAC,mBAAR,CAA4B,SAA5B,EAAwC,QAAxC,EAAA,UAAA,CAAA;AAAgG,GAA7G;AACD,CARM;;AAAM,OAAA,CAAA,EAAA,GAAE,EAAF","sourceRoot":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const markClassName = "ms-Slider-mark";
|
|
2
|
-
export declare const markLabelClassName = "ms-Slider-label";
|
|
3
|
-
/**
|
|
4
|
-
* Renders the marks
|
|
5
|
-
*
|
|
6
|
-
* @param markValues The marks percentage position relative to their individual positions.
|
|
7
|
-
* @param marks The provided marks prop from the Slider component.
|
|
8
|
-
*/
|
|
9
|
-
export declare const renderMarks: (markValues: number[], marks: boolean | (number | {
|
|
10
|
-
value: number;
|
|
11
|
-
label?: string | JSX.Element;
|
|
12
|
-
mark?: JSX.Element;
|
|
13
|
-
})[]) => JSX.Element[];
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.renderMarks = exports.markLabelClassName = exports.markClassName = void 0;
|
|
7
|
-
|
|
8
|
-
var React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
|
-
var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles"); // The mark related classNames are needed since they are used in a JSX element that is dynamically generated.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var markContainerClassName = 'ms-Slider-markItemContainer';
|
|
14
|
-
var firstMarkClassName = 'ms-Slider-firstMark';
|
|
15
|
-
var lastMarkClassName = 'ms-Slider-lastMark';
|
|
16
|
-
exports.markClassName = 'ms-Slider-mark';
|
|
17
|
-
exports.markLabelClassName = 'ms-Slider-label';
|
|
18
|
-
/**
|
|
19
|
-
* Renders the marks
|
|
20
|
-
*
|
|
21
|
-
* @param markValues The marks percentage position relative to their individual positions.
|
|
22
|
-
* @param marks The provided marks prop from the Slider component.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
var renderMarks = function (markValues, marks) {
|
|
26
|
-
return markValues.map(function (value, i) {
|
|
27
|
-
var marksItem = typeof marks === 'boolean' ? undefined : marks[i];
|
|
28
|
-
return React.createElement("div", {
|
|
29
|
-
className: markContainerClassName,
|
|
30
|
-
key: "markItemContainer-" + i
|
|
31
|
-
}, marksItem !== undefined && typeof marksItem === 'object' && marksItem.mark ? marksItem.mark : React.createElement("div", {
|
|
32
|
-
className: react_make_styles_1.mergeClasses(exports.markClassName, markValues[i] === 0 && firstMarkClassName, markValues[i] === 100 && lastMarkClassName),
|
|
33
|
-
key: "mark-" + i
|
|
34
|
-
}), marksItem !== undefined && typeof marksItem === 'object' && marksItem.label && React.createElement("div", {
|
|
35
|
-
className: exports.markLabelClassName,
|
|
36
|
-
key: "markLabel-" + i
|
|
37
|
-
}, marksItem.label));
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.renderMarks = renderMarks;
|
|
42
|
-
//# sourceMappingURL=renderMarks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/renderMarks.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA,C,CAEA;;;AACA,IAAM,sBAAsB,GAAG,6BAA/B;AACA,IAAM,kBAAkB,GAAG,qBAA3B;AACA,IAAM,iBAAiB,GAAG,oBAA1B;AACa,OAAA,CAAA,aAAA,GAAgB,gBAAhB;AACA,OAAA,CAAA,kBAAA,GAAqB,iBAArB;AAEb;;;;;AAKG;;AACI,IAAM,WAAW,GAAG,UACzB,UADyB,EAEzB,KAFyB,EAEwE;AAEjG,SAAA,UAAU,CAAC,GAAX,CAAe,UAAC,KAAD,EAAQ,CAAR,EAAS;AACtB,QAAM,SAAS,GAAG,OAAO,KAAP,KAAiB,SAAjB,GAA6B,SAA7B,GAAyC,KAAK,CAAC,CAAD,CAAhE;AAEA,WACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,MAAA,SAAS,EAAE,sBAAhB;AAAwC,MAAA,GAAG,EAAE,uBAAqB;AAAlE,KAAA,EACG,SAAS,KAAK,SAAd,IAA2B,OAAO,SAAP,KAAqB,QAAhD,IAA4D,SAAS,CAAC,IAAtE,GACC,SAAS,CAAC,IADX,GAGC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AACE,MAAA,SAAS,EAAE,mBAAA,CAAA,YAAA,CACT,OAAA,CAAA,aADS,EAET,UAAU,CAAC,CAAD,CAAV,KAAkB,CAAlB,IAAuB,kBAFd,EAGT,UAAU,CAAC,CAAD,CAAV,KAAkB,GAAlB,IAAyB,iBAHhB,CADb;AAME,MAAA,GAAG,EAAE,UAAQ;AANf,KAAA,CAJJ,EAaG,SAAS,KAAK,SAAd,IAA2B,OAAO,SAAP,KAAqB,QAAhD,IAA4D,SAAS,CAAC,KAAtE,IACC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,MAAA,SAAS,EAAE,OAAA,CAAA,kBAAhB;AAAoC,MAAA,GAAG,EAAE,eAAa;AAAtD,KAAA,EACG,SAAS,CAAC,KADb,CAdJ,CADF;AAqBD,GAxBD,CAAA;AAwBE,CA5BG;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX","sourceRoot":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.validateRangedThumbValues = void 0;
|
|
7
|
-
|
|
8
|
-
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
-
/**
|
|
10
|
-
* Clamps and sorts the values in RangedSlider to a given min and max
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var validateRangedThumbValues = function (thumbValues, min, max) {
|
|
15
|
-
return thumbValues.map(function (value) {
|
|
16
|
-
return react_utilities_1.clamp(value, min, max);
|
|
17
|
-
}).sort(function (a, b) {
|
|
18
|
-
return a - b;
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.validateRangedThumbValues = validateRangedThumbValues;
|
|
23
|
-
//# sourceMappingURL=validateRangedThumbValues.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/validateRangedThumbValues.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAEA;;AAEG;;;AACI,IAAM,yBAAyB,GAAG,UAAC,WAAD,EAAgC,GAAhC,EAA6C,GAA7C,EAAwD;AAC/F,SAAA,WAAW,CAAC,GAAZ,CAAgB,UAAA,KAAA,EAAK;AAAI,WAAA,iBAAA,CAAA,KAAA,CAAM,KAAN,EAAa,GAAb,EAAA,GAAA,CAAA;AAAsB,GAA/C,EAAiD,IAAjD,CAAsD,UAAC,CAAD,EAAI,CAAJ,EAAK;AAAK,WAAA,CAAC,GAAD,CAAA;AAAK,GAArE,CAAA;AAA0F,CADrF;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourceRoot":""}
|