@maropost-ui/liquidsky-ui 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,27 @@
1
1
  import type { MaybeRef, MaybeRefOrGetter, ToRefs } from 'vue';
2
+ /**
3
+ * @description
4
+ * toRefs - A Vue composable that extends the native `toRefs` function to handle refs of an object.
5
+ *
6
+ * @param objectRef A ref or normal object or array.
7
+ * @param options Options
8
+ *
9
+ * @returns A object with the same properties as the input object, but with the values wrapped in refs.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { toRefs } from '@liquidsky/ui'
14
+ *
15
+ * const obj = {
16
+ * name: 'John',
17
+ * age: 30
18
+ * }
19
+ * const refs = toRefs(obj)
20
+ *
21
+ * console.log(refs.name.value) // 'John'
22
+ * console.log(refs.age.value) // 30
23
+ * ```
24
+ */
2
25
  export interface ToRefsOptions {
3
26
  /**
4
27
  * Replace the original ref with a copy on property update.
@@ -1 +1 @@
1
- {"version":3,"file":"toRefs.d.ts","sourceRoot":"","sources":["../../src/composables/toRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAG7D,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CACvC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,SAAS,MAAM,EAC7C,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,EACtB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAAC,CAAC,CAAC,CAqCX"}
1
+ {"version":3,"file":"toRefs.d.ts","sourceRoot":"","sources":["../../src/composables/toRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAG7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CACvC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,SAAS,MAAM,EAC7C,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,EACtB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAAC,CAAC,CAAC,CAqCX"}
@@ -1,4 +1,18 @@
1
1
  import type { UnitType, Unit } from '../types';
2
+ /**
3
+ * @description
4
+ * useUnitConversion - A Vue composable that provides unit conversion functionality. Supports weight and dimension units.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const { isValidUnit, getValidUnit, getUnits, convert } = useUnitConversion()
9
+ *
10
+ * console.log(isValidUnit('kg', 'weight')) // true
11
+ * console.log(getValidUnit('kg', 'weight')) // 'kg'
12
+ * console.log(getUnits('weight')) // ['kg', 'g', 'mg', 'lb', 'oz', 'ton']
13
+ * console.log(convert(1, 'weight', 'kg', 'g')) // 1000
14
+ * ```
15
+ */
2
16
  export default function useUnitConversion(): {
3
17
  isValidUnit: (unit: string, type: UnitType) => boolean;
4
18
  getValidUnit: (unit: string, type: UnitType) => Unit;
@@ -1 +1 @@
1
- {"version":3,"file":"useUnitConversion.d.ts","sourceRoot":"","sources":["../../src/composables/useUnitConversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA6B,IAAI,EAAmB,MAAM,UAAU,CAAA;AAG1F,MAAM,CAAC,OAAO,UAAU,iBAAiB;wBA2BZ,MAAM,QAAQ,QAAQ,KAAG,OAAO;yBAO/B,MAAM,QAAQ,QAAQ,KAAG,IAAI;qBAWjC,QAAQ,KAAG,MAAM,EAAE;qBAOnB,MAAM,QAAQ,QAAQ,YAAY,MAAM,UAAU,MAAM,KAAG,MAAM;EAsB1F"}
1
+ {"version":3,"file":"useUnitConversion.d.ts","sourceRoot":"","sources":["../../src/composables/useUnitConversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA6B,IAAI,EAAmB,MAAM,UAAU,CAAA;AAE1F;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB;wBA2BZ,MAAM,QAAQ,QAAQ,KAAG,OAAO;yBAO/B,MAAM,QAAQ,QAAQ,KAAG,IAAI;qBAWjC,QAAQ,KAAG,MAAM,EAAE;qBAOnB,MAAM,QAAQ,QAAQ,YAAY,MAAM,UAAU,MAAM,KAAG,MAAM;EAsB1F"}