All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.composables.dimensions.mjs.map Maven / Gradle / Ivy

{"version":3,"file":"dimensions.mjs","names":["computed","convertToUnit","propsFactory","makeDimensionProps","height","Number","String","maxHeight","maxWidth","minHeight","minWidth","width","useDimension","props","dimensionStyles","styles"],"sources":["../../src/composables/dimensions.ts"],"sourcesContent":["// Utilities\nimport { computed } from 'vue'\nimport { convertToUnit, propsFactory } from '@/util'\n\n// Types\nexport interface DimensionProps {\n  height?: number | string\n  maxHeight?: number | string\n  maxWidth?: number | string\n  minHeight?: number | string\n  minWidth?: number | string\n  width?: number | string\n}\n\n// Composables\nexport const makeDimensionProps = propsFactory({\n  height: [Number, String],\n  maxHeight: [Number, String],\n  maxWidth: [Number, String],\n  minHeight: [Number, String],\n  minWidth: [Number, String],\n  width: [Number, String],\n}, 'dimension')\n\nexport function useDimension (props: DimensionProps) {\n  const dimensionStyles = computed(() => {\n    const styles: Record = {}\n\n    const height = convertToUnit(props.height)\n    const maxHeight = convertToUnit(props.maxHeight)\n    const maxWidth = convertToUnit(props.maxWidth)\n    const minHeight = convertToUnit(props.minHeight)\n    const minWidth = convertToUnit(props.minWidth)\n    const width = convertToUnit(props.width)\n\n    if (height != null) styles.height = height\n    if (maxHeight != null) styles.maxHeight = maxHeight\n    if (maxWidth != null) styles.maxWidth = maxWidth\n    if (minHeight != null) styles.minHeight = minHeight\n    if (minWidth != null) styles.minWidth = minWidth\n    if (width != null) styles.width = width\n\n    return styles\n  })\n\n  return { dimensionStyles }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,QAAQ,KAAK;AAAA,SACrBC,aAAa,EAAEC,YAAY,6BAEpC;AAUA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,YAAY,CAAC;EAC7CE,MAAM,EAAE,CAACC,MAAM,EAAEC,MAAM,CAAC;EACxBC,SAAS,EAAE,CAACF,MAAM,EAAEC,MAAM,CAAC;EAC3BE,QAAQ,EAAE,CAACH,MAAM,EAAEC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