element-plus
Version:
A Component Library for Vue 3
1 lines • 1.21 kB
Source Map (JSON)
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../../../../../packages/components/table-v2/src/composables/utils.ts"],"sourcesContent":["import type { CSSProperties } from 'vue'\nimport type { AnyColumns } from '../types'\n\nexport const calcColumnStyle = (\n column: AnyColumns[number],\n fixedColumn: boolean,\n fixed: boolean\n): CSSProperties => {\n const flex = {\n flexGrow: 0,\n flexShrink: 0,\n ...(fixed\n ? {}\n : {\n flexGrow: column.flexGrow ?? 0,\n flexShrink: column.flexShrink ?? 1,\n }),\n }\n\n const style = {\n ...(column.style ?? {}),\n ...flex,\n flexBasis: 'auto',\n width: column.width,\n }\n\n if (!fixedColumn) {\n if (column.maxWidth) style.maxWidth = column.maxWidth\n if (column.minWidth) style.minWidth = column.minWidth\n }\n\n return style\n}\n"],"mappings":";AAGA,MAAa,mBACX,QACA,aACA,UACkB;CAClB,MAAM,OAAO;EACX,UAAU;EACV,YAAY;EACZ,GAAI,QACA,EAAE,GACF;GACE,UAAU,OAAO,YAAY;GAC7B,YAAY,OAAO,cAAc;GAClC;EACN;CAED,MAAM,QAAQ;EACZ,GAAI,OAAO,SAAS,EAAE;EACtB,GAAG;EACH,WAAW;EACX,OAAO,OAAO;EACf;AAED,KAAI,CAAC,aAAa;AAChB,MAAI,OAAO,SAAU,OAAM,WAAW,OAAO;AAC7C,MAAI,OAAO,SAAU,OAAM,WAAW,OAAO;;AAG/C,QAAO"}