UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

176 lines (169 loc) 7.04 kB
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import { _ as __unplugin_components_0 } from '../_chunks/dep-6c2da407.js'; import { _ as __unplugin_components_3 } from '../_chunks/dep-17236cae.js'; import { openBlock, createElementBlock, createElementVNode, defineComponent, computed, createVNode } from 'vue'; import { _ as __unplugin_components_1 } from '../_chunks/dep-05bc6eb4.js'; import { _ as __unplugin_components_2$1 } from '../_chunks/dep-9beabfae.js'; import _defineProperty from '@babel/runtime/helpers/defineProperty'; import isObject from 'lodash/isObject'; import props from './pagination-mini-props.js'; import { usePrefixClass } from '../hooks/useConfig.js'; import { Button } from '../button/index.js'; import '../config-provider/useConfig.js'; import 'lodash/isFunction'; import 'lodash/cloneDeep'; import 'lodash/isString'; import '../config-provider/context.js'; import 'lodash/mergeWith'; import 'lodash/merge'; import '../_common/js/global-config/default-config.js'; import '../_common/js/global-config/locale/en_US.js'; import '../_chunks/dep-3a1cce9f.js'; import 'lodash/isArray'; import '../button/button.js'; import '@babel/runtime/helpers/toConsumableArray'; import '../loading/index.js'; import '../loading/directive.js'; import '../loading/plugin.js'; import '../loading/loading.js'; import '@babel/runtime/helpers/slicedToArray'; import '../loading/icon/gradient.js'; import '../_common/js/loading/circle-adapter.js'; import '../_common/js/utils/set-style.js'; import '../_common/js/utils/helper.js'; import '@babel/runtime/helpers/objectWithoutProperties'; import 'lodash/isNull'; import 'lodash/isUndefined'; import 'lodash/isNumber'; import '../utils/dom.js'; import '../utils/easing.js'; import '../utils/render-tnode.js'; import 'lodash/isEmpty'; import 'lodash/camelCase'; import 'lodash/kebabCase'; import '../loading/props.js'; import '../hooks/useTeleport.js'; import '../utils/withInstall.js'; import '../button/props.js'; import '../hooks/useRipple.js'; import '../hooks/useKeepAnimation.js'; import '../utils/set-style.js'; import '../hooks/tnode.js'; import '../hooks/useDisabled.js'; import 'lodash/isBoolean'; const _hoisted_1 = { class: "x-icon", viewBox: "0 0 24 24", width: "1.1em", height: "1.1em" }; const _hoisted_2 = /*#__PURE__*/createElementVNode("path", { fill: "currentColor", d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10Zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16Z" }, null, -1 /* HOISTED */); const _hoisted_3 = [ _hoisted_2 ]; function render(_ctx, _cache) { return (openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3)) } var __unplugin_components_2 = { name: 'ri-circle-line', render }; /* vite-plugin-components disabled */ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var _PaginationMini = defineComponent({ name: "XPaginationMini", props: _objectSpread({}, props), setup: function setup(props2) { var COMPONENT_NAME = usePrefixClass("pagination-mini"); var titleConfig = computed(function () { if (isObject(props2.tips)) return props2.tips; if (props2.tips === true) return { prev: "\u4E0A\u4E00\u9875", current: "\u5F53\u524D", next: "\u4E0B\u4E00\u9875" }; return {}; }); var disabledConfig = computed(function () { if (isObject(props2.disabled)) return props2.disabled; if (props2.disabled === true) return { prev: true, current: true, next: true }; return { prev: false, current: false, next: false }; }); return function () { var jumperClass = [COMPONENT_NAME.value, _defineProperty({}, "".concat(COMPONENT_NAME.value, "--outline"), props2.variant === "outline")]; return createVNode("div", { "class": jumperClass }, [createVNode(Button, { "title": titleConfig.value.prev, "variant": props2.variant, "size": props2.size, "shape": "square", "onClick": function onClick(e) { var _props2$onChange; return (_props2$onChange = props2.onChange) === null || _props2$onChange === void 0 ? void 0 : _props2$onChange.call(props2, { e: e, trigger: "prev" }); }, "icon": props2.layout === "horizontal" ? function () { return createVNode(__unplugin_components_2$1, null, null); } : function () { return createVNode(__unplugin_components_1, null, null); }, "class": "".concat(COMPONENT_NAME.value, "__prev"), "disabled": disabledConfig.value.prev }, null), props2.showCurrent && createVNode(Button, { "title": titleConfig.value.current, "variant": props2.variant, "size": props2.size, "shape": "square", "onClick": function onClick(e) { var _props2$onChange2; return (_props2$onChange2 = props2.onChange) === null || _props2$onChange2 === void 0 ? void 0 : _props2$onChange2.call(props2, { e: e, trigger: "current" }); }, "icon": function icon() { return createVNode(__unplugin_components_2, null, null); }, "class": "".concat(COMPONENT_NAME.value, "__current"), "disabled": disabledConfig.value.current }, null), createVNode(Button, { "title": titleConfig.value.next, "variant": props2.variant, "size": props2.size, "shape": "square", "onClick": function onClick(e) { var _props2$onChange3; return (_props2$onChange3 = props2.onChange) === null || _props2$onChange3 === void 0 ? void 0 : _props2$onChange3.call(props2, { e: e, trigger: "next" }); }, "icon": props2.layout === "horizontal" ? function () { return createVNode(__unplugin_components_3, null, null); } : function () { return createVNode(__unplugin_components_0, null, null); }, "class": "".concat(COMPONENT_NAME.value, "__next"), "disabled": disabledConfig.value.next }, null)]); }; } }); export { _PaginationMini as default }; //# sourceMappingURL=pagination-mini.js.map