@mvf/external-components 3.11.6-dev.6 → 3.11.6-dev.7
Sign up to get free protection for your applications and to get access to all the features.
- package/Components/Importers/TextField.d.ts +7 -0
- package/Components/Importers/TextField.js +7 -0
- package/Components/Importers/TextField.js.map +1 -1
- package/Components/Importers/TextFieldWithLazyLoading.d.ts +12 -0
- package/Components/Importers/TextFieldWithLazyLoading.js +77 -0
- package/Components/Importers/TextFieldWithLazyLoading.js.map +1 -0
- package/package.json +1 -1
@@ -3,5 +3,12 @@ import { FC } from 'react';
|
|
3
3
|
interface TextFieldWithExperimentProps extends ITextFieldProps {
|
4
4
|
experimentName?: string;
|
5
5
|
}
|
6
|
+
/**
|
7
|
+
* TextField component with experiment support
|
8
|
+
* This method would need to be set up for each component which we want to enable experimental features on.
|
9
|
+
* This is a manual process and would need to be done for each component although we may be able to automate this in the future.
|
10
|
+
*
|
11
|
+
* Currently all of the possible experiments would need to be pulled in although we could potentially lazy load experiments. This could be problematic if the experiment differs drastically from the default component.
|
12
|
+
*/
|
6
13
|
declare const TextField: FC<TextFieldWithExperimentProps>;
|
7
14
|
export default TextField;
|
@@ -28,6 +28,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
29
29
|
var TextField_1 = __importDefault(require("../Molecules/TextField/TextField"));
|
30
30
|
var TextField_2 = __importDefault(require("../Experiments/GOLD-1264/Molecules/TextField/TextField"));
|
31
|
+
/**
|
32
|
+
* TextField component with experiment support
|
33
|
+
* This method would need to be set up for each component which we want to enable experimental features on.
|
34
|
+
* This is a manual process and would need to be done for each component although we may be able to automate this in the future.
|
35
|
+
*
|
36
|
+
* Currently all of the possible experiments would need to be pulled in although we could potentially lazy load experiments. This could be problematic if the experiment differs drastically from the default component.
|
37
|
+
*/
|
31
38
|
var TextField = function (_a) {
|
32
39
|
var experimentName = _a.experimentName, props = __rest(_a, ["experimentName"]);
|
33
40
|
switch (experimentName) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../src/Components/Importers/TextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAgE;AAChE,qGAAuF;AAQvF,IAAM,SAAS,GAAqC,UAAC,EAGpD;IAFC,IAAA,cAAc,oBAAA,EACX,KAAK,cAF2C,kBAGpD,CADS;IAER,QAAQ,cAAc,EAAE;QACtB,KAAK,WAAW;YACd,OAAO,uBAAC,mBAAiB,eAAK,KAAK,EAAI,CAAC;QAC1C;YACE,OAAO,uBAAC,mBAAgB,eAAK,KAAK,EAAI,CAAC;KAC1C;AACH,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../src/Components/Importers/TextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAgE;AAChE,qGAAuF;AAQvF;;;;;;GAMG;AACH,IAAM,SAAS,GAAqC,UAAC,EAGpD;IAFC,IAAA,cAAc,oBAAA,EACX,KAAK,cAF2C,kBAGpD,CADS;IAER,QAAQ,cAAc,EAAE;QACtB,KAAK,WAAW;YACd,OAAO,uBAAC,mBAAiB,eAAK,KAAK,EAAI,CAAC;QAC1C;YACE,OAAO,uBAAC,mBAAgB,eAAK,KAAK,EAAI,CAAC;KAC1C;AACH,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import ITextFieldProps from '../Molecules/TextField/ITextFieldProps';
|
2
|
+
import { FC } from 'react';
|
3
|
+
interface TextFieldWithExperimentProps extends ITextFieldProps {
|
4
|
+
experimentName?: string;
|
5
|
+
}
|
6
|
+
/**
|
7
|
+
* Demonstration of how importing could use lazy loading to reduce bundle size.
|
8
|
+
*
|
9
|
+
* This could be problematic if there are large changes to the original component as there may be a flash of unstyled content but would reduce the bundle size.
|
10
|
+
*/
|
11
|
+
declare const TextField: FC<TextFieldWithExperimentProps>;
|
12
|
+
export default TextField;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
14
|
+
if (k2 === undefined) k2 = k;
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
18
|
+
}
|
19
|
+
Object.defineProperty(o, k2, desc);
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
37
|
+
var t = {};
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
39
|
+
t[p] = s[p];
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
43
|
+
t[p[i]] = s[p[i]];
|
44
|
+
}
|
45
|
+
return t;
|
46
|
+
};
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
49
|
+
};
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
51
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
52
|
+
var TextField_1 = __importDefault(require("../Molecules/TextField/TextField"));
|
53
|
+
var react_1 = require("react");
|
54
|
+
var LoadingValueContext = (0, react_1.createContext)(null);
|
55
|
+
var LoadingComponent = function () {
|
56
|
+
var props = (0, react_1.useContext)(LoadingValueContext);
|
57
|
+
if (!props)
|
58
|
+
return null;
|
59
|
+
return (0, jsx_runtime_1.jsx)(TextField_1.default, __assign({}, props));
|
60
|
+
};
|
61
|
+
/**
|
62
|
+
* Demonstration of how importing could use lazy loading to reduce bundle size.
|
63
|
+
*
|
64
|
+
* This could be problematic if there are large changes to the original component as there may be a flash of unstyled content but would reduce the bundle size.
|
65
|
+
*/
|
66
|
+
var TextField = function (_a) {
|
67
|
+
var experimentName = _a.experimentName, props = __rest(_a, ["experimentName"]);
|
68
|
+
switch (experimentName) {
|
69
|
+
case 'GOLD-1264':
|
70
|
+
var TextFieldGold1264 = (0, react_1.lazy)(function () { return Promise.resolve().then(function () { return __importStar(require("../Experiments/GOLD-1264/Molecules/TextField/TextField")); }); });
|
71
|
+
return ((0, jsx_runtime_1.jsx)(LoadingValueContext.Provider, __assign({ value: props }, { children: (0, jsx_runtime_1.jsxs)(react_1.Suspense, __assign({ fallback: (0, jsx_runtime_1.jsx)(LoadingComponent, {}) }, { children: [(0, jsx_runtime_1.jsx)(TextFieldGold1264, __assign({}, props)), ";"] })) })));
|
72
|
+
default:
|
73
|
+
return (0, jsx_runtime_1.jsx)(TextField_1.default, __assign({}, props));
|
74
|
+
}
|
75
|
+
};
|
76
|
+
exports.default = TextField;
|
77
|
+
//# sourceMappingURL=TextFieldWithLazyLoading.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextFieldWithLazyLoading.js","sourceRoot":"","sources":["../../../src/Components/Importers/TextFieldWithLazyLoading.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAgE;AAEhE,+BAAsE;AAMtE,IAAM,mBAAmB,GAAG,IAAA,qBAAa,EAAyB,IAAI,CAAC,CAAC;AAExE,IAAM,gBAAgB,GAAO;IAC3B,IAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,mBAAmB,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,OAAO,uBAAC,mBAAgB,eAAK,KAAK,EAAI,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,IAAM,SAAS,GAAqC,UAAC,EAGpD;IAFC,IAAA,cAAc,oBAAA,EACX,KAAK,cAF2C,kBAGpD,CADS;IAER,QAAQ,cAAc,EAAE;QACtB,KAAK,WAAW;YACd,IAAM,iBAAiB,GAAG,IAAA,YAAI,EAC5B,cAAM,wEAAO,wDAAwD,QAA/D,CAAgE,CACvE,CAAC;YACF,OAAO,CACL,uBAAC,mBAAmB,CAAC,QAAQ,aAAC,KAAK,EAAE,KAAK,gBACxC,wBAAC,gBAAQ,aAAC,QAAQ,EAAE,uBAAC,gBAAgB,KAAG,iBACtC,uBAAC,iBAAiB,eAAK,KAAK,EAAI,UACvB,IACkB,CAChC,CAAC;QACJ;YACE,OAAO,uBAAC,mBAAgB,eAAK,KAAK,EAAI,CAAC;KAC1C;AACH,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|