diginet-core-ui 1.3.75-beta.1 → 1.3.75-beta.3
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/components/avatar/index.js +19 -19
- package/components/badge/index.js +5 -5
- package/components/button/icon.js +21 -21
- package/components/button/index.js +13 -13
- package/components/form-control/dropdown/index.js +35 -35
- package/components/form-control/text-input/index.js +4 -4
- package/components/paging/page-info.js +23 -23
- package/components/paging/page-selector2.js +23 -23
- package/components/popover/index.js +25 -22
- package/components/tree-view/index.js +38 -38
- package/components/typography/index.js +10 -10
- package/icons/effect.js +15 -15
- package/package.json +1 -1
- package/utils/useInput.js +4 -1
|
@@ -437,15 +437,15 @@ Avatar.propTypes = {
|
|
|
437
437
|
/** If `true`, display remove avatar icon. */
|
|
438
438
|
clearAble: PropTypes.bool,
|
|
439
439
|
|
|
440
|
-
/**
|
|
441
|
-
* data to display when hoverAble is true<br />
|
|
442
|
-
* data is an object or function return a jsx element
|
|
440
|
+
/**
|
|
441
|
+
* data to display when hoverAble is true<br />
|
|
442
|
+
* data is an object or function return a jsx element
|
|
443
443
|
*/
|
|
444
444
|
data: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
|
445
445
|
|
|
446
|
-
/**
|
|
447
|
-
* it is used to display the default if there is no src<br />
|
|
448
|
-
* if undefined, will display icons available in the icons store
|
|
446
|
+
/**
|
|
447
|
+
* it is used to display the default if there is no src<br />
|
|
448
|
+
* if undefined, will display icons available in the icons store
|
|
449
449
|
*/
|
|
450
450
|
defaultSrc: PropTypes.string,
|
|
451
451
|
|
|
@@ -500,19 +500,19 @@ Avatar.propTypes = {
|
|
|
500
500
|
/** the error to show on wrong type */
|
|
501
501
|
wrongTypeError: PropTypes.string,
|
|
502
502
|
|
|
503
|
-
/**
|
|
504
|
-
* ref methods
|
|
505
|
-
*
|
|
506
|
-
* * option(): Gets all UI component properties
|
|
507
|
-
* * Returns value - object
|
|
508
|
-
* * option(optionName): Gets the value of a single property
|
|
509
|
-
* * @param {optionName} - string
|
|
510
|
-
* * Returns value - any
|
|
511
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
512
|
-
* * @param {optionName} - string
|
|
513
|
-
* * @param {optionValue} - any
|
|
514
|
-
* * option(options): Updates the values of several properties
|
|
515
|
-
* * @param {options} - object
|
|
503
|
+
/**
|
|
504
|
+
* ref methods
|
|
505
|
+
*
|
|
506
|
+
* * option(): Gets all UI component properties
|
|
507
|
+
* * Returns value - object
|
|
508
|
+
* * option(optionName): Gets the value of a single property
|
|
509
|
+
* * @param {optionName} - string
|
|
510
|
+
* * Returns value - any
|
|
511
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
512
|
+
* * @param {optionName} - string
|
|
513
|
+
* * @param {optionValue} - any
|
|
514
|
+
* * option(options): Updates the values of several properties
|
|
515
|
+
* * @param {options} - object
|
|
516
516
|
*/
|
|
517
517
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
518
518
|
current: PropTypes.instanceOf(Element)
|
|
@@ -213,11 +213,11 @@ Badge.propTypes = {
|
|
|
213
213
|
/** other icon props when use prop name */
|
|
214
214
|
iconProps: PropTypes.object,
|
|
215
215
|
|
|
216
|
-
/** size of Badge
|
|
217
|
-
*
|
|
218
|
-
* * medium (dot 8px, typography p3)
|
|
219
|
-
* * large (button 10px, typography p2)
|
|
220
|
-
* * giant (button 12px, typography p1)
|
|
216
|
+
/** size of Badge
|
|
217
|
+
*
|
|
218
|
+
* * medium (dot 8px, typography p3)
|
|
219
|
+
* * large (button 10px, typography p2)
|
|
220
|
+
* * giant (button 12px, typography p1)
|
|
221
221
|
* */
|
|
222
222
|
size: PropTypes.oneOf(['medium', 'large', 'giant']),
|
|
223
223
|
|
|
@@ -376,14 +376,14 @@ ButtonIcon.propTypes = {
|
|
|
376
376
|
/** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
|
|
377
377
|
name: PropTypes.string,
|
|
378
378
|
|
|
379
|
-
/**
|
|
380
|
-
* The size of the component.
|
|
381
|
-
*
|
|
382
|
-
* * tiny (button 24px, icon 16px)
|
|
383
|
-
* * small (button 32px, icon 20px)
|
|
384
|
-
* * medium (button 40px, icon 24px)
|
|
385
|
-
* * large (button 48px, icon 32px)
|
|
386
|
-
* * giant (button 56px, icon 40px)
|
|
379
|
+
/**
|
|
380
|
+
* The size of the component.
|
|
381
|
+
*
|
|
382
|
+
* * tiny (button 24px, icon 16px)
|
|
383
|
+
* * small (button 32px, icon 20px)
|
|
384
|
+
* * medium (button 40px, icon 24px)
|
|
385
|
+
* * large (button 48px, icon 32px)
|
|
386
|
+
* * giant (button 56px, icon 40px)
|
|
387
387
|
* */
|
|
388
388
|
size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant']),
|
|
389
389
|
|
|
@@ -399,19 +399,19 @@ ButtonIcon.propTypes = {
|
|
|
399
399
|
/** Width of the component. */
|
|
400
400
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
401
401
|
|
|
402
|
-
/**
|
|
403
|
-
* ref methods (ref.current.instance.*method*)
|
|
404
|
-
*
|
|
405
|
-
* * option(): Gets all UI component properties
|
|
406
|
-
* * Returns value - object
|
|
407
|
-
* * option(optionName): Gets the value of a single property
|
|
408
|
-
* * @param {optionName} - string
|
|
409
|
-
* * Returns value - any
|
|
410
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
411
|
-
* * @param {optionName} - string
|
|
412
|
-
* * @param {optionValue} - any
|
|
413
|
-
* * option(options): Updates the values of several properties
|
|
414
|
-
* * @param {options} - object
|
|
402
|
+
/**
|
|
403
|
+
* ref methods (ref.current.instance.*method*)
|
|
404
|
+
*
|
|
405
|
+
* * option(): Gets all UI component properties
|
|
406
|
+
* * Returns value - object
|
|
407
|
+
* * option(optionName): Gets the value of a single property
|
|
408
|
+
* * @param {optionName} - string
|
|
409
|
+
* * Returns value - any
|
|
410
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
411
|
+
* * @param {optionName} - string
|
|
412
|
+
* * @param {optionValue} - any
|
|
413
|
+
* * option(options): Updates the values of several properties
|
|
414
|
+
* * @param {options} - object
|
|
415
415
|
*/
|
|
416
416
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
417
417
|
current: PropTypes.instanceOf(Element)
|
|
@@ -491,19 +491,19 @@ Button.propTypes = {
|
|
|
491
491
|
/** The variant to use. */
|
|
492
492
|
viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'link']),
|
|
493
493
|
|
|
494
|
-
/**
|
|
495
|
-
* ref methods (ref.current.instance.*method*)
|
|
496
|
-
*
|
|
497
|
-
* * option(): Gets all UI component properties
|
|
498
|
-
* * Returns value - object
|
|
499
|
-
* * option(optionName): Gets the value of a single property
|
|
500
|
-
* * @param {optionName} - string
|
|
501
|
-
* * Returns value - any
|
|
502
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
503
|
-
* * @param {optionName} - string
|
|
504
|
-
* * @param {optionValue} - any
|
|
505
|
-
* * option(options): Updates the values of several properties
|
|
506
|
-
* * @param {options} - object
|
|
494
|
+
/**
|
|
495
|
+
* ref methods (ref.current.instance.*method*)
|
|
496
|
+
*
|
|
497
|
+
* * option(): Gets all UI component properties
|
|
498
|
+
* * Returns value - object
|
|
499
|
+
* * option(optionName): Gets the value of a single property
|
|
500
|
+
* * @param {optionName} - string
|
|
501
|
+
* * Returns value - any
|
|
502
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
503
|
+
* * @param {optionName} - string
|
|
504
|
+
* * @param {optionValue} - any
|
|
505
|
+
* * option(options): Updates the values of several properties
|
|
506
|
+
* * @param {options} - object
|
|
507
507
|
*/
|
|
508
508
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
509
509
|
current: PropTypes.instanceOf(Element)
|
|
@@ -1850,14 +1850,14 @@ Dropdown.propTypes = {
|
|
|
1850
1850
|
/** The icon to display if not found the icon follow `iconExpr`. */
|
|
1851
1851
|
iconDefault: PropTypes.string,
|
|
1852
1852
|
|
|
1853
|
-
/** Field name used for icon display.<br/>
|
|
1854
|
-
* Example:<br/>
|
|
1855
|
-
* string: 'icon'<br/>
|
|
1856
|
-
* object: {<br/>
|
|
1857
|
-
* key: 'icon',<br/>
|
|
1858
|
-
* prefix: 'https://imglink.com',<br/>
|
|
1859
|
-
* suffix: '.jpg'<br/>
|
|
1860
|
-
* }
|
|
1853
|
+
/** Field name used for icon display.<br/>
|
|
1854
|
+
* Example:<br/>
|
|
1855
|
+
* string: 'icon'<br/>
|
|
1856
|
+
* object: {<br/>
|
|
1857
|
+
* key: 'icon',<br/>
|
|
1858
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1859
|
+
* suffix: '.jpg'<br/>
|
|
1860
|
+
* }
|
|
1861
1861
|
*/
|
|
1862
1862
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1863
1863
|
key: PropTypes.string,
|
|
@@ -1872,9 +1872,9 @@ Dropdown.propTypes = {
|
|
|
1872
1872
|
/** The displayed value of component. */
|
|
1873
1873
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1874
1874
|
|
|
1875
|
-
/** Field name used for text display in dropdown list.<br/>
|
|
1876
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1877
|
-
* Note: don't use 'id - name', return undefined
|
|
1875
|
+
/** Field name used for text display in dropdown list.<br/>
|
|
1876
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1877
|
+
* Note: don't use 'id - name', return undefined
|
|
1878
1878
|
*/
|
|
1879
1879
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1880
1880
|
|
|
@@ -1884,10 +1884,10 @@ Dropdown.propTypes = {
|
|
|
1884
1884
|
/** The field name used for the returned result. */
|
|
1885
1885
|
valueExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1886
1886
|
|
|
1887
|
-
/**
|
|
1888
|
-
* Duration wait enter search content on search.<br/>
|
|
1889
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1890
|
-
* If `true`, used default delayOnInput.
|
|
1887
|
+
/**
|
|
1888
|
+
* Duration wait enter search content on search.<br/>
|
|
1889
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1890
|
+
* If `true`, used default delayOnInput.
|
|
1891
1891
|
*/
|
|
1892
1892
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1893
1893
|
|
|
@@ -1954,19 +1954,19 @@ Dropdown.propTypes = {
|
|
|
1954
1954
|
/** The array of elements that appear in the dropdown list. */
|
|
1955
1955
|
dataSource: PropTypes.array,
|
|
1956
1956
|
|
|
1957
|
-
/** Function displays items by custom.<br/>
|
|
1958
|
-
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1959
|
-
* --> such as: displayExpr={'name - role'}
|
|
1957
|
+
/** Function displays items by custom.<br/>
|
|
1958
|
+
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1959
|
+
* --> such as: displayExpr={'name - role'}
|
|
1960
1960
|
*/
|
|
1961
1961
|
renderItem: PropTypes.func,
|
|
1962
1962
|
|
|
1963
|
-
/** Function or field name used for display selected items, example:<br/>
|
|
1964
|
-
* renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1963
|
+
/** Function or field name used for display selected items, example:<br/>
|
|
1964
|
+
* renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1965
1965
|
*/
|
|
1966
1966
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1967
1967
|
|
|
1968
|
-
/** Callback fired when the input value changes.<br/>
|
|
1969
|
-
* if undefined: the filter function will run (default)
|
|
1968
|
+
/** Callback fired when the input value changes.<br/>
|
|
1969
|
+
* if undefined: the filter function will run (default)
|
|
1970
1970
|
*/
|
|
1971
1971
|
onInput: PropTypes.func,
|
|
1972
1972
|
|
|
@@ -1997,19 +1997,19 @@ Dropdown.propTypes = {
|
|
|
1997
1997
|
/** If `true`, show multi-line selected item(s). */
|
|
1998
1998
|
multilineSelectedItem: PropTypes.bool,
|
|
1999
1999
|
|
|
2000
|
-
/**
|
|
2001
|
-
* ref methods
|
|
2002
|
-
*
|
|
2003
|
-
* how to get component element? ref.current
|
|
2004
|
-
*
|
|
2005
|
-
* how to call method? ref.current.instance.{method}
|
|
2006
|
-
*
|
|
2007
|
-
* * showDropdown(): Show dropdown
|
|
2008
|
-
* * closeDropdown(): Close dropdown
|
|
2009
|
-
* * onClear(): Clear selected value
|
|
2010
|
-
* * setPreviousValue(): Set value to previous value
|
|
2011
|
-
* * setValue(value): Set value of dropdown
|
|
2012
|
-
* * @param {value} - string || number || array
|
|
2000
|
+
/**
|
|
2001
|
+
* ref methods
|
|
2002
|
+
*
|
|
2003
|
+
* how to get component element? ref.current
|
|
2004
|
+
*
|
|
2005
|
+
* how to call method? ref.current.instance.{method}
|
|
2006
|
+
*
|
|
2007
|
+
* * showDropdown(): Show dropdown
|
|
2008
|
+
* * closeDropdown(): Close dropdown
|
|
2009
|
+
* * onClear(): Clear selected value
|
|
2010
|
+
* * setPreviousValue(): Set value to previous value
|
|
2011
|
+
* * setValue(value): Set value of dropdown
|
|
2012
|
+
* * @param {value} - string || number || array
|
|
2013
2013
|
*/
|
|
2014
2014
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
2015
2015
|
current: PropTypes.instanceOf(Element)
|
|
@@ -433,10 +433,10 @@ TextInput.propTypes = {
|
|
|
433
433
|
/** Type of the input element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). */
|
|
434
434
|
type: PropTypes.oneOf(['inform', 'edit', 'quickEdit', 'text', 'number', 'password']),
|
|
435
435
|
|
|
436
|
-
/** Validation value, argument can:<br/>
|
|
437
|
-
* * string: the validation rule. Example required.<br/>
|
|
438
|
-
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
439
|
-
* * array: the validation rule list, insist object/string
|
|
436
|
+
/** Validation value, argument can:<br/>
|
|
437
|
+
* * string: the validation rule. Example required.<br/>
|
|
438
|
+
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
439
|
+
* * array: the validation rule list, insist object/string
|
|
440
440
|
*/
|
|
441
441
|
validates: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
442
442
|
|
|
@@ -601,23 +601,23 @@ PagingInfo.propTypes = {
|
|
|
601
601
|
/** Callback fired when quantity on per page changed. */
|
|
602
602
|
onChangePerPage: PropTypes.func,
|
|
603
603
|
|
|
604
|
-
/**
|
|
605
|
-
* Callback fired when page number is changing.
|
|
606
|
-
*
|
|
607
|
-
* * prevPage: Page before changed
|
|
608
|
-
* * newPage: Page after changed
|
|
609
|
-
* * cancel(value): Function cancel change page
|
|
610
|
-
* * @param {value} - bool
|
|
604
|
+
/**
|
|
605
|
+
* Callback fired when page number is changing.
|
|
606
|
+
*
|
|
607
|
+
* * prevPage: Page before changed
|
|
608
|
+
* * newPage: Page after changed
|
|
609
|
+
* * cancel(value): Function cancel change page
|
|
610
|
+
* * @param {value} - bool
|
|
611
611
|
*/
|
|
612
612
|
onChangingPage: PropTypes.func,
|
|
613
613
|
|
|
614
|
-
/**
|
|
615
|
-
* Callback fired when quantity on item per page is changing.
|
|
616
|
-
*
|
|
617
|
-
* * prevPerPage: Items per page before changed
|
|
618
|
-
* * newPerPage: Items per page after changed
|
|
619
|
-
* * cancel(value): Function cancel change items per page
|
|
620
|
-
* * @param {value} - bool
|
|
614
|
+
/**
|
|
615
|
+
* Callback fired when quantity on item per page is changing.
|
|
616
|
+
*
|
|
617
|
+
* * prevPerPage: Items per page before changed
|
|
618
|
+
* * newPerPage: Items per page after changed
|
|
619
|
+
* * cancel(value): Function cancel change items per page
|
|
620
|
+
* * @param {value} - bool
|
|
621
621
|
*/
|
|
622
622
|
onChangingPerPage: PropTypes.func,
|
|
623
623
|
|
|
@@ -630,15 +630,15 @@ PagingInfo.propTypes = {
|
|
|
630
630
|
/** Compact type for mobile. */
|
|
631
631
|
typeShort: PropTypes.bool,
|
|
632
632
|
|
|
633
|
-
/**
|
|
634
|
-
* ref methods (ref.current.instance.*method*)
|
|
635
|
-
*
|
|
636
|
-
* * onChangePage(page): Change page number
|
|
637
|
-
* * @param {page} - number
|
|
638
|
-
* * onChangePerPage(per): Change quantity on per page
|
|
639
|
-
* * @param {per} - number
|
|
640
|
-
* * setTotalItems(items): Set total items
|
|
641
|
-
* * @param {items} - number
|
|
633
|
+
/**
|
|
634
|
+
* ref methods (ref.current.instance.*method*)
|
|
635
|
+
*
|
|
636
|
+
* * onChangePage(page): Change page number
|
|
637
|
+
* * @param {page} - number
|
|
638
|
+
* * onChangePerPage(per): Change quantity on per page
|
|
639
|
+
* * @param {per} - number
|
|
640
|
+
* * setTotalItems(items): Set total items
|
|
641
|
+
* * @param {items} - number
|
|
642
642
|
*/
|
|
643
643
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
644
644
|
current: PropTypes.instanceOf(Element)
|
|
@@ -380,23 +380,23 @@ PagingSelector.propTypes = {
|
|
|
380
380
|
/** Callback fired when quantity on per page changed. */
|
|
381
381
|
onChangePerPage: PropTypes.func,
|
|
382
382
|
|
|
383
|
-
/**
|
|
384
|
-
* Callback fired when page number is changing.
|
|
385
|
-
*
|
|
386
|
-
* * prevPage: Page before changed
|
|
387
|
-
* * newPage: Page after changed
|
|
388
|
-
* * cancel(value): Function cancel change page
|
|
389
|
-
* * @param {value} - bool
|
|
383
|
+
/**
|
|
384
|
+
* Callback fired when page number is changing.
|
|
385
|
+
*
|
|
386
|
+
* * prevPage: Page before changed
|
|
387
|
+
* * newPage: Page after changed
|
|
388
|
+
* * cancel(value): Function cancel change page
|
|
389
|
+
* * @param {value} - bool
|
|
390
390
|
*/
|
|
391
391
|
onChangingPage: PropTypes.func,
|
|
392
392
|
|
|
393
|
-
/**
|
|
394
|
-
* Callback fired when quantity on item per page is changing.
|
|
395
|
-
*
|
|
396
|
-
* * prevPerPage: Items per page before changed
|
|
397
|
-
* * newPerPage: Items per page after changed
|
|
398
|
-
* * cancel(value): Function cancel change items per page
|
|
399
|
-
* * @param {value} - bool
|
|
393
|
+
/**
|
|
394
|
+
* Callback fired when quantity on item per page is changing.
|
|
395
|
+
*
|
|
396
|
+
* * prevPerPage: Items per page before changed
|
|
397
|
+
* * newPerPage: Items per page after changed
|
|
398
|
+
* * cancel(value): Function cancel change items per page
|
|
399
|
+
* * @param {value} - bool
|
|
400
400
|
*/
|
|
401
401
|
onChangingPerPage: PropTypes.func,
|
|
402
402
|
|
|
@@ -406,15 +406,15 @@ PagingSelector.propTypes = {
|
|
|
406
406
|
/** Total items. */
|
|
407
407
|
totalItems: PropTypes.number,
|
|
408
408
|
|
|
409
|
-
/**
|
|
410
|
-
* ref methods (ref.current.instance.*method*)
|
|
411
|
-
*
|
|
412
|
-
* * onChangePage(page): Change page number
|
|
413
|
-
* * @param {page} - number
|
|
414
|
-
* * onChangePerPage(per): Change quantity on per page
|
|
415
|
-
* * @param {per} - number
|
|
416
|
-
* * setTotalItems(items): Set total items
|
|
417
|
-
* * @param {items} - number
|
|
409
|
+
/**
|
|
410
|
+
* ref methods (ref.current.instance.*method*)
|
|
411
|
+
*
|
|
412
|
+
* * onChangePage(page): Change page number
|
|
413
|
+
* * @param {page} - number
|
|
414
|
+
* * onChangePerPage(per): Change quantity on per page
|
|
415
|
+
* * @param {per} - number
|
|
416
|
+
* * setTotalItems(items): Set total items
|
|
417
|
+
* * @param {items} - number
|
|
418
418
|
*/
|
|
419
419
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
420
420
|
current: PropTypes.instanceOf(Element)
|
|
@@ -496,7 +496,10 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
496
496
|
const currentRef = ref.current || {};
|
|
497
497
|
currentRef.element = ref.current;
|
|
498
498
|
const _instance = {
|
|
499
|
-
show: el =>
|
|
499
|
+
show: el => {
|
|
500
|
+
if (el) setElement(el);
|
|
501
|
+
!openState && el ? updatePositionPopover(el, onOpenPopover()) : onOpenPopover();
|
|
502
|
+
},
|
|
500
503
|
close: () => onClosePopover(),
|
|
501
504
|
setPosition: el => updatePositionPopover(el),
|
|
502
505
|
...action
|
|
@@ -625,9 +628,9 @@ Popover.propTypes = {
|
|
|
625
628
|
/** An HTML element, or a function that returns one. It's used to set the position of the popover. */
|
|
626
629
|
anchor: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.func, PropTypes.object, PropTypes.node, ref]),
|
|
627
630
|
|
|
628
|
-
/**
|
|
629
|
-
* This is the point on the anchor where the popover's anchor will attach to.
|
|
630
|
-
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
631
|
+
/**
|
|
632
|
+
* This is the point on the anchor where the popover's anchor will attach to.
|
|
633
|
+
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
631
634
|
*/
|
|
632
635
|
anchorOrigin: PropTypes.shape({
|
|
633
636
|
horizontal: PropTypes.oneOf(['center', 'left', 'right']),
|
|
@@ -649,14 +652,14 @@ Popover.propTypes = {
|
|
|
649
652
|
/** If `true`, click outside will close component. */
|
|
650
653
|
clickOutsideToClose: PropTypes.bool,
|
|
651
654
|
|
|
652
|
-
/**
|
|
653
|
-
* Direction when Popover shown.
|
|
654
|
-
* Note: This prop will overwrite anchorOrigin & transformOrigin.
|
|
655
|
-
*
|
|
656
|
-
* * top: anchorOrigin: { vertical: 'top', horizontal: 'center' }, transformOrigin: { vertical: 'bottom', horizontal: 'center' }
|
|
657
|
-
* * left: anchorOrigin: { vertical: 'center', horizontal: 'left' }, transformOrigin: { vertical: 'center', horizontal: 'right' }
|
|
658
|
-
* * right: anchorOrigin: { vertical: 'center', horizontal: 'right' }, transformOrigin: { vertical: 'center', horizontal: 'left' }
|
|
659
|
-
* * bottom: anchorOrigin: { vertical: 'bottom', horizontal: 'center' }, transformOrigin: { vertical: 'top', horizontal: 'center' }
|
|
655
|
+
/**
|
|
656
|
+
* Direction when Popover shown.
|
|
657
|
+
* Note: This prop will overwrite anchorOrigin & transformOrigin.
|
|
658
|
+
*
|
|
659
|
+
* * top: anchorOrigin: { vertical: 'top', horizontal: 'center' }, transformOrigin: { vertical: 'bottom', horizontal: 'center' }
|
|
660
|
+
* * left: anchorOrigin: { vertical: 'center', horizontal: 'left' }, transformOrigin: { vertical: 'center', horizontal: 'right' }
|
|
661
|
+
* * right: anchorOrigin: { vertical: 'center', horizontal: 'right' }, transformOrigin: { vertical: 'center', horizontal: 'left' }
|
|
662
|
+
* * bottom: anchorOrigin: { vertical: 'bottom', horizontal: 'center' }, transformOrigin: { vertical: 'top', horizontal: 'center' }
|
|
660
663
|
*/
|
|
661
664
|
direction: PropTypes.oneOf(['top', 'left', 'right', 'bottom']),
|
|
662
665
|
|
|
@@ -675,9 +678,9 @@ Popover.propTypes = {
|
|
|
675
678
|
/** Style inline of component. */
|
|
676
679
|
style: PropTypes.object,
|
|
677
680
|
|
|
678
|
-
/**
|
|
679
|
-
* This is the point on the popover which will attach to the anchor's origin.
|
|
680
|
-
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
681
|
+
/**
|
|
682
|
+
* This is the point on the popover which will attach to the anchor's origin.
|
|
683
|
+
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
681
684
|
*/
|
|
682
685
|
transformOrigin: PropTypes.shape({
|
|
683
686
|
horizontal: PropTypes.oneOf(['center', 'left', 'right']),
|
|
@@ -690,13 +693,13 @@ Popover.propTypes = {
|
|
|
690
693
|
/** Config z-index of the component. */
|
|
691
694
|
zIndex: PropTypes.number,
|
|
692
695
|
|
|
693
|
-
/**
|
|
694
|
-
* ref methods (ref.current.instance.*method*)
|
|
695
|
-
*
|
|
696
|
-
* * show: Show popover
|
|
697
|
-
* * close: Close popover
|
|
698
|
-
* * setPosition(element): Set position of popover
|
|
699
|
-
* * @param {element} - element
|
|
696
|
+
/**
|
|
697
|
+
* ref methods (ref.current.instance.*method*)
|
|
698
|
+
*
|
|
699
|
+
* * show: Show popover
|
|
700
|
+
* * close: Close popover
|
|
701
|
+
* * setPosition(element): Set position of popover
|
|
702
|
+
* * @param {element} - element
|
|
700
703
|
*/
|
|
701
704
|
reference: ref
|
|
702
705
|
};
|
|
@@ -1071,10 +1071,10 @@ TreeView.propTypes = {
|
|
|
1071
1071
|
/** class on element */
|
|
1072
1072
|
className: PropTypes.string,
|
|
1073
1073
|
|
|
1074
|
-
/**
|
|
1075
|
-
* field name used for text display<br/>
|
|
1076
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1077
|
-
* Note: don't use 'id - name', return undefined
|
|
1074
|
+
/**
|
|
1075
|
+
* field name used for text display<br/>
|
|
1076
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1077
|
+
* Note: don't use 'id - name', return undefined
|
|
1078
1078
|
*/
|
|
1079
1079
|
displayExpr: PropTypes.string,
|
|
1080
1080
|
|
|
@@ -1084,19 +1084,19 @@ TreeView.propTypes = {
|
|
|
1084
1084
|
/** return value for the select multiple use case */
|
|
1085
1085
|
multipleValueMode: PropTypes.oneOf(['single', 'multiple', 'inheritance']),
|
|
1086
1086
|
|
|
1087
|
-
/**
|
|
1088
|
-
* return value for the select multiple use case
|
|
1089
|
-
* * contains: "Công ty" contains "công", but not contains "cong"
|
|
1090
|
-
* * similar: "Công ty" contains "công" and "cong"
|
|
1087
|
+
/**
|
|
1088
|
+
* return value for the select multiple use case
|
|
1089
|
+
* * contains: "Công ty" contains "công", but not contains "cong"
|
|
1090
|
+
* * similar: "Công ty" contains "công" and "cong"
|
|
1091
1091
|
*/
|
|
1092
1092
|
searchMode: PropTypes.oneOf(['contains', 'similar']),
|
|
1093
1093
|
|
|
1094
1094
|
/** The content display for label of checkbox select all */
|
|
1095
1095
|
selectAllLabel: PropTypes.string,
|
|
1096
1096
|
|
|
1097
|
-
/**
|
|
1098
|
-
* duration wait enter search content on search<br/>
|
|
1099
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1097
|
+
/**
|
|
1098
|
+
* duration wait enter search content on search<br/>
|
|
1099
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1100
1100
|
*/
|
|
1101
1101
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1102
1102
|
|
|
@@ -1112,20 +1112,20 @@ TreeView.propTypes = {
|
|
|
1112
1112
|
/** the value was selected */
|
|
1113
1113
|
value: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
1114
1114
|
|
|
1115
|
-
/** function displays items by custom<br/>
|
|
1116
|
-
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1117
|
-
* --> such as: displayExpr={'name - role'}
|
|
1115
|
+
/** function displays items by custom<br/>
|
|
1116
|
+
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1117
|
+
* --> such as: displayExpr={'name - role'}
|
|
1118
1118
|
*/
|
|
1119
1119
|
renderItem: PropTypes.func,
|
|
1120
1120
|
|
|
1121
|
-
/**
|
|
1122
|
-
* on change value function<br />
|
|
1123
|
-
* return 2 parameters (e, data)<br />
|
|
1124
|
-
* * e: element (insist {value, justSelected, data})<br/>
|
|
1125
|
-
* + value is one or an array of selected values<br />
|
|
1126
|
-
* + justSelected is value has just been selected (either true or false))<br />
|
|
1127
|
-
* + data is one or an array of selected values with full information<br />
|
|
1128
|
-
* * data: array of selected values (not recommend because it's the same e.value)
|
|
1121
|
+
/**
|
|
1122
|
+
* on change value function<br />
|
|
1123
|
+
* return 2 parameters (e, data)<br />
|
|
1124
|
+
* * e: element (insist {value, justSelected, data})<br/>
|
|
1125
|
+
* + value is one or an array of selected values<br />
|
|
1126
|
+
* + justSelected is value has just been selected (either true or false))<br />
|
|
1127
|
+
* + data is one or an array of selected values with full information<br />
|
|
1128
|
+
* * data: array of selected values (not recommend because it's the same e.value)
|
|
1129
1129
|
*/
|
|
1130
1130
|
onChange: PropTypes.func,
|
|
1131
1131
|
|
|
@@ -1138,22 +1138,22 @@ TreeView.propTypes = {
|
|
|
1138
1138
|
/** the icon to display for collapse icon */
|
|
1139
1139
|
collapseIcon: PropTypes.any,
|
|
1140
1140
|
|
|
1141
|
-
/**
|
|
1142
|
-
* get ref of TreeView component, insist:<br/>
|
|
1143
|
-
* {<br/>
|
|
1144
|
-
* disabled: true/false,<br/>
|
|
1145
|
-
* displayExpr: string,<br/>
|
|
1146
|
-
* valueExpr: string,<br/>
|
|
1147
|
-
* id: string,<br/>
|
|
1148
|
-
* parentID: string,<br/>
|
|
1149
|
-
* value: string/array<br/>
|
|
1150
|
-
* getValue: get selected values (instead of onChange function),<br/>
|
|
1151
|
-
* setValue: set array of value (only multiple),<br/>
|
|
1152
|
-
* handleCheckbox: checked/unchecked a Checkbox, includes 2 parameters (isChecked, value):<br/>
|
|
1153
|
-
* + isChecked: checked if true (default is false) <br/>
|
|
1154
|
-
* + value: selected values, use 'all' for all values (default is 'all') <br/>
|
|
1155
|
-
* get: get DOM of TreeView component<br/>
|
|
1156
|
-
* }
|
|
1141
|
+
/**
|
|
1142
|
+
* get ref of TreeView component, insist:<br/>
|
|
1143
|
+
* {<br/>
|
|
1144
|
+
* disabled: true/false,<br/>
|
|
1145
|
+
* displayExpr: string,<br/>
|
|
1146
|
+
* valueExpr: string,<br/>
|
|
1147
|
+
* id: string,<br/>
|
|
1148
|
+
* parentID: string,<br/>
|
|
1149
|
+
* value: string/array<br/>
|
|
1150
|
+
* getValue: get selected values (instead of onChange function),<br/>
|
|
1151
|
+
* setValue: set array of value (only multiple),<br/>
|
|
1152
|
+
* handleCheckbox: checked/unchecked a Checkbox, includes 2 parameters (isChecked, value):<br/>
|
|
1153
|
+
* + isChecked: checked if true (default is false) <br/>
|
|
1154
|
+
* + value: selected values, use 'all' for all values (default is 'all') <br/>
|
|
1155
|
+
* get: get DOM of TreeView component<br/>
|
|
1156
|
+
* }
|
|
1157
1157
|
*/
|
|
1158
1158
|
ref: PropTypes.any
|
|
1159
1159
|
};
|
|
@@ -172,16 +172,16 @@ Typography.defaultProps = {
|
|
|
172
172
|
tooltipDirection: 'bottom',
|
|
173
173
|
type: 'p1'
|
|
174
174
|
};
|
|
175
|
-
/** type of text<br/>
|
|
176
|
-
* h1: Title <br/>
|
|
177
|
-
* h2: Header Popup <br/>
|
|
178
|
-
* h3: Header popup <br/>
|
|
179
|
-
* h4: Button, Tab, Title group <br/>
|
|
180
|
-
* h5: Label column, Title group <br/>
|
|
181
|
-
* h6: Label form <br/>
|
|
182
|
-
* p1: Body text <br/>
|
|
183
|
-
* p2: Body text <br/>
|
|
184
|
-
* p3: Notice, Tooltip <br/>
|
|
175
|
+
/** type of text<br/>
|
|
176
|
+
* h1: Title <br/>
|
|
177
|
+
* h2: Header Popup <br/>
|
|
178
|
+
* h3: Header popup <br/>
|
|
179
|
+
* h4: Button, Tab, Title group <br/>
|
|
180
|
+
* h5: Label column, Title group <br/>
|
|
181
|
+
* h6: Label form <br/>
|
|
182
|
+
* p1: Body text <br/>
|
|
183
|
+
* p2: Body text <br/>
|
|
184
|
+
* p3: Notice, Tooltip <br/>
|
|
185
185
|
*/
|
|
186
186
|
|
|
187
187
|
export const arrTypeTypography = ['t1', 't2', 't3', 't4', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p1', 'p2', 'p3', 'title1', 'title2', 'title3', 'title4', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6', 'paragraph1', 'paragraph2', 'paragraph3'];
|
package/icons/effect.js
CHANGED
|
@@ -97,8 +97,8 @@ Icon.propTypes = {
|
|
|
97
97
|
/** name of icon in icons store */
|
|
98
98
|
name: PropTypes.string.isRequired,
|
|
99
99
|
|
|
100
|
-
/** color of icon<br />
|
|
101
|
-
* default: #7F828E
|
|
100
|
+
/** color of icon<br />
|
|
101
|
+
* default: #7F828E
|
|
102
102
|
*/
|
|
103
103
|
color: PropTypes.string,
|
|
104
104
|
|
|
@@ -120,19 +120,19 @@ Icon.propTypes = {
|
|
|
120
120
|
/** have view box if true */
|
|
121
121
|
onClick: PropTypes.func,
|
|
122
122
|
|
|
123
|
-
/**
|
|
124
|
-
* ref methods
|
|
125
|
-
*
|
|
126
|
-
* * option(): Gets all UI component properties
|
|
127
|
-
* * Returns value - object
|
|
128
|
-
* * option(optionName): Gets the value of a single property
|
|
129
|
-
* * @param {optionName} - string
|
|
130
|
-
* * Returns value - any
|
|
131
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
132
|
-
* * @param {optionName} - string
|
|
133
|
-
* * @param {optionValue} - any
|
|
134
|
-
* * option(options): Updates the values of several properties
|
|
135
|
-
* * @param {options} - object
|
|
123
|
+
/**
|
|
124
|
+
* ref methods
|
|
125
|
+
*
|
|
126
|
+
* * option(): Gets all UI component properties
|
|
127
|
+
* * Returns value - object
|
|
128
|
+
* * option(optionName): Gets the value of a single property
|
|
129
|
+
* * @param {optionName} - string
|
|
130
|
+
* * Returns value - any
|
|
131
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
132
|
+
* * @param {optionName} - string
|
|
133
|
+
* * @param {optionValue} - any
|
|
134
|
+
* * option(options): Updates the values of several properties
|
|
135
|
+
* * @param {options} - object
|
|
136
136
|
*/
|
|
137
137
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
138
138
|
current: PropTypes.instanceOf(Element)
|
package/package.json
CHANGED
package/utils/useInput.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
const useInput = (defaultValue, valueProp, onChange, onInput, delayOnChange) => {
|
|
4
4
|
const [value, setValue] = useState(defaultValue || valueProp);
|
|
5
5
|
const timer = useRef(null);
|
|
6
6
|
delayOnChange = Number(delayOnChange || 0);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setValue(valueProp);
|
|
9
|
+
}, [valueProp]);
|
|
7
10
|
|
|
8
11
|
const _onChange = e => {
|
|
9
12
|
e.persist();
|