feat: Add comprehensive documentation suite and reorganize project structure
- Created complete documentation in docs/ directory - Added PROJECT_OVERVIEW.md with feature highlights and getting started guide - Added ARCHITECTURE.md with system design and technical details - Added SECURITY.md with comprehensive security implementation guide - Added DEVELOPMENT.md with development workflows and best practices - Added DEPLOYMENT.md with production deployment instructions - Added API.md with complete REST API documentation - Added CONTRIBUTING.md with contribution guidelines - Added CHANGELOG.md with version history and migration notes - Reorganized all documentation files into docs/ directory for better organization - Updated README.md with proper documentation links and quick navigation - Enhanced project structure with professional documentation standards
This commit is contained in:
50
f_scripts/shared/swiper/components-shared/get-params.js
Normal file
50
f_scripts/shared/swiper/components-shared/get-params.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import Swiper from 'swiper';
|
||||
import { isObject, extend } from './utils.js';
|
||||
import { paramsList } from './params-list.js';
|
||||
function getParams(obj = {}, splitEvents = true) {
|
||||
const params = {
|
||||
on: {}
|
||||
};
|
||||
const events = {};
|
||||
const passedParams = {};
|
||||
extend(params, Swiper.defaults);
|
||||
extend(params, Swiper.extendedDefaults);
|
||||
params._emitClasses = true;
|
||||
params.init = false;
|
||||
const rest = {};
|
||||
const allowedParams = paramsList.map(key => key.replace(/_/, ''));
|
||||
const plainObj = Object.assign({}, obj);
|
||||
Object.keys(plainObj).forEach(key => {
|
||||
if (typeof obj[key] === 'undefined') return;
|
||||
if (allowedParams.indexOf(key) >= 0) {
|
||||
if (isObject(obj[key])) {
|
||||
params[key] = {};
|
||||
passedParams[key] = {};
|
||||
extend(params[key], obj[key]);
|
||||
extend(passedParams[key], obj[key]);
|
||||
} else {
|
||||
params[key] = obj[key];
|
||||
passedParams[key] = obj[key];
|
||||
}
|
||||
} else if (key.search(/on[A-Z]/) === 0 && typeof obj[key] === 'function') {
|
||||
if (splitEvents) {
|
||||
events[`${key[2].toLowerCase()}${key.substr(3)}`] = obj[key];
|
||||
} else {
|
||||
params.on[`${key[2].toLowerCase()}${key.substr(3)}`] = obj[key];
|
||||
}
|
||||
} else {
|
||||
rest[key] = obj[key];
|
||||
}
|
||||
});
|
||||
['navigation', 'pagination', 'scrollbar'].forEach(key => {
|
||||
if (params[key] === true) params[key] = {};
|
||||
if (params[key] === false) delete params[key];
|
||||
});
|
||||
return {
|
||||
params,
|
||||
passedParams,
|
||||
rest,
|
||||
events
|
||||
};
|
||||
}
|
||||
export { getParams };
|
||||
Reference in New Issue
Block a user