@fluentui/react-utilities 9.18.2 → 9.18.4
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.md +20 -2
- package/lib/utils/types.js +4 -1
- package/lib/utils/types.js.map +1 -1
- package/lib-commonjs/compose/constants.js +3 -3
- package/lib-commonjs/compose/constants.js.map +1 -1
- package/lib-commonjs/events/mouseTouchHelpers.js +4 -4
- package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
- package/lib-commonjs/index.js +81 -81
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/ssr/SSRContext.js +6 -6
- package/lib-commonjs/ssr/SSRContext.js.map +1 -1
- package/lib-commonjs/utils/properties.js +52 -52
- package/lib-commonjs/utils/properties.js.map +1 -1
- package/lib-commonjs/utils/types.js +4 -1
- package/lib-commonjs/utils/types.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,30 @@
|
|
1
1
|
# Change Log - @fluentui/react-utilities
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Fri, 15 Mar 2024 21:37:57 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.18.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.18.4)
|
8
|
+
|
9
|
+
Fri, 15 Mar 2024 21:37:57 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.18.3..@fluentui/react-utilities_v9.18.4)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- Bump @fluentui/react-shared-contexts to v9.15.1 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
15
|
+
|
16
|
+
## [9.18.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.18.3)
|
17
|
+
|
18
|
+
Thu, 07 Mar 2024 19:33:27 GMT
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.18.2..@fluentui/react-utilities_v9.18.3)
|
20
|
+
|
21
|
+
### Patches
|
22
|
+
|
23
|
+
- Bump @fluentui/react-shared-contexts to v9.15.0 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
24
|
+
|
7
25
|
## [9.18.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.18.2)
|
8
26
|
|
9
|
-
Wed, 28 Feb 2024 02:
|
27
|
+
Wed, 28 Feb 2024 02:34:19 GMT
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.18.1..@fluentui/react-utilities_v9.18.2)
|
11
29
|
|
12
30
|
### Patches
|
package/lib/utils/types.js
CHANGED
@@ -18,4 +18,7 @@
|
|
18
18
|
// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },
|
19
19
|
// so the result is {} | { b: string }, as expected.
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
21
|
-
|
21
|
+
/**
|
22
|
+
* @internal
|
23
|
+
* If type T includes `null`, remove it and add `undefined` instead.
|
24
|
+
*/ export { };
|
package/lib/utils/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["types.ts"],"sourcesContent":["/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */\n// Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : T;\n\n/**\n * Converts a union type (`A | B | C`) to an intersection type (`A & B & C`)\n */\nexport type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;\n\n/**\n * @internal\n * If type T includes `null`, remove it and add `undefined` instead.\n */\nexport type ReplaceNullWithUndefined<T> = T extends null ? Exclude<T, null> | undefined : T;\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GACD,8EAA8E;AAC9E,EAAE;AACF,6DAA6D;AAC7D,0GAA0G;AAC1G,mGAAmG;AACnG,qFAAqF;AACrF,oCAAoC;AACpC,wDAAwD;AACxD,EAAE;AACF,gEAAgE;AAChE,uDAAuD;AACvD,qEAAqE;AACrE,0MAA0M;AAC1M,oDAAoD;AACpD,8DAA8D;
|
1
|
+
{"version":3,"sources":["types.ts"],"sourcesContent":["/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */\n// Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : T;\n\n/**\n * Converts a union type (`A | B | C`) to an intersection type (`A & B & C`)\n */\nexport type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;\n\n/**\n * @internal\n * If type T includes `null`, remove it and add `undefined` instead.\n */\nexport type ReplaceNullWithUndefined<T> = T extends null ? Exclude<T, null> | undefined : T;\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GACD,8EAA8E;AAC9E,EAAE;AACF,6DAA6D;AAC7D,0GAA0G;AAC1G,mGAAmG;AACnG,qFAAqF;AACrF,oCAAoC;AACpC,wDAAwD;AACxD,EAAE;AACF,gEAAgE;AAChE,uDAAuD;AACvD,qEAAqE;AACrE,0MAA0M;AAC1M,oDAAoD;AACpD,8DAA8D;AAQ9D;;;CAGC,GACD,WAA4F"}
|
@@ -12,11 +12,11 @@ function _export(target, all) {
|
|
12
12
|
});
|
13
13
|
}
|
14
14
|
_export(exports, {
|
15
|
-
SLOT_RENDER_FUNCTION_SYMBOL: function() {
|
16
|
-
return SLOT_RENDER_FUNCTION_SYMBOL;
|
17
|
-
},
|
18
15
|
SLOT_ELEMENT_TYPE_SYMBOL: function() {
|
19
16
|
return SLOT_ELEMENT_TYPE_SYMBOL;
|
17
|
+
},
|
18
|
+
SLOT_RENDER_FUNCTION_SYMBOL: function() {
|
19
|
+
return SLOT_RENDER_FUNCTION_SYMBOL;
|
20
20
|
}
|
21
21
|
});
|
22
22
|
const SLOT_RENDER_FUNCTION_SYMBOL = Symbol.for('fui.slotRenderFunction');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["constants.js"],"sourcesContent":["/**\n * @internal\n * Internal reference for the render function\n */ export const SLOT_RENDER_FUNCTION_SYMBOL = Symbol.for('fui.slotRenderFunction');\n/**\n * @internal\n * Internal reference for the render function\n */ export const SLOT_ELEMENT_TYPE_SYMBOL = Symbol.for('fui.slotElementType');\n"],"names":["
|
1
|
+
{"version":3,"sources":["constants.js"],"sourcesContent":["/**\n * @internal\n * Internal reference for the render function\n */ export const SLOT_RENDER_FUNCTION_SYMBOL = Symbol.for('fui.slotRenderFunction');\n/**\n * @internal\n * Internal reference for the render function\n */ export const SLOT_ELEMENT_TYPE_SYMBOL = Symbol.for('fui.slotElementType');\n"],"names":["SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","Symbol","for"],"mappings":"AAAA;;;CAGC;;;;;;;;;;;IAIgBA,wBAAwB;eAAxBA;;IAJAC,2BAA2B;eAA3BA;;;AAAN,MAAMA,8BAA8BC,OAAOC,GAAG,CAAC;AAI/C,MAAMH,2BAA2BE,OAAOC,GAAG,CAAC"}
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
|
13
|
-
return
|
12
|
+
getEventClientCoords: function() {
|
13
|
+
return getEventClientCoords;
|
14
14
|
},
|
15
15
|
isMouseEvent: function() {
|
16
16
|
return isMouseEvent;
|
17
17
|
},
|
18
|
-
|
19
|
-
return
|
18
|
+
isTouchEvent: function() {
|
19
|
+
return isTouchEvent;
|
20
20
|
}
|
21
21
|
});
|
22
22
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["mouseTouchHelpers.js"],"sourcesContent":["import * as React from 'react';\n/**\n * Returns true if event is a touch event. Useful when sharing logic between touch and mouse interactions.\n */ export function isTouchEvent(event) {\n return event.type.startsWith('touch');\n}\n/**\n * Returns true if event is a mouse event. Useful when sharing logic between touch and mouse interactions.\n */ export function isMouseEvent(event) {\n return event.type.startsWith('mouse') || [\n 'click',\n 'contextmenu',\n 'dblclick'\n ].indexOf(event.type) > -1;\n}\n/**\n * Returns an object with clientX, clientY for TouchOrMouseEvent.\n * Returns zeros in case the event is not a mouse or a touch event.\n */ export function getEventClientCoords(event) {\n if (isMouseEvent(event)) {\n return {\n clientX: event.clientX,\n clientY: event.clientY\n };\n } else if (isTouchEvent(event)) {\n return {\n clientX: event.touches[0].clientX,\n clientY: event.touches[0].clientY\n };\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('@fluentui/react-utilities]: Unable to get clientX. Unknown event type.');\n }\n return {\n clientX: 0,\n clientY: 0\n };\n }\n}\n"],"names":["
|
1
|
+
{"version":3,"sources":["mouseTouchHelpers.js"],"sourcesContent":["import * as React from 'react';\n/**\n * Returns true if event is a touch event. Useful when sharing logic between touch and mouse interactions.\n */ export function isTouchEvent(event) {\n return event.type.startsWith('touch');\n}\n/**\n * Returns true if event is a mouse event. Useful when sharing logic between touch and mouse interactions.\n */ export function isMouseEvent(event) {\n return event.type.startsWith('mouse') || [\n 'click',\n 'contextmenu',\n 'dblclick'\n ].indexOf(event.type) > -1;\n}\n/**\n * Returns an object with clientX, clientY for TouchOrMouseEvent.\n * Returns zeros in case the event is not a mouse or a touch event.\n */ export function getEventClientCoords(event) {\n if (isMouseEvent(event)) {\n return {\n clientX: event.clientX,\n clientY: event.clientY\n };\n } else if (isTouchEvent(event)) {\n return {\n clientX: event.touches[0].clientX,\n clientY: event.touches[0].clientY\n };\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('@fluentui/react-utilities]: Unable to get clientX. Unknown event type.');\n }\n return {\n clientX: 0,\n clientY: 0\n };\n }\n}\n"],"names":["getEventClientCoords","isMouseEvent","isTouchEvent","event","type","startsWith","indexOf","clientX","clientY","touches","process","env","NODE_ENV","Error"],"mappings":";;;;;;;;;;;IAkBoBA,oBAAoB;eAApBA;;IAVAC,YAAY;eAAZA;;IALAC,YAAY;eAAZA;;;;iEAHG;AAGZ,SAASA,aAAaC,KAAK;IAClC,OAAOA,MAAMC,IAAI,CAACC,UAAU,CAAC;AACjC;AAGW,SAASJ,aAAaE,KAAK;IAClC,OAAOA,MAAMC,IAAI,CAACC,UAAU,CAAC,YAAY;QACrC;QACA;QACA;KACH,CAACC,OAAO,CAACH,MAAMC,IAAI,IAAI,CAAC;AAC7B;AAIW,SAASJ,qBAAqBG,KAAK;IAC1C,IAAIF,aAAaE,QAAQ;QACrB,OAAO;YACHI,SAASJ,MAAMI,OAAO;YACtBC,SAASL,MAAMK,OAAO;QAC1B;IACJ,OAAO,IAAIN,aAAaC,QAAQ;QAC5B,OAAO;YACHI,SAASJ,MAAMM,OAAO,CAAC,EAAE,CAACF,OAAO;YACjCC,SAASL,MAAMM,OAAO,CAAC,EAAE,CAACD,OAAO;QACrC;IACJ,OAAO;QACH,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACvC,MAAM,IAAIC,MAAM;QACpB;QACA,OAAO;YACHN,SAAS;YACTC,SAAS;QACb;IACJ;AACJ"}
|
package/lib-commonjs/index.js
CHANGED
@@ -9,11 +9,53 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
|
13
|
-
return
|
12
|
+
IdPrefixProvider: function() {
|
13
|
+
return _index1.IdPrefixProvider;
|
14
14
|
},
|
15
|
-
|
16
|
-
return _index.
|
15
|
+
SLOT_ELEMENT_TYPE_SYMBOL: function() {
|
16
|
+
return _index.SLOT_ELEMENT_TYPE_SYMBOL;
|
17
|
+
},
|
18
|
+
SLOT_RENDER_FUNCTION_SYMBOL: function() {
|
19
|
+
return _index.SLOT_RENDER_FUNCTION_SYMBOL;
|
20
|
+
},
|
21
|
+
SSRProvider: function() {
|
22
|
+
return _index2.SSRProvider;
|
23
|
+
},
|
24
|
+
applyTriggerPropsToChildren: function() {
|
25
|
+
return _index4.applyTriggerPropsToChildren;
|
26
|
+
},
|
27
|
+
assertSlots: function() {
|
28
|
+
return _index.assertSlots;
|
29
|
+
},
|
30
|
+
canUseDOM: function() {
|
31
|
+
return _index2.canUseDOM;
|
32
|
+
},
|
33
|
+
clamp: function() {
|
34
|
+
return _index3.clamp;
|
35
|
+
},
|
36
|
+
createPriorityQueue: function() {
|
37
|
+
return _index3.createPriorityQueue;
|
38
|
+
},
|
39
|
+
elementContains: function() {
|
40
|
+
return _index7.elementContains;
|
41
|
+
},
|
42
|
+
getEventClientCoords: function() {
|
43
|
+
return _index5.getEventClientCoords;
|
44
|
+
},
|
45
|
+
getIntrinsicElementProps: function() {
|
46
|
+
return _index.getIntrinsicElementProps;
|
47
|
+
},
|
48
|
+
getNativeElementProps: function() {
|
49
|
+
return _index3.getNativeElementProps;
|
50
|
+
},
|
51
|
+
getParent: function() {
|
52
|
+
return _index7.getParent;
|
53
|
+
},
|
54
|
+
getPartitionedNativeProps: function() {
|
55
|
+
return _index3.getPartitionedNativeProps;
|
56
|
+
},
|
57
|
+
getRTLSafeKey: function() {
|
58
|
+
return _index3.getRTLSafeKey;
|
17
59
|
},
|
18
60
|
getSlots: function() {
|
19
61
|
return _index.getSlots;
|
@@ -21,30 +63,48 @@ _export(exports, {
|
|
21
63
|
getSlotsNext: function() {
|
22
64
|
return _index.getSlotsNext;
|
23
65
|
},
|
24
|
-
|
25
|
-
return
|
66
|
+
getTriggerChild: function() {
|
67
|
+
return _index4.getTriggerChild;
|
26
68
|
},
|
27
|
-
|
28
|
-
return
|
69
|
+
isFluentTrigger: function() {
|
70
|
+
return _index4.isFluentTrigger;
|
71
|
+
},
|
72
|
+
isHTMLElement: function() {
|
73
|
+
return _index3.isHTMLElement;
|
74
|
+
},
|
75
|
+
isInteractiveHTMLElement: function() {
|
76
|
+
return _index3.isInteractiveHTMLElement;
|
77
|
+
},
|
78
|
+
isMouseEvent: function() {
|
79
|
+
return _index5.isMouseEvent;
|
29
80
|
},
|
30
81
|
isResolvedShorthand: function() {
|
31
82
|
return _index.isResolvedShorthand;
|
32
83
|
},
|
33
|
-
|
34
|
-
return _index.
|
84
|
+
isSlot: function() {
|
85
|
+
return _index.isSlot;
|
35
86
|
},
|
36
|
-
|
37
|
-
return
|
87
|
+
isTouchEvent: function() {
|
88
|
+
return _index5.isTouchEvent;
|
38
89
|
},
|
39
|
-
|
40
|
-
return
|
90
|
+
mergeCallbacks: function() {
|
91
|
+
return _index3.mergeCallbacks;
|
41
92
|
},
|
42
|
-
|
43
|
-
return
|
93
|
+
omit: function() {
|
94
|
+
return _index3.omit;
|
44
95
|
},
|
45
96
|
resetIdsForTests: function() {
|
46
97
|
return _index1.resetIdsForTests;
|
47
98
|
},
|
99
|
+
resolveShorthand: function() {
|
100
|
+
return _index.resolveShorthand;
|
101
|
+
},
|
102
|
+
setVirtualParent: function() {
|
103
|
+
return _index7.setVirtualParent;
|
104
|
+
},
|
105
|
+
slot: function() {
|
106
|
+
return _index.slot;
|
107
|
+
},
|
48
108
|
useAnimationFrame: function() {
|
49
109
|
return _index1.useAnimationFrame;
|
50
110
|
},
|
@@ -63,6 +123,9 @@ _export(exports, {
|
|
63
123
|
useId: function() {
|
64
124
|
return _index1.useId;
|
65
125
|
},
|
126
|
+
useIsSSR: function() {
|
127
|
+
return _index2.useIsSSR;
|
128
|
+
},
|
66
129
|
useIsomorphicLayoutEffect: function() {
|
67
130
|
return _index1.useIsomorphicLayoutEffect;
|
68
131
|
},
|
@@ -81,74 +144,11 @@ _export(exports, {
|
|
81
144
|
useScrollbarWidth: function() {
|
82
145
|
return _index1.useScrollbarWidth;
|
83
146
|
},
|
84
|
-
useTimeout: function() {
|
85
|
-
return _index1.useTimeout;
|
86
|
-
},
|
87
|
-
canUseDOM: function() {
|
88
|
-
return _index2.canUseDOM;
|
89
|
-
},
|
90
|
-
useIsSSR: function() {
|
91
|
-
return _index2.useIsSSR;
|
92
|
-
},
|
93
|
-
SSRProvider: function() {
|
94
|
-
return _index2.SSRProvider;
|
95
|
-
},
|
96
|
-
clamp: function() {
|
97
|
-
return _index3.clamp;
|
98
|
-
},
|
99
|
-
getNativeElementProps: function() {
|
100
|
-
return _index3.getNativeElementProps;
|
101
|
-
},
|
102
|
-
getPartitionedNativeProps: function() {
|
103
|
-
return _index3.getPartitionedNativeProps;
|
104
|
-
},
|
105
|
-
getRTLSafeKey: function() {
|
106
|
-
return _index3.getRTLSafeKey;
|
107
|
-
},
|
108
|
-
mergeCallbacks: function() {
|
109
|
-
return _index3.mergeCallbacks;
|
110
|
-
},
|
111
|
-
isHTMLElement: function() {
|
112
|
-
return _index3.isHTMLElement;
|
113
|
-
},
|
114
|
-
isInteractiveHTMLElement: function() {
|
115
|
-
return _index3.isInteractiveHTMLElement;
|
116
|
-
},
|
117
|
-
omit: function() {
|
118
|
-
return _index3.omit;
|
119
|
-
},
|
120
|
-
createPriorityQueue: function() {
|
121
|
-
return _index3.createPriorityQueue;
|
122
|
-
},
|
123
|
-
applyTriggerPropsToChildren: function() {
|
124
|
-
return _index4.applyTriggerPropsToChildren;
|
125
|
-
},
|
126
|
-
getTriggerChild: function() {
|
127
|
-
return _index4.getTriggerChild;
|
128
|
-
},
|
129
|
-
isFluentTrigger: function() {
|
130
|
-
return _index4.isFluentTrigger;
|
131
|
-
},
|
132
|
-
isTouchEvent: function() {
|
133
|
-
return _index5.isTouchEvent;
|
134
|
-
},
|
135
|
-
isMouseEvent: function() {
|
136
|
-
return _index5.isMouseEvent;
|
137
|
-
},
|
138
|
-
getEventClientCoords: function() {
|
139
|
-
return _index5.getEventClientCoords;
|
140
|
-
},
|
141
147
|
useSelection: function() {
|
142
148
|
return _index6.useSelection;
|
143
149
|
},
|
144
|
-
|
145
|
-
return
|
146
|
-
},
|
147
|
-
setVirtualParent: function() {
|
148
|
-
return _index7.setVirtualParent;
|
149
|
-
},
|
150
|
-
getParent: function() {
|
151
|
-
return _index7.getParent;
|
150
|
+
useTimeout: function() {
|
151
|
+
return _index1.useTimeout;
|
152
152
|
}
|
153
153
|
});
|
154
154
|
const _index = require("./compose/index");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export { slot, isSlot, // eslint-disable-next-line deprecation/deprecation\ngetSlots, // eslint-disable-next-line deprecation/deprecation\ngetSlotsNext, assertSlots, // eslint-disable-next-line deprecation/deprecation\nresolveShorthand, isResolvedShorthand, getIntrinsicElementProps, SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from './compose/index';\nexport { IdPrefixProvider, resetIdsForTests, useAnimationFrame, useControllableState, useEventCallback, useFirstMount, useForceUpdate, useId, useIsomorphicLayoutEffect, useMergedRefs, useOnClickOutside, useOnScrollOutside, usePrevious, useScrollbarWidth, useTimeout } from './hooks/index';\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\nexport { clamp, // eslint-disable-next-line deprecation/deprecation\ngetNativeElementProps, getPartitionedNativeProps, getRTLSafeKey, mergeCallbacks, isHTMLElement, isInteractiveHTMLElement, omit, createPriorityQueue } from './utils/index';\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\nexport { isTouchEvent, isMouseEvent, getEventClientCoords } from './events/index';\nexport { useSelection } from './selection/index';\nexport { elementContains, setVirtualParent, getParent } from './virtualParent/index';\n"],"names":["
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { slot, isSlot, // eslint-disable-next-line deprecation/deprecation\ngetSlots, // eslint-disable-next-line deprecation/deprecation\ngetSlotsNext, assertSlots, // eslint-disable-next-line deprecation/deprecation\nresolveShorthand, isResolvedShorthand, getIntrinsicElementProps, SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from './compose/index';\nexport { IdPrefixProvider, resetIdsForTests, useAnimationFrame, useControllableState, useEventCallback, useFirstMount, useForceUpdate, useId, useIsomorphicLayoutEffect, useMergedRefs, useOnClickOutside, useOnScrollOutside, usePrevious, useScrollbarWidth, useTimeout } from './hooks/index';\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\nexport { clamp, // eslint-disable-next-line deprecation/deprecation\ngetNativeElementProps, getPartitionedNativeProps, getRTLSafeKey, mergeCallbacks, isHTMLElement, isInteractiveHTMLElement, omit, createPriorityQueue } from './utils/index';\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\nexport { isTouchEvent, isMouseEvent, getEventClientCoords } from './events/index';\nexport { useSelection } from './selection/index';\nexport { elementContains, setVirtualParent, getParent } from './virtualParent/index';\n"],"names":["IdPrefixProvider","SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","SSRProvider","applyTriggerPropsToChildren","assertSlots","canUseDOM","clamp","createPriorityQueue","elementContains","getEventClientCoords","getIntrinsicElementProps","getNativeElementProps","getParent","getPartitionedNativeProps","getRTLSafeKey","getSlots","getSlotsNext","getTriggerChild","isFluentTrigger","isHTMLElement","isInteractiveHTMLElement","isMouseEvent","isResolvedShorthand","isSlot","isTouchEvent","mergeCallbacks","omit","resetIdsForTests","resolveShorthand","setVirtualParent","slot","useAnimationFrame","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsSSR","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useScrollbarWidth","useSelection","useTimeout"],"mappings":";;;;;;;;;;;IAISA,gBAAgB;eAAhBA,wBAAgB;;IADwCC,wBAAwB;eAAxBA,+BAAwB;;IAAEC,2BAA2B;eAA3BA,kCAA2B;;IAExFC,WAAW;eAAXA,mBAAW;;IAGhCC,2BAA2B;eAA3BA,mCAA2B;;IANtBC,WAAW;eAAXA,kBAAW;;IAGhBC,SAAS;eAATA,iBAAS;;IACTC,KAAK;eAALA,aAAK;;IACkHC,mBAAmB;eAAnBA,2BAAmB;;IAI1IC,eAAe;eAAfA,uBAAe;;IA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@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
defaultSSRContextValue: function() {
|
13
|
-
return defaultSSRContextValue;
|
14
|
-
},
|
15
12
|
SSRContext: function() {
|
16
13
|
return SSRContext;
|
17
14
|
},
|
18
|
-
useSSRContext: function() {
|
19
|
-
return useSSRContext;
|
20
|
-
},
|
21
15
|
SSRProvider: function() {
|
22
16
|
return SSRProvider;
|
23
17
|
},
|
18
|
+
defaultSSRContextValue: function() {
|
19
|
+
return defaultSSRContextValue;
|
20
|
+
},
|
24
21
|
useIsSSR: function() {
|
25
22
|
return useIsSSR;
|
23
|
+
},
|
24
|
+
useSSRContext: function() {
|
25
|
+
return useSSRContext;
|
26
26
|
}
|
27
27
|
});
|
28
28
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["SSRContext.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from './canUseDOM';\n/**\n * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.\n *\n * @internal\n */ export const defaultSSRContextValue = {\n current: 0\n};\nexport const SSRContext = /*#__PURE__*/ React.createContext(undefined);\n/**\n * @internal\n */ export function useSSRContext() {\n var _React_useContext;\n return (_React_useContext = React.useContext(SSRContext)) !== null && _React_useContext !== void 0 ? _React_useContext : defaultSSRContextValue;\n}\n/**\n * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids\n * are consistent between the client and server.\n *\n * @public\n */ export const SSRProvider = (props)=>{\n const [value] = React.useState(()=>({\n current: 0\n }));\n return /*#__PURE__*/ React.createElement(SSRContext.Provider, {\n value: value\n }, props.children);\n};\n/**\n * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay\n * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.\n */ export function useIsSSR() {\n const isInSSRContext = useSSRContext() !== defaultSSRContextValue;\n const [isSSR, setIsSSR] = React.useState(isInSSRContext);\n // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the\n // developer to add one.\n if (process.env.NODE_ENV !== 'production') {\n if (!isInSSRContext && !canUseDOM()) {\n // eslint-disable-next-line no-console\n console.error(`@fluentui/react-components [${useIsSSR.name}]:\nWhen server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.\n\n\nCheck documentation at https://aka.ms/fluentui-ssr.`);\n }\n }\n // If on the client, and the component was initially server rendered, then schedule a layout effect to update the\n // component after hydration.\n if (canUseDOM() && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after\n // mounting.\n // eslint-disable-next-line\n React.useLayoutEffect(()=>{\n setIsSSR(false);\n }, []);\n }\n return isSSR;\n}\n"],"names":["
|
1
|
+
{"version":3,"sources":["SSRContext.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from './canUseDOM';\n/**\n * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.\n *\n * @internal\n */ export const defaultSSRContextValue = {\n current: 0\n};\nexport const SSRContext = /*#__PURE__*/ React.createContext(undefined);\n/**\n * @internal\n */ export function useSSRContext() {\n var _React_useContext;\n return (_React_useContext = React.useContext(SSRContext)) !== null && _React_useContext !== void 0 ? _React_useContext : defaultSSRContextValue;\n}\n/**\n * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids\n * are consistent between the client and server.\n *\n * @public\n */ export const SSRProvider = (props)=>{\n const [value] = React.useState(()=>({\n current: 0\n }));\n return /*#__PURE__*/ React.createElement(SSRContext.Provider, {\n value: value\n }, props.children);\n};\n/**\n * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay\n * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.\n */ export function useIsSSR() {\n const isInSSRContext = useSSRContext() !== defaultSSRContextValue;\n const [isSSR, setIsSSR] = React.useState(isInSSRContext);\n // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the\n // developer to add one.\n if (process.env.NODE_ENV !== 'production') {\n if (!isInSSRContext && !canUseDOM()) {\n // eslint-disable-next-line no-console\n console.error(`@fluentui/react-components [${useIsSSR.name}]:\nWhen server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.\n\n\nCheck documentation at https://aka.ms/fluentui-ssr.`);\n }\n }\n // If on the client, and the component was initially server rendered, then schedule a layout effect to update the\n // component after hydration.\n if (canUseDOM() && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after\n // mounting.\n // eslint-disable-next-line\n React.useLayoutEffect(()=>{\n setIsSSR(false);\n }, []);\n }\n return isSSR;\n}\n"],"names":["SSRContext","SSRProvider","defaultSSRContextValue","useIsSSR","useSSRContext","current","React","createContext","undefined","_React_useContext","useContext","props","value","useState","createElement","Provider","children","isInSSRContext","isSSR","setIsSSR","process","env","NODE_ENV","canUseDOM","console","error","name","useLayoutEffect"],"mappings":";;;;;;;;;;;IASaA,UAAU;eAAVA;;IAYIC,WAAW;eAAXA;;IAfAC,sBAAsB;eAAtBA;;IA0BGC,QAAQ;eAARA;;IApBAC,aAAa;eAAbA;;;;iEAZG;2BACG;AAKf,MAAMF,yBAAyB;IACtCG,SAAS;AACb;AACO,MAAML,aAAa,WAAW,GAAGM,OAAMC,aAAa,CAACC;AAGjD,SAASJ;IAChB,IAAIK;IACJ,OAAO,AAACA,CAAAA,oBAAoBH,OAAMI,UAAU,CAACV,WAAU,MAAO,QAAQS,sBAAsB,KAAK,IAAIA,oBAAoBP;AAC7H;AAMW,MAAMD,cAAc,CAACU;IAC5B,MAAM,CAACC,MAAM,GAAGN,OAAMO,QAAQ,CAAC,IAAK,CAAA;YAC5BR,SAAS;QACb,CAAA;IACJ,OAAO,WAAW,GAAGC,OAAMQ,aAAa,CAACd,WAAWe,QAAQ,EAAE;QAC1DH,OAAOA;IACX,GAAGD,MAAMK,QAAQ;AACrB;AAIW,SAASb;IAChB,MAAMc,iBAAiBb,oBAAoBF;IAC3C,MAAM,CAACgB,OAAOC,SAAS,GAAGb,OAAMO,QAAQ,CAACI;IACzC,6GAA6G;IAC7G,wBAAwB;IACxB,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACvC,IAAI,CAACL,kBAAkB,CAACM,IAAAA,oBAAS,KAAI;YACjC,sCAAsC;YACtCC,QAAQC,KAAK,CAAC,CAAC,4BAA4B,EAAEtB,SAASuB,IAAI,CAAC;;;;mDAIpB,CAAC;QAC5C;IACJ;IACA,iHAAiH;IACjH,6BAA6B;IAC7B,IAAIH,IAAAA,oBAAS,OAAMN,gBAAgB;QAC/B,iHAAiH;QACjH,YAAY;QACZ,2BAA2B;QAC3BX,OAAMqB,eAAe,CAAC;YAClBR,SAAS;QACb,GAAG,EAAE;IACT;IACA,OAAOD;AACX"}
|
@@ -9,92 +9,92 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
+
anchorProperties: function() {
|
13
|
+
return anchorProperties;
|
14
|
+
},
|
15
|
+
audioProperties: function() {
|
16
|
+
return audioProperties;
|
17
|
+
},
|
12
18
|
baseElementEvents: function() {
|
13
19
|
return baseElementEvents;
|
14
20
|
},
|
15
21
|
baseElementProperties: function() {
|
16
22
|
return baseElementProperties;
|
17
23
|
},
|
18
|
-
|
19
|
-
return
|
24
|
+
buttonProperties: function() {
|
25
|
+
return buttonProperties;
|
20
26
|
},
|
21
|
-
|
22
|
-
return
|
27
|
+
colGroupProperties: function() {
|
28
|
+
return colGroupProperties;
|
23
29
|
},
|
24
|
-
|
25
|
-
return
|
30
|
+
colProperties: function() {
|
31
|
+
return colProperties;
|
26
32
|
},
|
27
|
-
|
28
|
-
return
|
33
|
+
dialogProperties: function() {
|
34
|
+
return dialogProperties;
|
29
35
|
},
|
30
|
-
|
31
|
-
return
|
36
|
+
divProperties: function() {
|
37
|
+
return divProperties;
|
32
38
|
},
|
33
|
-
|
34
|
-
return
|
39
|
+
fieldsetProperties: function() {
|
40
|
+
return fieldsetProperties;
|
35
41
|
},
|
36
|
-
|
37
|
-
return
|
42
|
+
formProperties: function() {
|
43
|
+
return formProperties;
|
38
44
|
},
|
39
|
-
|
40
|
-
return
|
45
|
+
getNativeProps: function() {
|
46
|
+
return getNativeProps;
|
41
47
|
},
|
42
|
-
|
43
|
-
return
|
48
|
+
htmlElementProperties: function() {
|
49
|
+
return htmlElementProperties;
|
44
50
|
},
|
45
|
-
|
46
|
-
return
|
51
|
+
iframeProperties: function() {
|
52
|
+
return iframeProperties;
|
53
|
+
},
|
54
|
+
imgProperties: function() {
|
55
|
+
return imgProperties;
|
47
56
|
},
|
48
57
|
inputProperties: function() {
|
49
58
|
return inputProperties;
|
50
59
|
},
|
51
|
-
|
52
|
-
return
|
60
|
+
labelProperties: function() {
|
61
|
+
return labelProperties;
|
53
62
|
},
|
54
|
-
|
55
|
-
return
|
63
|
+
liProperties: function() {
|
64
|
+
return liProperties;
|
65
|
+
},
|
66
|
+
microdataProperties: function() {
|
67
|
+
return microdataProperties;
|
68
|
+
},
|
69
|
+
olProperties: function() {
|
70
|
+
return olProperties;
|
56
71
|
},
|
57
72
|
optionProperties: function() {
|
58
73
|
return optionProperties;
|
59
74
|
},
|
75
|
+
selectProperties: function() {
|
76
|
+
return selectProperties;
|
77
|
+
},
|
60
78
|
tableProperties: function() {
|
61
79
|
return tableProperties;
|
62
80
|
},
|
63
|
-
trProperties: function() {
|
64
|
-
return trProperties;
|
65
|
-
},
|
66
|
-
thProperties: function() {
|
67
|
-
return thProperties;
|
68
|
-
},
|
69
81
|
tdProperties: function() {
|
70
82
|
return tdProperties;
|
71
83
|
},
|
72
|
-
|
73
|
-
return
|
74
|
-
},
|
75
|
-
colProperties: function() {
|
76
|
-
return colProperties;
|
77
|
-
},
|
78
|
-
fieldsetProperties: function() {
|
79
|
-
return fieldsetProperties;
|
80
|
-
},
|
81
|
-
formProperties: function() {
|
82
|
-
return formProperties;
|
83
|
-
},
|
84
|
-
iframeProperties: function() {
|
85
|
-
return iframeProperties;
|
84
|
+
textAreaProperties: function() {
|
85
|
+
return textAreaProperties;
|
86
86
|
},
|
87
|
-
|
88
|
-
return
|
87
|
+
thProperties: function() {
|
88
|
+
return thProperties;
|
89
89
|
},
|
90
|
-
|
91
|
-
return
|
90
|
+
timeProperties: function() {
|
91
|
+
return timeProperties;
|
92
92
|
},
|
93
|
-
|
94
|
-
return
|
93
|
+
trProperties: function() {
|
94
|
+
return trProperties;
|
95
95
|
},
|
96
|
-
|
97
|
-
return
|
96
|
+
videoProperties: function() {
|
97
|
+
return videoProperties;
|
98
98
|
}
|
99
99
|
});
|
100
100
|
const toObjectMap = (...items)=>{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["properties.js"],"sourcesContent":["const toObjectMap = (...items)=>{\n const result = {};\n for (const item of items){\n const keys = Array.isArray(item) ? item : Object.keys(item);\n for (const key of keys){\n result[key] = 1;\n }\n }\n return result;\n};\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */ export const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onAnimationEnd',\n 'onAnimationStart',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture'\n]);\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */ export const baseElementProperties = toObjectMap([\n 'accessKey',\n 'children',\n 'className',\n 'contentEditable',\n 'dir',\n 'draggable',\n 'hidden',\n 'htmlFor',\n 'id',\n 'lang',\n 'ref',\n 'role',\n 'style',\n 'tabIndex',\n 'title',\n 'translate',\n 'spellCheck',\n 'name'\n]);\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */ export const microdataProperties = toObjectMap([\n 'itemID',\n 'itemProp',\n 'itemRef',\n 'itemScope',\n 'itemType'\n]);\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */ export const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */ export const labelProperties = toObjectMap(htmlElementProperties, [\n 'form'\n]);\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */ export const audioProperties = toObjectMap(htmlElementProperties, [\n 'height',\n 'loop',\n 'muted',\n 'preload',\n 'src',\n 'width'\n]);\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */ export const videoProperties = toObjectMap(audioProperties, [\n 'poster'\n]);\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */ export const olProperties = toObjectMap(htmlElementProperties, [\n 'start'\n]);\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */ export const liProperties = toObjectMap(htmlElementProperties, [\n 'value'\n]);\n/**\n * An array of A tag properties and events.\n *\n * @public\n */ export const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download',\n 'href',\n 'hrefLang',\n 'media',\n 'rel',\n 'target',\n 'type'\n]);\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */ export const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime'\n]);\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */ export const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus',\n 'disabled',\n 'form',\n 'formAction',\n 'formEncType',\n 'formMethod',\n 'formNoValidate',\n 'formTarget',\n 'type',\n 'value'\n]);\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */ export const inputProperties = toObjectMap(buttonProperties, [\n 'accept',\n 'alt',\n 'autoCapitalize',\n 'autoComplete',\n 'checked',\n 'dirname',\n 'form',\n 'height',\n 'inputMode',\n 'list',\n 'max',\n 'maxLength',\n 'min',\n 'multiple',\n 'pattern',\n 'placeholder',\n 'readOnly',\n 'required',\n 'src',\n 'step',\n 'size',\n 'type',\n 'value',\n 'width'\n]);\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */ export const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize',\n 'cols',\n 'dirname',\n 'form',\n 'maxLength',\n 'placeholder',\n 'readOnly',\n 'required',\n 'rows',\n 'wrap'\n]);\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */ export const selectProperties = toObjectMap(buttonProperties, [\n 'form',\n 'multiple',\n 'required'\n]);\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected',\n 'value'\n]);\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */ export const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding',\n 'cellSpacing'\n]);\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */ export const trProperties = htmlElementProperties;\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */ export const thProperties = toObjectMap(htmlElementProperties, [\n 'colSpan',\n 'rowSpan',\n 'scope'\n]);\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */ export const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan',\n 'headers',\n 'rowSpan',\n 'scope'\n]);\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span'\n]);\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span'\n]);\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */ export const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled',\n 'form'\n]);\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */ export const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset',\n 'action',\n 'encType',\n 'encType',\n 'method',\n 'noValidate',\n 'target'\n]);\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */ export const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow',\n 'allowFullScreen',\n 'allowPaymentRequest',\n 'allowTransparency',\n 'csp',\n 'height',\n 'importance',\n 'referrerPolicy',\n 'sandbox',\n 'src',\n 'srcDoc',\n 'width'\n]);\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */ export const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt',\n 'crossOrigin',\n 'height',\n 'src',\n 'srcSet',\n 'useMap',\n 'width'\n]);\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */ export const dialogProperties = toObjectMap(htmlElementProperties, [\n 'open',\n 'onCancel',\n 'onClose'\n]);\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */ export const divProperties = htmlElementProperties;\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps(// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprops, allowedPropNames, excludedPropNames) {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = {};\n const keys = Object.keys(props);\n for (const key of keys){\n const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;\n if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props[key];\n }\n }\n return result;\n}\n"],"names":["baseElementEvents","baseElementProperties","microdataProperties","htmlElementProperties","labelProperties","audioProperties","videoProperties","olProperties","liProperties","anchorProperties","timeProperties","buttonProperties","inputProperties","textAreaProperties","selectProperties","optionProperties","tableProperties","trProperties","thProperties","tdProperties","colGroupProperties","colProperties","fieldsetProperties","formProperties","iframeProperties","imgProperties","dialogProperties","divProperties","getNativeProps","toObjectMap","items","result","item","keys","Array","isArray","Object","key","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"mappings":";;;;;;;;;;;IAciBA,iBAAiB;eAAjBA;;IAw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IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAM5B,wBAAwB4B,YAAY;IACjD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAM3B,sBAAsB2B,YAAY;IAC/C;IACA;IACA;IACA;IACA;CACH;AAKU,MAAM1B,wBAAwB0B,YAAY5B,uBAAuBD,mBAAmBE;AAKpF,MAAME,kBAAkByB,YAAY1B,uBAAuB;IAClE;CACH;AAKU,MAAME,kBAAkBwB,YAAY1B,uBAAuB;IAClE;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAMG,kBAAkBuB,YAAYxB,iBAAiB;IAC5D;CACH;AAKU,MAAME,eAAesB,YAAY1B,uBAAuB;IAC/D;CACH;AAKU,MAAMK,eAAeqB,YAAY1B,uBAAuB;IAC/D;CACH;AAKU,MAAMM,mBAAmBoB,YAAY1B,uBAAuB;IACnE;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAMO,iBAAiBmB,YAAY1B,uBAAuB;IACjE;CACH;AAKU,MAAMQ,mBAAmBkB,YAAY1B,uBAAuB;IACnE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAMS,kBAAkBiB,YAAYlB,kBAAkB;IAC7D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAME,qBAAqBgB,YAAYlB,kBAAkB;IAChE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAMG,mBAAmBe,YAAYlB,kBAAkB;IAC9D;IACA;IACA;CACH;AACM,MAAMI,mBAAmBc,YAAY1B,uBAAuB;IAC/D;IACA;CACH;AA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sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBE,OAAO,CAACL,IAAG,MAAO,CAAC,CAAA,GAAI;YACvJ,8DAA8D;YAC9DN,MAAM,CAACM,IAAI,GAAGC,KAAK,CAACD,IAAI;QAC5B;IACJ;IACA,OAAON;AACX"}
|
1
|
+
{"version":3,"sources":["properties.js"],"sourcesContent":["const toObjectMap = (...items)=>{\n const result = {};\n for (const item of items){\n const keys = Array.isArray(item) ? item : Object.keys(item);\n for (const key of keys){\n result[key] = 1;\n }\n }\n return result;\n};\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */ export const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onAnimationEnd',\n 'onAnimationStart',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture'\n]);\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */ export const baseElementProperties = toObjectMap([\n 'accessKey',\n 'children',\n 'className',\n 'contentEditable',\n 'dir',\n 'draggable',\n 'hidden',\n 'htmlFor',\n 'id',\n 'lang',\n 'ref',\n 'role',\n 'style',\n 'tabIndex',\n 'title',\n 'translate',\n 'spellCheck',\n 'name'\n]);\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */ export const microdataProperties = toObjectMap([\n 'itemID',\n 'itemProp',\n 'itemRef',\n 'itemScope',\n 'itemType'\n]);\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */ export const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */ export const labelProperties = toObjectMap(htmlElementProperties, [\n 'form'\n]);\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */ export const audioProperties = toObjectMap(htmlElementProperties, [\n 'height',\n 'loop',\n 'muted',\n 'preload',\n 'src',\n 'width'\n]);\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */ export const videoProperties = toObjectMap(audioProperties, [\n 'poster'\n]);\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */ export const olProperties = toObjectMap(htmlElementProperties, [\n 'start'\n]);\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */ export const liProperties = toObjectMap(htmlElementProperties, [\n 'value'\n]);\n/**\n * An array of A tag properties and events.\n *\n * @public\n */ export const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download',\n 'href',\n 'hrefLang',\n 'media',\n 'rel',\n 'target',\n 'type'\n]);\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */ export const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime'\n]);\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */ export const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus',\n 'disabled',\n 'form',\n 'formAction',\n 'formEncType',\n 'formMethod',\n 'formNoValidate',\n 'formTarget',\n 'type',\n 'value'\n]);\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */ export const inputProperties = toObjectMap(buttonProperties, [\n 'accept',\n 'alt',\n 'autoCapitalize',\n 'autoComplete',\n 'checked',\n 'dirname',\n 'form',\n 'height',\n 'inputMode',\n 'list',\n 'max',\n 'maxLength',\n 'min',\n 'multiple',\n 'pattern',\n 'placeholder',\n 'readOnly',\n 'required',\n 'src',\n 'step',\n 'size',\n 'type',\n 'value',\n 'width'\n]);\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */ export const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize',\n 'cols',\n 'dirname',\n 'form',\n 'maxLength',\n 'placeholder',\n 'readOnly',\n 'required',\n 'rows',\n 'wrap'\n]);\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */ export const selectProperties = toObjectMap(buttonProperties, [\n 'form',\n 'multiple',\n 'required'\n]);\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected',\n 'value'\n]);\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */ export const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding',\n 'cellSpacing'\n]);\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */ export const trProperties = htmlElementProperties;\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */ export const thProperties = toObjectMap(htmlElementProperties, [\n 'colSpan',\n 'rowSpan',\n 'scope'\n]);\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */ export const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan',\n 'headers',\n 'rowSpan',\n 'scope'\n]);\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span'\n]);\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span'\n]);\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */ export const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled',\n 'form'\n]);\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */ export const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset',\n 'action',\n 'encType',\n 'encType',\n 'method',\n 'noValidate',\n 'target'\n]);\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */ export const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow',\n 'allowFullScreen',\n 'allowPaymentRequest',\n 'allowTransparency',\n 'csp',\n 'height',\n 'importance',\n 'referrerPolicy',\n 'sandbox',\n 'src',\n 'srcDoc',\n 'width'\n]);\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */ export const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt',\n 'crossOrigin',\n 'height',\n 'src',\n 'srcSet',\n 'useMap',\n 'width'\n]);\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */ export const dialogProperties = toObjectMap(htmlElementProperties, [\n 'open',\n 'onCancel',\n 'onClose'\n]);\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */ export const divProperties = htmlElementProperties;\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps(// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprops, allowedPropNames, excludedPropNames) {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = {};\n const keys = Object.keys(props);\n for (const key of keys){\n const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;\n if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props[key];\n }\n }\n return result;\n}\n"],"names":["anchorProperties","audioProperties","baseElementEvents","baseElementProperties","buttonProperties","colGroupProperties","colProperties","dialogProperties","divProperties","fieldsetProperties","formProperties","getNativeProps","htmlElementProperties","iframeProperties","imgProperties","inputProperties","labelProperties","liProperties","microdataProperties","olProperties","optionProperties","selectProperties","tableProperties","tdProperties","textAreaProperties","thProperties","timeProperties","trProperties","videoProperties","toObjectMap","items","result","item","keys","Array","isArray","Object","key","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"mappings":";;;;;;;;;;;IAsLiBA,gBAAgB;eAAhBA;;IAjCAC,eAAe;eAAfA;;IAvIAC,iBAAiB;eAAjBA;;IAwFAC,qBAAqB;eAArBA;;IAoGAC,gBAAgB;eAAhBA;;IAuGJC,kBAAkB;eAAlBA;;IAGAC,aAAa;eAAbA;;IA2DIC,gBAAgB;eAAhBA;;IASAC,aAAa;eAAbA;;IA7DAC,kBAAkB;eAAlBA;;IAQAC,cAAc;eAAdA;;IAqEDC,cAAc;eAAdA;;IA/PCC,qBAAqB;eAArBA;;IAuMAC,gBAAgB;eAAhBA;;IAkBAC,aAAa;eAAbA;;IAxIAC,eAAe;eAAfA;;IA5EAC,eAAe;eAAfA;;IAiCAC,YAAY;eAAZA;;IAjDAC,mBAAmB;eAAnBA;;IA0CAC,YAAY;eAAZA;;IAqGJC,gBAAgB;eAAhBA;;IALIC,gBAAgB;eAAhBA;;IAaAC,eAAe;eAAfA;;IAsBAC,YAAY;eAAZA;;IAnDAC,kBAAkB;eAAlBA;;IA0CAC,YAAY;eAAZA;;IA/FAC,cAAc;eAAdA;;IA0FAC,YAAY;eAAZA;;IA5HAC,eAAe;eAAfA;;;AAjKjB,MAAMC,cAAc,CAAC,GAAGC;IACpB,MAAMC,SAAS,CAAC;IAChB,KAAK,MAAMC,QAAQF,MAAM;QACrB,MAAMG,OAAOC,MAAMC,OAAO,CAACH,QAAQA,OAAOI,OAAOH,IAAI,CAACD;QACtD,KAAK,MAAMK,OAAOJ,KAAK;YACnBF,MAAM,CAACM,IAAI,GAAG;QAClB;IACJ;IACA,OAAON;AACX;AAKW,MAAM7B,oBAAoB2B,YAAY;IAC7C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAM1B,wBAAwB0B,YAAY;IACjD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAC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BAAuB;IACjE;CACH;AACM,MAAMN,gBAAgBuB,YAAYjB,uBAAuB;IAC5D;CACH;AAKU,MAAMH,qBAAqBoB,YAAYjB,uBAAuB;IACrE;IACA;CACH;AAKU,MAAMF,iBAAiBmB,YAAYjB,uBAAuB;IACjE;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAMC,mBAAmBgB,YAAYjB,uBAAuB;IACnE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAME,gBAAgBe,YAAYjB,uBAAuB;IAChE;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAKU,MAAML,mBAAmBsB,YAAYjB,uBAAuB;IACnE;IACA;IACA;CACH;AAKU,MAAMJ,gBAAgBI;AAgB1B,SAASD,eAChB2B,KAAK,EAAEC,gBAAgB,EAAEC,iBAAiB;IACtC,6GAA6G;IAC7G,2GAA2G;IAC3G,2GAA2G;IAC3G,uBAAuB;IACvB,0GAA0G;IAC1G,MAAML,UAAUD,MAAMC,OAAO,CAACI;IAC9B,8DAA8D;IAC9D,MAAMR,SAAS,CAAC;IAChB,MAAME,OAAOG,OAAOH,IAAI,CAACK;IACzB,KAAK,MAAMD,OAAOJ,KAAK;QACnB,MAAMQ,eAAe,CAACN,WAAWI,gBAAgB,CAACF,IAAI,IAAIF,WAAWI,iBAAiBG,OAAO,CAACL,QAAQ,KAAKA,IAAIK,OAAO,CAAC,aAAa,KAAKL,IAAIK,OAAO,CAAC,aAAa;QAClK,IAAID,gBAAiB,CAAA,CAACD,qBAAqB,AAACA,CAAAA,sBAAsB,QAAQA,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBE,OAAO,CAACL,IAAG,MAAO,CAAC,CAAA,GAAI;YACvJ,8DAA8D;YAC9DN,MAAM,CAACM,IAAI,GAAGC,KAAK,CAACD,IAAI;QAC5B;IACJ;IACA,OAAON;AACX"}
|
@@ -18,7 +18,10 @@
|
|
18
18
|
// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },
|
19
19
|
// so the result is {} | { b: string }, as expected.
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
21
|
-
|
21
|
+
/**
|
22
|
+
* @internal
|
23
|
+
* If type T includes `null`, remove it and add `undefined` instead.
|
24
|
+
*/ "use strict";
|
22
25
|
Object.defineProperty(exports, "__esModule", {
|
23
26
|
value: true
|
24
27
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["types.js"],"sourcesContent":["/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */ // Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\
|
1
|
+
{"version":3,"sources":["types.js"],"sourcesContent":["/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */ // Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n/**\n * @internal\n * If type T includes `null`, remove it and add `undefined` instead.\n */ export { };\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAAG,8EAA8E;AAClF,EAAE;AACF,6DAA6D;AAC7D,0GAA0G;AAC1G,mGAAmG;AACnG,qFAAqF;AACrF,oCAAoC;AACpC,wDAAwD;AACxD,EAAE;AACF,gEAAgE;AAChE,uDAAuD;AACvD,qEAAqE;AACrE,0MAA0M;AAC1M,oDAAoD;AACpD,8DAA8D;AAC9D;;;CAGC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-utilities",
|
3
|
-
"version": "9.18.
|
3
|
+
"version": "9.18.4",
|
4
4
|
"description": "A set of general React-specific utilities.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@fluentui/keyboard-keys": "^9.0.7",
|
35
|
-
"@fluentui/react-shared-contexts": "^9.
|
35
|
+
"@fluentui/react-shared-contexts": "^9.15.1",
|
36
36
|
"@swc/helpers": "^0.5.1"
|
37
37
|
},
|
38
38
|
"peerDependencies": {
|