@fluentui-react-native/experimental-expander 0.8.3 → 0.8.5
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 +65 -0
- package/CHANGELOG.md +17 -1
- package/eslint.config.js +3 -0
- package/lib/Expander.js +16 -80
- package/lib/Expander.js.map +1 -1
- package/lib/Expander.types.js +1 -1
- package/lib/Expander.types.js.map +1 -1
- package/lib-commonjs/Expander.js +19 -83
- package/lib-commonjs/Expander.js.map +1 -1
- package/lib-commonjs/ExpanderNativeComponent.js +1 -13
- package/lib-commonjs/ExpanderNativeComponent.js.map +1 -1
- package/package.json +30 -13
- package/.eslintrc.js +0 -3
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/experimental-expander",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Thu, 10 Jul 2025 20:30:40 GMT",
|
|
6
|
+
"version": "0.8.5",
|
|
7
|
+
"tag": "@fluentui-react-native/experimental-expander_v0.8.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "ruaraki@microsoft.com",
|
|
12
|
+
"package": "@fluentui-react-native/experimental-expander",
|
|
13
|
+
"commit": "a245202877ef7f2be9ab5f0e1356b2270957e693",
|
|
14
|
+
"comment": "Run bump-versions"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "jasonmo@microsoft.com",
|
|
18
|
+
"package": "@fluentui-react-native/experimental-expander",
|
|
19
|
+
"commit": "54087dca787180bbf34630470cd0d06e88366b30",
|
|
20
|
+
"comment": "update eslint to 9.x and use new flat config format with security rules"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "4123478+tido64@users.noreply.github.com",
|
|
24
|
+
"package": "@fluentui-react-native/experimental-expander",
|
|
25
|
+
"commit": "79bb06f6bbfd0a36f9d2ef371f4857be9660f027",
|
|
26
|
+
"comment": "Fixed `align-deps` warnings"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"patch": [
|
|
30
|
+
{
|
|
31
|
+
"author": "jasonmo@microsoft.com",
|
|
32
|
+
"package": "@fluentui-react-native/experimental-expander",
|
|
33
|
+
"commit": "479b93cea460a26df70c55b5d3335927ed374713",
|
|
34
|
+
"comment": "update builds to use node16 settings and modern export maps"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"date": "Thu, 10 Jul 2025 19:20:24 GMT",
|
|
41
|
+
"version": "0.8.4",
|
|
42
|
+
"tag": "@fluentui-react-native/experimental-expander_v0.8.4",
|
|
43
|
+
"comments": {
|
|
44
|
+
"patch": [
|
|
45
|
+
{
|
|
46
|
+
"author": "4123478+tido64@users.noreply.github.com",
|
|
47
|
+
"package": "@fluentui-react-native/experimental-expander",
|
|
48
|
+
"commit": "24b9abab3370f008afd2dbb304751fc9af6bec4a",
|
|
49
|
+
"comment": "Add support for React Native 0.74"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"date": "Wed, 11 Jun 2025 19:34:56 GMT",
|
|
56
|
+
"version": "0.8.3",
|
|
57
|
+
"tag": "@fluentui-react-native/experimental-expander_v0.8.3",
|
|
58
|
+
"comments": {
|
|
59
|
+
"none": [
|
|
60
|
+
{
|
|
61
|
+
"author": "4123478+tido64@users.noreply.github.com",
|
|
62
|
+
"package": "@fluentui-react-native/experimental-expander",
|
|
63
|
+
"commit": "2342b87a20e5a584bd2073c8c5a266f0aa48c8bb",
|
|
64
|
+
"comment": "Added missing dev dependencies"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
4
69
|
{
|
|
5
70
|
"date": "Mon, 15 Apr 2024 21:31:43 GMT",
|
|
6
71
|
"version": "0.8.1",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/experimental-expander
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Thu, 10 Jul 2025 20:30:40 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.8.5
|
|
8
|
+
|
|
9
|
+
Thu, 10 Jul 2025 20:30:40 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- update builds to use node16 settings and modern export maps (jasonmo@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 0.8.4
|
|
16
|
+
|
|
17
|
+
Thu, 10 Jul 2025 19:20:24 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Add support for React Native 0.74 (4123478+tido64@users.noreply.github.com)
|
|
22
|
+
|
|
7
23
|
## 0.8.1
|
|
8
24
|
|
|
9
25
|
Mon, 15 Apr 2024 21:31:43 GMT
|
package/eslint.config.js
ADDED
package/lib/Expander.js
CHANGED
|
@@ -3,53 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
* @format
|
|
5
5
|
*/
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
6
|
/** @jsxRuntime classic */
|
|
54
7
|
/** @jsx withSlots */
|
|
55
8
|
import * as React from 'react';
|
|
@@ -57,47 +10,30 @@ import { compose, mergeProps, withSlots, buildProps } from '@fluentui-react-nati
|
|
|
57
10
|
import { expanderName } from './Expander.types';
|
|
58
11
|
import ExpanderComponent from './ExpanderNativeComponent';
|
|
59
12
|
function delay(ms) {
|
|
60
|
-
return new Promise(
|
|
13
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
61
14
|
}
|
|
62
|
-
export
|
|
15
|
+
export const Expander = compose({
|
|
63
16
|
displayName: expanderName,
|
|
64
17
|
tokens: [{}, expanderName],
|
|
65
18
|
slotProps: {
|
|
66
|
-
root: buildProps(
|
|
19
|
+
root: buildProps((tokens) => ({ ...tokens })),
|
|
67
20
|
},
|
|
68
21
|
slots: { root: ExpanderComponent },
|
|
69
|
-
useRender:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(_a = userProps.onCollapsing) === null || _a === void 0 ? void 0 : _a.call(userProps);
|
|
79
|
-
// Need to delay the height change so that the animation runs
|
|
80
|
-
return [4 /*yield*/, delay(175)];
|
|
81
|
-
case 1:
|
|
82
|
-
// Need to delay the height change so that the animation runs
|
|
83
|
-
_b.sent();
|
|
84
|
-
setExpandedState(false);
|
|
85
|
-
return [2 /*return*/];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}); };
|
|
89
|
-
var _onExpanding = function () {
|
|
90
|
-
var _a;
|
|
91
|
-
setExpandedState(true);
|
|
92
|
-
(_a = userProps.onExpanding) === null || _a === void 0 ? void 0 : _a.call(userProps);
|
|
22
|
+
useRender: (userProps, useSlots) => {
|
|
23
|
+
const Root = useSlots(userProps).root;
|
|
24
|
+
const [expandedState, setExpandedState] = React.useState(userProps.expanded);
|
|
25
|
+
const expanderHeight = expandedState ? userProps.expandedHeight : userProps.collapsedHeight;
|
|
26
|
+
const _onCollapsing = async () => {
|
|
27
|
+
userProps.onCollapsing?.();
|
|
28
|
+
// Need to delay the height change so that the animation runs
|
|
29
|
+
await delay(175);
|
|
30
|
+
setExpandedState(false);
|
|
93
31
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
children[_i - 1] = arguments[_i];
|
|
98
|
-
}
|
|
99
|
-
return (withSlots(Root, __assign({}, mergeProps(userProps, rest), { height: expanderHeight, onCollapsing: _onCollapsing, onExpanding: _onExpanding }), children));
|
|
32
|
+
const _onExpanding = () => {
|
|
33
|
+
setExpandedState(true);
|
|
34
|
+
userProps.onExpanding?.();
|
|
100
35
|
};
|
|
36
|
+
return (rest, ...children) => (withSlots(Root, { ...mergeProps(userProps, rest), height: expanderHeight, onCollapsing: _onCollapsing, onExpanding: _onExpanding }, children));
|
|
101
37
|
},
|
|
102
38
|
});
|
|
103
39
|
//# sourceMappingURL=Expander.js.map
|
package/lib/Expander.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expander.js","sourceRoot":"","sources":["../src/Expander.tsx"],"names":[],"mappings":"AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"Expander.js","sourceRoot":"","sources":["../src/Expander.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0BAA0B;AAC1B,qBAAqB;AACrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG9F,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAe;IAC5C,WAAW,EAAE,YAAY;IACzB,MAAM,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;KAC9C;IACD,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IAClC,SAAS,EAAE,CAAC,SAAwB,EAAE,QAAgC,EAAE,EAAE;QACxE,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;QACtC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC7E,MAAM,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;QAE5F,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;YAC/B,SAAS,CAAC,YAAY,EAAE,EAAE,CAAC;YAC3B,6DAA6D;YAC7D,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YACjB,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,GAAG,EAAE;YACxB,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACvB,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;QAC5B,CAAC,CAAC;QAEF,OAAO,CAAC,IAAuB,EAAE,GAAG,QAA2B,EAAE,EAAE,CAAC,CAClE,UAAC,IAAI,OAAK,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,IAClH,QAAQ,CACJ,CACR,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/lib/Expander.types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const expanderName = 'Expander';
|
|
2
2
|
//# sourceMappingURL=Expander.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expander.types.js","sourceRoot":"","sources":["../src/Expander.types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"Expander.types.js","sourceRoot":"","sources":["../src/Expander.types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC"}
|
package/lib-commonjs/Expander.js
CHANGED
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
* @format
|
|
6
6
|
*/
|
|
7
|
-
var __assign = (this && this.__assign) || function () {
|
|
8
|
-
__assign = Object.assign || function(t) {
|
|
9
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
-
s = arguments[i];
|
|
11
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
-
t[p] = s[p];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
|
-
return __assign.apply(this, arguments);
|
|
17
|
-
};
|
|
18
7
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
8
|
if (k2 === undefined) k2 = k;
|
|
20
9
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -38,42 +27,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
27
|
__setModuleDefault(result, mod);
|
|
39
28
|
return result;
|
|
40
29
|
};
|
|
41
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
51
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
52
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
53
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
|
-
function step(op) {
|
|
55
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
-
switch (op[0]) {
|
|
60
|
-
case 0: case 1: t = op; break;
|
|
61
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
62
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
63
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
64
|
-
default:
|
|
65
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
66
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
67
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
68
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
69
|
-
if (t[2]) _.ops.pop();
|
|
70
|
-
_.trys.pop(); continue;
|
|
71
|
-
}
|
|
72
|
-
op = body.call(thisArg, _);
|
|
73
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
74
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
30
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
78
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
79
32
|
};
|
|
@@ -81,52 +34,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
81
34
|
exports.Expander = void 0;
|
|
82
35
|
/** @jsxRuntime classic */
|
|
83
36
|
/** @jsx withSlots */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const framework_1 = require("@fluentui-react-native/framework");
|
|
39
|
+
const Expander_types_1 = require("./Expander.types");
|
|
40
|
+
const ExpanderNativeComponent_1 = __importDefault(require("./ExpanderNativeComponent"));
|
|
88
41
|
function delay(ms) {
|
|
89
|
-
return new Promise(
|
|
42
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
90
43
|
}
|
|
91
44
|
exports.Expander = (0, framework_1.compose)({
|
|
92
45
|
displayName: Expander_types_1.expanderName,
|
|
93
46
|
tokens: [{}, Expander_types_1.expanderName],
|
|
94
47
|
slotProps: {
|
|
95
|
-
root: (0, framework_1.buildProps)(
|
|
48
|
+
root: (0, framework_1.buildProps)((tokens) => ({ ...tokens })),
|
|
96
49
|
},
|
|
97
50
|
slots: { root: ExpanderNativeComponent_1.default },
|
|
98
|
-
useRender:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
(_a = userProps.onCollapsing) === null || _a === void 0 ? void 0 : _a.call(userProps);
|
|
108
|
-
// Need to delay the height change so that the animation runs
|
|
109
|
-
return [4 /*yield*/, delay(175)];
|
|
110
|
-
case 1:
|
|
111
|
-
// Need to delay the height change so that the animation runs
|
|
112
|
-
_b.sent();
|
|
113
|
-
setExpandedState(false);
|
|
114
|
-
return [2 /*return*/];
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}); };
|
|
118
|
-
var _onExpanding = function () {
|
|
119
|
-
var _a;
|
|
120
|
-
setExpandedState(true);
|
|
121
|
-
(_a = userProps.onExpanding) === null || _a === void 0 ? void 0 : _a.call(userProps);
|
|
51
|
+
useRender: (userProps, useSlots) => {
|
|
52
|
+
const Root = useSlots(userProps).root;
|
|
53
|
+
const [expandedState, setExpandedState] = React.useState(userProps.expanded);
|
|
54
|
+
const expanderHeight = expandedState ? userProps.expandedHeight : userProps.collapsedHeight;
|
|
55
|
+
const _onCollapsing = async () => {
|
|
56
|
+
userProps.onCollapsing?.();
|
|
57
|
+
// Need to delay the height change so that the animation runs
|
|
58
|
+
await delay(175);
|
|
59
|
+
setExpandedState(false);
|
|
122
60
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
children[_i - 1] = arguments[_i];
|
|
127
|
-
}
|
|
128
|
-
return ((0, framework_1.withSlots)(Root, __assign({}, (0, framework_1.mergeProps)(userProps, rest), { height: expanderHeight, onCollapsing: _onCollapsing, onExpanding: _onExpanding }), children));
|
|
61
|
+
const _onExpanding = () => {
|
|
62
|
+
setExpandedState(true);
|
|
63
|
+
userProps.onExpanding?.();
|
|
129
64
|
};
|
|
65
|
+
return (rest, ...children) => ((0, framework_1.withSlots)(Root, { ...(0, framework_1.mergeProps)(userProps, rest), height: expanderHeight, onCollapsing: _onCollapsing, onExpanding: _onExpanding }, children));
|
|
130
66
|
},
|
|
131
67
|
});
|
|
132
68
|
//# sourceMappingURL=Expander.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expander.js","sourceRoot":"","sources":["../src/Expander.tsx"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"Expander.js","sourceRoot":"","sources":["../src/Expander.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0BAA0B;AAC1B,qBAAqB;AACrB,6CAA+B;AAG/B,gEAA8F;AAG9F,qDAAgD;AAChD,wFAA0D;AAE1D,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAEY,QAAA,QAAQ,GAAG,IAAA,mBAAO,EAAe;IAC5C,WAAW,EAAE,6BAAY;IACzB,MAAM,EAAE,CAAC,EAAE,EAAE,6BAAY,CAAC;IAC1B,SAAS,EAAE;QACT,IAAI,EAAE,IAAA,sBAAU,EAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;KAC9C;IACD,KAAK,EAAE,EAAE,IAAI,EAAE,iCAAiB,EAAE;IAClC,SAAS,EAAE,CAAC,SAAwB,EAAE,QAAgC,EAAE,EAAE;QACxE,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;QACtC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC7E,MAAM,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;QAE5F,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;YAC/B,SAAS,CAAC,YAAY,EAAE,EAAE,CAAC;YAC3B,6DAA6D;YAC7D,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YACjB,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,GAAG,EAAE;YACxB,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACvB,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;QAC5B,CAAC,CAAC;QAEF,OAAO,CAAC,IAAuB,EAAE,GAAG,QAA2B,EAAE,EAAE,CAAC,CAClE,2BAAC,IAAI,OAAK,IAAA,sBAAU,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,IAClH,QAAQ,CACJ,CACR,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Microsoft Corporation.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
var codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
12
|
-
exports.default = (0, codegenNativeComponent_1.default)('ExpanderView');
|
|
13
|
-
//# sourceMappingURL=ExpanderNativeComponent.js.map
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=void 0;var _codegenNativeComponent=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var nativeComponentName='ExpanderView';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'ExpanderView',directEventTypes:{topCollapsing:{registrationName:'onCollapsing'},topExpanding:{registrationName:'onExpanding'}},validAttributes:Object.assign({expandDirection:true,expanded:true,enabled:true,width:true,height:true,contentHorizontalAlignment:true,contentVerticalAlignment:true,headerBackground:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerForeground:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerForegroundPointerOver:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerForegroundPressed:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerBorderBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerBorderPointerOverBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerBorderPressedBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerDisabledForeground:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerDisabledBorderBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default},headerBorderThickness:true,contentBackground:{process:require('react-native/Libraries/StyleSheet/processColor').default},contentBorderBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronBackground:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronForeground:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronPointerOverBackground:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronPointerOverForeground:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronPressedBackground:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronPressedForeground:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronBorderThickness:true,chevronBorderBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronBorderPointerOverBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default},chevronBorderPressedBrush:{process:require('react-native/Libraries/StyleSheet/processColor').default}},ConditionallyIgnoredEventHandlers({onCollapsing:true,onExpanding:true}))};var _default=exports.default=NativeComponentRegistry.get(nativeComponentName,function(){return __INTERNAL_VIEW_CONFIG;});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpanderNativeComponent.js","sourceRoot":"","sources":["../src/ExpanderNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAKH,
|
|
1
|
+
{"version":3,"file":"ExpanderNativeComponent.js","sourceRoot":"","sources":["../src/ExpanderNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAKH,qHAA6F;AAqC7F,kBAAe,IAAA,gCAAsB,EACnC,cAAc,CACe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/experimental-expander",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "A cross-platform Native Expander component using the Fluent Design System. Currently only implemented on windows",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Microsoft <fluentuinativeowners@microsoft.com>",
|
|
7
7
|
"homepage": "https://github.com/microsoft/fluentui-react-native",
|
|
8
8
|
"main": "lib-commonjs/index.js",
|
|
9
9
|
"module": "lib/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./lib/index.js",
|
|
13
|
+
"require": "./lib-commonjs/index.js",
|
|
14
|
+
"types": "./lib/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
10
17
|
"typings": "lib/index.d.ts",
|
|
11
18
|
"scripts": {
|
|
12
19
|
"build": "fluentui-scripts build",
|
|
@@ -26,23 +33,26 @@
|
|
|
26
33
|
"directory": "packages/experimental/Expander"
|
|
27
34
|
},
|
|
28
35
|
"dependencies": {
|
|
29
|
-
"@fluentui-react-native/framework": "0.14.
|
|
36
|
+
"@fluentui-react-native/framework": "0.14.4"
|
|
30
37
|
},
|
|
31
38
|
"devDependencies": {
|
|
39
|
+
"@babel/core": "^7.20.0",
|
|
32
40
|
"@fluentui-react-native/eslint-config-rules": "0.1.1",
|
|
33
41
|
"@fluentui-react-native/scripts": "0.1.1",
|
|
34
|
-
"@react-native/babel-preset": "^0.
|
|
35
|
-
"@react-native/metro-config": "^0.
|
|
42
|
+
"@react-native/babel-preset": "^0.74.0",
|
|
43
|
+
"@react-native/metro-config": "^0.74.0",
|
|
44
|
+
"@types/react": "~18.2.0",
|
|
36
45
|
"react": "18.2.0",
|
|
37
|
-
"react-native": "^0.
|
|
38
|
-
"react-native-
|
|
46
|
+
"react-native": "^0.74.0",
|
|
47
|
+
"react-native-macos": "^0.74.0",
|
|
48
|
+
"react-native-windows": "^0.74.0"
|
|
39
49
|
},
|
|
40
50
|
"peerDependencies": {
|
|
41
|
-
"@office-iss/react-native-win32": "^0.
|
|
51
|
+
"@office-iss/react-native-win32": "^0.74.0",
|
|
42
52
|
"react": "18.2.0",
|
|
43
|
-
"react-native": "^0.73.0",
|
|
44
|
-
"react-native-macos": "^0.73.0",
|
|
45
|
-
"react-native-windows": "^0.73.0"
|
|
53
|
+
"react-native": "^0.73.0 || ^0.74.0",
|
|
54
|
+
"react-native-macos": "^0.73.0 || ^0.74.0",
|
|
55
|
+
"react-native-windows": "^0.73.0 || ^0.74.0"
|
|
46
56
|
},
|
|
47
57
|
"rnx-kit": {
|
|
48
58
|
"kitType": "library",
|
|
@@ -50,13 +60,20 @@
|
|
|
50
60
|
"presets": [
|
|
51
61
|
"microsoft/react-native"
|
|
52
62
|
],
|
|
53
|
-
"requirements":
|
|
54
|
-
"
|
|
55
|
-
|
|
63
|
+
"requirements": {
|
|
64
|
+
"development": [
|
|
65
|
+
"react-native@0.74"
|
|
66
|
+
],
|
|
67
|
+
"production": [
|
|
68
|
+
"react-native@0.73 || 0.74"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
56
71
|
"capabilities": [
|
|
72
|
+
"babel-preset-react-native",
|
|
57
73
|
"core",
|
|
58
74
|
"core-android",
|
|
59
75
|
"core-ios",
|
|
76
|
+
"core-macos",
|
|
60
77
|
"core-windows",
|
|
61
78
|
"react"
|
|
62
79
|
]
|
package/.eslintrc.js
DELETED