UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

100 lines (99 loc) 2.81 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const skeleton = require("../../common/mixins/skeleton.cjs"); const skeleton_constants = require("./skeleton_constants.cjs"); const _pluginVue2_normalizer = require("../../_virtual/_plugin-vue2_normalizer.cjs"); const _sfc_main = { name: "DtSkeletonShape", mixins: [skeleton.default], props: { /** * Defines the shape of the skeleton, accepts circle or square. * @values circle, square */ shape: { type: String, default: "circle", validator: (shape) => Object.keys(skeleton_constants.SKELETON_SHAPES).includes(shape) }, /** * Size of the shape * @values xs, sm, md, lg, xl */ size: { type: String, default: "md" }, /** * Duration time of the animation (ms), set -1 for an infinite animation. */ animationDuration: { type: Number, default: -1 }, /** * This property has higher priority than "option.animate" * @values true, false */ animate: { type: Boolean, default: true }, /** * RippleDuration controls how long the delay is for the animation of a * placeholder 1000 pixels from the top of the page. Each placeholder * from the top down will have a delay duration from 0 to this offset. * The delay of each placeholder animation is based on how far down the page * the placeholder is rendered. This is a linear relationship. The unit * is milliseconds. */ offset: { type: Number, default: 1 }, /** * Additional class name for the content. */ contentClass: { type: [String, Object, Array], default: "" } }, data() { return { SKELETON_SHAPES: skeleton_constants.SKELETON_SHAPES }; }, computed: { shapeStyles() { const size = skeleton_constants.SKELETON_SHAPE_SIZES[this.size] || this.size; return { ...this.skeletonStyle, "min-width": size, "max-width": size, "min-height": size, "max-height": size }; } } }; var _sfc_render = function render() { var _vm = this, _c = _vm._self._c; return _c("div", { ref: "skeleton", class: [ "d-skeleton-placeholder", _vm.SKELETON_SHAPES[_vm.shape], { "d-skeleton-placeholder--animate": _vm.animate }, _vm.contentClass ], style: _vm.shapeStyles, attrs: { "data-qa": "skeleton-shape" } }); }; var _sfc_staticRenderFns = []; var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default( _sfc_main, _sfc_render, _sfc_staticRenderFns ); const DtSkeletonShape = __component__.exports; exports.default = DtSkeletonShape; //# sourceMappingURL=skeleton-shape.vue.cjs.map