@evlop/commons 1.0.368 → 1.0.369
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/dist/cjs/src/components/hoc/withSettings.app.d.ts +8 -7
- package/dist/cjs/src/components/hoc/withSettings.app.d.ts.map +1 -1
- package/dist/cjs/src/components/hoc/withSettings.app.js +7 -7
- package/dist/cjs/src/components/hoc/withSettings.app.js.map +1 -1
- package/dist/cjs/src/components/hoc/withSettings.d.ts +6 -4
- package/dist/cjs/src/components/hoc/withSettings.d.ts.map +1 -1
- package/dist/cjs/src/components/hoc/withSettings.js +4 -5
- package/dist/cjs/src/components/hoc/withSettings.js.map +1 -1
- package/dist/esm/src/components/hoc/withSettings.app.d.ts +8 -7
- package/dist/esm/src/components/hoc/withSettings.app.d.ts.map +1 -1
- package/dist/esm/src/components/hoc/withSettings.app.js +8 -8
- package/dist/esm/src/components/hoc/withSettings.app.js.map +1 -1
- package/dist/esm/src/components/hoc/withSettings.d.ts +6 -4
- package/dist/esm/src/components/hoc/withSettings.d.ts.map +1 -1
- package/dist/esm/src/components/hoc/withSettings.js +5 -6
- package/dist/esm/src/components/hoc/withSettings.js.map +1 -1
- package/dist/types/src/components/hoc/withSettings.app.d.ts +8 -7
- package/dist/types/src/components/hoc/withSettings.app.d.ts.map +1 -1
- package/dist/types/src/components/hoc/withSettings.d.ts +6 -4
- package/dist/types/src/components/hoc/withSettings.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import React, { PropsWithChildren
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
type ModalProps = {
|
|
3
3
|
model?: string;
|
|
4
4
|
dataModel?: string;
|
|
5
5
|
configModel?: string;
|
|
6
|
+
ref?: any;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
type PropsWithSetting<P> = PropsWithChildren<P & ModalProps>;
|
|
9
|
+
export type ComponentWithSettings<P> = React.ComponentType<PropsWithSetting<P>>;
|
|
8
10
|
export type SettingOptions = {
|
|
11
|
+
name: string;
|
|
9
12
|
valueOptions: any[];
|
|
10
13
|
configurationOptions: any[];
|
|
11
14
|
};
|
|
12
|
-
export declare const withSettings: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.
|
|
13
|
-
export declare const withModelPropsLoader: (settingOptions: SettingOptions) => <P
|
|
14
|
-
|
|
15
|
-
}) => React.JSX.Element;
|
|
16
|
-
export declare const withToolbar: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithChildren<P & ModalProps>> & React.RefAttributes<any>>;
|
|
15
|
+
export declare const withSettings: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
16
|
+
export declare const withModelPropsLoader: (settingOptions: SettingOptions) => <P = Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
17
|
+
export declare const withToolbar: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
17
18
|
export default withSettings;
|
|
18
19
|
//# sourceMappingURL=withSettings.app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.app.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,
|
|
1
|
+
{"version":3,"file":"withSettings.app.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAGtG,KAAK,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAA;CAAE,CAAA;AAEzF,KAAK,gBAAgB,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;AAE7D,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;AAE/E,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,GAAG,EAAE,CAAC;IAAC,oBAAoB,EAAE,GAAG,EAAE,CAAA;CAAE,CAAC;AAEhG,eAAO,MAAM,YAAY,GAAI,gBAAgB,cAAc,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAmBjK,CAAA;AAGD,eAAO,MAAM,oBAAoB,GAAI,gBAAgB,cAAc,MAAM,CAAC,GAAG,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAiBnK,CAAC;AAGF,eAAO,MAAM,WAAW,mBA1CqB,cAAc,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CA0C3H,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -39,25 +39,25 @@ const react_1 = __importStar(require("react"));
|
|
|
39
39
|
const hooks_1 = require("../../hooks");
|
|
40
40
|
const withSettings = (settingOptions) => (BaseComponent) => {
|
|
41
41
|
const ComponentWithModalPropsLoader = (0, exports.withModelPropsLoader)(settingOptions)(BaseComponent);
|
|
42
|
-
return (
|
|
43
|
-
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`, ...remainingProps } = props;
|
|
42
|
+
return (props) => {
|
|
43
|
+
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`, ref, ...remainingProps } = props;
|
|
44
44
|
if (dataModel || configModel) {
|
|
45
|
-
return react_1.default.createElement(ComponentWithModalPropsLoader, {
|
|
45
|
+
return react_1.default.createElement(ComponentWithModalPropsLoader, { ref: ref, model: model, dataModel: dataModel, configModel: configModel, ...remainingProps });
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
return react_1.default.createElement(BaseComponent, { ref:
|
|
48
|
+
return react_1.default.createElement(BaseComponent, { ref: ref, ...props });
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
};
|
|
51
51
|
};
|
|
52
52
|
exports.withSettings = withSettings;
|
|
53
53
|
const withModelPropsLoader = (settingOptions) => (BaseComponent) => (props) => {
|
|
54
|
-
const { model,
|
|
54
|
+
const { model, ref, dataModel = model, configModel = dataModel && `${dataModel}_config`, ...remainingProps } = props;
|
|
55
55
|
const { data } = (0, hooks_1.useComponentData)();
|
|
56
56
|
// Extract values from component data,
|
|
57
57
|
const propsFromModel = (0, react_1.useMemo)(() => {
|
|
58
58
|
return (0, lodash_1.assign)({}, (0, lodash_1.get)(data, configModel), (0, lodash_1.get)(data, dataModel));
|
|
59
59
|
}, [dataModel, props, data]);
|
|
60
|
-
return (react_1.default.createElement(BaseComponent, { ref:
|
|
60
|
+
return (react_1.default.createElement(BaseComponent, { ref: ref, ...remainingProps, ...propsFromModel }));
|
|
61
61
|
};
|
|
62
62
|
exports.withModelPropsLoader = withModelPropsLoader;
|
|
63
63
|
exports.withToolbar = exports.withSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.app.js","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAqC;AACrC,+CAAsG;AACtG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AC;IAEpC,sCAAsC;IACtC,MAAM,cAAc,GAAQ,IAAA,eAAO,EAAC,GAAG,EAAE;QACrC,OAAO,IAAA,eAAM,EAAC,EAAE,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,WAAW,CAAC,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IAE7B,OAAO,CACH,8BAAC,aAAa,IACV,GAAG,EAAE,GAAG,KACJ,cAAc,KACd,cAAc,GACpB,CACL,CAAC;AACN,CAAC,CAAC;AAjBW,QAAA,oBAAoB,wBAiB/B;AAGW,QAAA,WAAW,GAAG,oBAAY,CAAC;AACxC,kBAAe,oBAAY,CAAC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import React, { PropsWithChildren
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Action } from '../../hooks';
|
|
3
3
|
type SettingProp = {
|
|
4
4
|
model?: string;
|
|
5
5
|
dataModel?: string;
|
|
6
6
|
configModel?: string;
|
|
7
7
|
action?: Action;
|
|
8
|
+
ref?: any;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
type PropsWithSetting<P extends Object> = PropsWithChildren<P & SettingProp>;
|
|
11
|
+
export type ComponentWithSettings<P extends Object> = React.ComponentType<PropsWithSetting<P>>;
|
|
10
12
|
export declare const withSettings: ({ name: elementName, valueOptions, configurationOptions }: {
|
|
11
13
|
name: any;
|
|
12
14
|
valueOptions?: any[];
|
|
13
15
|
configurationOptions?: any[];
|
|
14
|
-
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) =>
|
|
16
|
+
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) => (props: PropsWithSetting<P>) => React.JSX.Element;
|
|
15
17
|
export declare const withToolbar: ({ name: elementName, valueOptions, configurationOptions }: {
|
|
16
18
|
name: any;
|
|
17
19
|
valueOptions?: any[];
|
|
18
20
|
configurationOptions?: any[];
|
|
19
|
-
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) =>
|
|
21
|
+
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) => (props: PropsWithSetting<P>) => React.JSX.Element;
|
|
20
22
|
export default withSettings;
|
|
21
23
|
//# sourceMappingURL=withSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"withSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAA+B,MAAM,aAAa,CAAC;AAElE,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAA;CAAE,CAAA;AAC3G,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI,iBAAiB,CAAC,CAAC,GAAG,WAAW,CAAC,CAAA;AAC5E,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;AAE9F,eAAO,MAAM,YAAY,GAAI;;;;CAAmE,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC,CAAC,sBAoC5L,CAAC;AAEF,eAAO,MAAM,WAAW;;;;OAtC8E,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC,CAAC,sBAsCtJ,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -37,8 +37,8 @@ exports.withToolbar = exports.withSettings = void 0;
|
|
|
37
37
|
const lodash_1 = require("lodash");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const hooks_1 = require("../../hooks");
|
|
40
|
-
const withSettings = ({ name: elementName, valueOptions = [], configurationOptions = [] }) => (BaseComponent) => (
|
|
41
|
-
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`,
|
|
40
|
+
const withSettings = ({ name: elementName, valueOptions = [], configurationOptions = [] }) => (BaseComponent) => (props) => {
|
|
41
|
+
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`, action: actionProp, ref, ...remainingProps } = props;
|
|
42
42
|
const { data } = (0, hooks_1.useComponentData)();
|
|
43
43
|
// Extract values from component data,
|
|
44
44
|
const propsFromModel = (0, react_1.useMemo)(() => {
|
|
@@ -59,9 +59,8 @@ const withSettings = ({ name: elementName, valueOptions = [], configurationOptio
|
|
|
59
59
|
return { handleAction: action };
|
|
60
60
|
}, [dataModel, action]);
|
|
61
61
|
const actionClickEvent = (0, hooks_1.useAction)(handleAction);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
62
|
+
return (react_1.default.createElement(BaseComponent, { animate: true, ...propsFromModel, onClick: actionClickEvent, action: forwardActions, ref: ref, ...remainingProps }));
|
|
63
|
+
};
|
|
65
64
|
exports.withSettings = withSettings;
|
|
66
65
|
exports.withToolbar = exports.withSettings;
|
|
67
66
|
exports.default = exports.withSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.js","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAqC;AACrC,+
|
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D,OAAO;gBACH,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACzC,aAAa,EAAE,gBAAgB;aAClC,CAAA;QACL,CAAC;QACD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IACpC,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAExB,MAAM,gBAAgB,GAAG,IAAA,iBAAS,EAAC,YAAY,CAAC,CAAC;IAEjD,OAAO,CACH,8BAAC,aAAa,IACV,OAAO,WACH,cAAc,EAClB,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG,KACJ,cAAc,GACpB,CACL,CAAC;AACN,CAAC,CAAC;AApCW,QAAA,YAAY,gBAoCvB;AAEW,QAAA,WAAW,GAAG,oBAAY,CAAC;AACxC,kBAAe,oBAAY,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import React, { PropsWithChildren
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
type ModalProps = {
|
|
3
3
|
model?: string;
|
|
4
4
|
dataModel?: string;
|
|
5
5
|
configModel?: string;
|
|
6
|
+
ref?: any;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
type PropsWithSetting<P> = PropsWithChildren<P & ModalProps>;
|
|
9
|
+
export type ComponentWithSettings<P> = React.ComponentType<PropsWithSetting<P>>;
|
|
8
10
|
export type SettingOptions = {
|
|
11
|
+
name: string;
|
|
9
12
|
valueOptions: any[];
|
|
10
13
|
configurationOptions: any[];
|
|
11
14
|
};
|
|
12
|
-
export declare const withSettings: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.
|
|
13
|
-
export declare const withModelPropsLoader: (settingOptions: SettingOptions) => <P
|
|
14
|
-
|
|
15
|
-
}) => React.JSX.Element;
|
|
16
|
-
export declare const withToolbar: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithChildren<P & ModalProps>> & React.RefAttributes<any>>;
|
|
15
|
+
export declare const withSettings: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
16
|
+
export declare const withModelPropsLoader: (settingOptions: SettingOptions) => <P = Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
17
|
+
export declare const withToolbar: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
17
18
|
export default withSettings;
|
|
18
19
|
//# sourceMappingURL=withSettings.app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.app.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,
|
|
1
|
+
{"version":3,"file":"withSettings.app.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAGtG,KAAK,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAA;CAAE,CAAA;AAEzF,KAAK,gBAAgB,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;AAE7D,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;AAE/E,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,GAAG,EAAE,CAAC;IAAC,oBAAoB,EAAE,GAAG,EAAE,CAAA;CAAE,CAAC;AAEhG,eAAO,MAAM,YAAY,GAAI,gBAAgB,cAAc,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAmBjK,CAAA;AAGD,eAAO,MAAM,oBAAoB,GAAI,gBAAgB,cAAc,MAAM,CAAC,GAAG,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAiBnK,CAAC;AAGF,eAAO,MAAM,WAAW,mBA1CqB,cAAc,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CA0C3H,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { assign, get } from 'lodash';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
3
|
import { useComponentData } from '../../hooks';
|
|
4
4
|
export const withSettings = (settingOptions) => (BaseComponent) => {
|
|
5
5
|
const ComponentWithModalPropsLoader = withModelPropsLoader(settingOptions)(BaseComponent);
|
|
6
|
-
return
|
|
7
|
-
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`, ...remainingProps } = props;
|
|
6
|
+
return (props) => {
|
|
7
|
+
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`, ref, ...remainingProps } = props;
|
|
8
8
|
if (dataModel || configModel) {
|
|
9
|
-
return React.createElement(ComponentWithModalPropsLoader, {
|
|
9
|
+
return React.createElement(ComponentWithModalPropsLoader, { ref: ref, model: model, dataModel: dataModel, configModel: configModel, ...remainingProps });
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
return React.createElement(BaseComponent, { ref:
|
|
12
|
+
return React.createElement(BaseComponent, { ref: ref, ...props });
|
|
13
13
|
}
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
};
|
|
16
16
|
export const withModelPropsLoader = (settingOptions) => (BaseComponent) => (props) => {
|
|
17
|
-
const { model,
|
|
17
|
+
const { model, ref, dataModel = model, configModel = dataModel && `${dataModel}_config`, ...remainingProps } = props;
|
|
18
18
|
const { data } = useComponentData();
|
|
19
19
|
// Extract values from component data,
|
|
20
20
|
const propsFromModel = useMemo(() => {
|
|
21
21
|
return assign({}, get(data, configModel), get(data, dataModel));
|
|
22
22
|
}, [dataModel, props, data]);
|
|
23
|
-
return (React.createElement(BaseComponent, { ref:
|
|
23
|
+
return (React.createElement(BaseComponent, { ref: ref, ...remainingProps, ...propsFromModel }));
|
|
24
24
|
};
|
|
25
25
|
export const withToolbar = withSettings;
|
|
26
26
|
export default withSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.app.js","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"withSettings.app.js","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,EAAiE,OAAO,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAU/C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,cAA8B,EAAE,EAAE,CAAC,CAAmB,aAAqC,EAA4C,EAAE;IAElK,MAAM,6BAA6B,GAAG,oBAAoB,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,C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C;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import React, { PropsWithChildren
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Action } from '../../hooks';
|
|
3
3
|
type SettingProp = {
|
|
4
4
|
model?: string;
|
|
5
5
|
dataModel?: string;
|
|
6
6
|
configModel?: string;
|
|
7
7
|
action?: Action;
|
|
8
|
+
ref?: any;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
type PropsWithSetting<P extends Object> = PropsWithChildren<P & SettingProp>;
|
|
11
|
+
export type ComponentWithSettings<P extends Object> = React.ComponentType<PropsWithSetting<P>>;
|
|
10
12
|
export declare const withSettings: ({ name: elementName, valueOptions, configurationOptions }: {
|
|
11
13
|
name: any;
|
|
12
14
|
valueOptions?: any[];
|
|
13
15
|
configurationOptions?: any[];
|
|
14
|
-
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) =>
|
|
16
|
+
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) => (props: PropsWithSetting<P>) => React.JSX.Element;
|
|
15
17
|
export declare const withToolbar: ({ name: elementName, valueOptions, configurationOptions }: {
|
|
16
18
|
name: any;
|
|
17
19
|
valueOptions?: any[];
|
|
18
20
|
configurationOptions?: any[];
|
|
19
|
-
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) =>
|
|
21
|
+
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) => (props: PropsWithSetting<P>) => React.JSX.Element;
|
|
20
22
|
export default withSettings;
|
|
21
23
|
//# sourceMappingURL=withSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"withSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAA+B,MAAM,aAAa,CAAC;AAElE,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAA;CAAE,CAAA;AAC3G,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI,iBAAiB,CAAC,CAAC,GAAG,WAAW,CAAC,CAAA;AAC5E,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;AAE9F,eAAO,MAAM,YAAY,GAAI;;;;CAAmE,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC,CAAC,sBAoC5L,CAAC;AAEF,eAAO,MAAM,WAAW;;;;OAtC8E,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC,CAAC,sBAsCtJ,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { assign, get } from 'lodash';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
3
|
import { useAction, useComponentData } from '../../hooks';
|
|
4
|
-
export const withSettings = ({ name: elementName, valueOptions = [], configurationOptions = [] }) => (BaseComponent) =>
|
|
5
|
-
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`,
|
|
4
|
+
export const withSettings = ({ name: elementName, valueOptions = [], configurationOptions = [] }) => (BaseComponent) => (props) => {
|
|
5
|
+
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config`, action: actionProp, ref, ...remainingProps } = props;
|
|
6
6
|
const { data } = useComponentData();
|
|
7
7
|
// Extract values from component data,
|
|
8
8
|
const propsFromModel = useMemo(() => {
|
|
@@ -23,9 +23,8 @@ export const withSettings = ({ name: elementName, valueOptions = [], configurati
|
|
|
23
23
|
return { handleAction: action };
|
|
24
24
|
}, [dataModel, action]);
|
|
25
25
|
const actionClickEvent = useAction(handleAction);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
26
|
+
return (React.createElement(BaseComponent, { animate: true, ...propsFromModel, onClick: actionClickEvent, action: forwardActions, ref: ref, ...remainingProps }));
|
|
27
|
+
};
|
|
29
28
|
export const withToolbar = withSettings;
|
|
30
29
|
export default withSettings;
|
|
31
30
|
//# sourceMappingURL=withSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.js","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"withSettings.js","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,EAAqB,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAU,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMlE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,GAAG,EAAE,EAAE,oBAAoB,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAmB,aAAqC,EAAE,EAAE,CAAC,CA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,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG,KACJ,cAAc,GACpB,CACL,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import React, { PropsWithChildren
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
type ModalProps = {
|
|
3
3
|
model?: string;
|
|
4
4
|
dataModel?: string;
|
|
5
5
|
configModel?: string;
|
|
6
|
+
ref?: any;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
type PropsWithSetting<P> = PropsWithChildren<P & ModalProps>;
|
|
9
|
+
export type ComponentWithSettings<P> = React.ComponentType<PropsWithSetting<P>>;
|
|
8
10
|
export type SettingOptions = {
|
|
11
|
+
name: string;
|
|
9
12
|
valueOptions: any[];
|
|
10
13
|
configurationOptions: any[];
|
|
11
14
|
};
|
|
12
|
-
export declare const withSettings: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.
|
|
13
|
-
export declare const withModelPropsLoader: (settingOptions: SettingOptions) => <P
|
|
14
|
-
|
|
15
|
-
}) => React.JSX.Element;
|
|
16
|
-
export declare const withToolbar: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithChildren<P & ModalProps>> & React.RefAttributes<any>>;
|
|
15
|
+
export declare const withSettings: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
16
|
+
export declare const withModelPropsLoader: (settingOptions: SettingOptions) => <P = Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
17
|
+
export declare const withToolbar: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ComponentType<PropsWithSetting<P>>;
|
|
17
18
|
export default withSettings;
|
|
18
19
|
//# sourceMappingURL=withSettings.app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.app.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,
|
|
1
|
+
{"version":3,"file":"withSettings.app.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAGtG,KAAK,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAA;CAAE,CAAA;AAEzF,KAAK,gBAAgB,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;AAE7D,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;AAE/E,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,GAAG,EAAE,CAAC;IAAC,oBAAoB,EAAE,GAAG,EAAE,CAAA;CAAE,CAAC;AAEhG,eAAO,MAAM,YAAY,GAAI,gBAAgB,cAAc,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAmBjK,CAAA;AAGD,eAAO,MAAM,oBAAoB,GAAI,gBAAgB,cAAc,MAAM,CAAC,GAAG,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAiBnK,CAAC;AAGF,eAAO,MAAM,WAAW,mBA1CqB,cAAc,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CA0C3H,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import React, { PropsWithChildren
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { Action } from '../../hooks';
|
|
3
3
|
type SettingProp = {
|
|
4
4
|
model?: string;
|
|
5
5
|
dataModel?: string;
|
|
6
6
|
configModel?: string;
|
|
7
7
|
action?: Action;
|
|
8
|
+
ref?: any;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
type PropsWithSetting<P extends Object> = PropsWithChildren<P & SettingProp>;
|
|
11
|
+
export type ComponentWithSettings<P extends Object> = React.ComponentType<PropsWithSetting<P>>;
|
|
10
12
|
export declare const withSettings: ({ name: elementName, valueOptions, configurationOptions }: {
|
|
11
13
|
name: any;
|
|
12
14
|
valueOptions?: any[];
|
|
13
15
|
configurationOptions?: any[];
|
|
14
|
-
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) =>
|
|
16
|
+
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) => (props: PropsWithSetting<P>) => React.JSX.Element;
|
|
15
17
|
export declare const withToolbar: ({ name: elementName, valueOptions, configurationOptions }: {
|
|
16
18
|
name: any;
|
|
17
19
|
valueOptions?: any[];
|
|
18
20
|
configurationOptions?: any[];
|
|
19
|
-
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) =>
|
|
21
|
+
}) => <P extends Object>(BaseComponent: React.ComponentType<P>) => (props: PropsWithSetting<P>) => React.JSX.Element;
|
|
20
22
|
export default withSettings;
|
|
21
23
|
//# sourceMappingURL=withSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"withSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/hoc/withSettings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAA+B,MAAM,aAAa,CAAC;AAElE,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAA;CAAE,CAAA;AAC3G,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI,iBAAiB,CAAC,CAAC,GAAG,WAAW,CAAC,CAAA;AAC5E,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;AAE9F,eAAO,MAAM,YAAY,GAAI;;;;CAAmE,MAAM,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC,CAAC,sBAoC5L,CAAC;AAEF,eAAO,MAAM,WAAW;;;;OAtC8E,CAAC,SAAS,MAAM,EAAE,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC,CAAC,sBAsCtJ,CAAC;AACxC,eAAe,YAAY,CAAC"}
|