UNPKG

tdesign-vue

Version:
216 lines (208 loc) 7.93 kB
/** * tdesign v1.12.1 * (c) 2025 tdesign * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _slicedToArray = require('@babel/runtime/helpers/slicedToArray'); var tdesignIconsVue = require('tdesign-icons-vue'); var button_index = require('../../button/index.js'); var utils_mixins = require('../../utils/mixins.js'); var configProvider_configReceiver = require('../../config-provider/config-receiver.js'); require('../../button/button.js'); require('@babel/runtime/helpers/defineProperty'); require('../../loading/index.js'); require('../../loading/directive.js'); require('../../loading/plugin.js'); require('vue'); require('../../loading/loading.js'); require('../../loading/icon/gradient.js'); require('../../_common/js/loading/circle-adapter.js'); require('../../_common/js/utils/setStyle.js'); require('../../_common/js/utils/helper.js'); require('@babel/runtime/helpers/toConsumableArray'); require('@babel/runtime/helpers/objectWithoutProperties'); require('../../_chunks/dep-5a0b1276.js'); require('../../_chunks/dep-2d34b118.js'); require('../../_chunks/dep-6b60413b.js'); require('../../_chunks/dep-5ea2b00f.js'); require('@babel/runtime/helpers/typeof'); require('../../_chunks/dep-9b72cbc5.js'); require('../../_chunks/dep-d7270eaf.js'); require('../../_chunks/dep-2edcfe51.js'); require('../../utils/dom.js'); require('raf'); require('../../utils/easing.js'); require('../../utils/render-tnode.js'); require('@babel/runtime/helpers/readOnlyError'); require('@vue/composition-api'); require('../../_chunks/dep-bf70543d.js'); require('../../_chunks/dep-f895c884.js'); require('../../_chunks/dep-e1cc6f64.js'); require('../../_chunks/dep-7b78e8c3.js'); require('../../_chunks/dep-68f48b50.js'); require('../../_chunks/dep-051ce30d.js'); require('../../_chunks/dep-4b30bfe2.js'); require('../../_chunks/dep-727a349e.js'); require('../../utils/transfer-dom.js'); require('../../loading/props.js'); require('../../_chunks/dep-6247fdbf.js'); require('../../_common/js/global-config/default-config.js'); require('../../_common/js/global-config/locale/zh_CN.js'); require('../../_chunks/dep-3ed0c42e.js'); require('../../_chunks/dep-53935099.js'); require('dayjs'); require('../../_chunks/dep-403352a7.js'); require('../../_chunks/dep-cca66fee.js'); require('../../_chunks/dep-4361b357.js'); require('../../_chunks/dep-887c649b.js'); require('../../_chunks/dep-411a10dd.js'); require('../../_chunks/dep-51fe98f1.js'); require('../../_chunks/dep-3d682642.js'); require('../../_chunks/dep-dea23841.js'); require('../../_chunks/dep-4aa08166.js'); require('../../_chunks/dep-ddc1429e.js'); require('../../_chunks/dep-65896ff9.js'); require('../../_chunks/dep-b65b2f55.js'); require('../../_chunks/dep-6e7b8cda.js'); require('../../_chunks/dep-98f48ff2.js'); require('../../_chunks/dep-80e3757f.js'); require('../../_chunks/dep-08d7842c.js'); require('../../_chunks/dep-1ca3138c.js'); require('../../_chunks/dep-e6ed4b1f.js'); require('../../_chunks/dep-c44b2462.js'); require('../../_common/js/global-config/t.js'); require('../../config.js'); require('../../_chunks/dep-e1a96c85.js'); require('../../_chunks/dep-35eb80a8.js'); require('../../_chunks/dep-a8feef06.js'); require('../../_chunks/dep-361a995e.js'); require('../../_chunks/dep-563168ba.js'); require('../../_chunks/dep-dd8aea11.js'); require('../../_chunks/dep-ed8c3176.js'); require('../../_chunks/dep-28836b00.js'); require('../../_chunks/dep-de009b1f.js'); require('../../_chunks/dep-165bd1be.js'); require('../../_chunks/dep-e1bd36c1.js'); require('../../_chunks/dep-2d46186d.js'); require('../../_chunks/dep-459d78d6.js'); require('../../utils/withInstall.js'); require('../../button/props.js'); require('../../utils/ripple.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray); var classPrefixMixins = configProvider_configReceiver.getClassPrefixMixins("transfer"); var TransferOperations = utils_mixins["default"](classPrefixMixins, configProvider_configReceiver.getGlobalIconMixins()).extend({ name: "TTransferOperations", props: { leftDisabled: { type: Boolean, required: true }, rightDisabled: { type: Boolean, required: true }, operation: { type: [String, Array, Function, Boolean] } }, methods: { moveToRight: function moveToRight() { this.$emit("moveToRight"); }, moveToLeft: function moveToLeft() { this.$emit("moveToLeft"); }, getIconRight: function getIconRight() { var h = this.$createElement; var _this$useGlobalIcon = this.useGlobalIcon({ ChevronRightIcon: tdesignIconsVue.ChevronRightIcon }), ChevronRightIcon = _this$useGlobalIcon.ChevronRightIcon; return h(ChevronRightIcon); }, getIconLeft: function getIconLeft() { var h = this.$createElement; var _this$useGlobalIcon2 = this.useGlobalIcon({ ChevronLeftIcon: tdesignIconsVue.ChevronLeftIcon }), ChevronLeftIcon = _this$useGlobalIcon2.ChevronLeftIcon; return h(ChevronLeftIcon); }, getIcon: function getIcon(direction) { if (typeof this.operation === "function") { return null; } if (direction === "right" && this.operation && typeof this.operation[0] === "function") { return null; } if (direction === "left" && this.operation && typeof this.operation[1] === "function") { return null; } if (this.$scopedSlots.operation) { return null; } return direction === "left" ? this.getIconLeft : this.getIconRight; }, _renderButton: function _renderButton(h, direction) { if (typeof this.$scopedSlots.operation === "function") { return this.$scopedSlots.operation({ direction: direction }); } if (typeof this.operation === "function") { var renderContent2 = this.operation; return renderContent2(h, { direction: direction }); } var renderContent; if (Array.isArray(this.operation)) { var _this$operation = _slicedToArray__default["default"](this.operation, 2), left = _this$operation[0], right = _this$operation[1]; renderContent = direction === "right" ? right : left; } else { renderContent = ""; } return renderContent; } }, render: function render(h) { var _this$operation2, _this$operation3; var _this$$props = this.$props, leftDisabled = _this$$props.leftDisabled, rightDisabled = _this$$props.rightDisabled; return h("div", { "class": "".concat(this.componentName, "__operations") }, [h(button_index.Button, { "attrs": { "variant": "outline", "size": "small", "shape": typeof ((_this$operation2 = this.operation) === null || _this$operation2 === void 0 ? void 0 : _this$operation2[1]) === "string" ? "rectangle" : "square", "disabled": rightDisabled, "icon": this.getIcon("right") }, "key": rightDisabled ? "right-outline" : "right-base", "on": { "click": this.moveToRight } }, [this._renderButton(h, "right")]), h(button_index.Button, { "attrs": { "variant": "outline", "size": "small", "shape": typeof ((_this$operation3 = this.operation) === null || _this$operation3 === void 0 ? void 0 : _this$operation3[0]) === "string" ? "rectangle" : "square", "disabled": leftDisabled, "icon": this.getIcon("left") }, "key": leftDisabled ? "left-outline" : "left-base", "on": { "click": this.moveToLeft } }, [this._renderButton(h, "left")])]); } }); exports["default"] = TransferOperations; //# sourceMappingURL=transfer-operations.js.map