@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
1 lines • 3.46 kB
Source Map (JSON)
{"version":3,"file":"description-list.cjs","sources":["../../../components/description_list/description_list.vue"],"sourcesContent":["<template>\n <dl :class=\"['d-description-list', getDirectionClass, getGapClass]\">\n <template\n v-for=\"item in items\"\n :key=\"item.term\"\n >\n <dt :class=\"dtClass\">\n {{ item.term }}\n </dt>\n <dd :class=\"ddClass\">\n {{ item.description }}\n </dd>\n </template>\n </dl>\n</template>\n\n<script>\nimport { DT_STACK_GAP } from '@/components/stack';\nimport { DT_DESCRIPTION_LIST_DIRECTION } from './description_list_constants';\nimport { itemsValidator } from './description_list_validators';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtDescriptionList',\n\n props: {\n /**\n * The direction for the list\n * @values row, column\n */\n direction: {\n type: String,\n default: 'row',\n validator: direction => DT_DESCRIPTION_LIST_DIRECTION.includes(direction),\n },\n\n /**\n * A list of items that represent the term and the description\n */\n items: {\n type: Array,\n default: () => [],\n validator: items => itemsValidator(items),\n required: true,\n },\n\n /**\n * Set the space between the elements\n * @values 0, 100, 200, 300, 400, 500, 600\n */\n gap: {\n type: String,\n default: '400',\n validator: (gap) => DT_STACK_GAP.includes(gap),\n },\n\n /**\n * Used to customize the term element\n */\n termClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Used to customize the description element\n */\n descriptionClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n computed: {\n dtClass () {\n return ['d-description-list__term', this.termClass];\n },\n\n ddClass () {\n return ['d-description-list__description', this.descriptionClass];\n },\n\n getDirectionClass () {\n return `d-description-list--${this.direction}`;\n },\n\n getGapClass () {\n return `d-description-list--gap-${this.gap}`;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","direction","DT_DESCRIPTION_LIST_DIRECTION","items","itemsValidator","gap","DT_STACK_GAP","_createElementBlock","_normalizeClass","$options","_openBlock","_Fragment","_renderList","$props","item","_createElementVNode","_toDisplayString"],"mappings":"oUAqBKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,oBAEN,MAAO,CAKL,UAAW,CACT,KAAM,OACN,QAAS,MACT,UAAWC,GAAaC,gCAA8B,SAASD,CAAS,GAM1E,MAAO,CACL,KAAM,MACN,QAAS,IAAM,CAAA,EACf,UAAWE,GAASC,EAAAA,eAAeD,CAAK,EACxC,SAAU,IAOZ,IAAK,CACH,KAAM,OACN,QAAS,MACT,UAAYE,GAAQC,eAAa,SAASD,CAAG,GAM/C,UAAW,CACT,KAAM,CAAC,OAAQ,MAAO,MAAM,EAC5B,QAAS,IAMX,iBAAkB,CAChB,KAAM,CAAC,OAAQ,MAAO,MAAM,EAC5B,QAAS,KAIb,SAAU,CACR,SAAW,CACT,MAAO,CAAC,2BAA4B,KAAK,SAAS,CACpD,EAEA,SAAW,CACT,MAAO,CAAC,kCAAmC,KAAK,gBAAgB,CAClE,EAEA,mBAAqB,CACnB,MAAO,uBAAuB,KAAK,SAAS,EAC9C,EAEA,aAAe,CACb,MAAO,2BAA2B,KAAK,GAAG,EAC5C,EAEJ,+CAzFEE,EAAAA,mBAYK,KAAA,CAZA,MADPC,EAAAA,eAAA,CAAA,qBACqCC,EAAA,kBAAmBA,EAAA,WAAW,CAAA,KAC/DC,YAAA,EAAA,EAAAH,EAAAA,mBAUWI,EAAAA,SAAA,KAZfC,EAAAA,WAGqBC,EAAA,MAARC,IAHbJ,EAAAA,UAAA,EAAAH,EAAAA,mBAAAI,WAAA,CAAA,IAIYG,EAAK,OAEXC,EAAAA,mBAEK,KAAA,CAFA,MANXP,EAAAA,eAMkBC,EAAA,OAAO,CACd,EAAAO,kBAAAF,EAAK,IAAI,EAAA,CAAA,EAEdC,EAAAA,mBAEK,KAAA,CAFA,MATXP,EAAAA,eASkBC,EAAA,OAAO,CACd,EAAAO,kBAAAF,EAAK,WAAW,EAAA,CAAA"}