@fluentui/react-link 9.1.19 → 9.1.22
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 +136 -1
- package/CHANGELOG.md +44 -2
- package/lib/components/Link/useLinkState.js +2 -4
- package/lib/components/Link/useLinkState.js.map +1 -1
- package/lib-commonjs/components/Link/useLinkState.js +2 -4
- package/lib-commonjs/components/Link/useLinkState.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,142 @@
|
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 26 Sep 2023 17:44:12 GMT",
|
|
6
|
+
"tag": "@fluentui/react-link_v9.1.22",
|
|
7
|
+
"version": "9.1.22",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "yuanboxue@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-link",
|
|
13
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d",
|
|
14
|
+
"comment": "chore: trigger manual version bump after broken release"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-link",
|
|
19
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.6",
|
|
20
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-link",
|
|
25
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.12",
|
|
26
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-link",
|
|
31
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.1",
|
|
32
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-link",
|
|
37
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.1",
|
|
38
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-link",
|
|
43
|
+
"comment": "Bump @fluentui/react-theme to v9.1.14",
|
|
44
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-link",
|
|
49
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.5",
|
|
50
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "Tue, 26 Sep 2023 15:31:57 GMT",
|
|
57
|
+
"tag": "@fluentui/react-link_v9.1.21",
|
|
58
|
+
"version": "9.1.21",
|
|
59
|
+
"comments": {
|
|
60
|
+
"patch": [
|
|
61
|
+
{
|
|
62
|
+
"author": "martinhochel@microsoft.com",
|
|
63
|
+
"package": "@fluentui/react-link",
|
|
64
|
+
"commit": "e61473fa10195f6ebf2308205c1e72e91b711831",
|
|
65
|
+
"comment": "fix: bump swc core to mitigate transpilation memory leaks"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "beachball",
|
|
69
|
+
"package": "@fluentui/react-link",
|
|
70
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.5",
|
|
71
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "beachball",
|
|
75
|
+
"package": "@fluentui/react-link",
|
|
76
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.11",
|
|
77
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-link",
|
|
82
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.0",
|
|
83
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-link",
|
|
88
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.0",
|
|
89
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-link",
|
|
94
|
+
"comment": "Bump @fluentui/react-theme to v9.1.13",
|
|
95
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-link",
|
|
100
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.4",
|
|
101
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"date": "Wed, 20 Sep 2023 17:47:38 GMT",
|
|
108
|
+
"tag": "@fluentui/react-link_v9.1.20",
|
|
109
|
+
"version": "9.1.20",
|
|
110
|
+
"comments": {
|
|
111
|
+
"patch": [
|
|
112
|
+
{
|
|
113
|
+
"author": "martinhochel@microsoft.com",
|
|
114
|
+
"package": "@fluentui/react-link",
|
|
115
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0",
|
|
116
|
+
"comment": "chore: trigger manual version bump after broken release"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"author": "beachball",
|
|
120
|
+
"package": "@fluentui/react-link",
|
|
121
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.10",
|
|
122
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"author": "beachball",
|
|
126
|
+
"package": "@fluentui/react-link",
|
|
127
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.8.1",
|
|
128
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"author": "beachball",
|
|
132
|
+
"package": "@fluentui/react-link",
|
|
133
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.11",
|
|
134
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"date": "Wed, 20 Sep 2023 14:59:53 GMT",
|
|
6
141
|
"tag": "@fluentui/react-link_v9.1.19",
|
|
7
142
|
"version": "9.1.19",
|
|
8
143
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,54 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-link
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 26 Sep 2023 17:44:12 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.1.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.1.22)
|
|
8
|
+
|
|
9
|
+
Tue, 26 Sep 2023 17:44:12 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.1.21..@fluentui/react-link_v9.1.22)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
|
|
15
|
+
- Bump @fluentui/keyboard-keys to v9.0.6 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.12 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.9.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v9.13.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
19
|
+
- Bump @fluentui/react-theme to v9.1.14 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v9.13.5 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
21
|
+
|
|
22
|
+
## [9.1.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.1.21)
|
|
23
|
+
|
|
24
|
+
Tue, 26 Sep 2023 15:31:57 GMT
|
|
25
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.1.20..@fluentui/react-link_v9.1.21)
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
|
|
30
|
+
- Bump @fluentui/keyboard-keys to v9.0.5 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
31
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.11 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
32
|
+
- Bump @fluentui/react-shared-contexts to v9.9.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
33
|
+
- Bump @fluentui/react-tabster to v9.13.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
34
|
+
- Bump @fluentui/react-theme to v9.1.13 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
35
|
+
- Bump @fluentui/react-utilities to v9.13.4 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
36
|
+
|
|
37
|
+
## [9.1.20](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.1.20)
|
|
38
|
+
|
|
39
|
+
Wed, 20 Sep 2023 17:47:38 GMT
|
|
40
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.1.19..@fluentui/react-link_v9.1.20)
|
|
41
|
+
|
|
42
|
+
### Patches
|
|
43
|
+
|
|
44
|
+
- chore: trigger manual version bump after broken release ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by martinhochel@microsoft.com)
|
|
45
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.10 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
46
|
+
- Bump @fluentui/react-shared-contexts to v9.8.1 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
47
|
+
- Bump @fluentui/react-tabster to v9.12.11 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
48
|
+
|
|
7
49
|
## [9.1.19](https://github.com/microsoft/fluentui/tree/@fluentui/react-link_v9.1.19)
|
|
8
50
|
|
|
9
|
-
Wed, 20 Sep 2023 14:
|
|
51
|
+
Wed, 20 Sep 2023 14:59:53 GMT
|
|
10
52
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-link_v9.1.18..@fluentui/react-link_v9.1.19)
|
|
11
53
|
|
|
12
54
|
### Patches
|
|
@@ -22,8 +22,7 @@ import { Enter, Space } from '@fluentui/keyboard-keys';
|
|
|
22
22
|
if (disabled || disabledFocusable) {
|
|
23
23
|
ev.preventDefault();
|
|
24
24
|
} else {
|
|
25
|
-
|
|
26
|
-
(_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(ev);
|
|
25
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
// Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.
|
|
@@ -32,8 +31,7 @@ import { Enter, Space } from '@fluentui/keyboard-keys';
|
|
|
32
31
|
ev.preventDefault();
|
|
33
32
|
ev.stopPropagation();
|
|
34
33
|
} else {
|
|
35
|
-
|
|
36
|
-
(_onKeyDown = onKeyDown) === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(ev);
|
|
34
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
|
|
37
35
|
}
|
|
38
36
|
};
|
|
39
37
|
// Set the aria-disabled and disabled props correctly.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n // Add type=\"button\" for button elements.\n else {\n state.root.type = type || 'button';\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"names":["React","Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AAGvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwB,CAACC;IACpC,MAAM,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGF;IACxC,MAAM,EAAEG,OAAO,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGP,MAAMQ,IAAI;IAE/D,+CAA+C;IAC/C,IAAIR,MAAMQ,IAAI,CAACC,EAAE,KAAK,KAAK;QACzBT,MAAMQ,IAAI,CAACE,IAAI,GAAGT,WAAWU,YAAYX,MAAMQ,IAAI,CAACE,IAAI;QACxDV,MAAMQ,IAAI,CAACF,QAAQ,GAAGA,qBAAAA,sBAAAA,WAAaL,YAAY,CAACC,oBAAoBS,YAAY;QAEhF,4DAA4D;QAC5D,IAAIV,YAAYC,mBAAmB;YACjCF,MAAMQ,IAAI,CAACH,IAAI,GAAGA,QAAQ;QAC5B;IACF,OAEK;QACHL,MAAMQ,IAAI,CAACD,IAAI,GAAGA,QAAQ;IAC5B;IAEA,wGAAwG;IACxGP,MAAMQ,IAAI,CAACL,OAAO,GAAG,CAACS;QACpB,IAAIX,YAAYC,mBAAmB;YACjCU,GAAGC,cAAc;QACnB,OAAO;
|
|
1
|
+
{"version":3,"sources":["useLinkState.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { LinkState } from './Link.types';\n\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */\nexport const useLinkState_unstable = (state: LinkState): LinkState => {\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex ?? (disabled && !disabledFocusable ? undefined : 0);\n\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n }\n // Add type=\"button\" for button elements.\n else {\n state.root.type = type || 'button';\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev: React.MouseEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev: React.KeyboardEvent<HTMLAnchorElement & HTMLButtonElement>) => {\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n\n return state;\n};\n"],"names":["React","Enter","Space","useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","stopPropagation"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,E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AACC,EAAE,KAAK,UAAU;QAC9BT,MAAMQ,IAAI,CAACP,QAAQ,GAAGA,YAAY,CAACC;IACrC;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -30,8 +30,7 @@ const useLinkState_unstable = (state)=>{
|
|
|
30
30
|
if (disabled || disabledFocusable) {
|
|
31
31
|
ev.preventDefault();
|
|
32
32
|
} else {
|
|
33
|
-
|
|
34
|
-
(_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(ev);
|
|
33
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
36
|
// Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.
|
|
@@ -40,8 +39,7 @@ const useLinkState_unstable = (state)=>{
|
|
|
40
39
|
ev.preventDefault();
|
|
41
40
|
ev.stopPropagation();
|
|
42
41
|
} else {
|
|
43
|
-
|
|
44
|
-
(_onKeyDown = onKeyDown) === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(ev);
|
|
42
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
|
|
45
43
|
}
|
|
46
44
|
};
|
|
47
45
|
// Set the aria-disabled and disabled props correctly.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLinkState.js"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */ export const useLinkState_unstable = (state)=>{\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex !== null && tabIndex !== void 0 ? tabIndex : disabled && !disabledFocusable ? undefined : 0;\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n } else {\n state.root.type = type || 'button';\n }\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev)=>{\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n
|
|
1
|
+
{"version":3,"sources":["useLinkState.js"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\n/**\n * The useLinkState_unstable hook processes the Link state.\n * @param state - Link state to mutate.\n */ export const useLinkState_unstable = (state)=>{\n const { disabled, disabledFocusable } = state;\n const { onClick, onKeyDown, role, tabIndex, type } = state.root;\n // Add href and tabIndex=0 for anchor elements.\n if (state.root.as === 'a') {\n state.root.href = disabled ? undefined : state.root.href;\n state.root.tabIndex = tabIndex !== null && tabIndex !== void 0 ? tabIndex : disabled && !disabledFocusable ? undefined : 0;\n // Add role=\"link\" for disabled and disabledFocusable links.\n if (disabled || disabledFocusable) {\n state.root.role = role || 'link';\n }\n } else {\n state.root.type = type || 'button';\n }\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onClick = (ev)=>{\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick === null || onClick === void 0 ? void 0 : onClick(ev);\n }\n };\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n state.root.onKeyDown = (ev)=>{\n if ((disabled || disabledFocusable) && (ev.key === Enter || ev.key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);\n }\n };\n // Set the aria-disabled and disabled props correctly.\n state.disabled = disabled || disabledFocusable;\n state.root['aria-disabled'] = disabled || disabledFocusable || undefined;\n if (state.root.as === 'button') {\n state.root.disabled = disabled && !disabledFocusable;\n }\n return state;\n};\n"],"names":["useLinkState_unstable","state","disabled","disabledFocusable","onClick","onKeyDown","role","tabIndex","type","root","as","href","undefined","ev","preventDefault","key","Enter","Space","stopPropagation"],"mappings":";;;;+BAKiBA;;;eAAAA;;;;iEALM;8BACM;AAIlB,MAA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IAC/D,IAAIX,MAAMQ,IAAI,CAACC,EAAE,KAAK,UAAU;QAC5BT,MAAMQ,IAAI,CAACP,QAAQ,GAAGA,YAAY,CAACC;IACvC;IACA,OAAOF;AACX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-link",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.22",
|
|
4
4
|
"description": "Fluent UI React Link component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"@fluentui/scripts-tasks": "*"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@fluentui/keyboard-keys": "^9.0.
|
|
38
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
39
|
-
"@fluentui/react-shared-contexts": "^9.
|
|
40
|
-
"@fluentui/react-tabster": "^9.
|
|
41
|
-
"@fluentui/react-theme": "^9.1.
|
|
42
|
-
"@fluentui/react-utilities": "^9.13.
|
|
37
|
+
"@fluentui/keyboard-keys": "^9.0.6",
|
|
38
|
+
"@fluentui/react-jsx-runtime": "^9.0.12",
|
|
39
|
+
"@fluentui/react-shared-contexts": "^9.9.1",
|
|
40
|
+
"@fluentui/react-tabster": "^9.13.1",
|
|
41
|
+
"@fluentui/react-theme": "^9.1.14",
|
|
42
|
+
"@fluentui/react-utilities": "^9.13.5",
|
|
43
43
|
"@griffel/react": "^1.5.14",
|
|
44
44
|
"@swc/helpers": "^0.5.1"
|
|
45
45
|
},
|