@seeqdev/qomponents 0.0.108 → 0.0.109
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.
- package/dist/Accordion/Accordion.js +8 -8
- package/dist/Accordion/Accordion.stories.js +114 -114
- package/dist/Accordion/Accordion.test.js +54 -54
- package/dist/Accordion/Accordion.types.js +1 -1
- package/dist/Accordion/index.js +1 -1
- package/dist/Alert/Alert.js +31 -31
- package/dist/Alert/Alert.stories.js +44 -44
- package/dist/Alert/Alert.test.js +50 -50
- package/dist/Alert/Alert.types.js +1 -1
- package/dist/Alert/index.js +1 -1
- package/dist/Button/Button.js +91 -91
- package/dist/Button/Button.stories.js +97 -97
- package/dist/Button/Button.test.js +48 -48
- package/dist/Button/Button.types.js +4 -4
- package/dist/Button/index.js +1 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js +66 -66
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +97 -97
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +84 -84
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +1 -1
- package/dist/ButtonWithDropdown/index.js +1 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.js +50 -50
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +74 -74
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js +81 -81
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js +1 -1
- package/dist/ButtonWithPopover/index.js +1 -1
- package/dist/Checkbox/Checkbox.js +25 -25
- package/dist/Checkbox/Checkbox.stories.js +33 -33
- package/dist/Checkbox/Checkbox.test.js +93 -93
- package/dist/Checkbox/Checkbox.types.js +1 -1
- package/dist/Checkbox/index.js +1 -1
- package/dist/Icon/Icon.js +53 -53
- package/dist/Icon/Icon.stories.js +44 -44
- package/dist/Icon/Icon.test.js +54 -54
- package/dist/Icon/Icon.types.js +15 -15
- package/dist/Icon/index.js +1 -1
- package/dist/InputGroup/InputGroup.js +25 -25
- package/dist/InputGroup/InputGroup.stories.js +141 -141
- package/dist/InputGroup/InputGroup.test.js +42 -42
- package/dist/InputGroup/InputGroup.types.js +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/Modal/Modal.js +97 -97
- package/dist/Modal/Modal.stories.js +126 -126
- package/dist/Modal/Modal.test.js +107 -107
- package/dist/Modal/Modal.types.js +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/SeeqActionDropdown/SeeqActionDropdown.js +47 -47
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +79 -79
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +72 -72
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +1 -1
- package/dist/SeeqActionDropdown/index.js +1 -1
- package/dist/SeeqActionDropdown/variants.js +22 -22
- package/dist/Select/Select.js +173 -173
- package/dist/Select/Select.stories.js +79 -79
- package/dist/Select/Select.test.js +181 -181
- package/dist/Select/Select.types.js +1 -1
- package/dist/Select/index.js +2 -2
- package/dist/Tabs/Tabs.js +21 -21
- package/dist/Tabs/Tabs.stories.js +90 -90
- package/dist/Tabs/Tabs.test.js +90 -90
- package/dist/Tabs/Tabs.types.js +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/TextArea/TextArea.js +24 -24
- package/dist/TextArea/TextArea.stories.js +45 -45
- package/dist/TextArea/TextArea.test.js +67 -67
- package/dist/TextArea/TextArea.types.js +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/TextField/TextField.js +78 -78
- package/dist/TextField/TextField.stories.js +69 -69
- package/dist/TextField/TextField.test.js +38 -38
- package/dist/TextField/TextField.types.js +1 -1
- package/dist/TextField/index.js +1 -1
- package/dist/ToolbarButton/ToolbarButton.js +74 -74
- package/dist/ToolbarButton/ToolbarButton.stories.js +93 -93
- package/dist/ToolbarButton/ToolbarButton.test.js +92 -92
- package/dist/ToolbarButton/ToolbarButton.types.js +1 -1
- package/dist/ToolbarButton/index.js +1 -1
- package/dist/Tooltip/QTip.stories.js +44 -44
- package/dist/Tooltip/QTip.types.js +1 -1
- package/dist/Tooltip/QTipPerformance.stories.js +29 -29
- package/dist/Tooltip/Qtip.js +154 -154
- package/dist/Tooltip/Tooltip.js +30 -30
- package/dist/Tooltip/Tooltip.stories.js +31 -31
- package/dist/Tooltip/Tooltip.types.js +2 -2
- package/dist/Tooltip/TooltipPerformance.stories.js +29 -29
- package/dist/Tooltip/index.js +2 -2
- package/dist/Tooltip/qTip.utilities.js +10 -10
- package/dist/index.esm.js +30 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +30 -17
- package/dist/index.js.map +1 -1
- package/dist/types.js +1 -1
- package/dist/utils/browserId.js +28 -28
- package/dist/utils/svg.js +19 -19
- package/dist/utils/validateStyleDimension.js +13 -13
- package/dist/utils/validateStyleDimension.test.js +19 -19
- package/package.json +1 -1
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/dist/utils/browserId.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @exports the browser id (i.e., 'IE 11' 'Chrome 90')
|
|
3
|
-
* @see http://stackoverflow.com/questions/2400935/browser-detection-in-javascript
|
|
4
|
-
*/
|
|
5
|
-
export const browserId = (function () {
|
|
6
|
-
let tem;
|
|
7
|
-
const ua = navigator.userAgent;
|
|
8
|
-
let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
9
|
-
if (/trident/i.test(M[1])) {
|
|
10
|
-
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
11
|
-
return `IE ${tem[1] || ''}`;
|
|
12
|
-
}
|
|
13
|
-
if (M[1] === 'Chrome') {
|
|
14
|
-
tem = ua.match(/\b(OPR|Edge?)\/(\d+)/);
|
|
15
|
-
if (tem !== null) {
|
|
16
|
-
return tem.slice(1).join(' ').replace('OPR', 'Opera').replace('Edg ', 'Edge ');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];
|
|
20
|
-
if ((tem = ua.match(/version\/(\d+)/i)) !== null) {
|
|
21
|
-
M.splice(1, 1, tem[1]);
|
|
22
|
-
}
|
|
23
|
-
return M.join(' ');
|
|
24
|
-
})();
|
|
25
|
-
export const browserName = browserId && browserId.split(' ', 2)[0];
|
|
26
|
-
export const browserVersion = browserId && parseInt(browserId.split(' ', 2)[1], 10);
|
|
27
|
-
export const browserIsFirefox = browserId && browserName === 'Firefox';
|
|
28
|
-
export const browserIsEdgeBeforeChromium = browserName && browserVersion && browserName === 'Edge' && browserVersion < 70;
|
|
1
|
+
/**
|
|
2
|
+
* @exports the browser id (i.e., 'IE 11' 'Chrome 90')
|
|
3
|
+
* @see http://stackoverflow.com/questions/2400935/browser-detection-in-javascript
|
|
4
|
+
*/
|
|
5
|
+
export const browserId = (function () {
|
|
6
|
+
let tem;
|
|
7
|
+
const ua = navigator.userAgent;
|
|
8
|
+
let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
9
|
+
if (/trident/i.test(M[1])) {
|
|
10
|
+
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
11
|
+
return `IE ${tem[1] || ''}`;
|
|
12
|
+
}
|
|
13
|
+
if (M[1] === 'Chrome') {
|
|
14
|
+
tem = ua.match(/\b(OPR|Edge?)\/(\d+)/);
|
|
15
|
+
if (tem !== null) {
|
|
16
|
+
return tem.slice(1).join(' ').replace('OPR', 'Opera').replace('Edg ', 'Edge ');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];
|
|
20
|
+
if ((tem = ua.match(/version\/(\d+)/i)) !== null) {
|
|
21
|
+
M.splice(1, 1, tem[1]);
|
|
22
|
+
}
|
|
23
|
+
return M.join(' ');
|
|
24
|
+
})();
|
|
25
|
+
export const browserName = browserId && browserId.split(' ', 2)[0];
|
|
26
|
+
export const browserVersion = browserId && parseInt(browserId.split(' ', 2)[1], 10);
|
|
27
|
+
export const browserIsFirefox = browserId && browserName === 'Firefox';
|
|
28
|
+
export const browserIsEdgeBeforeChromium = browserName && browserVersion && browserName === 'Edge' && browserVersion < 70;
|
|
29
29
|
//# sourceMappingURL=browserId.js.map
|
package/dist/utils/svg.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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
|
-
}
|
|
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
20
|
//# sourceMappingURL=svg.js.map
|
|
@@ -1,14 +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
|
-
};
|
|
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
14
|
//# sourceMappingURL=validateStyleDimension.js.map
|
|
@@ -1,20 +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
|
-
});
|
|
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
20
|
//# sourceMappingURL=validateStyleDimension.test.js.map
|