UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

110 lines (109 loc) 3.12 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const skeleton_constants = require("./skeleton_constants.cjs"); const skeleton = require("../../common/mixins/skeleton.cjs"); const _pluginVue2_normalizer = require("../../_virtual/_plugin-vue2_normalizer.cjs"); const _sfc_main = { name: "DtSkeletonText", mixins: [skeleton.default], props: { /** * Skeleton type * @values body, heading */ type: { type: String, default: "body", validator: (type) => skeleton_constants.SKELETON_TEXT_TYPES.includes(type) }, /** * Heading height * @values sm, md, lg */ headingHeight: { type: String, default: "md", validator: (headingHeight) => Object.keys(skeleton_constants.SKELETON_HEADING_HEIGHTS).includes(headingHeight) }, /** * Width of the skeleton */ width: { type: String, default: "100%" }, /** * 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: false }, /** * 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, default: "" } }, data() { return { SKELETON_HEADING_HEIGHTS: skeleton_constants.SKELETON_HEADING_HEIGHTS }; } }; var _sfc_render = function render() { var _vm = this, _c = _vm._self._c; return _vm.type === "body" ? _c("div", { ref: "skeleton", class: [ "d-skeleton-text", "d-skeleton-placeholder", { "d-skeleton-placeholder--animate": _vm.animate }, _vm.contentClass ], style: { width: _vm.width, ..._vm.skeletonStyle }, attrs: { "data-qa": "skeleton-text-body" } }) : _vm.type === "heading" ? _c("div", { ref: "skeleton", class: [ _vm.SKELETON_HEADING_HEIGHTS[_vm.headingHeight], "d-skeleton-text--heading", "d-skeleton-placeholder", { "d-skeleton-placeholder--animate": _vm.animate }, _vm.contentClass ], style: { width: _vm.width, ..._vm.skeletonStyle }, attrs: { "data-qa": "skeleton-text-heading" } }) : _vm._e(); }; var _sfc_staticRenderFns = []; var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default( _sfc_main, _sfc_render, _sfc_staticRenderFns ); const DtSkeletonText = __component__.exports; exports.default = DtSkeletonText; //# sourceMappingURL=skeleton-text.vue.cjs.map