@evlop/commons 1.0.214 → 1.0.216
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/reducers/components.js +2 -2
- package/dist/src/reducers/components.js.map +1 -1
- package/dist/src/reducers/modals.d.ts +14 -3
- package/dist/src/reducers/modals.d.ts.map +1 -1
- package/dist/src/reducers/modals.js +31 -12
- package/dist/src/reducers/modals.js.map +1 -1
- package/package.json +1 -1
@@ -48,7 +48,7 @@ function registerComponent(component) {
|
|
48
48
|
exports.registerComponent = registerComponent;
|
49
49
|
function registerPageComponent(component) {
|
50
50
|
return {
|
51
|
-
type: exports.
|
51
|
+
type: exports.REGISTER_PAGE_COMPONENT,
|
52
52
|
component,
|
53
53
|
};
|
54
54
|
}
|
@@ -102,7 +102,7 @@ const components = (state = initialState, action) => {
|
|
102
102
|
return Object.assign(Object.assign({}, state), { components: lodash_1.assign(newComponents, lodash_1.keyBy(newComponents, 'uuid')) });
|
103
103
|
}
|
104
104
|
case exports.REGISTER_PAGE_COMPONENT:
|
105
|
-
return Object.assign(Object.assign({}, state), { pageComponents: [...state.pageComponents,
|
105
|
+
return Object.assign(Object.assign({}, state), { pageComponents: [...state.pageComponents, action.component] });
|
106
106
|
case exports.REGISTER_FIELD_COMPONENT:
|
107
107
|
return Object.assign(Object.assign({}, state), { fieldComponents: [...state.fieldComponents, Object.assign({}, action.component)] });
|
108
108
|
case exports.REGISTER_STYLE_COMPONENT:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/reducers/components.tsx"],"names":[],"mappings":";;;AAAA,mCAAuC;AAE1B,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAC1D,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAChD,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AACpD,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAG/C,SAAgB,oBAAoB,CAAC,SAAS;IAC1C,OAAO;QACH,IAAI,EAAE,gCAAwB;QAC9B,SAAS;KACZ,CAAC;AACN,CAAC;AALD,oDAKC;AAED,SAAgB,uBAAuB,CAAC,SAAS;IAC7C,OAAO;QACH,IAAI,EAAE,kCAA0B;QAChC,SAAS;KACZ,CAAC;AACN,CAAC;AALD,0DAKC;AAED,SAAgB,kBAAkB,CAAC,SAAS;IACxC,OAAO;QACH,IAAI,EAAE,6BAAqB;QAC3B,SAAS;KACZ,CAAC;AACN,CAAC;AALD,gDAKC;AAED,SAAgB,kBAAkB,CAAC,MAAM;IACrC,OAAO;QACH,IAAI,EAAE,4BAAoB;QAC1B,MAAM;KACT,CAAC;AACN,CAAC;AALD,gDAKC;AAED,SAAgB,iBAAiB,CAAC,SAAS;IACvC,OAAO;QACH,IAAI,EAAE,0BAAkB;QACxB,SAAS;KACZ,CAAC;AACN,CAAC;AALD,8CAKC;AAED,SAAgB,qBAAqB,CAAC,SAAS;IAC3C,OAAO;QACH,IAAI,EAAE
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/reducers/components.tsx"],"names":[],"mappings":";;;AAAA,mCAAuC;AAE1B,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAC1D,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAChD,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AACpD,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAG/C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C,SAAS,EAAE,IACpE;QACN,KAAK,sBAAc;YACf,uCACO,KAAK,KACR,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAA,EAAE,CAAA,SAAS,CAAC,WAAW,KAAG,MAAM,CAAC,WAAW,CAAC,IAC5F;QACN,KAAK,6BAAqB;YACtB,uCACO,KAAK,KACR,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IACzC;QACN,KAAK,4BAAoB;YACrB,uCACO,KAAK,KACR,gBAAgB,EAAE,CAAC,GAAG,KAAK,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,IAC9D;QACN;YACI,OAAO,KAAK,CAAC;KACpB;AAEL,CAAC,CAAC;AA3DW,QAAA,UAAU,cA2DrB;AAEF,kBAAe,kBAAU,CAAC"}
|
@@ -1,9 +1,20 @@
|
|
1
1
|
export declare const SHOW_MODAL = "modal/show";
|
2
|
+
export declare const UPDATE_MODAL = "modal/update";
|
2
3
|
export declare const CLOSE_MODAL = "modal/close";
|
3
|
-
export
|
4
|
-
|
4
|
+
export interface AppModal {
|
5
|
+
id: number;
|
5
6
|
component: any;
|
6
|
-
props:
|
7
|
+
props: any;
|
8
|
+
closeable: boolean;
|
9
|
+
}
|
10
|
+
export declare const showModal: (options: Partial<AppModal>) => {
|
11
|
+
type: string;
|
12
|
+
modal: AppModal;
|
13
|
+
};
|
14
|
+
export declare const updateModal: (id: AppModal['id'], options: Partial<AppModal>) => {
|
15
|
+
type: string;
|
16
|
+
id: number;
|
17
|
+
modalUpdates: Partial<AppModal>;
|
7
18
|
};
|
8
19
|
export declare const closeModal: (id: any) => {
|
9
20
|
type: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../../src/reducers/modals.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,eAAO,MAAM,SAAS
|
1
|
+
{"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../../src/reducers/modals.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,GAAG,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;CACtB;AAGD,eAAO,MAAM,SAAS,YAAa,QAAQ,QAAQ,CAAC;;;CAiBnD,CAAC;AAEF,eAAO,MAAM,WAAW,OAAQ,QAAQ,CAAC,IAAI,CAAC,WAAW,QAAQ,QAAQ,CAAC;;;;CAMzE,CAAA;AAED,eAAO,MAAM,UAAU;;;CAGrB,CAAC;;AAIH,wBAcC"}
|
@@ -1,15 +1,36 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.closeModal = exports.showModal = exports.CLOSE_MODAL = exports.SHOW_MODAL = void 0;
|
3
|
+
exports.closeModal = exports.updateModal = exports.showModal = exports.CLOSE_MODAL = exports.UPDATE_MODAL = exports.SHOW_MODAL = void 0;
|
4
4
|
const lodash_1 = require("lodash");
|
5
5
|
exports.SHOW_MODAL = 'modal/show';
|
6
|
+
exports.UPDATE_MODAL = 'modal/update';
|
6
7
|
exports.CLOSE_MODAL = 'modal/close';
|
7
|
-
const showModal = (component, props = {})
|
8
|
-
|
9
|
-
component,
|
10
|
-
|
11
|
-
|
8
|
+
// export const showModal = (component, props = {})=>({
|
9
|
+
const showModal = (options) => {
|
10
|
+
const { id = lodash_1.random(Number.MAX_SAFE_INTEGER), component, props = {} } = options;
|
11
|
+
if (!component) {
|
12
|
+
throw new Error('Modal component is required');
|
13
|
+
}
|
14
|
+
const modal = {
|
15
|
+
id,
|
16
|
+
component,
|
17
|
+
props,
|
18
|
+
closeable: true,
|
19
|
+
};
|
20
|
+
return {
|
21
|
+
type: exports.SHOW_MODAL,
|
22
|
+
modal,
|
23
|
+
};
|
24
|
+
};
|
12
25
|
exports.showModal = showModal;
|
26
|
+
const updateModal = (id, options) => {
|
27
|
+
return {
|
28
|
+
type: exports.UPDATE_MODAL,
|
29
|
+
id,
|
30
|
+
modalUpdates: options,
|
31
|
+
};
|
32
|
+
};
|
33
|
+
exports.updateModal = updateModal;
|
13
34
|
const closeModal = (id) => ({
|
14
35
|
type: exports.CLOSE_MODAL,
|
15
36
|
id,
|
@@ -20,13 +41,11 @@ exports.default = (state = initialState, action) => {
|
|
20
41
|
switch (action.type) {
|
21
42
|
case exports.SHOW_MODAL:
|
22
43
|
return [
|
23
|
-
...state,
|
24
|
-
|
25
|
-
id: lodash_1.random(Number.MAX_SAFE_INTEGER),
|
26
|
-
component: action.component,
|
27
|
-
props: action.props,
|
28
|
-
}
|
44
|
+
...state.filter(m => m.id !== action.modal.id),
|
45
|
+
action.modal,
|
29
46
|
];
|
47
|
+
case exports.UPDATE_MODAL:
|
48
|
+
return state.map(m => m.id === action.id ? Object.assign(Object.assign({}, m), action.modalUpdates) : m);
|
30
49
|
case exports.CLOSE_MODAL:
|
31
50
|
return state.filter(m => m.id !== action.id);
|
32
51
|
default:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modals.js","sourceRoot":"","sources":["../../../src/reducers/modals.tsx"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"modals.js","sourceRoot":"","sources":["../../../src/reducers/modals.tsx"],"names":[],"mappings":";;;AAAA,mCAAwC;AAE3B,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,WAAW,GAAG,aAAa,CAAC;AASzC,uDAAuD;AAChD,MAAM,SAAS,GAAG,CAAC,OAA0B,EAAC,EAAE;IACnD,MAA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