@seeqdev/qomponents 0.0.84 → 0.0.86

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.
@@ -0,0 +1,2 @@
1
+ import { DimensionStyle } from '../TextField/TextField.types';
2
+ export declare const setValidInputDimension: (width?: number, height?: number) => DimensionStyle | undefined;
@@ -0,0 +1,14 @@
1
+ export const setValidInputDimension = (width, height) => {
2
+ let inputStyle;
3
+ if (typeof width === 'number' && width > 0) {
4
+ inputStyle = {
5
+ width: `${width}px`,
6
+ };
7
+ }
8
+ if (typeof height === 'number' && height > 0) {
9
+ inputStyle = inputStyle || {};
10
+ inputStyle['height'] = `${height}px`;
11
+ }
12
+ return inputStyle;
13
+ };
14
+ //# sourceMappingURL=validateStyleDimension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateStyleDimension.js","sourceRoot":"","sources":["../../src/utils/validateStyleDimension.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAc,EAAE,MAAe,EAA8B,EAAE;IACpG,IAAI,UAAsC,CAAC;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,EAAE;QAC1C,UAAU,GAAG;YACX,KAAK,EAAE,GAAG,KAAK,IAAI;SACpB,CAAC;KACH;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,GAAG,CAAC,EAAE;QAC5C,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;QAC9B,UAAU,CAAC,QAAQ,CAAC,GAAG,GAAG,MAAM,IAAI,CAAC;KACtC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { setValidInputDimension } from './validateStyleDimension';
2
+ describe('setValidInputDimension', () => {
3
+ it('returns undefined if both width and height are undefined', () => {
4
+ const result = setValidInputDimension();
5
+ expect(result).toBeUndefined();
6
+ });
7
+ it('returns a DimensionStyle object with width if width is a valid number', () => {
8
+ const result = setValidInputDimension(300);
9
+ expect(result).toEqual({ width: '300px' });
10
+ });
11
+ it('returns a DimensionStyle object with height if height is a valid number', () => {
12
+ const result = setValidInputDimension(undefined, 400);
13
+ expect(result).toEqual({ height: '400px' });
14
+ });
15
+ it('returns a DimensionStyle object with both width and height if both are valid numbers', () => {
16
+ const result = setValidInputDimension(500, 600);
17
+ expect(result).toEqual({ width: '500px', height: '600px' });
18
+ });
19
+ });
20
+ //# sourceMappingURL=validateStyleDimension.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateStyleDimension.test.js","sourceRoot":"","sources":["../../src/utils/validateStyleDimension.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAClE,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;QACxC,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,MAAM,MAAM,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QACjF,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QACtD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC9F,MAAM,MAAM,GAAG,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seeqdev/qomponents",
3
- "version": "0.0.84",
3
+ "version": "0.0.86",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.js",
package/dist/utils/svg.js DELETED
@@ -1,20 +0,0 @@
1
- export const SVG_PATH = 'svgpath:';
2
- /**
3
- * Determines if an icon is SVG
4
- *
5
- * @param icon - an icon string that will either be an icon class or an SVG path definition (e.g. "fa fa-wrench" or
6
- * "svgpath:M 17.0181 0 ...")
7
- */
8
- export function isSvgIcon(icon) {
9
- return icon.startsWith(SVG_PATH);
10
- }
11
- /**
12
- * Retrieves the SVG path from an SVG icon
13
- *
14
- * @param icon - an SVG icon string including path definition (e.g. "svgpath:M 17.0181 0 ...")
15
- * @returns the SVG icon path or an empty string if the supplied icon is not SVG
16
- */
17
- export function getSvgIconPath(icon) {
18
- return isSvgIcon(icon) ? icon.substring(SVG_PATH.length) : '';
19
- }
20
- //# sourceMappingURL=svg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/utils/svg.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAChE,CAAC"}