bootstrap-vue-next
Version:
BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.
1 lines • 2.97 kB
Source Map (JSON)
{"version":3,"file":"tableUtils-Jp7dzXjS.mjs","sources":["../src/utils/tableUtils.ts"],"sourcesContent":["import {titleCase} from './stringUtils'\nimport type {TableFieldRaw} from '../types/TableTypes'\nimport type {Breakpoint, BTableLiteProps, BTableSimpleProps} from '../types'\n\nexport const getTableFieldHeadLabel = (field: Readonly<TableFieldRaw<unknown>>) =>\n typeof field === 'string'\n ? titleCase(field)\n : field.label !== undefined\n ? field.label\n : typeof field.key === 'string'\n ? titleCase(field.key)\n : field.key\n\nexport const btableSimpleProps = Object.freeze(\n Object.keys({\n bordered: 0,\n borderless: 0,\n borderVariant: 0,\n captionTop: 0,\n dark: 0,\n fixed: 0,\n hover: 0,\n id: 0,\n noBorderCollapse: 0,\n outlined: 0,\n responsive: 0,\n small: 0,\n stacked: 0,\n stickyHeader: 0,\n striped: 0,\n stripedColumns: 0,\n variant: 0,\n tableAttrs: 0,\n tableClass: 0,\n } satisfies Record<keyof BTableSimpleProps, 0>)\n) as readonly (keyof BTableSimpleProps)[]\n\nexport const btableLiteProps = Object.freeze(\n Object.keys({\n align: 0,\n caption: 0,\n detailsTdClass: 0,\n fieldColumnClass: 0,\n fields: 0,\n footClone: 0,\n footRowVariant: 0,\n footVariant: 0,\n headRowVariant: 0,\n headVariant: 0,\n items: 0,\n labelStacked: 0,\n modelValue: 0,\n primaryKey: 0,\n tbodyClass: 0,\n tbodyTrAttrs: 0,\n tbodyTrClass: 0,\n tfootClass: 0,\n tfootTrClass: 0,\n theadClass: 0,\n theadTrClass: 0,\n } satisfies Record<keyof Omit<BTableLiteProps<unknown>, keyof BTableSimpleProps>, 0>)\n) as readonly (keyof Omit<BTableLiteProps<unknown>, keyof BTableSimpleProps>)[]\n\nexport const getDataLabelAttr = (\n props: {stacked: boolean | Breakpoint | undefined; labelStacked: boolean | undefined},\n label: string\n) => (props.stacked && props.labelStacked !== true ? {'data-label': label} : undefined)\n"],"names":[],"mappings":";AAIO,MAAM,yBAAyB,CAAC,UACrC,OAAO,UAAU,WACb,UAAU,KAAK,IACf,MAAM,UAAU,SACd,MAAM,QACN,OAAO,MAAM,QAAQ,WACnB,UAAU,MAAM,GAAG,IACnB,MAAM;AAET,MAAM,oBAAoB,OAAO;AAAA,EACtC,OAAO,KAAK;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,kBAAkB;AAAA,IAClB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,cAAc;AAAA,IACd,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,YAAY;AAAA,EAAA,CACgC;AAChD;AAEO,MAAM,kBAAkB,OAAO;AAAA,EACpC,OAAO,KAAK;AAAA,IACV,OAAO;AAAA,IACP,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,OAAO;AAAA,IACP,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,cAAc;AAAA,EAAA,CACoE;AACtF;AAEO,MAAM,mBAAmB,CAC9B,OACA,UACI,MAAM,WAAW,MAAM,iBAAiB,OAAO,EAAC,cAAc,MAAA,IAAS;"}