mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
ENH: model info display UI
Change-Id: I066c0e7f8ce87ec00b1141a1b44430444a819b42 (cherry picked from commit 05907a1a42da82737090d55046974d401f8af057)
This commit is contained in:
parent
0cc953ad41
commit
b4ffa91cb4
343 changed files with 54828 additions and 2 deletions
44
resources/web/include/swiper/svelte/get-params.js
Normal file
44
resources/web/include/swiper/svelte/get-params.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import Swiper from 'swiper';
|
||||
import { isObject, extend } from './utils.js';
|
||||
import { paramsList } from './params-list.js';
|
||||
|
||||
function getParams(obj = {}) {
|
||||
const params = {
|
||||
on: {}
|
||||
};
|
||||
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(/_/, ''));
|
||||
Object.keys(obj).forEach(key => {
|
||||
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') {
|
||||
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
|
||||
};
|
||||
}
|
||||
|
||||
export { getParams };
|
Loading…
Add table
Add a link
Reference in a new issue