lightning-base-components 1.13.6-alpha → 1.14.1-alpha
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/metadata/raptor.json +104 -2
- package/package.json +37 -1
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/scopedImports/@salesforce-label-LightningAlert.defaultLabel.js +1 -0
- package/scopedImports/@salesforce-label-LightningConfirm.defaultLabel.js +1 -0
- package/scopedImports/@salesforce-label-LightningDateTimePicker.selectDateFor.js +1 -0
- package/scopedImports/@salesforce-label-LightningInteractiveDialogBase.cancel.js +1 -0
- package/scopedImports/@salesforce-label-LightningInteractiveDialogBase.ok.js +1 -0
- package/scopedImports/@salesforce-label-LightningLookup.recentItems.js +1 -0
- package/scopedImports/@salesforce-label-LightningModalBase.close.js +1 -0
- package/scopedImports/@salesforce-label-LightningModalBase.waitstate.js +1 -0
- package/scopedImports/@salesforce-label-LightningPrompt.defaultLabel.js +1 -0
- package/src/lightning/baseCombobox/baseCombobox.html +50 -24
- package/src/lightning/baseCombobox/baseCombobox.js +53 -28
- package/src/lightning/card/card.html +7 -1
- package/src/lightning/card/card.js +30 -2
- package/src/lightning/card/utils.js +14 -0
- package/src/lightning/combobox/combobox.css +12 -0
- package/src/lightning/combobox/combobox.html +1 -0
- package/src/lightning/datatable/__docs__/datatable.md +40 -13
- package/src/lightning/datatable/columnWidthManager.js +8 -4
- package/src/lightning/datatable/columns-shared.js +8 -7
- package/src/lightning/datatable/columns.js +38 -4
- package/src/lightning/datatable/datatable.js +932 -727
- package/src/lightning/datatable/datatableResizeObserver.js +1 -1
- package/src/lightning/datatable/inlineEdit.js +15 -3
- package/src/lightning/datatable/keyboard.js +1078 -935
- package/src/lightning/datatable/resizer.js +92 -109
- package/src/lightning/datatable/rows.js +245 -59
- package/src/lightning/datatable/sort.js +83 -28
- package/src/lightning/datatable/{normalizer.js → state.js} +16 -28
- package/src/lightning/datatable/templates/div/div.css +53 -0
- package/src/lightning/datatable/templates/div/div.html +272 -0
- package/src/lightning/datatable/{datatable.css → templates/table/table.css} +0 -0
- package/src/lightning/datatable/templates/table/table.html +260 -0
- package/src/lightning/datatable/widthManagerShared.js +1 -1
- package/src/lightning/datepicker/datepicker.html +3 -3
- package/src/lightning/datepicker/datepicker.js +6 -2
- package/src/lightning/datetimepicker/datetimepicker.html +3 -4
- package/src/lightning/datetimepicker/datetimepicker.js +0 -2
- package/src/lightning/formattedRichText/__docs__/formattedRichText.md +1 -0
- package/src/lightning/helptext/helptext.js +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/asset_audit.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/attach.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/historical_adherence.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/med_rec_recommendation.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/med_rec_statement_recommendation.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/medication_dispense.html +11 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/medication_reconciliation.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/report_type.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/story.html +2 -4
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/tour.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/unified_health_score.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/workforce_engagement.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +26 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/asset_audit.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/collection_alt.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/contract_doc.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/einstein.html +2 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/entitlement.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/signature.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tour.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/truck.html +10 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/workforce_engagement.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/asset_audit.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/attach.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/historical_adherence.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/med_rec_recommendation.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/med_rec_statement_recommendation.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/medication_dispense.html +11 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/medication_reconciliation.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/report_type.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/story.html +2 -4
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tour.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/unified_health_score.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/workforce_engagement.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +26 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/asset_audit.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/collection_alt.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/contract_doc.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/einstein.html +2 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/entitlement.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/signature.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tour.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/truck.html +10 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/workforce_engagement.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/asset_audit.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/attach.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/historical_adherence.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/med_rec_recommendation.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/med_rec_statement_recommendation.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/medication_dispense.html +11 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/medication_reconciliation.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/report_type.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/story.html +2 -4
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tour.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/unified_health_score.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/workforce_engagement.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +15 -1
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/asset_audit.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/attach.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/historical_adherence.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/med_rec_recommendation.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/med_rec_statement_recommendation.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/medication_dispense.html +11 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/medication_reconciliation.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/report_type.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/story.html +2 -4
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tour.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/unified_health_score.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/workforce_engagement.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +15 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +12 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/asset_audit.html +9 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/collection_alt.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/contract_doc.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/einstein.html +2 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/entitlement.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/signature.html +9 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tour.html +9 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/truck.html +10 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/workforce_engagement.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +12 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/asset_audit.html +9 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/collection_alt.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/contract_doc.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/contract_payment.html +10 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/einstein.html +2 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/entitlement.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/field_sales.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/signature.html +9 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tour.html +9 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tour_check.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/truck.html +10 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/workforce_engagement.html +8 -0
- package/src/lightning/input/__docs__/input.md +4 -0
- package/src/lightning/input/input.html +0 -1
- package/src/lightning/input/input.js +31 -30
- package/src/lightning/pill/link.html +1 -1
- package/src/lightning/pill/pill.js +18 -0
- package/src/lightning/pill/plainLink.html +2 -0
- package/src/lightning/pillContainer/barePillContainer.html +5 -5
- package/src/lightning/pillContainer/pillContainer.js +5 -4
- package/src/lightning/pillContainer/standardPillContainer.html +5 -5
- package/src/lightning/positionLibrary/__component__/positionLibraryBounding.spec.js +8 -6
- package/src/lightning/positionLibrary/__component__/x/bounding/bounding.html +1 -1
- package/src/lightning/positionLibrary/__component__/x/bounding/bounding.js +6 -9
- package/src/lightning/positionLibrary/direction.js +17 -5
- package/src/lightning/primitiveDatatableIeditPanel/primitiveDatatableIeditPanel.js +20 -0
- package/src/lightning/primitiveDatatableIeditTypeFactory/primitiveDatatableIeditTypeFactory.js +10 -0
- package/src/lightning/primitiveDatatableStatusBar/primitiveDatatableStatusBar.js +17 -3
- package/src/lightning/primitiveDatatableTooltip/primitiveDatatableTooltip.js +1 -0
- package/src/lightning/primitiveHeaderFactory/nonsortableHeader.html +5 -4
- package/src/lightning/primitiveHeaderFactory/primitiveHeaderFactory.js +255 -94
- package/src/lightning/primitiveHeaderFactory/selectableHeader.html +25 -23
- package/src/lightning/primitiveHeaderFactory/sortableHeader.html +13 -9
- package/src/lightning/progressIndicator/progressIndicator.js +30 -9
- package/src/lightning/progressRing/progressRing.html +6 -0
- package/src/lightning/progressRing/progressRing.js +98 -3
- package/src/lightning/progressStep/progressStep.js +6 -3
- package/src/lightning/timepicker/timepicker.html +1 -0
- package/src/lightning/utilsPrivate/aria.js +30 -0
- package/src/lightning/utilsPrivate/utilsPrivate.js +12 -2
- package/src/lightning/datatable/datatable.html +0 -237
- package/src/lightning/datatable/keys.js +0 -32
- package/src/lightning/utilsPrivate/contentMutation.js +0 -273
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
<!-- Header Content -->
|
|
3
|
+
<div class="slds-th__action slds-th__action_form slds-cell-fixed" style={columnStyles}>
|
|
4
4
|
<template if:true={showCheckbox}>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
<span class="slds-checkbox">
|
|
6
|
+
|
|
7
|
+
<!-- Selectable Checkbox -->
|
|
8
|
+
<input
|
|
9
|
+
type="checkbox"
|
|
10
|
+
class="datatable-select-all"
|
|
11
|
+
name={computedOptionName}
|
|
12
|
+
id="lgt-dt-header-factory-id"
|
|
13
|
+
onclick={handleSelectAllRows}
|
|
14
|
+
tabindex={internalTabIndex}
|
|
15
|
+
data-navigation="enable"
|
|
16
|
+
disabled={def.isBulkSelectionDisabled}>
|
|
17
|
+
|
|
18
|
+
<label class="slds-checkbox__label" for="lgt-dt-header-factory-id">
|
|
19
|
+
<span class="slds-checkbox_faux"></span>
|
|
20
|
+
<span class="slds-form-element__label slds-assistive-text">
|
|
21
|
+
{i18n.selectAll}
|
|
22
|
+
</span>
|
|
23
|
+
</label>
|
|
24
|
+
</span>
|
|
23
25
|
</template>
|
|
24
26
|
<template if:false={showCheckbox}>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
<span id="column-group-header" class="slds-assistive-text" data-column-header>
|
|
28
|
+
{i18n.chooseARow}
|
|
29
|
+
</span>
|
|
28
30
|
</template>
|
|
29
31
|
</div>
|
|
30
32
|
</template>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
style={columnStyles}
|
|
6
|
-
>
|
|
2
|
+
<!-- Header Content -->
|
|
3
|
+
<span class={computedClass} tabindex={internalTabIndex} style={columnStyles}>
|
|
4
|
+
|
|
7
5
|
<a href="javascript:void(0);"
|
|
8
6
|
class={computedSortClass}
|
|
9
7
|
role={headerRole}
|
|
10
8
|
tabindex={internalTabIndex}
|
|
11
9
|
data-navigation="enable"
|
|
12
10
|
onclick={handleSortingClick}
|
|
13
|
-
style={columnStyles}
|
|
11
|
+
style={columnStyles}
|
|
12
|
+
data-action-triggers="enter">
|
|
14
13
|
|
|
15
14
|
<span class="slds-assistive-text">{i18n.sort}</span>
|
|
16
15
|
|
|
16
|
+
<!-- Icon to display to the left/start of the header text -->
|
|
17
17
|
<template if:true={def.iconName}>
|
|
18
18
|
<div class="slds-grid slds-grid_vertical-align-center slds-has-flexi-truncate">
|
|
19
19
|
<lightning-icon icon-name={def.iconName} size="x-small" class="slds-icon_container slds-m-right_xx-small" alternative-text={def.label} title={def.label}></lightning-icon>
|
|
@@ -21,17 +21,18 @@
|
|
|
21
21
|
<span class="slds-truncate">{def.label}</span>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
|
+
<!-- Arrow Icon - Rotates based on sorting direction -->
|
|
24
25
|
<lightning-primitive-icon
|
|
25
26
|
class="slds-icon_container"
|
|
26
27
|
svg-class="slds-icon slds-icon-text-default slds-is-sortable__icon"
|
|
27
28
|
icon-name="utility:arrowdown"
|
|
28
29
|
size="x-small">
|
|
29
30
|
</lightning-primitive-icon>
|
|
30
|
-
|
|
31
31
|
</div>
|
|
32
32
|
</template>
|
|
33
33
|
<template if:false={def.iconName}>
|
|
34
34
|
<span class="slds-truncate" title={def.label}>{def.label}</span>
|
|
35
|
+
<!-- Arrow Icon - Rotates based on sorting direction -->
|
|
35
36
|
<lightning-primitive-icon
|
|
36
37
|
class="slds-icon_container"
|
|
37
38
|
svg-class="slds-icon slds-icon-text-default slds-is-sortable__icon"
|
|
@@ -41,17 +42,20 @@
|
|
|
41
42
|
</template>
|
|
42
43
|
</a>
|
|
43
44
|
|
|
45
|
+
<!-- Aria Live Region to announce sorting order -->
|
|
44
46
|
<span class="slds-assistive-text" aria-live="polite" aria-atomic="true">{sortedOrderLabel}</span>
|
|
45
47
|
|
|
48
|
+
<!-- Header Actions -->
|
|
46
49
|
<template if:true={hasActions}>
|
|
47
50
|
<lightning-primitive-header-actions
|
|
48
51
|
col-key-value={def.colKeyValue}
|
|
49
52
|
actions={actions}
|
|
50
53
|
tabindex={internalTabIndex}
|
|
51
|
-
data-navigation="enable"
|
|
52
|
-
|
|
54
|
+
data-navigation="enable">
|
|
55
|
+
</lightning-primitive-header-actions>
|
|
53
56
|
</template>
|
|
54
57
|
|
|
58
|
+
<!-- Resize Handler -->
|
|
55
59
|
<template if:true={isResizable}>
|
|
56
60
|
<lightning-primitive-resize-handler
|
|
57
61
|
value={columnWidth}
|
|
@@ -93,17 +93,28 @@ export default class LightningProgressIndicator extends LightningElement {
|
|
|
93
93
|
this.updateSteps();
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
// Added `shouldFocus` as fix for W-9862373
|
|
97
|
+
updateSteps(activeStep, shouldFocus) {
|
|
97
98
|
const steps = this.getSteps();
|
|
98
99
|
const { privateStepHandlers, type, hasError, currentStep } = this;
|
|
99
100
|
const currentStepIndex = getCurrentStepIndex(steps, currentStep);
|
|
100
|
-
let activeStepIndex = -1;
|
|
101
101
|
|
|
102
|
+
let activeStepIndex = -1;
|
|
103
|
+
// Set activeStepIndex to activeStep if provided.
|
|
104
|
+
// This happens when focus is updated by user using arrow keys or clicking a progress step.
|
|
105
|
+
// When component re-renders, active step is not passed from renderedCallback or handleSlotChange
|
|
106
|
+
// In this scenario, use the privateActiveStepIndex to maintain the activeStep.
|
|
107
|
+
// privateActiveStepInde will have the active step before the re-render
|
|
108
|
+
// In case of initial render, privateActiveStepIndex is undefined. Use privateCurrentStep as activeStepIndex for fallback.
|
|
109
|
+
// activeStep is needed to set active class and proper tabIndex for the progress step
|
|
102
110
|
if (activeStep) {
|
|
103
111
|
activeStepIndex = getStepIndex(steps, activeStep);
|
|
112
|
+
} else if (this.privateActiveStepIndex !== undefined) {
|
|
113
|
+
activeStepIndex = this.privateActiveStepIndex;
|
|
104
114
|
} else {
|
|
105
115
|
activeStepIndex = getStepIndex(steps, this.privateCurrentStep);
|
|
106
116
|
}
|
|
117
|
+
|
|
107
118
|
this.privateActiveStepIndex = activeStepIndex;
|
|
108
119
|
|
|
109
120
|
// cast 'steps' NodeList to an Array for crossbrowser compatibility
|
|
@@ -111,24 +122,32 @@ export default class LightningProgressIndicator extends LightningElement {
|
|
|
111
122
|
|
|
112
123
|
stepsArray.forEach((step, index) => {
|
|
113
124
|
const stepName = step.value;
|
|
114
|
-
const isActive = index ===
|
|
125
|
+
const isActive = index === this.privateActiveStepIndex;
|
|
115
126
|
|
|
116
127
|
if (index < currentStepIndex) {
|
|
117
128
|
privateStepHandlers[stepName](
|
|
118
129
|
STATE_COMPLETED,
|
|
119
130
|
type,
|
|
120
131
|
index,
|
|
121
|
-
isActive
|
|
132
|
+
isActive,
|
|
133
|
+
shouldFocus
|
|
122
134
|
);
|
|
123
135
|
} else if (index === currentStepIndex) {
|
|
124
136
|
const state = hasError ? STATE_ERROR : STATE_CURRENT;
|
|
125
|
-
privateStepHandlers[stepName](
|
|
137
|
+
privateStepHandlers[stepName](
|
|
138
|
+
state,
|
|
139
|
+
type,
|
|
140
|
+
index,
|
|
141
|
+
isActive,
|
|
142
|
+
shouldFocus
|
|
143
|
+
);
|
|
126
144
|
} else {
|
|
127
145
|
privateStepHandlers[stepName](
|
|
128
146
|
STATE_INCOMPLETE,
|
|
129
147
|
type,
|
|
130
148
|
index,
|
|
131
|
-
isActive
|
|
149
|
+
isActive,
|
|
150
|
+
shouldFocus
|
|
132
151
|
);
|
|
133
152
|
}
|
|
134
153
|
});
|
|
@@ -169,15 +188,17 @@ export default class LightningProgressIndicator extends LightningElement {
|
|
|
169
188
|
case LEFT:
|
|
170
189
|
if (this.privateActiveStepIndex - 1 >= 0) {
|
|
171
190
|
this.updateSteps(
|
|
172
|
-
steps[this.privateActiveStepIndex - 1].value
|
|
191
|
+
steps[this.privateActiveStepIndex - 1].value,
|
|
192
|
+
true // Set shouldFocus to true to focus on nthe updated progress step
|
|
173
193
|
);
|
|
174
194
|
}
|
|
175
195
|
break;
|
|
176
196
|
case DOWN:
|
|
177
197
|
case RIGHT:
|
|
178
|
-
if (this.privateActiveStepIndex + 1
|
|
198
|
+
if (this.privateActiveStepIndex + 1 < steps.length) {
|
|
179
199
|
this.updateSteps(
|
|
180
|
-
steps[this.privateActiveStepIndex + 1].value
|
|
200
|
+
steps[this.privateActiveStepIndex + 1].value,
|
|
201
|
+
true // Set shouldFocus to true to focus on nthe updated progress step
|
|
181
202
|
);
|
|
182
203
|
}
|
|
183
204
|
break;
|
|
@@ -29,5 +29,11 @@
|
|
|
29
29
|
<span class="slds-assistive-text">{computedAltText}</span>
|
|
30
30
|
</span>
|
|
31
31
|
</div>
|
|
32
|
+
<div class="slds-progress-ring__progress-head">
|
|
33
|
+
<svg viewBox="-1 -1 2 2">
|
|
34
|
+
<circle if:true={isProgressHeadVisible} class="slds-progress-ring__path" cx={progressHeadCenter.x} cy={progressHeadCenter.y} r="0.2">
|
|
35
|
+
</circle>
|
|
36
|
+
</svg>
|
|
37
|
+
</div>
|
|
32
38
|
</div>
|
|
33
39
|
</template>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { LightningElement, api } from 'lwc';
|
|
2
2
|
import { classSet } from 'lightning/utils';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Progress head SVG element viewBox attribute is set as '-1 -1 2 2', hence viewbox height is 2 units
|
|
6
|
+
*/
|
|
7
|
+
export const PROGRESS_HEAD_VIEWBOX_HEIGHT = 2;
|
|
8
|
+
|
|
4
9
|
/**
|
|
5
10
|
* Displays a circular progress indicator to provide feedback about an action or process.
|
|
6
11
|
* This component requires API version 48.0 and later.
|
|
@@ -42,6 +47,94 @@ export default class progressRing extends LightningElement {
|
|
|
42
47
|
*/
|
|
43
48
|
@api size = 'medium';
|
|
44
49
|
|
|
50
|
+
arcY = 0;
|
|
51
|
+
arcX = 0;
|
|
52
|
+
radiusOfCircularMotionForProgressHead = 0;
|
|
53
|
+
|
|
54
|
+
isRendered = false;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Calculates the radius along which to rotate the SVG circle element present inside
|
|
58
|
+
* ".slds-progress-ring__progress-head" container element.
|
|
59
|
+
*/
|
|
60
|
+
calculateRadiusOfCircularMotionForProgressHead() {
|
|
61
|
+
const progressHeadContainerHeight = parseFloat(
|
|
62
|
+
getComputedStyle(
|
|
63
|
+
this.template.querySelector(
|
|
64
|
+
'.slds-progress-ring__progress-head'
|
|
65
|
+
)
|
|
66
|
+
).height
|
|
67
|
+
);
|
|
68
|
+
const progressArcContainerHeight = parseFloat(
|
|
69
|
+
getComputedStyle(
|
|
70
|
+
this.template.querySelector('.slds-progress-ring__progress')
|
|
71
|
+
).height
|
|
72
|
+
);
|
|
73
|
+
const progressContentContainerHeight = parseFloat(
|
|
74
|
+
getComputedStyle(
|
|
75
|
+
this.template.querySelector('.slds-progress-ring__content')
|
|
76
|
+
).height
|
|
77
|
+
);
|
|
78
|
+
// NOTE:- The progress-head SVG viewbox attribute is set as '-1 -1 2 2', which means the "2" units
|
|
79
|
+
// height and width of viewbox would correspond to the actual height/width of the SVG in pixels.
|
|
80
|
+
// ex:- If the SVG's actual widthxheight in pixels is 32x32, then inside the viewbox the "32px" would
|
|
81
|
+
// correspond to "2" units. This means the viewbox scales down lengths to it's own units between 0 and 2.
|
|
82
|
+
// So to work with actual lengths in pixels inside the viewbox, you have to first convert the pixel length
|
|
83
|
+
// to "viewbox length" units.
|
|
84
|
+
// ex:- Continuing from previous example, If 32px is 2 units inside viewbox, how many units is 24px?
|
|
85
|
+
// it will be 24 * (2 / 32).
|
|
86
|
+
// Therefore, you need a "length scaling factor" to find the "viewbox length" for a given pixel length. The
|
|
87
|
+
// (2 / 32) in the previous example is the "length scaling factor"
|
|
88
|
+
const lengthScalingFactorInProgressHeadViewBox =
|
|
89
|
+
PROGRESS_HEAD_VIEWBOX_HEIGHT / progressHeadContainerHeight;
|
|
90
|
+
const radiusOfProgressArcInPixels = progressArcContainerHeight / 2;
|
|
91
|
+
const radiusOfProgressArcInProgressHeadViewBox =
|
|
92
|
+
radiusOfProgressArcInPixels *
|
|
93
|
+
lengthScalingFactorInProgressHeadViewBox;
|
|
94
|
+
|
|
95
|
+
// Note:- The progress-content container element partially overlaps the progress-arc container
|
|
96
|
+
// element like a concentric circle inside another circle. So the width of the progress arc that is visible to the user
|
|
97
|
+
// is equal to the length of the non-overlapping part between them.
|
|
98
|
+
const radiusOfProgressContentInPixels =
|
|
99
|
+
progressContentContainerHeight / 2;
|
|
100
|
+
const widthOfArcInPixels =
|
|
101
|
+
radiusOfProgressArcInPixels - radiusOfProgressContentInPixels;
|
|
102
|
+
const widthOfArcInProgressHeadViewBox =
|
|
103
|
+
widthOfArcInPixels * lengthScalingFactorInProgressHeadViewBox;
|
|
104
|
+
|
|
105
|
+
// Note:- Here the intent is to move the progress-head circle svg element
|
|
106
|
+
// along the midpoint of the progress arc width.
|
|
107
|
+
this.radiusOfCircularMotionForProgressHead =
|
|
108
|
+
radiusOfProgressArcInProgressHeadViewBox -
|
|
109
|
+
widthOfArcInProgressHeadViewBox / 2;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
renderedCallback() {
|
|
113
|
+
if (this.isRendered) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.calculateRadiusOfCircularMotionForProgressHead();
|
|
117
|
+
this.isRendered = true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
get progressHeadCenter() {
|
|
121
|
+
// Note:- Formula is x = radius * Cosine(theta), y = radius * Sine(theta), and here
|
|
122
|
+
// arcX = Cosine(theta), arcY = Sine(theta) calculated already in the method "get d()"
|
|
123
|
+
const x = this.arcX * this.radiusOfCircularMotionForProgressHead;
|
|
124
|
+
const y = this.arcY * this.radiusOfCircularMotionForProgressHead;
|
|
125
|
+
return {
|
|
126
|
+
x,
|
|
127
|
+
y,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
get isProgressHeadVisible() {
|
|
132
|
+
if (this.value > 0 && this.value < 100) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
|
|
45
138
|
get d() {
|
|
46
139
|
const fillPercent = this.value / 100;
|
|
47
140
|
const filldrain = this.direction === 'drain' ? 1 : 0;
|
|
@@ -50,10 +143,12 @@ export default class progressRing extends LightningElement {
|
|
|
50
143
|
|
|
51
144
|
const subCalc = 2 * Math.PI * fillPercent;
|
|
52
145
|
|
|
53
|
-
|
|
54
|
-
|
|
146
|
+
// Note:- The formula is x = radius * Cosine(theta), y = radius * Sine(theta) with appropriate signs (+ / -), and
|
|
147
|
+
// here the radius is 1 unit implicitly as per the svg's viewBox attribute.
|
|
148
|
+
this.arcX = Math.cos(subCalc);
|
|
149
|
+
this.arcY = Math.sin(subCalc) * inverter;
|
|
55
150
|
|
|
56
|
-
return `M 1 0 A 1 1 0 ${islong} ${filldrain} ${
|
|
151
|
+
return `M 1 0 A 1 1 0 ${islong} ${filldrain} ${this.arcX} ${this.arcY} L 0 0`;
|
|
57
152
|
}
|
|
58
153
|
|
|
59
154
|
get iconSvg() {
|
|
@@ -33,12 +33,14 @@ export default class LightningProgressStep extends LightningElement {
|
|
|
33
33
|
|
|
34
34
|
@track state = {};
|
|
35
35
|
|
|
36
|
-
updateInternal(newStatus, newType, newIndex, newActive) {
|
|
36
|
+
updateInternal(newStatus, newType, newIndex, newActive, shouldFocus) {
|
|
37
37
|
classListMutation(
|
|
38
38
|
this.classList,
|
|
39
39
|
this.computeClassSet(newType, newStatus, newActive)
|
|
40
40
|
);
|
|
41
|
-
|
|
41
|
+
// Added `shouldFocus` as fix for W-9862373
|
|
42
|
+
// This ensures progressStep is focused only when this argument is true.
|
|
43
|
+
if (newActive === true && shouldFocus) {
|
|
42
44
|
this.focusPathLink();
|
|
43
45
|
}
|
|
44
46
|
this.state.status = newStatus;
|
|
@@ -85,7 +87,8 @@ export default class LightningProgressStep extends LightningElement {
|
|
|
85
87
|
'slds-is-completed': !isPath && status === 'completed',
|
|
86
88
|
'slds-has-error': !isPath && status === 'error',
|
|
87
89
|
'slds-is-active':
|
|
88
|
-
|
|
90
|
+
(type !== 'base' && isActive === true) ||
|
|
91
|
+
(type === 'base' && status === 'current'),
|
|
89
92
|
'slds-path__item': isPath,
|
|
90
93
|
'slds-is-complete': isPath && status === 'completed',
|
|
91
94
|
'slds-is-current':
|
|
@@ -17,6 +17,7 @@ const ARIA_PROP_LIST = [
|
|
|
17
17
|
'current',
|
|
18
18
|
'describedAt',
|
|
19
19
|
'describedBy',
|
|
20
|
+
'description',
|
|
20
21
|
'details',
|
|
21
22
|
'disabled',
|
|
22
23
|
'dropEffect',
|
|
@@ -105,3 +106,32 @@ export const ARIA = getAriaLookup(ARIA_PROP_LIST);
|
|
|
105
106
|
* Useful for converting from normal aria properties to aria camel cased values
|
|
106
107
|
*/
|
|
107
108
|
export const ARIA_TO_CAMEL = getAriaLookup(ARIA_PROP_LIST, 'cc');
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Set either 'aria-describedby' or 'aria-description' value for accessibility
|
|
112
|
+
* based on the presence of 'description' api value and support of the newer ARIA
|
|
113
|
+
* 'aria-description'. At launch, Firefox, Safari do not support it (and IE11 never will).
|
|
114
|
+
* https://caniuse.com/mdn-api_element_ariadescription
|
|
115
|
+
* @private
|
|
116
|
+
* @returns {boolean} true indicates aria-description is supported; false, no support
|
|
117
|
+
*/
|
|
118
|
+
// cached value, so check once and only once
|
|
119
|
+
let ariaDescriptionSupported = null;
|
|
120
|
+
|
|
121
|
+
export function isAriaDescriptionSupported() {
|
|
122
|
+
// return previously cached value, don't recheck
|
|
123
|
+
if (ariaDescriptionSupported !== null) {
|
|
124
|
+
return ariaDescriptionSupported;
|
|
125
|
+
}
|
|
126
|
+
// if not previously set, test for browser support
|
|
127
|
+
const testVal = 'test ability to set';
|
|
128
|
+
const span = document.createElement('span');
|
|
129
|
+
try {
|
|
130
|
+
span.ariaDescription = testVal;
|
|
131
|
+
const ariaDescVal = span.getAttribute(ARIA.DESCRIPTION);
|
|
132
|
+
ariaDescriptionSupported = testVal === ariaDescVal;
|
|
133
|
+
} catch (e) {
|
|
134
|
+
ariaDescriptionSupported = false;
|
|
135
|
+
}
|
|
136
|
+
return ariaDescriptionSupported;
|
|
137
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { assert } from './assert';
|
|
2
|
-
export { ARIA, ARIA_TO_CAMEL } from './aria';
|
|
2
|
+
export { ARIA, ARIA_TO_CAMEL, isAriaDescriptionSupported } from './aria';
|
|
3
3
|
export { EventEmitter } from './eventEmitter';
|
|
4
4
|
export { toNorthAmericanPhoneNumber } from './phonify';
|
|
5
5
|
export * from './linkUtils';
|
|
@@ -23,7 +23,6 @@ export {
|
|
|
23
23
|
} from './keyboard';
|
|
24
24
|
export { raf } from './scroll';
|
|
25
25
|
export { isChrome, isIE11, isSafari } from './browser';
|
|
26
|
-
export { ContentMutation } from './contentMutation';
|
|
27
26
|
export { observePosition } from './observers';
|
|
28
27
|
export { hasOnlyAllowedVideoIframes } from './videoUtils';
|
|
29
28
|
export {
|
|
@@ -212,3 +211,14 @@ export function buttonGroupOrderClass(groupOrder) {
|
|
|
212
211
|
[BUTTON_GROUP_ORDER.ONLY]: 'single-button',
|
|
213
212
|
}[groupOrder];
|
|
214
213
|
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Checks if the given component is native
|
|
217
|
+
* @param {Object} cmp Component instance
|
|
218
|
+
* @returns {Boolean} Whether the component is native
|
|
219
|
+
*/
|
|
220
|
+
export function isNativeComponent(cmp) {
|
|
221
|
+
return !String(cmp?.template?.constructor).includes(
|
|
222
|
+
'function SyntheticShadowRoot'
|
|
223
|
+
);
|
|
224
|
+
}
|