@fluentui/react-switch 0.0.0-nightlya372ad979820211103.1 → 0.0.0-nightlya54302c0b220211124.1
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 +67 -26
- package/CHANGELOG.md +26 -15
- package/Spec.md +4 -4
- package/dist/react-switch.d.ts +2 -0
- package/lib/common/isConformant.js +1 -1
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Switch/renderSwitch.js +6 -7
- package/lib/components/Switch/renderSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitch.js +22 -21
- package/lib/components/Switch/useSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitchState.js +48 -56
- package/lib/components/Switch/useSwitchState.js.map +1 -1
- package/lib/components/Switch/useSwitchStyles.d.ts +1 -0
- package/lib/components/Switch/useSwitchStyles.js +30 -29
- package/lib/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib-commonjs/Switch.js +1 -1
- package/lib-commonjs/common/isConformant.js +3 -3
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Switch/Switch.js +6 -6
- package/lib-commonjs/components/Switch/Switch.js.map +1 -1
- package/lib-commonjs/components/Switch/index.js +1 -1
- package/lib-commonjs/components/Switch/renderSwitch.js +9 -11
- package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitch.js +23 -23
- package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitchState.js +51 -59
- package/lib-commonjs/components/Switch/useSwitchState.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitchStyles.d.ts +1 -0
- package/lib-commonjs/components/Switch/useSwitchStyles.js +33 -32
- package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/package.json +8 -12
package/CHANGELOG.json
CHANGED
@@ -2,76 +2,117 @@
|
|
2
2
|
"name": "@fluentui/react-switch",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "Wed,
|
6
|
-
"tag": "@fluentui/react-switch_v0.0.0-
|
7
|
-
"version": "0.0.0-
|
5
|
+
"date": "Wed, 24 Nov 2021 04:12:46 GMT",
|
6
|
+
"tag": "@fluentui/react-switch_v0.0.0-nightlya54302c0b220211124.1",
|
7
|
+
"version": "0.0.0-nightlya54302c0b220211124.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
11
|
-
"author": "
|
11
|
+
"author": "beachball",
|
12
|
+
"package": "@fluentui/react-switch",
|
13
|
+
"comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlya54302c0b220211124.1",
|
14
|
+
"commit": "e3c1bd15060ac276670338660c7965b877e333f4"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
12
18
|
"package": "@fluentui/react-switch",
|
13
|
-
"
|
14
|
-
"
|
19
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlya54302c0b220211124.1",
|
20
|
+
"commit": "e3c1bd15060ac276670338660c7965b877e333f4"
|
15
21
|
},
|
16
22
|
{
|
17
23
|
"author": "beachball",
|
18
24
|
"package": "@fluentui/react-switch",
|
19
|
-
"comment": "Bump @fluentui/react-
|
20
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightlya54302c0b220211124.1",
|
26
|
+
"commit": "e3c1bd15060ac276670338660c7965b877e333f4"
|
21
27
|
},
|
22
28
|
{
|
23
29
|
"author": "beachball",
|
24
30
|
"package": "@fluentui/react-switch",
|
25
|
-
"comment": "Bump @fluentui/
|
26
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlya54302c0b220211124.1",
|
32
|
+
"commit": "e3c1bd15060ac276670338660c7965b877e333f4"
|
27
33
|
},
|
28
34
|
{
|
29
35
|
"author": "beachball",
|
30
36
|
"package": "@fluentui/react-switch",
|
31
|
-
"comment": "Bump @fluentui/
|
32
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlya54302c0b220211124.1",
|
38
|
+
"commit": "e3c1bd15060ac276670338660c7965b877e333f4"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-switch",
|
43
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlya54302c0b220211124.1",
|
44
|
+
"commit": "e3c1bd15060ac276670338660c7965b877e333f4"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
}
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"date": "Fri, 12 Nov 2021 13:25:33 GMT",
|
51
|
+
"tag": "@fluentui/react-switch_v9.0.0-beta.4",
|
52
|
+
"version": "9.0.0-beta.4",
|
53
|
+
"comments": {
|
54
|
+
"none": [
|
55
|
+
{
|
56
|
+
"author": "olfedias@microsoft.com",
|
57
|
+
"package": "@fluentui/react-switch",
|
58
|
+
"commit": "9e6977945782df1cc997c92804a1b214cc4e4f43",
|
59
|
+
"comment": "do not use other packages in devDependencies"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"author": "lingfangao@hotmail.com",
|
63
|
+
"package": "@fluentui/react-switch",
|
64
|
+
"commit": "00f70581480b536e723fb69edf0ae617beac4807",
|
65
|
+
"comment": "Remove beta release tag"
|
66
|
+
}
|
67
|
+
],
|
68
|
+
"prerelease": [
|
69
|
+
{
|
70
|
+
"author": "olfedias@microsoft.com",
|
71
|
+
"package": "@fluentui/react-switch",
|
72
|
+
"commit": "9186578324773f95f4d61be3d70e67752159d843",
|
73
|
+
"comment": "export static classes for components"
|
33
74
|
},
|
34
75
|
{
|
35
76
|
"author": "beachball",
|
36
77
|
"package": "@fluentui/react-switch",
|
37
|
-
"comment": "Bump @fluentui/react-
|
38
|
-
"commit": "
|
78
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.3",
|
79
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
39
80
|
},
|
40
81
|
{
|
41
82
|
"author": "beachball",
|
42
83
|
"package": "@fluentui/react-switch",
|
43
|
-
"comment": "Bump @fluentui/
|
44
|
-
"commit": "
|
84
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.3",
|
85
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
45
86
|
},
|
46
87
|
{
|
47
88
|
"author": "beachball",
|
48
89
|
"package": "@fluentui/react-switch",
|
49
|
-
"comment": "Bump @fluentui/
|
50
|
-
"commit": "
|
90
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.4",
|
91
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
51
92
|
},
|
52
93
|
{
|
53
94
|
"author": "beachball",
|
54
95
|
"package": "@fluentui/react-switch",
|
55
|
-
"comment": "Bump @fluentui/react-
|
56
|
-
"commit": "
|
96
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.3",
|
97
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
57
98
|
},
|
58
99
|
{
|
59
100
|
"author": "beachball",
|
60
101
|
"package": "@fluentui/react-switch",
|
61
|
-
"comment": "Bump @fluentui/
|
62
|
-
"commit": "
|
102
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.3",
|
103
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
63
104
|
},
|
64
105
|
{
|
65
106
|
"author": "beachball",
|
66
107
|
"package": "@fluentui/react-switch",
|
67
|
-
"comment": "Bump @fluentui/
|
68
|
-
"commit": "
|
108
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3",
|
109
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
69
110
|
},
|
70
111
|
{
|
71
112
|
"author": "beachball",
|
72
113
|
"package": "@fluentui/react-switch",
|
73
|
-
"comment": "Bump @fluentui/react-
|
74
|
-
"commit": "
|
114
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3",
|
115
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
75
116
|
}
|
76
117
|
]
|
77
118
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,27 +1,38 @@
|
|
1
1
|
# Change Log - @fluentui/react-switch
|
2
2
|
|
3
|
-
This log was last generated on Wed,
|
3
|
+
This log was last generated on Wed, 24 Nov 2021 04:12:46 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-
|
7
|
+
## [0.0.0-nightlya54302c0b220211124.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v0.0.0-nightlya54302c0b220211124.1)
|
8
8
|
|
9
|
-
Wed,
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.
|
9
|
+
Wed, 24 Nov 2021 04:12:46 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.4..@fluentui/react-switch_v0.0.0-nightlya54302c0b220211124.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
-
|
15
|
-
- Bump @fluentui/react-
|
16
|
-
- Bump @fluentui/react-
|
17
|
-
- Bump @fluentui/
|
18
|
-
- Bump @fluentui/
|
19
|
-
- Bump @fluentui/
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
- Bump @fluentui/react-make-styles to v0.0.0-nightlya54302c0b220211124.1 ([commit](https://github.com/microsoft/fluentui/commit/e3c1bd15060ac276670338660c7965b877e333f4) by beachball)
|
15
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightlya54302c0b220211124.1 ([commit](https://github.com/microsoft/fluentui/commit/e3c1bd15060ac276670338660c7965b877e333f4) by beachball)
|
16
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightlya54302c0b220211124.1 ([commit](https://github.com/microsoft/fluentui/commit/e3c1bd15060ac276670338660c7965b877e333f4) by beachball)
|
17
|
+
- Bump @fluentui/babel-make-styles to v0.0.0-nightlya54302c0b220211124.1 ([commit](https://github.com/microsoft/fluentui/commit/e3c1bd15060ac276670338660c7965b877e333f4) by beachball)
|
18
|
+
- Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlya54302c0b220211124.1 ([commit](https://github.com/microsoft/fluentui/commit/e3c1bd15060ac276670338660c7965b877e333f4) by beachball)
|
19
|
+
- Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlya54302c0b220211124.1 ([commit](https://github.com/microsoft/fluentui/commit/e3c1bd15060ac276670338660c7965b877e333f4) by beachball)
|
20
|
+
|
21
|
+
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.4)
|
22
|
+
|
23
|
+
Fri, 12 Nov 2021 13:25:33 GMT
|
24
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.3..@fluentui/react-switch_v9.0.0-beta.4)
|
25
|
+
|
26
|
+
### Changes
|
27
|
+
|
28
|
+
- export static classes for components ([PR #20456](https://github.com/microsoft/fluentui/pull/20456) by olfedias@microsoft.com)
|
29
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
30
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
31
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.4 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
32
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
33
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
34
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
35
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
25
36
|
|
26
37
|
## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.3)
|
27
38
|
|
package/Spec.md
CHANGED
@@ -86,10 +86,10 @@ Amongst other major component libraries (`Material UI`, `Ant Design`, `Evergreen
|
|
86
86
|
- _**DOM**_
|
87
87
|
|
88
88
|
```jsx=
|
89
|
-
<div className="
|
90
|
-
<div className="
|
91
|
-
<div className="
|
92
|
-
<div className="
|
89
|
+
<div className="fui-Switch">
|
90
|
+
<div className="fui-Switch-track" />
|
91
|
+
<div className="fui-Switch-thumbWrapper">
|
92
|
+
<div className="fui-Switch-thumb" />
|
93
93
|
</div>
|
94
94
|
<input type="checkbox" />
|
95
95
|
</div>;
|
package/dist/react-switch.d.ts
CHANGED
@@ -14,6 +14,8 @@ export declare const renderSwitch: (state: SwitchState) => JSX.Element;
|
|
14
14
|
*/
|
15
15
|
export declare const Switch: ForwardRefComponent<SwitchProps>;
|
16
16
|
|
17
|
+
export declare const switchClassName = "fui-Switch";
|
18
|
+
|
17
19
|
export declare interface SwitchCommons {
|
18
20
|
/**
|
19
21
|
* The starting value for a uncontrolled Switch. If `true` then the Switch will be enabled.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
2
|
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
3
3
|
export function isConformant(testInfo) {
|
4
|
-
|
4
|
+
const defaultOptions = {
|
5
5
|
asPropHandlesRef: true,
|
6
6
|
componentPath: module.parent.filename.replace('.test', ''),
|
7
7
|
extraTests: makeStylesTests,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,QAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,UAAU,EAAE,eAH+C;AAI3D,IAAA,eAAe,EAAE;AAJ0C,GAA7D;AAOA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -6,8 +6,8 @@ import { useSwitchStyles } from './useSwitchStyles';
|
|
6
6
|
* The Switch control enables users to trigger an option on or off through pressing on the component.
|
7
7
|
*/
|
8
8
|
|
9
|
-
export
|
10
|
-
|
9
|
+
export const Switch = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
+
const state = useSwitch(props, ref);
|
11
11
|
useSwitchStyles(state);
|
12
12
|
return renderSwitch(state);
|
13
13
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,SAAT,QAA0B,aAA1B;AACA,SAAS,YAAT,QAA6B,gBAA7B;AACA,SAAS,eAAT,QAAgC,mBAAhC;AAIA;;AAEG;;AACH,OAAO,
|
1
|
+
{"version":3,"sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,SAAT,QAA0B,aAA1B;AACA,SAAS,YAAT,QAA6B,gBAA7B;AACA,SAAS,eAAT,QAAgC,mBAAhC;AAIA;;AAEG;;AACH,OAAO,MAAM,MAAM,gBAAqC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtF,QAAM,KAAK,GAAG,SAAS,CAAC,KAAD,EAAQ,GAAR,CAAvB;AAEA,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,YAAY,CAAC,KAAD,CAAnB;AACD,CANuD,CAAjD;AAQP,MAAM,CAAC,WAAP,GAAqB,QAArB","sourceRoot":""}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { getSlots } from '@fluentui/react-utilities';
|
4
3
|
import { switchShorthandProps } from './useSwitch';
|
@@ -6,11 +5,11 @@ import { switchShorthandProps } from './useSwitch';
|
|
6
5
|
* Render the final JSX of Switch
|
7
6
|
*/
|
8
7
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
8
|
+
export const renderSwitch = state => {
|
9
|
+
const {
|
10
|
+
slots,
|
11
|
+
slotProps
|
12
|
+
} = getSlots(state, switchShorthandProps);
|
13
|
+
return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.track, Object.assign({}, slotProps.track)), /*#__PURE__*/React.createElement(slots.thumbWrapper, Object.assign({}, slotProps.thumbWrapper), /*#__PURE__*/React.createElement(slots.thumb, Object.assign({}, slotProps.thumb))), /*#__PURE__*/React.createElement(slots.input, Object.assign({}, slotProps.input)), /*#__PURE__*/React.createElement(slots.activeRail, Object.assign({}, slotProps.activeRail)));
|
15
14
|
};
|
16
15
|
//# sourceMappingURL=renderSwitch.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/renderSwitch.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Switch/renderSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,oBAAT,QAAqC,aAArC;AAGA;;AAEG;;AACH,OAAO,MAAM,YAAY,GAAI,KAAD,IAAuB;AACjD,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAc,KAAd,EAAqB,oBAArB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,KAAf,CAAZ,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,YAAP,EAAmB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,YAAf,CAAnB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,KAAf,CAAZ,CADF,CAFF,eAKE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,KAAf,CAAZ,CALF,eAME,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,UAAf,CAAjB,CANF,CADF;AAUD,CAbM","sourceRoot":""}
|
@@ -1,35 +1,36 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
|
3
2
|
import { useSwitchState } from './useSwitchState';
|
4
3
|
/**
|
5
4
|
* Array of all shorthand properties listed in SwitchSlots
|
6
5
|
*/
|
7
6
|
|
8
|
-
export
|
7
|
+
export const switchShorthandProps = ['root', 'track', 'thumbWrapper', 'thumb', 'activeRail', 'input'];
|
9
8
|
/**
|
10
9
|
* Given user props, returns state and render function for a Switch.
|
11
10
|
*/
|
12
11
|
|
13
|
-
export
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
12
|
+
export const useSwitch = (props, ref) => {
|
13
|
+
const {
|
14
|
+
track,
|
15
|
+
thumbWrapper,
|
16
|
+
thumb,
|
17
|
+
activeRail,
|
18
|
+
input,
|
19
|
+
defaultChecked,
|
20
|
+
checked,
|
21
|
+
disabled,
|
22
|
+
onChange
|
23
|
+
} = props;
|
24
|
+
const state = {
|
25
|
+
defaultChecked,
|
26
|
+
checked,
|
27
|
+
disabled,
|
28
|
+
onChange,
|
29
|
+
root: getNativeElementProps('span', {
|
30
|
+
ref,
|
31
|
+
...props,
|
31
32
|
id: useId('switch-', props.id)
|
32
|
-
})
|
33
|
+
}),
|
33
34
|
components: {
|
34
35
|
root: 'div',
|
35
36
|
track: 'div',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/useSwitch.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Switch/useSwitch.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,KAAlD,QAA+D,2BAA/D;AACA,SAAS,cAAT,QAA+B,kBAA/B;AAGA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAA0B,CACzD,MADyD,EAEzD,OAFyD,EAGzD,cAHyD,EAIzD,OAJyD,E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,KAAD,EAAQ;AAC7B,MAAA,QAAQ,EAAE,IADmB;AAE7B,MAAA,YAAY,EAAE;AACZ,QAAA,IAAI,EAAE;AADM;AAFe,KAAR;AAtBE,GAA3B;AA8BA,EAAA,cAAc,CAAC,KAAD,CAAd;AAEA,SAAO,KAAP;AACD,CAnCM","sourceRoot":""}
|
@@ -3,51 +3,43 @@ import { clamp, useBoolean, useControllableState, useEventCallback, useMergedRef
|
|
3
3
|
import { useFluent } from '@fluentui/react-shared-contexts'; // TODO: This should be replaced with a useEvent hook
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5
5
|
|
6
|
-
|
6
|
+
const on = (element, eventName, callback) => {
|
7
7
|
element.addEventListener(eventName, callback);
|
8
|
-
return
|
9
|
-
return element.removeEventListener(eventName, callback);
|
10
|
-
};
|
8
|
+
return () => element.removeEventListener(eventName, callback);
|
11
9
|
};
|
12
10
|
|
13
|
-
export
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
11
|
+
export const useSwitchState = state => {
|
12
|
+
const {
|
13
|
+
defaultChecked = false,
|
14
|
+
checked,
|
15
|
+
disabled = false,
|
16
|
+
onChange
|
17
|
+
} = state;
|
18
|
+
const {
|
19
|
+
onPointerDown: onPointerDownCallback,
|
20
|
+
onKeyUp: onKeyUpCallback
|
21
|
+
} = state.root;
|
22
|
+
const {
|
23
|
+
dir
|
24
|
+
} = useFluent();
|
25
|
+
const inputRef = useMergedRefs(state.input.ref);
|
26
|
+
const railRef = React.useRef(null);
|
27
|
+
const internalState = React.useRef({
|
27
28
|
internalValue: checked ? checked : defaultChecked,
|
28
29
|
thumbIsDragging: false,
|
29
30
|
disposables: []
|
30
31
|
});
|
31
|
-
|
32
|
-
var _d = useControllableState({
|
32
|
+
const [currentValue, setCurrentValue] = useControllableState({
|
33
33
|
defaultState: defaultChecked,
|
34
34
|
state: checked,
|
35
35
|
initialState: false
|
36
|
-
})
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
showThumbAnimation = _f.setTrue,
|
44
|
-
hideThumbAnimation = _f.setFalse;
|
45
|
-
|
46
|
-
var _g = React.useState(currentValue === true ? 100 : 0),
|
47
|
-
renderedPosition = _g[0],
|
48
|
-
setRenderedPosition = _g[1];
|
49
|
-
|
50
|
-
var setChecked = useEventCallback(function (ev, incomingValue) {
|
36
|
+
});
|
37
|
+
const [thumbAnimation, {
|
38
|
+
setTrue: showThumbAnimation,
|
39
|
+
setFalse: hideThumbAnimation
|
40
|
+
}] = useBoolean(true);
|
41
|
+
const [renderedPosition, setRenderedPosition] = React.useState(currentValue === true ? 100 : 0);
|
42
|
+
const setChecked = useEventCallback((ev, incomingValue) => {
|
51
43
|
ev.stopPropagation();
|
52
44
|
ev.preventDefault();
|
53
45
|
internalState.current.internalValue = incomingValue;
|
@@ -57,17 +49,17 @@ export var useSwitchState = function (state) {
|
|
57
49
|
setCurrentValue(incomingValue);
|
58
50
|
setRenderedPosition(undefined);
|
59
51
|
});
|
60
|
-
|
52
|
+
const calculatePosition = React.useCallback(ev => {
|
61
53
|
var _a;
|
62
54
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
55
|
+
const currentBounds = (_a = railRef === null || railRef === void 0 ? void 0 : railRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
56
|
+
const railWidth = currentBounds.width;
|
57
|
+
const railPosition = dir === 'rtl' ? currentBounds.right : currentBounds.left;
|
58
|
+
const distance = dir === 'rtl' ? railPosition - ev.clientX : ev.clientX - railPosition;
|
67
59
|
return clamp(distance / railWidth * 100, 0, 100);
|
68
60
|
}, [dir]);
|
69
|
-
|
70
|
-
|
61
|
+
const onPointerMove = React.useCallback(ev => {
|
62
|
+
const incomingPosition = calculatePosition(ev);
|
71
63
|
internalState.current.thumbIsDragging = true;
|
72
64
|
hideThumbAnimation();
|
73
65
|
setRenderedPosition(incomingPosition); // If the Switch reaches a new position of 0% or 100%, update the state and fire change.
|
@@ -78,15 +70,13 @@ export var useSwitchState = function (state) {
|
|
78
70
|
setChecked(ev, false);
|
79
71
|
}
|
80
72
|
}, [calculatePosition, hideThumbAnimation, setChecked]);
|
81
|
-
|
82
|
-
internalState.current.disposables.forEach(
|
83
|
-
return dispose();
|
84
|
-
});
|
73
|
+
const onPointerUp = React.useCallback(ev => {
|
74
|
+
internalState.current.disposables.forEach(dispose => dispose());
|
85
75
|
internalState.current.disposables = [];
|
86
76
|
inputRef.current.focus();
|
87
77
|
|
88
78
|
if (internalState.current.thumbIsDragging) {
|
89
|
-
|
79
|
+
const roundedPosition = Math.round(calculatePosition(ev) / 100) * 100;
|
90
80
|
showThumbAnimation();
|
91
81
|
|
92
82
|
if (roundedPosition === 100) {
|
@@ -98,35 +88,37 @@ export var useSwitchState = function (state) {
|
|
98
88
|
setChecked(ev, !internalState.current.internalValue);
|
99
89
|
}
|
100
90
|
}, [calculatePosition, inputRef, setChecked, showThumbAnimation]);
|
101
|
-
|
91
|
+
const onPointerDown = React.useCallback(ev => {
|
102
92
|
var _a;
|
103
93
|
|
104
|
-
|
105
|
-
|
94
|
+
const {
|
95
|
+
pointerId
|
96
|
+
} = ev;
|
97
|
+
const target = ev.target;
|
106
98
|
onPointerDownCallback === null || onPointerDownCallback === void 0 ? void 0 : onPointerDownCallback(ev);
|
107
99
|
showThumbAnimation();
|
108
100
|
(_a = target.setPointerCapture) === null || _a === void 0 ? void 0 : _a.call(target, pointerId);
|
109
101
|
internalState.current.thumbIsDragging = false;
|
110
|
-
internalState.current.disposables.push(on(target, 'pointermove', onPointerMove), on(target, 'pointerup', onPointerUp),
|
102
|
+
internalState.current.disposables.push(on(target, 'pointermove', onPointerMove), on(target, 'pointerup', onPointerUp), () => {
|
111
103
|
var _a;
|
112
104
|
|
113
105
|
(_a = target.releasePointerCapture) === null || _a === void 0 ? void 0 : _a.call(target, pointerId);
|
114
106
|
});
|
115
107
|
}, [onPointerDownCallback, onPointerMove, onPointerUp, showThumbAnimation]);
|
116
|
-
|
108
|
+
const onKeyUp = React.useCallback(ev => {
|
117
109
|
onKeyUpCallback === null || onKeyUpCallback === void 0 ? void 0 : onKeyUpCallback(ev);
|
118
110
|
|
119
111
|
if (ev.key === ' ') {
|
120
112
|
setChecked(ev, !internalState.current.internalValue);
|
121
113
|
}
|
122
114
|
}, [onKeyUpCallback, setChecked]);
|
123
|
-
|
124
|
-
|
115
|
+
const currentPosition = renderedPosition !== undefined ? renderedPosition : currentValue ? 100 : 0;
|
116
|
+
const rootStyles = {
|
125
117
|
'--switch-checked-opacity': currentPosition / 100,
|
126
118
|
'--switch-unchecked-opacity': (100 - currentPosition) / 100
|
127
119
|
};
|
128
|
-
|
129
|
-
transform:
|
120
|
+
const thumbWrapperStyles = {
|
121
|
+
transform: `translate(${dir === 'rtl' ? -currentPosition : currentPosition}%)`,
|
130
122
|
transition: thumbAnimation ? 'transform .1s cubic-bezier(0.33, 0.0, 0.67, 1), opacity .1s cubic-bezier(0.33, 0.0, 0.67, 1)' : 'none'
|
131
123
|
}; // Root Props
|
132
124
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/useSwitchState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,KAAT,EAAgB,UAAhB,EAA4B,oBAA5B,EAAkD,gBAAlD,EAAoE,aAApE,QAAyF,2BAAzF;AACA,SAAS,SAAT,QAA0B,iCAA1B,C,CAoBA;AACA;;AACA,
|
1
|
+
{"version":3,"sources":["../../../src/components/Switch/useSwitchState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,KAAT,EAAgB,UAAhB,EAA4B,oBAA5B,EAAkD,gBAAlD,EAAoE,aAApE,QAAyF,2BAAzF;AACA,SAAS,SAAT,QAA0B,iCAA1B,C,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