@bundle-stats/ui 4.8.4-beta.0 → 4.9.0-beta.0
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/lib/components/bundle-assets/bundle-assets.js +2 -2
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +2 -2
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +2 -2
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/index.js +1 -3
- package/lib/components/index.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.i18n.js +4 -4
- package/lib/components/metrics-table/metrics-table.i18n.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.js +3 -3
- package/lib/components/metrics-table/metrics-table.js.map +1 -1
- package/lib/hooks/rows-sort.js +1 -1
- package/lib/hooks/rows-sort.js.map +1 -1
- package/lib/ui/filters/filters.i18n.js +4 -1
- package/lib/ui/filters/filters.i18n.js.map +1 -1
- package/lib/ui/filters/filters.js +22 -6
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/filters.module.css +29 -0
- package/lib/ui/index.js +3 -1
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/input/index.js.map +1 -1
- package/lib/ui/input/input.js +2 -10
- package/lib/ui/input/input.js.map +1 -1
- package/lib/{components/metrics-table-search → ui/input-search}/index.js +1 -1
- package/lib/ui/input-search/index.js.map +1 -0
- package/lib/ui/input-search/input-search.js +63 -0
- package/lib/ui/input-search/input-search.js.map +1 -0
- package/lib-esm/components/bundle-assets/bundle-assets.js +2 -2
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +2 -2
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js +2 -2
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/index.js +0 -1
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.i18n.js +3 -3
- package/lib-esm/components/metrics-table/metrics-table.i18n.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.js +3 -3
- package/lib-esm/components/metrics-table/metrics-table.js.map +1 -1
- package/lib-esm/hooks/rows-sort.js +1 -1
- package/lib-esm/hooks/rows-sort.js.map +1 -1
- package/lib-esm/ui/filters/filters.i18n.js +3 -0
- package/lib-esm/ui/filters/filters.i18n.js.map +1 -1
- package/lib-esm/ui/filters/filters.js +23 -7
- package/lib-esm/ui/filters/filters.js.map +1 -1
- package/lib-esm/ui/filters/filters.module.css +29 -0
- package/lib-esm/ui/index.js +1 -0
- package/lib-esm/ui/index.js.map +1 -1
- package/lib-esm/ui/input/index.js.map +1 -1
- package/lib-esm/ui/input/input.js +2 -10
- package/lib-esm/ui/input/input.js.map +1 -1
- package/lib-esm/ui/input-search/index.js +2 -0
- package/lib-esm/ui/input-search/index.js.map +1 -0
- package/lib-esm/ui/input-search/input-search.js +33 -0
- package/lib-esm/ui/input-search/input-search.js.map +1 -0
- package/package.json +10 -10
- package/src/components/bundle-assets/bundle-assets.jsx +4 -4
- package/src/components/bundle-modules/bundle-modules.tsx +4 -4
- package/src/components/bundle-packages/bundle-packages.jsx +4 -4
- package/src/components/index.js +0 -1
- package/src/components/metrics-table/metrics-table.i18n.ts +3 -3
- package/src/components/metrics-table/metrics-table.tsx +3 -3
- package/src/hooks/rows-sort.ts +1 -1
- package/src/ui/filters/filters.i18n.ts +3 -0
- package/src/ui/filters/filters.module.css +29 -0
- package/src/ui/filters/filters.tsx +63 -25
- package/src/ui/index.js +1 -0
- package/src/ui/input/input.stories.tsx +13 -0
- package/src/ui/input/input.tsx +16 -0
- package/src/ui/input-search/index.ts +1 -0
- package/src/ui/input-search/input-search.tsx +82 -0
- package/types/components/index.d.ts +0 -1
- package/types/components/metrics-table/metrics-table.i18n.d.ts +3 -3
- package/types/hooks/rows-sort.d.ts +1 -1
- package/types/ui/filters/filters.i18n.d.ts +3 -0
- package/types/ui/index.d.ts +1 -0
- package/types/ui/input/index.d.ts +1 -1
- package/types/ui/input/input.d.ts +5 -18
- package/types/ui/input-search/index.d.ts +1 -0
- package/types/ui/input-search/input-search.d.ts +9 -0
- package/lib/components/metrics-table-search/index.js.map +0 -1
- package/lib/components/metrics-table-search/metrics-table-search.js +0 -73
- package/lib/components/metrics-table-search/metrics-table-search.js.map +0 -1
- package/lib-esm/components/metrics-table-search/index.js +0 -2
- package/lib-esm/components/metrics-table-search/index.js.map +0 -1
- package/lib-esm/components/metrics-table-search/metrics-table-search.js +0 -43
- package/lib-esm/components/metrics-table-search/metrics-table-search.js.map +0 -1
- package/src/components/metrics-table-search/index.js +0 -1
- package/src/components/metrics-table-search/metrics-table-search.jsx +0 -72
- package/src/ui/input/input.jsx +0 -20
- package/types/components/metrics-table-search/index.d.ts +0 -1
- package/types/components/metrics-table-search/metrics-table-search.d.ts +0 -17
- /package/lib/{components/metrics-table-search/metrics-table-search.module.css → ui/input-search/input-search.module.css} +0 -0
- /package/lib-esm/{components/metrics-table-search/metrics-table-search.module.css → ui/input-search/input-search.module.css} +0 -0
- /package/src/ui/input/{index.js → index.ts} +0 -0
- /package/src/{components/metrics-table-search/metrics-table-search.module.css → ui/input-search/input-search.module.css} +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import debounce from 'lodash/debounce';
|
|
5
|
-
import { Icon } from '../../ui/icon';
|
|
6
|
-
import { Input } from '../../ui/input';
|
|
7
|
-
import css from './metrics-table-search.module.css';
|
|
8
|
-
export const MetricsTableSearch = (props) => {
|
|
9
|
-
const { className, placeholder, search, updateSearch } = props;
|
|
10
|
-
const rootClassname = cx(css.root, className);
|
|
11
|
-
const [value, setValue] = useState(search);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setValue(search);
|
|
14
|
-
}, [search]);
|
|
15
|
-
const debouncedUpdateSearch = useCallback(debounce(updateSearch, 500), []);
|
|
16
|
-
const handleChangeValue = useCallback((event) => {
|
|
17
|
-
const newValue = event.target.value;
|
|
18
|
-
setValue(newValue);
|
|
19
|
-
if (newValue !== search) {
|
|
20
|
-
debouncedUpdateSearch(newValue);
|
|
21
|
-
}
|
|
22
|
-
}, [search]);
|
|
23
|
-
const handleClearValue = useCallback(() => {
|
|
24
|
-
const newValue = '';
|
|
25
|
-
setValue(newValue);
|
|
26
|
-
updateSearch(newValue);
|
|
27
|
-
}, []);
|
|
28
|
-
return (React.createElement("div", { className: rootClassname },
|
|
29
|
-
React.createElement(Input, { className: css.input, placeholder: placeholder, onChange: handleChangeValue, value: value, size: "small", autoComplete: "off" }),
|
|
30
|
-
search && (React.createElement("button", { className: css.cancelButton, type: "button", onClick: handleClearValue },
|
|
31
|
-
React.createElement(Icon, { className: css.cancelButtonIcon, glyph: Icon.ICONS.CANCEL })))));
|
|
32
|
-
};
|
|
33
|
-
MetricsTableSearch.propTypes = {
|
|
34
|
-
className: PropTypes.string,
|
|
35
|
-
placeholder: PropTypes.string,
|
|
36
|
-
search: PropTypes.string.isRequired,
|
|
37
|
-
updateSearch: PropTypes.func.isRequired,
|
|
38
|
-
};
|
|
39
|
-
MetricsTableSearch.defaultProps = {
|
|
40
|
-
className: '',
|
|
41
|
-
placeholder: '',
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=metrics-table-search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-table-search.js","sourceRoot":"","sources":["../../../src/components/metrics-table-search/metrics-table-search.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,Y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SAAS,EAAE,aAAa;QAC3B,oBAAC,KAAK,IACJ,SAAS,EAAE,GAAG,CAAC,KAAK,EACpB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,OAAO,EACZ,YAAY,EAAC,KAAK,GAClB;QACD,MAAM,IAAI,CACT,gCAAQ,SAAS,EAAE,GAAG,CAAC,YAAY,EAAE,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,gBAAgB;YAC1E,oBAAC,IAAI,IAAC,SAAS,EAAE,GAAG,CAAC,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAI,CAC5D,CACV,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAkB,CAAC,SAAS,GAAG;IAC7B,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACnC,YAAY,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACxC,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG;IAChC,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,EAAE;CAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './metrics-table-search';
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import debounce from 'lodash/debounce';
|
|
5
|
-
|
|
6
|
-
import { Icon } from '../../ui/icon';
|
|
7
|
-
import { Input } from '../../ui/input';
|
|
8
|
-
|
|
9
|
-
import css from './metrics-table-search.module.css';
|
|
10
|
-
|
|
11
|
-
export const MetricsTableSearch = (props) => {
|
|
12
|
-
const { className, placeholder, search, updateSearch } = props;
|
|
13
|
-
const rootClassname = cx(css.root, className);
|
|
14
|
-
|
|
15
|
-
const [value, setValue] = useState(search);
|
|
16
|
-
|
|
17
|
-
// Update local state when initial value has changed
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
setValue(search);
|
|
20
|
-
}, [search]);
|
|
21
|
-
|
|
22
|
-
const debouncedUpdateSearch = useCallback(debounce(updateSearch, 500), []);
|
|
23
|
-
|
|
24
|
-
const handleChangeValue = useCallback(
|
|
25
|
-
(event) => {
|
|
26
|
-
const newValue = event.target.value;
|
|
27
|
-
setValue(newValue);
|
|
28
|
-
|
|
29
|
-
// Update parent state when the local value has changed
|
|
30
|
-
if (newValue !== search) {
|
|
31
|
-
debouncedUpdateSearch(newValue);
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
[search],
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
const handleClearValue = useCallback(() => {
|
|
38
|
-
const newValue = '';
|
|
39
|
-
setValue(newValue);
|
|
40
|
-
updateSearch(newValue);
|
|
41
|
-
}, []);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div className={rootClassname}>
|
|
45
|
-
<Input
|
|
46
|
-
className={css.input}
|
|
47
|
-
placeholder={placeholder}
|
|
48
|
-
onChange={handleChangeValue}
|
|
49
|
-
value={value}
|
|
50
|
-
size="small"
|
|
51
|
-
autoComplete="off"
|
|
52
|
-
/>
|
|
53
|
-
{search && (
|
|
54
|
-
<button className={css.cancelButton} type="button" onClick={handleClearValue}>
|
|
55
|
-
<Icon className={css.cancelButtonIcon} glyph={Icon.ICONS.CANCEL} />
|
|
56
|
-
</button>
|
|
57
|
-
)}
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
MetricsTableSearch.propTypes = {
|
|
63
|
-
className: PropTypes.string,
|
|
64
|
-
placeholder: PropTypes.string,
|
|
65
|
-
search: PropTypes.string.isRequired,
|
|
66
|
-
updateSearch: PropTypes.func.isRequired,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
MetricsTableSearch.defaultProps = {
|
|
70
|
-
className: '',
|
|
71
|
-
placeholder: '',
|
|
72
|
-
};
|
package/src/ui/input/input.jsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import cx from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import css from './input.module.css';
|
|
6
|
-
|
|
7
|
-
export const Input = ({ className, size, ...restProps }) => {
|
|
8
|
-
const rootClassName = cx(css.root, className, css[size]);
|
|
9
|
-
return <input className={rootClassName} {...restProps} />;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
Input.propTypes = {
|
|
13
|
-
className: PropTypes.string,
|
|
14
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
Input.defaultProps = {
|
|
18
|
-
className: '',
|
|
19
|
-
size: 'medium',
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./metrics-table-search";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export function MetricsTableSearch(props: any): React.JSX.Element;
|
|
2
|
-
export namespace MetricsTableSearch {
|
|
3
|
-
namespace propTypes {
|
|
4
|
-
let className: PropTypes.Requireable<string>;
|
|
5
|
-
let placeholder: PropTypes.Requireable<string>;
|
|
6
|
-
let search: PropTypes.Validator<string>;
|
|
7
|
-
let updateSearch: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
|
-
}
|
|
9
|
-
namespace defaultProps {
|
|
10
|
-
let className_1: string;
|
|
11
|
-
export { className_1 as className };
|
|
12
|
-
let placeholder_1: string;
|
|
13
|
-
export { placeholder_1 as placeholder };
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import PropTypes from 'prop-types';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|