@hixme/modal
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.MrModalManager = exports.setView = exports.setData = exports.removeFromViewList = exports.hasActiveModal = exports.getViewList = exports.getModalData = exports.getModal = exports.getCurrentView = exports.clearModal = exports.addToViewList = exports.NAME = exports.MrModal = undefined; | ||
exports.MrModalManager = exports.setModal = exports.setView = exports.setData = exports.removeFromViewList = exports.hasActiveModal = exports.getViewList = exports.getModalData = exports.getModal = exports.getCurrentView = exports.clearModal = exports.addToViewList = exports.NAME = exports.MrModal = undefined; | ||
@@ -77,4 +77,10 @@ var _modules = require('./modules'); | ||
}); | ||
Object.defineProperty(exports, 'setModal', { | ||
enumerable: true, | ||
get: function get() { | ||
return _modules.setModal; | ||
} | ||
}); | ||
var _MrModalContainer = require('./components/MrModalContainer'); | ||
var _MrModalContainer = require('./MrModalContainer'); | ||
@@ -81,0 +87,0 @@ var _MrModalContainer2 = _interopRequireDefault(_MrModalContainer); |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.getModalData = exports.hasActiveModal = exports.getViewList = exports.getCurrentView = exports.getModal = exports.removeFromViewList = exports.addToViewList = exports.setData = exports.clearModal = exports.setView = exports.NAME = undefined; | ||
exports.getModalData = exports.hasActiveModal = exports.getViewList = exports.getCurrentView = exports.getModal = exports.removeFromViewList = exports.addToViewList = exports.setView = exports.setModal = exports.setData = exports.clearModal = exports.NAME = undefined; | ||
@@ -26,17 +26,8 @@ var _createReducer; | ||
var SET_VIEW = 'SET_VIEW'; | ||
var SET_MODAL = 'SET_MODAL'; | ||
var ADD_TO_VIEW_LIST = 'ADD_TO_VIEW_LIST'; | ||
var REMOVE_FROM_VIEW_LIST = 'REMOVE_FROM_VIEW_LIST'; | ||
(0, _reduxUtils.namespaceActions)(NAME)([CLEAR_MODAL, SET_DATA, SET_VIEW, ADD_TO_VIEW_LIST, REMOVE_FROM_VIEW_LIST]); | ||
(0, _reduxUtils.namespaceActions)(NAME)([CLEAR_MODAL, SET_DATA, SET_MODAL, SET_VIEW, ADD_TO_VIEW_LIST, REMOVE_FROM_VIEW_LIST]); | ||
var setView = exports.setView = function setView(view) { | ||
return function (dispatch) { | ||
document.body.style.overflow = 'hidden'; | ||
return dispatch({ | ||
type: SET_VIEW, | ||
payload: view | ||
}); | ||
}; | ||
}; | ||
var clearModal = exports.clearModal = function clearModal() { | ||
@@ -58,2 +49,24 @@ return function (dispatch) { | ||
var setModal = exports.setModal = function setModal(view) { | ||
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return function (dispatch) { | ||
document.body.style.overflow = 'hidden'; | ||
return dispatch({ | ||
type: SET_MODAL, | ||
payload: { | ||
view: view, | ||
data: data | ||
} | ||
}); | ||
}; | ||
}; | ||
var setView = exports.setView = function setView(view) { | ||
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return function (dispatch) { | ||
console.warn('setView is deprecated, please use setModal action instead'); | ||
return dispatch(setModal(view, data)); | ||
}; | ||
}; | ||
var addToViewList = exports.addToViewList = function addToViewList(payload) { | ||
@@ -111,6 +124,16 @@ return { | ||
exports.default = (0, _reduxUtils.createReducer)(initialState, (_createReducer = {}, _defineProperty(_createReducer, SET_VIEW, function (state, payload) { | ||
exports.default = (0, _reduxUtils.createReducer)(initialState, (_createReducer = {}, _defineProperty(_createReducer, SET_MODAL, function (state, _ref) { | ||
var view = _ref.view, | ||
data = _ref.data; | ||
return Object.assign({}, state, { | ||
view: payload | ||
view: view, | ||
data: data | ||
}); | ||
}), _defineProperty(_createReducer, SET_VIEW, function (state, _ref2) { | ||
var view = _ref2.view, | ||
data = _ref2.data; | ||
return Object.assign({}, state, { | ||
view: view, | ||
data: data | ||
}); | ||
}), _defineProperty(_createReducer, SET_DATA, function (state, payload) { | ||
@@ -117,0 +140,0 @@ return Object.assign({}, state, { |
{ | ||
"name": "@hixme/modal", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Hixme Modal", | ||
@@ -52,2 +52,3 @@ "main": "lib/index.js", | ||
"@hixme-ui/container": "^1.8.0", | ||
"@hixme-ui/modal": "^1.16.2", | ||
"@hixme-ui/title": "^1.8.0", | ||
@@ -54,0 +55,0 @@ "@hixme/redux-utils": "^2.1.8", |
@@ -1,2 +0,2 @@ | ||
import MrModalContainer from './components/MrModalContainer' | ||
import MrModalContainer from './MrModalContainer' | ||
import MrModalReducer from './modules' | ||
@@ -17,2 +17,3 @@ | ||
setView, | ||
setModal, | ||
} from './modules' | ||
@@ -19,0 +20,0 @@ export MrModalManager from './MrModalManager' |
@@ -11,2 +11,3 @@ import { createReducer, namespaceActions } from '@hixme/redux-utils' | ||
const SET_VIEW = 'SET_VIEW' | ||
const SET_MODAL = 'SET_MODAL' | ||
const ADD_TO_VIEW_LIST = 'ADD_TO_VIEW_LIST' | ||
@@ -18,2 +19,3 @@ const REMOVE_FROM_VIEW_LIST = 'REMOVE_FROM_VIEW_LIST' | ||
SET_DATA, | ||
SET_MODAL, | ||
SET_VIEW, | ||
@@ -24,10 +26,2 @@ ADD_TO_VIEW_LIST, | ||
export const setView = view => (dispatch) => { | ||
document.body.style.overflow = 'hidden' | ||
return dispatch({ | ||
type: SET_VIEW, | ||
payload: view, | ||
}) | ||
} | ||
export const clearModal = () => (dispatch) => { | ||
@@ -45,2 +39,18 @@ document.body.style.overflow = 'unset' | ||
export const setModal = (view, data = {}) => (dispatch) => { | ||
document.body.style.overflow = 'hidden' | ||
return dispatch({ | ||
type: SET_MODAL, | ||
payload: { | ||
view, | ||
data, | ||
}, | ||
}) | ||
} | ||
export const setView = (view, data = {}) => (dispatch) => { | ||
console.warn('setView is deprecated, please use setModal action instead') | ||
return dispatch(setModal(view, data)) | ||
} | ||
export const addToViewList = payload => ({ | ||
@@ -90,5 +100,10 @@ type: ADD_TO_VIEW_LIST, | ||
export default createReducer(initialState, { | ||
[SET_VIEW]: (state, payload) => Object.assign({}, state, { | ||
view: payload, | ||
[SET_MODAL]: (state, { view, data }) => Object.assign({}, state, { | ||
view, | ||
data, | ||
}), | ||
[SET_VIEW]: (state, { view, data }) => Object.assign({}, state, { | ||
view, | ||
data, | ||
}), | ||
[SET_DATA]: (state, payload) => Object.assign({}, state, { | ||
@@ -95,0 +110,0 @@ data: payload, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36013
12
15
494
1
+ Added@hixme-ui/modal@^1.16.2
+ Added@hixme-ui/close-button@1.20.7(transitive)
+ Added@hixme-ui/modal@1.20.7(transitive)