diginet-core-ui 1.4.49-beta.1 → 1.4.49-beta.2
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/assets/images/menu/dhr/MHRP39N0025.svg +9 -0
- package/assets/images/menu/dhr/MHRP39N0027.svg +18 -0
- package/assets/images/menu/dhr/MHRP39N0028.svg +18 -0
- package/components/form-control/dropdown/index.js +43 -43
- package/components/popover/index.js +13 -13
- package/components/tree-view/index.js +34 -34
- package/package.json +1 -1
- package/utils/getFileType.js +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M31 2H26V4H31C32.1 4 33 4.9 33 6V35C33 36.1 32.1 37 31 37H8C6.9 37 6 36.1 6 35V6C6 4.9 6.9 4 8 4H13V2H8C5.8 2 4 3.8 4 6V35C4 37.2 5.8 39 8 39H31C33.2 39 35 37.2 35 35V6C35 3.8 33.2 2 31 2Z" fill="#2680EB"/>
|
|
3
|
+
<path d="M26 0H13C11.9 0 11 0.9 11 2V4C11 5.1 11.9 6 13 6H26C27.1 6 28 5.1 28 4V2C28 0.9 27.1 0 26 0ZM13 4V2H26V4H13Z" fill="#2680EB"/>
|
|
4
|
+
<path d="M10.5999 33.1C10.5999 32.8 10.7999 32.4 10.9999 32C11.7999 30.2 13.1999 29 14.9999 28.2C16.8999 27.4 18.8999 27.1 21.0999 27.4C22.6999 27.6 24.1999 28.1 25.4999 29C27.0999 30.1 28.0999 31.4 28.4999 33.2C28.4999 33.2 28.4999 33.3 28.4999 33.4C28.4999 33.5 28.4999 33.7 28.4999 33.9C28.2999 34.5 27.8999 34.9 27.1999 35.1C27.5999 35.1 24.7999 35.1 23.0999 35.1C18.9999 35 11.3999 35 11.7999 35C11.4999 34.9 11.0999 34.8 10.8999 34.5C10.7999 34.3 10.6999 34.2 10.5999 34C10.4999 33.8 10.4999 33.4 10.5999 33.1Z" fill="#2680EB"/>
|
|
5
|
+
<path d="M19.9999 17C20.1999 17 20.4999 17.1 20.6999 17.1C22.4999 17.6 23.5999 18.8 23.7999 20.6C23.9999 22.4 23.3999 23.9 21.9999 25C20.3999 26.3 18.3999 26.2 16.7999 24.9C15.7999 24.1 15.2999 23 15.0999 21.8C14.9999 20.7 15.0999 19.8 15.6999 18.8C16.3999 17.8 17.3999 17.2 18.5999 17C19.3999 17 19.8999 17 19.9999 17Z" fill="#2680EB"/>
|
|
6
|
+
<path d="M19.6998 7.09999L20.9998 9.79999L23.9998 10.2C24.1998 10.2 24.2998 10.5 24.0998 10.6L21.9998 12.8L22.4998 15.7C22.4998 15.9 22.2998 16.1 22.0998 16L19.4998 14.6L16.8998 16C16.6998 16.1 16.4998 15.9 16.4998 15.7L16.9998 12.8L14.8998 10.7C14.6998 10.6 14.7998 10.3 14.9998 10.3L17.9998 9.89999L19.2998 7.19999C19.3998 6.99999 19.5998 6.99999 19.6998 7.09999Z" fill="#FF8C00"/>
|
|
7
|
+
<path d="M27.6998 10.4L28.6998 12.4L30.8998 12.7C31.0998 12.7 31.0998 12.9 30.9998 13L29.3998 14.5L29.7998 16.7C29.7998 16.9 29.6998 17 29.4998 16.9L27.4998 15.9L25.4998 16.9C25.3998 17 25.1998 16.9 25.1998 16.7L25.5998 14.5L23.9998 13C23.8998 12.9 23.8998 12.7 24.0998 12.7L26.2998 12.4L27.2998 10.4C27.3998 10.3 27.5998 10.3 27.6998 10.4Z" fill="#FF8C00"/>
|
|
8
|
+
<path d="M11.6998 10.4L12.6998 12.4L14.8998 12.7C15.0998 12.7 15.0998 12.9 14.9998 13L13.3998 14.5L13.7998 16.7C13.7998 16.9 13.6998 17 13.4998 16.9L11.4998 15.9L9.49977 16.9C9.39977 17 9.19977 16.9 9.19977 16.7L9.59977 14.5L7.99977 13C7.89977 12.9 7.89977 12.7 8.09977 12.7L10.2998 12.4L11.2998 10.4C11.3998 10.3 11.5998 10.3 11.6998 10.4Z" fill="#FF8C00"/>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_2247_88)">
|
|
3
|
+
<path d="M22 27.3C22 26.7 21.5 26.2 20.9 26.2H7.1C6.5 26.2 6 26.7 6 27.3C6 27.9 6.5 28.4 7.1 28.4H20.8C21.5 28.4 22 27.9 22 27.3Z" fill="#2680EB"/>
|
|
4
|
+
<path d="M20.9 21.6H7.1C6.5 21.6 6 22.1 6 22.7C6 23.3 6.5 23.8 7.1 23.8H20.8C21.4 23.8 21.9 23.3 21.9 22.7C21.9 22.1 21.5 21.6 20.9 21.6Z" fill="#2680EB"/>
|
|
5
|
+
<path d="M7.1 30.8C6.5 30.8 6 31.2 6 31.8C6 32.4 6.5 33 7.1 33H16.2C16.8 33 17.3 32.5 17.3 31.9C17.3 31.3 16.8 30.8 16.2 30.8H7.1Z" fill="#2680EB"/>
|
|
6
|
+
<path d="M28 2H25C25 0.9 24.1 0 23 0H10C8.9 0 8 0.9 8 2H5C2.8 2 1 3.8 1 6V35C1 37.2 2.8 39 5 39H25.5C24.4 38.4 23.3 37.8 22.3 37H5C3.9 37 3 36.1 3 35V6C3 4.9 3.9 4 5 4H8C8 5.1 8.9 6 10 6H23C24.1 6 25 5.1 25 4H28C29.1 4 30 4.9 30 6V13.8C30.7 13.8 31.3 13.9 32 14.1V6C32 3.8 30.2 2 28 2ZM10 4V2H23V4H10Z" fill="#2680EB"/>
|
|
7
|
+
<path d="M30 26.9C26.8 26.9 24.2 24.2 24.2 21C24.2 17.7 26.8 15.1 30.1 15.1C33.3 15.1 35.9 17.8 35.9 21.1C35.8 24.2 33.2 26.9 30 26.9Z" fill="#2680EB"/>
|
|
8
|
+
<path d="M37.3 30.9C37.1 29.9 36.6 29.2 35.6 28.8C33.8 28.1 32.6 27.4 32.6 27.4L31.2 31.9L31 32.5L30.4 30.7C31.9 28.7 30.3 28.6 30 28.6C29.7 28.6 28.1 28.7 29.6 30.7L29 32.5L28.8 31.9L27.4 27.4C27.4 27.4 26.3 28.1 24.4 28.8C23.5 29.1 23.1 29.6 22.8 30.3L22.4 32.1C22.3 32.6 22.2 33.1 22.1 33.6C21.9 34.5 22.2 35.3 23 35.9C24.3 36.9 25.8 37.8 27.4 38.4C28.8 39 30.3 39.2 31.8 38.8C33.8 38.2 35.6 37.2 37.3 35.9C38 35.4 38.2 34.5 38.1 33.6C38 33 37.4 31.2 37.3 30.9Z" fill="#2680EB"/>
|
|
9
|
+
<path d="M16.6998 8.09999L17.9998 10.8L20.9998 11.2C21.1998 11.2 21.2998 11.5 21.0998 11.6L18.9998 13.8L19.4998 16.7C19.4998 16.9 19.2998 17.1 19.0998 17L16.4998 15.6L13.8998 17C13.6998 17.1 13.4998 16.9 13.4998 16.7L13.9998 13.8L11.8998 11.7C11.6998 11.6 11.7998 11.3 11.9998 11.3L14.9998 10.9L16.2998 8.19999C16.3998 7.99999 16.5998 7.99999 16.6998 8.09999Z" fill="#FF8C00"/>
|
|
10
|
+
<path d="M8.69977 11.4L9.69977 13.4L11.8998 13.7C12.0998 13.7 12.0998 13.9 11.9998 14L10.3998 15.5L10.7998 17.7C10.7998 17.9 10.6998 18 10.4998 17.9L8.49977 16.9L6.49977 17.9C6.39977 18 6.19977 17.9 6.19977 17.7L6.59977 15.5L4.99977 14C4.89977 13.9 4.89977 13.7 5.09977 13.7L7.29977 13.4L8.29977 11.4C8.39977 11.3 8.59977 11.3 8.69977 11.4Z" fill="#FF8C00"/>
|
|
11
|
+
<path d="M27.8998 14C27.8998 14.1 27.8998 14.1 27.8998 14C26.0998 14.6 24.6998 15.8 23.7998 17.3L22.4998 18C22.3998 18.1 22.1998 18 22.1998 17.8L22.5998 15.6L21.0998 14C20.9998 13.9 21.0998 13.7 21.1998 13.7L23.3998 13.4L24.3998 11.4C24.4998 11.3 24.6998 11.3 24.6998 11.4L25.6998 13.4L27.8998 13.7C27.9998 13.8 27.9998 13.9 27.8998 14Z" fill="#FF8C00"/>
|
|
12
|
+
</g>
|
|
13
|
+
<defs>
|
|
14
|
+
<clipPath id="clip0_2247_88">
|
|
15
|
+
<rect width="39" height="39" fill="white"/>
|
|
16
|
+
</clipPath>
|
|
17
|
+
</defs>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_2247_110)">
|
|
3
|
+
<path d="M27 2H22V4H27C28.1 4 29 4.9 29 6V18C29.7 18 30.3 18.1 31 18.2V6C31 3.8 29.2 2 27 2ZM4 37C2.9 37 2 36.1 2 35V6C2 4.9 2.9 4 4 4H9V2H4C1.8 2 0 3.8 0 6V35C0 37.2 1.8 39 4 39H24.4C23.3 38.5 22.3 37.8 21.4 37H4Z" fill="#2680EB"/>
|
|
4
|
+
<path d="M22 0H9C7.9 0 7 0.9 7 2V4C7 5.1 7.9 6 9 6H22C23.1 6 24 5.1 24 4V2C24 0.9 23.1 0 22 0ZM9 4V2H22V4H9Z" fill="#2680EB"/>
|
|
5
|
+
<path d="M18.4 26.2C18.2 26.9 18.1 27.5999 18 28.3999H6.2C5.6 28.3999 5 27.8999 5 27.2999C5 26.6999 5.5 26.2 6.2 26.2L18.4 26.2Z" fill="#2680EB"/>
|
|
6
|
+
<path d="M20.6 21.9C20.1 22.5 19.6 23.2 19.3 23.9H6.2C5.6 23.9 5 23.3999 5 22.7999C5 22.1999 5.5 21.7 6.2 21.7H19.9C20.0625 21.7 20.4 21.7 20.6 21.9Z" fill="#2680EB"/>
|
|
7
|
+
<path d="M6.1 30.7999C5.5 30.7999 5 31.1999 5 31.7999C5 32.3999 5.5 33 6.1 33H15.2C15.8 33 16.3 32.5 16.3 31.9C16.3 31.3 15.8 30.7999 15.2 30.7999H6.1Z" fill="#2680EB"/>
|
|
8
|
+
<path d="M34.4 20.6C32.8 19.6 31 19 29 19C28.5 19 28.1 19 27.7 19.1C26.9 19.2 26 19.4 25.3 19.7C24.9 19.9 24.4 20.1 24 20.3C22 21.4 20.5 23.2 19.7 25.3C19.2 26.5 19 27.7 19 29C19 34.5 23.5 39 29 39C34.5 39 39 34.5 39 29C39 25.5 37.1 22.3 34.4 20.6ZM35.2 25.8L29.3 33.8C29 34.3 28.4 34.6 27.8 34.6H27.7C27.2 34.6 26.6 34.4 26.3 34L22.8 30.2C22.3 29.6 22.3 28.7 22.9 28.1C23.2 27.8 23.5 27.7 23.9 27.7C24.3 27.7 24.7 27.9 25 28.2L27.5 30.9L27.6 31C27.7 31 27.7 31 27.7 30.9L32.7 24.1C33 23.7 33.4 23.5 33.9 23.5C34.2 23.5 34.5 23.6 34.8 23.8C35.6 24.2 35.7 25.1 35.2 25.8Z" fill="#1CA261"/>
|
|
9
|
+
<path d="M15.6998 8.09999L16.9998 10.8L19.9998 11.2C20.1998 11.2 20.2998 11.5 20.0998 11.6L17.9998 13.8L18.4998 16.7C18.4998 16.9 18.2998 17.1 18.0998 17L15.4998 15.6L12.8998 17C12.6998 17.1 12.4998 16.9 12.4998 16.7L12.9998 13.8L10.8998 11.7C10.6998 11.6 10.7998 11.3 10.9998 11.3L13.9998 10.9L15.2998 8.19999C15.3998 7.99999 15.5998 7.99999 15.6998 8.09999Z" fill="#FF8C00"/>
|
|
10
|
+
<path d="M23.6998 11.4L24.6998 13.4L26.8998 13.7C27.0998 13.7 27.0998 13.9 26.9998 14L25.3998 15.5L25.7998 17.7C25.7998 17.9 25.6998 18 25.4998 17.9L23.4998 16.9L21.4998 17.9C21.3998 18 21.1998 17.9 21.1998 17.7L21.5998 15.5L19.9998 14C19.8998 13.9 19.8998 13.7 20.0998 13.7L22.2998 13.4L23.2998 11.4C23.3998 11.3 23.5998 11.3 23.6998 11.4Z" fill="#FF8C00"/>
|
|
11
|
+
<path d="M7.69977 11.4L8.69977 13.4L10.8998 13.7C11.0998 13.7 11.0998 13.9 10.9998 14L9.39977 15.5L9.79977 17.7C9.79977 17.9 9.69977 18 9.49977 17.9L7.49977 16.9L5.49977 17.9C5.39977 18 5.19977 17.9 5.19977 17.7L5.59977 15.5L3.99977 14C3.89977 13.9 3.89977 13.7 4.09977 13.7L6.29977 13.4L7.29977 11.4C7.39977 11.3 7.59977 11.3 7.69977 11.4Z" fill="#FF8C00"/>
|
|
12
|
+
</g>
|
|
13
|
+
<defs>
|
|
14
|
+
<clipPath id="clip0_2247_110">
|
|
15
|
+
<rect width="39" height="39" fill="white"/>
|
|
16
|
+
</clipPath>
|
|
17
|
+
</defs>
|
|
18
|
+
</svg>
|
|
@@ -286,10 +286,10 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
/**
|
|
290
|
-
* So sánh text đầu vào cáo map với txtSearch
|
|
291
|
-
* @param text
|
|
292
|
-
* @return {boolean}
|
|
289
|
+
/**
|
|
290
|
+
* So sánh text đầu vào cáo map với txtSearch
|
|
291
|
+
* @param text
|
|
292
|
+
* @return {boolean}
|
|
293
293
|
*/
|
|
294
294
|
const handleRenderBySearch = (text = '') => {
|
|
295
295
|
if (typeof text !== 'string') text = text.toString();
|
|
@@ -301,10 +301,10 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
301
301
|
} else return text.toLowerCase().includes(txtSearch.toLowerCase());
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
-
/**
|
|
305
|
-
* Chuyển đổi data thành giá trị cần hiện thị dựa vào displayExpr [string, string object {field} - {field}], renderSelectedItem, displayExpr, valueExpr
|
|
306
|
-
* @param data {object} rowData of dataSource
|
|
307
|
-
* @return {string}
|
|
304
|
+
/**
|
|
305
|
+
* Chuyển đổi data thành giá trị cần hiện thị dựa vào displayExpr [string, string object {field} - {field}], renderSelectedItem, displayExpr, valueExpr
|
|
306
|
+
* @param data {object} rowData of dataSource
|
|
307
|
+
* @return {string}
|
|
308
308
|
*/
|
|
309
309
|
const displayValue = data => {
|
|
310
310
|
let text = '';
|
|
@@ -1709,9 +1709,9 @@ Dropdown.propTypes = {
|
|
|
1709
1709
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1710
1710
|
/** If `true`, the component is disabled. */
|
|
1711
1711
|
disabled: PropTypes.bool,
|
|
1712
|
-
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1713
|
-
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1714
|
-
* Note: Do not use 'id - name', as it will return undefined.
|
|
1712
|
+
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1713
|
+
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1714
|
+
* Note: Do not use 'id - name', as it will return undefined.
|
|
1715
1715
|
*/
|
|
1716
1716
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1717
1717
|
/** Inline style for dropdown items. */
|
|
@@ -1720,14 +1720,14 @@ Dropdown.propTypes = {
|
|
|
1720
1720
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
1721
1721
|
/** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
|
|
1722
1722
|
helperTextProps: PropTypes.object,
|
|
1723
|
-
/** The field name used for displaying icons.<br/>
|
|
1724
|
-
* Example:<br/>
|
|
1725
|
-
* string: 'icon'<br/>
|
|
1726
|
-
* object: {<br/>
|
|
1727
|
-
* key: 'icon',<br/>
|
|
1728
|
-
* prefix: 'https://imglink.com',<br/>
|
|
1729
|
-
* suffix: '.jpg'<br/>
|
|
1730
|
-
* }
|
|
1723
|
+
/** The field name used for displaying icons.<br/>
|
|
1724
|
+
* Example:<br/>
|
|
1725
|
+
* string: 'icon'<br/>
|
|
1726
|
+
* object: {<br/>
|
|
1727
|
+
* key: 'icon',<br/>
|
|
1728
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1729
|
+
* suffix: '.jpg'<br/>
|
|
1730
|
+
* }
|
|
1731
1731
|
*/
|
|
1732
1732
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1733
1733
|
key: PropTypes.string,
|
|
@@ -1761,8 +1761,8 @@ Dropdown.propTypes = {
|
|
|
1761
1761
|
onChange: PropTypes.func,
|
|
1762
1762
|
/** Callback function fired when the dropdown is closed. */
|
|
1763
1763
|
onClosed: PropTypes.func,
|
|
1764
|
-
/** Callback function fired when the input value changes.<br/>
|
|
1765
|
-
* If undefined, the filter function will run (default behavior).
|
|
1764
|
+
/** Callback function fired when the input value changes.<br/>
|
|
1765
|
+
* If undefined, the filter function will run (default behavior).
|
|
1766
1766
|
*/
|
|
1767
1767
|
onInput: PropTypes.func,
|
|
1768
1768
|
/** Callback function fired when a key is pressed down in the input. */
|
|
@@ -1775,21 +1775,21 @@ Dropdown.propTypes = {
|
|
|
1775
1775
|
placeholder: PropTypes.string,
|
|
1776
1776
|
/** If `true`, the component is read-only. */
|
|
1777
1777
|
readOnly: PropTypes.bool,
|
|
1778
|
-
/** Function used for custom rendering of items.<br/>
|
|
1779
|
-
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1780
|
-
* This can be used as an alternative to `displayExpr`
|
|
1778
|
+
/** Function used for custom rendering of items.<br/>
|
|
1779
|
+
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1780
|
+
* This can be used as an alternative to `displayExpr`
|
|
1781
1781
|
*/
|
|
1782
1782
|
renderItem: PropTypes.func,
|
|
1783
|
-
/** Function or field name used to display selected items.<br/>
|
|
1784
|
-
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1783
|
+
/** Function or field name used to display selected items.<br/>
|
|
1784
|
+
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1785
1785
|
*/
|
|
1786
1786
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1787
1787
|
/** If `true`, the label will indicate that the input is required. */
|
|
1788
1788
|
required: PropTypes.bool,
|
|
1789
|
-
/**
|
|
1790
|
-
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1791
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1792
|
-
* If `true`, the default delayOnInput will be used.
|
|
1789
|
+
/**
|
|
1790
|
+
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1791
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1792
|
+
* If `true`, the default delayOnInput will be used.
|
|
1793
1793
|
*/
|
|
1794
1794
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1795
1795
|
/** Specifies the field name or expression used to compare values with the search string. */
|
|
@@ -1816,19 +1816,19 @@ Dropdown.propTypes = {
|
|
|
1816
1816
|
valueObjectDefault: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
1817
1817
|
/** The variant to use. */
|
|
1818
1818
|
viewType: PropTypes.oneOf(['underlined', 'outlined', 'none'])
|
|
1819
|
-
/**
|
|
1820
|
-
* ref methods
|
|
1821
|
-
*
|
|
1822
|
-
* how to get component element? ref.current
|
|
1823
|
-
*
|
|
1824
|
-
* how to call method? ref.current.instance.{method}
|
|
1825
|
-
*
|
|
1826
|
-
* * showDropdown(): Show dropdown
|
|
1827
|
-
* * closeDropdown(): Close dropdown
|
|
1828
|
-
* * onClear(): Clear selected value
|
|
1829
|
-
* * setPreviousValue(): Set value to previous value
|
|
1830
|
-
* * setValue(value): Set value of dropdown
|
|
1831
|
-
* * @param {value} - string || number || array
|
|
1819
|
+
/**
|
|
1820
|
+
* ref methods
|
|
1821
|
+
*
|
|
1822
|
+
* how to get component element? ref.current
|
|
1823
|
+
*
|
|
1824
|
+
* how to call method? ref.current.instance.{method}
|
|
1825
|
+
*
|
|
1826
|
+
* * showDropdown(): Show dropdown
|
|
1827
|
+
* * closeDropdown(): Close dropdown
|
|
1828
|
+
* * onClear(): Clear selected value
|
|
1829
|
+
* * setPreviousValue(): Set value to previous value
|
|
1830
|
+
* * setValue(value): Set value of dropdown
|
|
1831
|
+
* * @param {value} - string || number || array
|
|
1832
1832
|
*/
|
|
1833
1833
|
};
|
|
1834
1834
|
export default Dropdown;
|
|
@@ -202,7 +202,7 @@ const Popover = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) =
|
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
204
|
const updatePositionPopover = (el = null, cb) => {
|
|
205
|
-
var _window, _window2, _anchor6, _anchorRect, _anchorRect2, _anchor7, _anchorRect3, _anchorRect4, _anchorRect5, _anchorRect6, _anchorRect7, _anchorRect8, _anchorRect9,
|
|
205
|
+
var _window, _window2, _anchor6, _anchorRect, _anchorRect2, _anchor7, _anchorRect3, _anchorRect4, _anchorRect5, _anchorRect6, _anchorRect7, _anchorRect8, _anchorRect9, _anchorRect10, _anchorRect11, _anchorRect12, _newDirectionObject, _newDirectionObject$t, _transformOrigin, _newDirectionObject2, _newDirectionObject2$, _transformOrigin2;
|
|
206
206
|
if (el instanceof Element) setElement(el);
|
|
207
207
|
if (!ref.current) {
|
|
208
208
|
window.removeEventListener('resize', updatePositionPopover);
|
|
@@ -336,36 +336,36 @@ const Popover = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) =
|
|
|
336
336
|
|
|
337
337
|
// Valid mean popover not at top-left, top-right, bottom-left, bottom-right
|
|
338
338
|
const validVerticalArrow = left >= ((_anchorRect5 = anchorRect) === null || _anchorRect5 === void 0 ? void 0 : _anchorRect5.left) + ((_anchorRect6 = anchorRect) === null || _anchorRect6 === void 0 ? void 0 : _anchorRect6.width) / 2 - popoverWidth && left <= ((_anchorRect7 = anchorRect) === null || _anchorRect7 === void 0 ? void 0 : _anchorRect7.right) - ((_anchorRect8 = anchorRect) === null || _anchorRect8 === void 0 ? void 0 : _anchorRect8.width) / 2 + popoverWidth;
|
|
339
|
-
const validHorizontalArrow = top >= ((_anchorRect9 = anchorRect) === null || _anchorRect9 === void 0 ? void 0 : _anchorRect9.top) + ((
|
|
339
|
+
const validHorizontalArrow = top >= ((_anchorRect9 = anchorRect) === null || _anchorRect9 === void 0 ? void 0 : _anchorRect9.top) + ((_anchorRect10 = anchorRect) === null || _anchorRect10 === void 0 ? void 0 : _anchorRect10.height) / 2 - popoverHeight && top <= ((_anchorRect11 = anchorRect) === null || _anchorRect11 === void 0 ? void 0 : _anchorRect11.bottom) - ((_anchorRect12 = anchorRect) === null || _anchorRect12 === void 0 ? void 0 : _anchorRect12.height) / 2;
|
|
340
340
|
|
|
341
341
|
// Get arrow's position
|
|
342
342
|
if (arrow && translate) {
|
|
343
343
|
switch (aPosition) {
|
|
344
344
|
case 'top':
|
|
345
345
|
if (validVerticalArrow) {
|
|
346
|
-
var
|
|
347
|
-
arrowPosition.left = ((
|
|
346
|
+
var _anchorRect13, _anchorRect14;
|
|
347
|
+
arrowPosition.left = ((_anchorRect13 = anchorRect) === null || _anchorRect13 === void 0 ? void 0 : _anchorRect13.width) / 2 + ((_anchorRect14 = anchorRect) === null || _anchorRect14 === void 0 ? void 0 : _anchorRect14.left) - arrowSize + 'px';
|
|
348
348
|
arrowPosition.top = Math.round(top) - arrowSize + 'px';
|
|
349
349
|
}
|
|
350
350
|
break;
|
|
351
351
|
case 'bottom':
|
|
352
352
|
if (validVerticalArrow) {
|
|
353
|
-
var
|
|
354
|
-
arrowPosition.left = ((
|
|
353
|
+
var _anchorRect15, _anchorRect16;
|
|
354
|
+
arrowPosition.left = ((_anchorRect15 = anchorRect) === null || _anchorRect15 === void 0 ? void 0 : _anchorRect15.width) / 2 + ((_anchorRect16 = anchorRect) === null || _anchorRect16 === void 0 ? void 0 : _anchorRect16.left) - arrowSize + 'px';
|
|
355
355
|
arrowPosition.top = Math.round(top) + popoverHeight + 'px';
|
|
356
356
|
}
|
|
357
357
|
break;
|
|
358
358
|
case 'left':
|
|
359
359
|
if (validHorizontalArrow) {
|
|
360
|
-
var
|
|
361
|
-
arrowPosition.top = ((
|
|
360
|
+
var _anchorRect17, _anchorRect18;
|
|
361
|
+
arrowPosition.top = ((_anchorRect17 = anchorRect) === null || _anchorRect17 === void 0 ? void 0 : _anchorRect17.height) / 2 + ((_anchorRect18 = anchorRect) === null || _anchorRect18 === void 0 ? void 0 : _anchorRect18.top) - arrowSize / 2 + 'px';
|
|
362
362
|
arrowPosition.left = Math.round(left) - 1.5 * arrowSize + 'px';
|
|
363
363
|
}
|
|
364
364
|
break;
|
|
365
365
|
case 'right':
|
|
366
366
|
if (validHorizontalArrow) {
|
|
367
|
-
var
|
|
368
|
-
arrowPosition.top = ((
|
|
367
|
+
var _anchorRect19, _anchorRect20;
|
|
368
|
+
arrowPosition.top = ((_anchorRect19 = anchorRect) === null || _anchorRect19 === void 0 ? void 0 : _anchorRect19.height) / 2 + ((_anchorRect20 = anchorRect) === null || _anchorRect20 === void 0 ? void 0 : _anchorRect20.top) - arrowSize / 2 + 'px';
|
|
369
369
|
arrowPosition.left = Math.round(left) + popoverWidth - arrowSize / 2 + 'px';
|
|
370
370
|
}
|
|
371
371
|
break;
|
|
@@ -495,15 +495,15 @@ const Popover = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) =
|
|
|
495
495
|
return currentRef;
|
|
496
496
|
});
|
|
497
497
|
const renderAnchor = () => {
|
|
498
|
-
var
|
|
499
|
-
if (!((
|
|
498
|
+
var _anchor10, _anchor11, _anchor11$props;
|
|
499
|
+
if (!((_anchor10 = anchor) !== null && _anchor10 !== void 0 && _anchor10.type)) return null;
|
|
500
500
|
const AnchorTag = /*#__PURE__*/React.cloneElement(anchor, {
|
|
501
501
|
ref: ref => {
|
|
502
502
|
anchor = ref;
|
|
503
503
|
},
|
|
504
504
|
style: {
|
|
505
505
|
cursor: 'pointer',
|
|
506
|
-
...(((
|
|
506
|
+
...(((_anchor11 = anchor) === null || _anchor11 === void 0 ? void 0 : (_anchor11$props = _anchor11.props) === null || _anchor11$props === void 0 ? void 0 : _anchor11$props.style) || {})
|
|
507
507
|
}
|
|
508
508
|
});
|
|
509
509
|
return AnchorTag;
|
|
@@ -950,9 +950,9 @@ TreeView.propTypes = {
|
|
|
950
950
|
disabledBoldResult: PropTypes.bool,
|
|
951
951
|
/** If `true`, disabled parent and children item (only supported for multipleValueMode is single). */
|
|
952
952
|
disabledRelevantValue: PropTypes.bool,
|
|
953
|
-
/** Field name used for text display in dropdown list.<br/>
|
|
954
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
955
|
-
* Note: don't use 'id - name', return undefined
|
|
953
|
+
/** Field name used for text display in dropdown list.<br/>
|
|
954
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
955
|
+
* Note: don't use 'id - name', return undefined
|
|
956
956
|
*/
|
|
957
957
|
displayExpr: PropTypes.string,
|
|
958
958
|
/** If `true`, expand immediate after render (shouldn't use this). */
|
|
@@ -963,14 +963,14 @@ TreeView.propTypes = {
|
|
|
963
963
|
multiple: PropTypes.bool,
|
|
964
964
|
/** Return value for the select multiple use case. */
|
|
965
965
|
multipleValueMode: PropTypes.oneOf(['single', 'multiple', 'inheritance']),
|
|
966
|
-
/**
|
|
967
|
-
* Callback fired when the value changes.<br />
|
|
968
|
-
* return 2 parameters (e, data)<br />
|
|
969
|
-
* * e: element (insist {value, justSelected, data})<br/>
|
|
970
|
-
* + value is one or an array of selected values<br />
|
|
971
|
-
* + justSelected is value has just been selected (either true or false))<br />
|
|
972
|
-
* + data is one or an array of selected values with full information<br />
|
|
973
|
-
* * data: array of selected values (not recommend because it's the same e.value)
|
|
966
|
+
/**
|
|
967
|
+
* Callback fired when the value changes.<br />
|
|
968
|
+
* return 2 parameters (e, data)<br />
|
|
969
|
+
* * e: element (insist {value, justSelected, data})<br/>
|
|
970
|
+
* + value is one or an array of selected values<br />
|
|
971
|
+
* + justSelected is value has just been selected (either true or false))<br />
|
|
972
|
+
* + data is one or an array of selected values with full information<br />
|
|
973
|
+
* * data: array of selected values (not recommend because it's the same e.value)
|
|
974
974
|
*/
|
|
975
975
|
onChange: PropTypes.func,
|
|
976
976
|
/** Used for mapping into a nested list. */
|
|
@@ -979,15 +979,15 @@ TreeView.propTypes = {
|
|
|
979
979
|
renderAsyncFromLevel: PropTypes.oneOf([2, 3, 4, 5]),
|
|
980
980
|
/** Will render asynchronously if the number of elements is greater than this number. */
|
|
981
981
|
renderAsyncWithLength: PropTypes.number,
|
|
982
|
-
/** Function displays items by custom.<br/>
|
|
983
|
-
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
984
|
-
* --> such as: displayExpr={'name - role'}
|
|
982
|
+
/** Function displays items by custom.<br/>
|
|
983
|
+
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
984
|
+
* --> such as: displayExpr={'name - role'}
|
|
985
985
|
*/
|
|
986
986
|
renderItem: PropTypes.func,
|
|
987
|
-
/**
|
|
988
|
-
* Duration wait enter search content on search.<br/>
|
|
989
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
990
|
-
* If `true`, used default delayOnInput.
|
|
987
|
+
/**
|
|
988
|
+
* Duration wait enter search content on search.<br/>
|
|
989
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
990
|
+
* If `true`, used default delayOnInput.
|
|
991
991
|
*/
|
|
992
992
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
993
993
|
/** Specifies a comparison operation used to search items. */
|
|
@@ -1010,22 +1010,22 @@ TreeView.propTypes = {
|
|
|
1010
1010
|
value: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
1011
1011
|
/** The field name used for the returned result. */
|
|
1012
1012
|
valueExpr: PropTypes.string
|
|
1013
|
-
/**
|
|
1014
|
-
* get ref of TreeView component, insist:<br/>
|
|
1015
|
-
* {<br/>
|
|
1016
|
-
* disabled: true/false,<br/>
|
|
1017
|
-
* displayExpr: string,<br/>
|
|
1018
|
-
* valueExpr: string,<br/>
|
|
1019
|
-
* id: string,<br/>
|
|
1020
|
-
* parentID: string,<br/>
|
|
1021
|
-
* value: string/array<br/>
|
|
1022
|
-
* getValue: get selected values (instead of onChange function),<br/>
|
|
1023
|
-
* setValue: set array of value (only multiple),<br/>
|
|
1024
|
-
* handleCheckbox: checked/unchecked a Checkbox, includes 2 parameters (isChecked, value):<br/>
|
|
1025
|
-
* + isChecked: checked if true (default is false) <br/>
|
|
1026
|
-
* + value: selected values, use 'all' for all values (default is 'all') <br/>
|
|
1027
|
-
* get: get DOM of TreeView component<br/>
|
|
1028
|
-
* }
|
|
1013
|
+
/**
|
|
1014
|
+
* get ref of TreeView component, insist:<br/>
|
|
1015
|
+
* {<br/>
|
|
1016
|
+
* disabled: true/false,<br/>
|
|
1017
|
+
* displayExpr: string,<br/>
|
|
1018
|
+
* valueExpr: string,<br/>
|
|
1019
|
+
* id: string,<br/>
|
|
1020
|
+
* parentID: string,<br/>
|
|
1021
|
+
* value: string/array<br/>
|
|
1022
|
+
* getValue: get selected values (instead of onChange function),<br/>
|
|
1023
|
+
* setValue: set array of value (only multiple),<br/>
|
|
1024
|
+
* handleCheckbox: checked/unchecked a Checkbox, includes 2 parameters (isChecked, value):<br/>
|
|
1025
|
+
* + isChecked: checked if true (default is false) <br/>
|
|
1026
|
+
* + value: selected values, use 'all' for all values (default is 'all') <br/>
|
|
1027
|
+
* get: get DOM of TreeView component<br/>
|
|
1028
|
+
* }
|
|
1029
1029
|
*/
|
|
1030
1030
|
};
|
|
1031
1031
|
export default TreeView;
|
package/package.json
CHANGED
package/utils/getFileType.js
CHANGED
|
@@ -4,7 +4,7 @@ const getFileType = (FileExt, defaultValue = 'another', onlyExt = true) => {
|
|
|
4
4
|
FileExt = FileExt.slice(FileExt.lastIndexOf('.') + 1);
|
|
5
5
|
}
|
|
6
6
|
switch (true) {
|
|
7
|
-
case /jpg|png|jpeg|gif|bmp|tiff|svg|image/i.test(FileExt):
|
|
7
|
+
case /jpg|png|jpeg|gif|bmp|tiff|svg|image|heif/i.test(FileExt):
|
|
8
8
|
return 'image';
|
|
9
9
|
case /doc|word/i.test(FileExt):
|
|
10
10
|
return 'word';
|