You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.5 KiB
67 lines
1.5 KiB
'use strict';
|
|
|
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
var core = require('@vueuse/core');
|
|
require('../../../utils/index.js');
|
|
|
|
const buildPopperOptions = (props, modifiers = []) => {
|
|
const { placement, strategy, popperOptions } = props;
|
|
const options = {
|
|
placement,
|
|
strategy,
|
|
...popperOptions,
|
|
modifiers: [...genModifiers(props), ...modifiers]
|
|
};
|
|
deriveExtraModifiers(options, popperOptions == null ? void 0 : popperOptions.modifiers);
|
|
return options;
|
|
};
|
|
const unwrapMeasurableEl = ($el) => {
|
|
if (!core.isClient)
|
|
return;
|
|
return core.unrefElement($el);
|
|
};
|
|
function genModifiers(options) {
|
|
const { offset, gpuAcceleration, fallbackPlacements } = options;
|
|
return [
|
|
{
|
|
name: "offset",
|
|
options: {
|
|
offset: [0, offset != null ? offset : 12]
|
|
}
|
|
},
|
|
{
|
|
name: "preventOverflow",
|
|
options: {
|
|
padding: {
|
|
top: 2,
|
|
bottom: 2,
|
|
left: 5,
|
|
right: 5
|
|
}
|
|
}
|
|
},
|
|
{
|
|
name: "flip",
|
|
options: {
|
|
padding: 5,
|
|
fallbackPlacements
|
|
}
|
|
},
|
|
{
|
|
name: "computeStyles",
|
|
options: {
|
|
gpuAcceleration
|
|
}
|
|
}
|
|
];
|
|
}
|
|
function deriveExtraModifiers(options, modifiers) {
|
|
if (modifiers) {
|
|
options.modifiers = [...options.modifiers, ...modifiers != null ? modifiers : []];
|
|
}
|
|
}
|
|
|
|
exports.buildPopperOptions = buildPopperOptions;
|
|
exports.unwrapMeasurableEl = unwrapMeasurableEl;
|
|
//# sourceMappingURL=utils.js.map
|
|
|