@fluentui-react-native/use-slots 0.10.11 → 0.11.0
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 +15 -0
- package/CHANGELOG.md +46 -1
- package/babel.config.js +1 -1
- package/lib/buildUseSlots.d.ts +11 -10
- package/lib/buildUseSlots.d.ts.map +1 -1
- package/lib/buildUseSlots.js +16 -14
- package/lib/buildUseSlots.js.map +1 -1
- package/lib/buildUseSlots.test.d.ts +1 -1
- package/lib/buildUseSlots.test.js +27 -17
- package/lib/buildUseSlots.test.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/useSlots.samples.test.d.ts +1 -1
- package/lib/useSlots.samples.test.js +228 -187
- package/lib/useSlots.samples.test.js.map +1 -1
- package/lib-commonjs/buildUseSlots.d.ts +11 -10
- package/lib-commonjs/buildUseSlots.d.ts.map +1 -1
- package/lib-commonjs/buildUseSlots.js +20 -19
- package/lib-commonjs/buildUseSlots.js.map +1 -1
- package/lib-commonjs/buildUseSlots.test.d.ts +1 -1
- package/lib-commonjs/buildUseSlots.test.js +82 -45
- package/lib-commonjs/buildUseSlots.test.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +10 -5
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/useSlots.samples.test.d.ts +1 -1
- package/lib-commonjs/useSlots.samples.test.js +297 -215
- package/lib-commonjs/useSlots.samples.test.js.map +1 -1
- package/package.json +48 -41
- package/src/__snapshots__/useSlots.samples.test.tsx.snap +42 -42
- package/src/buildUseSlots.test.tsx +8 -5
- package/src/buildUseSlots.ts +8 -5
- package/src/useSlots.samples.test.tsx +42 -42
|
@@ -1,52 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k];
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
});
|
|
22
|
+
var __setModuleDefault =
|
|
23
|
+
(this && this.__setModuleDefault) ||
|
|
24
|
+
(Object.create
|
|
25
|
+
? function (o, v) {
|
|
26
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
27
|
+
}
|
|
28
|
+
: function (o, v) {
|
|
29
|
+
o['default'] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar =
|
|
32
|
+
(this && this.__importStar) ||
|
|
33
|
+
(function () {
|
|
34
|
+
var ownKeys = function (o) {
|
|
35
|
+
ownKeys =
|
|
36
|
+
Object.getOwnPropertyNames ||
|
|
37
|
+
function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
53
|
+
const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
|
|
54
|
+
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
55
|
+
const react_1 = require('react');
|
|
56
|
+
const react_native_1 = require('react-native');
|
|
57
|
+
const framework_base_1 = require('@fluentui-react-native/framework-base');
|
|
58
|
+
const renderer = __importStar(require('react-test-renderer'));
|
|
59
|
+
const buildUseSlots_1 = require('./buildUseSlots');
|
|
30
60
|
const useSlotsBase = (0, buildUseSlots_1.buildUseSlots)({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
61
|
+
slots: {
|
|
62
|
+
outer: react_native_1.View,
|
|
63
|
+
inner: react_native_1.View,
|
|
64
|
+
content: react_native_1.Text,
|
|
65
|
+
},
|
|
36
66
|
});
|
|
37
67
|
const CompBase = (0, framework_base_1.stagedComponent)((props) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
68
|
+
const Slots = useSlotsBase(props);
|
|
69
|
+
return (extra) => {
|
|
70
|
+
const merged = { ...props, ...extra };
|
|
71
|
+
return jsx_runtime_1.jsx(Slots.outer, {
|
|
72
|
+
...merged,
|
|
73
|
+
children: jsx_runtime_1.jsx(Slots.inner, {
|
|
74
|
+
style: { backgroundColor: 'blue', width: 20, height: 10 },
|
|
75
|
+
children: jsx_runtime_1.jsx(Slots.content, { children: 'Hello' }),
|
|
76
|
+
}),
|
|
77
|
+
});
|
|
78
|
+
};
|
|
45
79
|
});
|
|
46
80
|
describe('buildUseSlots test suite', () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
81
|
+
it('Simple component render', () => {
|
|
82
|
+
let component;
|
|
83
|
+
(0, react_1.act)(() => {
|
|
84
|
+
component = renderer.create(jsx_runtime_1.jsx(CompBase, { style: { width: 30, height: 20, borderColor: 'green', borderWidth: 1 } }));
|
|
50
85
|
});
|
|
86
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
87
|
+
});
|
|
51
88
|
});
|
|
52
|
-
//# sourceMappingURL=buildUseSlots.test.js.map
|
|
89
|
+
//# sourceMappingURL=buildUseSlots.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildUseSlots.test.js","sourceRoot":"","sources":["../src/buildUseSlots.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildUseSlots.test.js","sourceRoot":"","sources":["../src/buildUseSlots.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA6D;AAC7D,iCAA4B;AAE5B,+CAA0C;AAE1C,0EAAwE;AACxE,MAAY,QAAQ,gDAA4B;AAEhD,mDAAgD;AAQhD,MAAM,YAAY,GAAG,IAAA,6BAAa,EAAa;IAC7C,KAAK,EAAE;QACL,KAAK,EAAE,mBAAI;QACX,KAAK,EAAE,mBAAI;QACX,OAAO,EAAE,mBAAI;KACd;CACF,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,IAAA,gCAAe,EAAC,CAAC,KAAgB,EAAE,EAAE,CAAC;IACrD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO,CAAC,KAAgB,EAAE,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;QACtC,OAAO,CACL,kBAAC,KAAK,CAAC,KAAK,OAAK,MAAM,YACrB,kBAAC,KAAK,CAAC,KAAK,IAAC,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,YACpE,kBAAC,KAAK,CAAC,OAAO,wBAAsB,GACxB,GACF,CACf,CAAC;IAAA,CACH,CAAC;AAAA,CACH,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE,CAAC;IACzC,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC;QAClC,IAAI,SAAqC,CAAC;QAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,GAAI,CAAC,CAAC;QAAA,CACnH,CAAC,CAAC;QACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAC/C,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
|
package/lib-commonjs/index.d.ts
CHANGED
package/lib-commonjs/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.buildUseSlots = void 0;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports,
|
|
6
|
-
|
|
4
|
+
const buildUseSlots_1 = require('./buildUseSlots');
|
|
5
|
+
Object.defineProperty(exports, 'buildUseSlots', {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () {
|
|
8
|
+
return buildUseSlots_1.buildUseSlots;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=useSlots.samples.test.d.ts.map
|
|
2
|
+
//# sourceMappingURL=useSlots.samples.test.d.ts.map
|