@lumx/react 4.12.0-next.1 → 4.12.0-next.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/index.d.ts +5 -1
- package/index.js +14 -3
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -589,6 +589,7 @@ interface AutocompleteProps extends GenericProps$1, HasTheme$1 {
|
|
|
589
589
|
/**
|
|
590
590
|
* Autocomplete component.
|
|
591
591
|
*
|
|
592
|
+
* @deprecated use `SelectTextField` instead
|
|
592
593
|
* @param props Component props.
|
|
593
594
|
* @param ref Component ref.
|
|
594
595
|
* @return React element.
|
|
@@ -608,7 +609,8 @@ interface AutocompleteMultipleProps extends AutocompleteProps {
|
|
|
608
609
|
}
|
|
609
610
|
/**
|
|
610
611
|
* AutocompleteMultiple component.
|
|
611
|
-
|
|
612
|
+
|
|
613
|
+
* @deprecated use `SelectTextField` instead
|
|
612
614
|
* @param props Component props.
|
|
613
615
|
* @param ref Component ref.
|
|
614
616
|
* @return React element.
|
|
@@ -3934,6 +3936,7 @@ interface SelectProps extends CoreSelectProps {
|
|
|
3934
3936
|
/**
|
|
3935
3937
|
* Select component.
|
|
3936
3938
|
*
|
|
3939
|
+
* @deprecated use `SelectTextField` instead
|
|
3937
3940
|
* @param props Component props.
|
|
3938
3941
|
* @param ref Component ref.
|
|
3939
3942
|
* @return React element.
|
|
@@ -3951,6 +3954,7 @@ declare const SelectMultipleField: React.FC<SelectMultipleProps>;
|
|
|
3951
3954
|
/**
|
|
3952
3955
|
* SelectMultiple component.
|
|
3953
3956
|
*
|
|
3957
|
+
* @deprecated use `SelectTextField` instead
|
|
3954
3958
|
* @param props Component props.
|
|
3955
3959
|
* @param ref Component ref.
|
|
3956
3960
|
* @return React element.
|
package/index.js
CHANGED
|
@@ -861,6 +861,7 @@ const DEFAULT_PROPS$1f = {
|
|
|
861
861
|
/**
|
|
862
862
|
* Autocomplete component.
|
|
863
863
|
*
|
|
864
|
+
* @deprecated use `SelectTextField` instead
|
|
864
865
|
* @param props Component props.
|
|
865
866
|
* @param ref Component ref.
|
|
866
867
|
* @return React element.
|
|
@@ -991,7 +992,8 @@ const DEFAULT_PROPS$1e = {
|
|
|
991
992
|
|
|
992
993
|
/**
|
|
993
994
|
* AutocompleteMultiple component.
|
|
994
|
-
|
|
995
|
+
|
|
996
|
+
* @deprecated use `SelectTextField` instead
|
|
995
997
|
* @param props Component props.
|
|
996
998
|
* @param ref Component ref.
|
|
997
999
|
* @return React element.
|
|
@@ -2507,6 +2509,9 @@ const ENABLED_CHIP_SELECTOR = `.${CLASSNAME$1j}:not([aria-disabled="true"])`;
|
|
|
2507
2509
|
/** Find the closest chip element from an event target. */
|
|
2508
2510
|
const getChip = target => target?.closest?.(`.${CLASSNAME$1j}`) || null;
|
|
2509
2511
|
|
|
2512
|
+
/** Whether the chip is marked as disabled via aria-disabled. */
|
|
2513
|
+
const isChipDisabled = chip => chip?.getAttribute('aria-disabled') === 'true';
|
|
2514
|
+
|
|
2510
2515
|
/**
|
|
2511
2516
|
* Options for setting up selection chip group event handlers.
|
|
2512
2517
|
* All option accessors are wrapped in getters so that React/Vue can provide
|
|
@@ -2561,7 +2566,9 @@ function setupSelectionChipGroupEvents(options) {
|
|
|
2561
2566
|
const handleClick = evt => {
|
|
2562
2567
|
const chip = getChip(evt.target);
|
|
2563
2568
|
const optionId = chip?.dataset.optionId;
|
|
2564
|
-
if (optionId == null)
|
|
2569
|
+
if (optionId == null || isChipDisabled(chip)) {
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2565
2572
|
evt.stopImmediatePropagation();
|
|
2566
2573
|
removeOption(options, optionId);
|
|
2567
2574
|
};
|
|
@@ -2574,7 +2581,9 @@ function setupSelectionChipGroupEvents(options) {
|
|
|
2574
2581
|
const chip = getChip(evt.target);
|
|
2575
2582
|
const optionId = chip?.dataset.optionId;
|
|
2576
2583
|
const activatingKey = evt.key === 'Enter' || evt.key === ' ' || evt.key === 'Backspace';
|
|
2577
|
-
if (optionId == null || !activatingKey)
|
|
2584
|
+
if (optionId == null || !activatingKey || isChipDisabled(chip)) {
|
|
2585
|
+
return;
|
|
2586
|
+
}
|
|
2578
2587
|
if (evt.key === 'Backspace') {
|
|
2579
2588
|
// Move focus to previous option (instead of next in listbox)
|
|
2580
2589
|
const previousChip = findPreviousChip(container, chip);
|
|
@@ -16475,6 +16484,7 @@ const SelectField = props => {
|
|
|
16475
16484
|
/**
|
|
16476
16485
|
* Select component.
|
|
16477
16486
|
*
|
|
16487
|
+
* @deprecated use `SelectTextField` instead
|
|
16478
16488
|
* @param props Component props.
|
|
16479
16489
|
* @param ref Component ref.
|
|
16480
16490
|
* @return React element.
|
|
@@ -16631,6 +16641,7 @@ const SelectMultipleField = props => {
|
|
|
16631
16641
|
/**
|
|
16632
16642
|
* SelectMultiple component.
|
|
16633
16643
|
*
|
|
16644
|
+
* @deprecated use `SelectTextField` instead
|
|
16634
16645
|
* @param props Component props.
|
|
16635
16646
|
* @param ref Component ref.
|
|
16636
16647
|
* @return React element.
|