lightning-base-components 1.15.1-alpha → 1.15.4-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 +64 -2
- package/package.json +64 -2
- package/scopedImports/@salesforce-i18n-calendarData.js +1 -0
- package/scopedImports/@salesforce-i18n-common.calendarData.js +1 -0
- package/scopedImports/@salesforce-i18n-common.digits.js +1 -0
- package/scopedImports/@salesforce-i18n-dateTime.longDateTimeFormat.js +1 -0
- package/scopedImports/@salesforce-i18n-defaultCalendar.js +1 -0
- package/scopedImports/@salesforce-i18n-defaultNumberingSystem.js +1 -0
- package/scopedImports/@salesforce-i18n-number.exponentialSign.js +1 -0
- package/scopedImports/@salesforce-i18n-number.infinity.js +1 -0
- package/scopedImports/@salesforce-i18n-number.minusSign.js +1 -0
- package/scopedImports/@salesforce-i18n-number.nan.js +1 -0
- package/scopedImports/@salesforce-i18n-number.perMilleSign.js +1 -0
- package/scopedImports/@salesforce-i18n-number.percentSign.js +1 -0
- package/scopedImports/@salesforce-i18n-number.plusSign.js +1 -0
- package/scopedImports/@salesforce-i18n-number.superscriptingExponentSign.js +1 -0
- package/scopedImports/@salesforce-label-LightningMap.defaultTitle.js +1 -0
- package/src/lightning/alert/__docs__/alert.md +4 -6
- package/src/lightning/baseCombobox/baseCombobox.html +3 -1
- package/src/lightning/baseCombobox/baseCombobox.js +44 -7
- package/src/lightning/button/button.js +22 -1
- package/src/lightning/buttonIcon/buttonIcon.js +0 -3
- package/src/lightning/calendar/calendar.html +2 -1
- package/src/lightning/calendar/calendar.js +2 -2
- package/src/lightning/checkboxGroup/checkboxGroup.html +2 -2
- package/src/lightning/checkboxGroup/checkboxGroup.js +9 -5
- package/src/lightning/combobox/__docs__/combobox.md +3 -1
- package/src/lightning/combobox/combobox.html +1 -1
- package/src/lightning/combobox/combobox.js +7 -2
- package/src/lightning/configProvider/defaultLocalizationConfig.js +43 -6
- package/src/lightning/confirm/__docs__/confirm.md +2 -4
- package/src/lightning/datatable/__examples__/basic/basic.js +3 -4
- package/src/lightning/datatable/__examples__/basic/generateData.js +13 -0
- package/src/lightning/datatable/__examples__/withInfiniteLoading/generateDataWithDelay.js +18 -0
- package/src/lightning/datatable/__examples__/withInfiniteLoading/withInfiniteLoading.js +3 -3
- package/src/lightning/datatable/__examples__/withInlineEdit/generateData.js +13 -0
- package/src/lightning/datatable/__examples__/withInlineEdit/withInlineEdit.js +3 -4
- package/src/lightning/datatable/__examples__/withRowActions/generateData.js +13 -0
- package/src/lightning/datatable/__examples__/withRowActions/withRowActions.js +3 -4
- package/src/lightning/datatable/__examples__/withRowNumbers/generateData.js +13 -0
- package/src/lightning/datatable/__examples__/withRowNumbers/withRowNumbers.js +3 -4
- package/src/lightning/datatable/__wdio__/utam/utam.html +15 -0
- package/src/lightning/datatable/__wdio__/utam/utam.spec.js +208 -183
- package/src/lightning/datatable/datatable.js +13 -7
- package/src/lightning/datatable/inlineEdit.js +0 -5
- package/src/lightning/datatable/inlineEditShared.js +4 -2
- package/src/lightning/datatable/keyboard.js +13 -5
- package/src/lightning/datatable/rowSelection.js +8 -2
- package/src/lightning/datatable/state.js +1 -0
- package/src/lightning/datatable/templates/table/table.html +2 -2
- package/src/lightning/datatable/utils.js +11 -0
- package/src/lightning/datatable/virtualization.js +2 -2
- package/src/lightning/datatable/wrapText.js +1 -0
- package/src/lightning/datepicker/datepicker.html +5 -4
- package/src/lightning/datepicker/datepicker.js +35 -77
- package/src/lightning/datetimepicker/datetimepicker.html +3 -1
- package/src/lightning/datetimepicker/datetimepicker.js +44 -8
- package/src/lightning/dualListbox/dualListbox.html +1 -1
- package/src/lightning/dualListbox/dualListbox.js +8 -1
- package/src/lightning/fileDownload/fileDownload.js +15 -0
- package/src/lightning/fileDownload/fileDownload.js-meta.xml +5 -0
- package/src/lightning/fileDownload/resourceResolver.js +58 -0
- package/src/lightning/formattedAddress/__docs__/formattedAddress.md +3 -0
- package/src/lightning/formattedAddress/__examples__/customLocale/customLocale.html +22 -0
- package/src/lightning/formattedAddress/__examples__/customLocale/customLocale.js +3 -0
- package/src/lightning/formattedAddress/formattedAddress.js +7 -1
- package/src/lightning/formattedDateTime/formattedDateTime.js +1 -1
- package/src/lightning/formattedLookup/events.js +19 -0
- package/src/lightning/formattedLookup/formattedLookup.js +7 -0
- package/src/lightning/formattedRichText/__docs__/formattedRichText.md +9 -7
- package/src/lightning/formattedRichText/__examples__disabled/basic/basic.html +1 -1
- package/src/lightning/formattedTime/formattedTime.js +2 -1
- package/src/lightning/groupedCombobox/groupedCombobox.html +3 -2
- package/src/lightning/groupedCombobox/groupedCombobox.js +26 -4
- package/src/lightning/helptext/helptext.html +1 -0
- package/src/lightning/helptext/helptext.js +29 -2
- package/src/lightning/i18nCldrOptions/all-locales.js +1 -0
- package/src/lightning/i18nCldrOptions/i18nCldrOptions.js +4 -0
- package/src/lightning/i18nService/i18nService.js +1810 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/action/scan_disabled.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/action/scan_enabled.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/ai_accelerator_card.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/connect_wallet.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_category_wallet_group.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_product.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_product_category_wallet_role.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_transaction.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_transaction_envelope.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_transaction_envelope_item.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_wallet.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_wallet_group.html +9 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/crypto_wallet_group_item.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/customer.html +10 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/learner_program.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/nft_settings.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/nft_studio.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/prompt.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/setup_modal.html +11 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/snippet_alt.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/water.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +48 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/captions.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/customer.html +10 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/detach.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/hazmat_equipment.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/label.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/labels.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/record_alt.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/segments.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tollways.html +8 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/transport_bicycle.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/transport_heavy_truck.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/transport_light_truck.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/transport_walking.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/water.html +7 -0
- package/src/lightning/iconSvgTemplatesAction/buildTemplates/action/scan_disabled.html +7 -0
- package/src/lightning/iconSvgTemplatesAction/buildTemplates/action/scan_enabled.html +7 -0
- package/src/lightning/iconSvgTemplatesAction/buildTemplates/templates.js +3 -1
- package/src/lightning/iconSvgTemplatesActionRtl/buildTemplates/action/scan_disabled.html +7 -0
- package/src/lightning/iconSvgTemplatesActionRtl/buildTemplates/action/scan_enabled.html +7 -0
- package/src/lightning/iconSvgTemplatesActionRtl/buildTemplates/templates.js +3 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/action/scan_disabled.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/action/scan_enabled.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/ai_accelerator_card.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/connect_wallet.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_category_wallet_group.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_product.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_product_category_wallet_role.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_transaction.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_transaction_envelope.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_transaction_envelope_item.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_wallet.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_wallet_group.html +9 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/crypto_wallet_group_item.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/customer.html +10 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/learner_program.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/nft_settings.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/nft_studio.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/prompt.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/setup_modal.html +11 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/snippet_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/water.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +48 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/captions.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/customer.html +10 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/detach.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/hazmat_equipment.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/label.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/labels.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/record_alt.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/segments.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tollways.html +8 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/transport_bicycle.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/transport_heavy_truck.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/transport_light_truck.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/transport_walking.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/water.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/ai_accelerator_card.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/connect_wallet.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_category_wallet_group.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_product.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_product_category_wallet_role.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_transaction.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_transaction_envelope.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_transaction_envelope_item.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_wallet.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_wallet_group.html +9 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/crypto_wallet_group_item.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/customer.html +10 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/learner_program.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/nft_settings.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/nft_studio.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/prompt.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/setup_modal.html +11 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/snippet_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/water.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +26 -1
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/ai_accelerator_card.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/connect_wallet.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_category_wallet_group.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_product.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_product_category_wallet_role.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_transaction.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_transaction_envelope.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_transaction_envelope_item.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_wallet.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_wallet_group.html +9 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/crypto_wallet_group_item.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/customer.html +10 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/learner_program.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/nft_settings.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/nft_studio.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/prompt.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/setup_modal.html +11 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/snippet_alt.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/water.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +26 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +21 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/captions.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/customer.html +10 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/detach.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/hazmat_equipment.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/label.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/labels.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/record_alt.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/segments.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tollways.html +8 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/transport_bicycle.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/transport_heavy_truck.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/transport_light_truck.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/transport_walking.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/water.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +21 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/captions.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/contract_line_outcome.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/contract_line_outcome_data.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/customer.html +10 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/customer_workspace.html +11 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/detach.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/hazmat_equipment.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/label.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/labels.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/record_alt.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/segments.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tax_policy.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tax_rate.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tax_treatment.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tollways.html +8 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/transport_bicycle.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/transport_heavy_truck.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/transport_light_truck.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/transport_walking.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/water.html +7 -0
- package/src/lightning/input/dateTimeUtil.js +2 -2
- package/src/lightning/input/input.html +6 -0
- package/src/lightning/input/input.js +2 -1
- package/src/lightning/inputAddress/__docs__/inputAddress.md +5 -0
- package/src/lightning/inputAddress/__examples__/customLocale/customLocale.html +12 -0
- package/src/lightning/inputAddress/__examples__/customLocale/customLocale.js +3 -0
- package/src/lightning/inputAddress/inputAddress.html +3 -1
- package/src/lightning/inputAddress/inputAddress.js +33 -4
- package/src/lightning/inputLocation/inputLocation.html +1 -1
- package/src/lightning/inputLocation/inputLocation.js +7 -1
- package/src/lightning/inputName/__docs__/inputName.md +2 -0
- package/src/lightning/inputName/inputName.html +5 -2
- package/src/lightning/inputName/inputName.js +7 -1
- package/src/lightning/inputUtils/inputUtils.js +11 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.js +1 -0
- package/src/lightning/internationalizationLibrary/datetime/dateTimeOptions.js +16 -29
- package/src/lightning/internationalizationLibrary/datetime/dateTimeUtils.js +524 -135
- package/src/lightning/internationalizationLibrary/datetime/intlFormat.js +92 -72
- package/src/lightning/internationalizationLibrary/internationalizationLibrary.js +9 -4
- package/src/lightning/internationalizationLibrary/localizationService.js +1 -0
- package/src/lightning/internationalizationLibrary/number/NumberFormat.js +17 -11
- package/src/lightning/internationalizationLibrary/number/numberFormatFallback.js +3 -2
- package/src/lightning/internationalizationLibrary/number/numberOptions.js +22 -26
- package/src/lightning/internationalizationLibrary/number/utils.js +134 -131
- package/src/lightning/internationalizationLibrary/utils.js +14 -0
- package/src/lightning/iso8601Utils/iso8601Utils.js +1 -0
- package/src/lightning/modalBase/modalBase.css +0 -4
- package/src/lightning/modalBase/modalBase.html +1 -1
- package/src/lightning/modalBase/modalBase.js +0 -14
- package/src/lightning/navigation/__docs__/navigation.md +0 -2
- package/src/lightning/overlayContainer/overlayContainer.html +2 -2
- package/src/lightning/overlayContainer/overlayContainer.js +217 -49
- package/src/lightning/overlayManager/overlayManager.js +378 -28
- package/src/lightning/overlayManager/overlayManager.js-meta.xml +5 -0
- package/src/lightning/picklist/picklist.js +6 -1
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +1 -11
- package/src/lightning/prompt/__docs__/prompt.md +2 -4
- package/src/lightning/radioGroup/radioGroup.js +9 -0
- package/src/lightning/select/select.html +4 -2
- package/src/lightning/select/select.js +12 -2
- package/src/lightning/tabBar/tabBar.html +3 -2
- package/src/lightning/tabBar/tabBar.js +15 -0
- package/src/lightning/textarea/textarea.html +2 -1
- package/src/lightning/textarea/textarea.js +12 -1
- package/src/lightning/timepicker/timepicker.html +4 -2
- package/src/lightning/timepicker/timepicker.js +49 -86
- package/src/lightning/utils/labelUtils.js +4 -1
- package/src/lightning/utilsPrivate/animation.js +0 -4
- package/src/lightning/utilsPrivate/aria.js +26 -0
- package/src/lightning/utilsPrivate/linkify.js +1 -1
- package/src/lightning/utilsPrivate/utilsPrivate.js +7 -1
- package/src/lightning/datatable/__examples__/basic/fetchDataHelper.js +0 -21
- package/src/lightning/datatable/__examples__/withInfiniteLoading/fetchDataHelper.js +0 -21
- package/src/lightning/datatable/__examples__/withInlineEdit/fetchDataHelper.js +0 -21
- package/src/lightning/datatable/__examples__/withRowActions/fetchDataHelper.js +0 -21
- package/src/lightning/datatable/__examples__/withRowNumbers/fetchDataHelper.js +0 -21
- package/src/lightning/icon/__component__/icon-spirite.spec.js +0 -59
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LightningElement } from 'lwc';
|
|
2
|
-
import
|
|
2
|
+
import generateData from './generateData';
|
|
3
3
|
|
|
4
4
|
const columns = [
|
|
5
5
|
{ label: 'Label', fieldName: 'name' },
|
|
@@ -14,9 +14,8 @@ export default class BasicDatatable extends LightningElement {
|
|
|
14
14
|
columns = columns;
|
|
15
15
|
rowOffset = 0;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.data = await fetchDataHelper({ amountOfRecords: 100 });
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
this.data = generateData({ amountOfRecords: 100 });
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
increaseRowOffset() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div style="height:160px">
|
|
3
3
|
<lightning-datatable
|
|
4
|
+
data-render-mode="default"
|
|
4
5
|
key-field="id"
|
|
5
6
|
columns={columns}
|
|
6
7
|
data={data}
|
|
@@ -11,6 +12,20 @@
|
|
|
11
12
|
is-loading={loading}>
|
|
12
13
|
</lightning-datatable>
|
|
13
14
|
</div>
|
|
15
|
+
<div style="height:160px">
|
|
16
|
+
<lightning-datatable
|
|
17
|
+
data-render-mode="role-based"
|
|
18
|
+
key-field="id"
|
|
19
|
+
columns={columns}
|
|
20
|
+
data={data}
|
|
21
|
+
default-sort-direction={defaultSortDirection}
|
|
22
|
+
sorted-direction={sortDirection}
|
|
23
|
+
sorted-by={sortedBy}
|
|
24
|
+
onsort={onHandleSort}
|
|
25
|
+
is-loading={loading}
|
|
26
|
+
render-mode="role-based">
|
|
27
|
+
</lightning-datatable>
|
|
28
|
+
</div>
|
|
14
29
|
|
|
15
30
|
<lightning-button label="Enable Loading State" onclick={handleLoadingClick}></lightning-button>
|
|
16
31
|
<lightning-button label="Add More Rows" onclick={handleMoreRowsClick}></lightning-button>
|
|
@@ -1,189 +1,214 @@
|
|
|
1
1
|
const Datatable = require('pageobjects/datatable');
|
|
2
2
|
const Button = require('pageobjects/button');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
4
|
+
const tableTypes = {
|
|
5
|
+
default: '[data-render-mode="default"]',
|
|
6
|
+
roleBased: '[data-render-mode="role-based"]',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
describe('Datatable UTAM Page Object Tests', () => {
|
|
10
|
+
Object.keys(tableTypes).forEach((type) => {
|
|
11
|
+
describe(`${type} table`, () => {
|
|
12
|
+
const TABLE_SELECTOR = tableTypes[type];
|
|
13
|
+
|
|
14
|
+
let root;
|
|
15
|
+
|
|
16
|
+
beforeEach(async () => {
|
|
17
|
+
await browser.url('/datatable/utam');
|
|
18
|
+
root = await $('datatable-utam');
|
|
19
|
+
await root.waitForDisplayed();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should get the cell value by row and column index', async () => {
|
|
23
|
+
const datatable = await utam.load(Datatable, {
|
|
24
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const cellValue = await datatable.getCellValueByIndex(1, 2);
|
|
28
|
+
expect(cellValue).toBe('Billy Simmons');
|
|
29
|
+
});
|
|
30
|
+
it('should get the cell value by row index and column label', async () => {
|
|
31
|
+
const datatable = await utam.load(Datatable, {
|
|
32
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const cellValue = await datatable.getCellValueByLabel(2, 'Age');
|
|
36
|
+
expect(cellValue).toBe('35');
|
|
37
|
+
});
|
|
38
|
+
it('should get the number of rows in the table', async () => {
|
|
39
|
+
const datatable = await utam.load(Datatable, {
|
|
40
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const cellValue = await datatable.getNumRows();
|
|
44
|
+
expect(cellValue).toBe(4);
|
|
45
|
+
});
|
|
46
|
+
it('should tell if the table has any rows', async () => {
|
|
47
|
+
const datatable = await utam.load(Datatable, {
|
|
48
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const cellValue = await datatable.hasRows();
|
|
52
|
+
expect(cellValue).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
it('should toggle selection of row - comprehensive', async () => {
|
|
55
|
+
const datatable = await utam.load(Datatable, {
|
|
56
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
for (let i = 1; i <= 4; i++) {
|
|
60
|
+
expect(await datatable.isRowSelected(i)).toBe('false');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
await datatable.toggleRowSelection(1);
|
|
64
|
+
expect(await datatable.isRowSelected(1)).toBe('true');
|
|
65
|
+
[2, 3, 4].forEach(async (i) => {
|
|
66
|
+
expect(await datatable.isRowSelected(i)).toBe('false');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
await datatable.toggleRowSelection(2);
|
|
70
|
+
expect(await datatable.isRowSelected(2)).toBe('true');
|
|
71
|
+
[3, 4].forEach(async (i) => {
|
|
72
|
+
expect(await datatable.isRowSelected(i)).toBe('false');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
await datatable.toggleRowSelection(3);
|
|
76
|
+
expect(await datatable.isRowSelected(3)).toBe('true');
|
|
77
|
+
expect(await datatable.isRowSelected(4)).toBe('false');
|
|
78
|
+
|
|
79
|
+
await datatable.toggleRowSelection(4);
|
|
80
|
+
expect(await datatable.isRowSelected(4)).toBe('true');
|
|
81
|
+
});
|
|
82
|
+
it('should toggle selection of row', async () => {
|
|
83
|
+
const datatable = await utam.load(Datatable, {
|
|
84
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
await datatable.toggleRowSelection(3);
|
|
88
|
+
expect(await datatable.isRowSelected(3)).toBe('true');
|
|
89
|
+
|
|
90
|
+
await datatable.toggleRowSelection(3);
|
|
91
|
+
expect(await datatable.isRowSelected(3)).toBe('false');
|
|
92
|
+
});
|
|
93
|
+
it('should get the number of selected rows when not all rows are selected', async () => {
|
|
94
|
+
const datatable = await utam.load(Datatable, {
|
|
95
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
await datatable.toggleRowSelection(3);
|
|
99
|
+
expect(await datatable.getNumSelectedRows()).toBe(1);
|
|
100
|
+
|
|
101
|
+
await datatable.toggleRowSelection(2);
|
|
102
|
+
expect(await datatable.getNumSelectedRows()).toBe(2);
|
|
103
|
+
});
|
|
104
|
+
it('should get the number of selected rows when all rows are selected', async () => {
|
|
105
|
+
const datatable = await utam.load(Datatable, {
|
|
106
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
await datatable.clickSelectAllCheckbox();
|
|
110
|
+
expect(await datatable.getNumSelectedRows()).toBe(4);
|
|
111
|
+
});
|
|
112
|
+
it('should get the number of columns in the table', async () => {
|
|
113
|
+
const datatable = await utam.load(Datatable, {
|
|
114
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
expect(await datatable.getNumColumns()).toBe(5);
|
|
118
|
+
});
|
|
119
|
+
it('should tell whether or not a column is sortable', async () => {
|
|
120
|
+
const datatable = await utam.load(Datatable, {
|
|
121
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
expect(await datatable.isSortableColumn('Age')).toBe(true);
|
|
125
|
+
|
|
126
|
+
// Need to speak to UTAM (about isPresent) or find a better way to write this method
|
|
127
|
+
// If column is not sortable, the test fails with the error:
|
|
128
|
+
// "Can't find elements with locator 'lightning-primitive-header-factory.slds-is-sortable' inside its scope element."
|
|
129
|
+
// expect(await datatable.isSortableColumn('Name')).toBe(false);
|
|
130
|
+
});
|
|
131
|
+
it('should tell whether or not the row is selectable', async () => {
|
|
132
|
+
const datatable = await utam.load(Datatable, {
|
|
133
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
expect(await datatable.isSelectableRow(1)).toBe(true);
|
|
137
|
+
});
|
|
138
|
+
it('should get the width of a column', async () => {
|
|
139
|
+
const datatable = await utam.load(Datatable, {
|
|
140
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const datatableElement = await root.shadow$(
|
|
144
|
+
'lightning-datatable'
|
|
145
|
+
);
|
|
146
|
+
const columnHeader = await datatableElement.shadow$(
|
|
147
|
+
'[aria-label="Name"]'
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// Remove intermediate white spaces
|
|
151
|
+
let expectedWidth = await columnHeader.getAttribute('style');
|
|
152
|
+
expectedWidth = expectedWidth.replace(/\s/g, '');
|
|
153
|
+
let actualWidth = await datatable.getWidth('Name');
|
|
154
|
+
actualWidth = actualWidth.replace(/\s/g, '');
|
|
155
|
+
|
|
156
|
+
// Using indexOf in case of presence of ';'
|
|
157
|
+
expect(actualWidth.indexOf(expectedWidth) >= 0).toBe(true);
|
|
158
|
+
});
|
|
159
|
+
it('should tell whether or not a column has header actions', async () => {
|
|
160
|
+
const datatable = await utam.load(Datatable, {
|
|
161
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
expect(await datatable.hasHeaderActions('Name')).toBe(true);
|
|
165
|
+
expect(await datatable.hasHeaderActions('Age')).toBe(true);
|
|
166
|
+
// false fails; need to check for true or null; check with UTAM if expected
|
|
167
|
+
expect(await datatable.hasHeaderActions('Email')).toBe(null);
|
|
168
|
+
});
|
|
169
|
+
it('should get the text of the rowheader cell of the specified row', async () => {
|
|
170
|
+
const datatable = await utam.load(Datatable, {
|
|
171
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
expect(await datatable.getRowHeaderText(2)).toBe(
|
|
175
|
+
'Kelsey Denesik'
|
|
176
|
+
);
|
|
177
|
+
});
|
|
178
|
+
it('should click column header of the sortable column', async () => {
|
|
179
|
+
const datatable = await utam.load(Datatable, {
|
|
180
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
let cellValue = await datatable.getCellValueByLabel(1, 'Age');
|
|
184
|
+
expect(cellValue).toBe('40');
|
|
185
|
+
|
|
186
|
+
await datatable.clickSortHeaderButton('Age');
|
|
187
|
+
|
|
188
|
+
cellValue = await datatable.getCellValueByLabel(1, 'Age');
|
|
189
|
+
expect(cellValue).toBe('35');
|
|
190
|
+
});
|
|
191
|
+
it('should tell whether the specified row has row actions or not', async () => {
|
|
192
|
+
const datatable = await utam.load(Datatable, {
|
|
193
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
expect(await datatable.hasRowActionInRow(2)).toBe(true);
|
|
197
|
+
});
|
|
198
|
+
it('should tell whether or not the datatable has the loading indicator visible', async () => {
|
|
199
|
+
const datatable = await utam.load(Datatable, {
|
|
200
|
+
element: await root.shadow$(TABLE_SELECTOR),
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
expect(await datatable.isLoading()).toBe(false);
|
|
204
|
+
|
|
205
|
+
const button = await utam.load(Button, {
|
|
206
|
+
element: await root.shadow$('lightning-button'),
|
|
207
|
+
});
|
|
208
|
+
await button.click();
|
|
209
|
+
|
|
210
|
+
expect(await datatable.isLoading()).toBe(true);
|
|
211
|
+
});
|
|
57
212
|
});
|
|
58
|
-
|
|
59
|
-
await datatable.toggleRowSelection(2);
|
|
60
|
-
expect(await datatable.isRowSelected(2)).toBe('true');
|
|
61
|
-
[3, 4].forEach(async (i) => {
|
|
62
|
-
expect(await datatable.isRowSelected(i)).toBe('false');
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
await datatable.toggleRowSelection(3);
|
|
66
|
-
expect(await datatable.isRowSelected(3)).toBe('true');
|
|
67
|
-
expect(await datatable.isRowSelected(4)).toBe('false');
|
|
68
|
-
|
|
69
|
-
await datatable.toggleRowSelection(4);
|
|
70
|
-
expect(await datatable.isRowSelected(4)).toBe('true');
|
|
71
|
-
});
|
|
72
|
-
it('should toggle selection of row', async () => {
|
|
73
|
-
const datatable = await utam.load(Datatable, {
|
|
74
|
-
element: await root.shadow$('lightning-datatable'),
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
await datatable.toggleRowSelection(3);
|
|
78
|
-
expect(await datatable.isRowSelected(3)).toBe('true');
|
|
79
|
-
|
|
80
|
-
await datatable.toggleRowSelection(3);
|
|
81
|
-
expect(await datatable.isRowSelected(3)).toBe('false');
|
|
82
|
-
});
|
|
83
|
-
it('should get the number of selected rows when not all rows are selected', async () => {
|
|
84
|
-
const datatable = await utam.load(Datatable, {
|
|
85
|
-
element: await root.shadow$('lightning-datatable'),
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
await datatable.toggleRowSelection(3);
|
|
89
|
-
expect(await datatable.getNumSelectedRows()).toBe(1);
|
|
90
|
-
|
|
91
|
-
await datatable.toggleRowSelection(2);
|
|
92
|
-
expect(await datatable.getNumSelectedRows()).toBe(2);
|
|
93
|
-
});
|
|
94
|
-
it('should get the number of selected rows when all rows are selected', async () => {
|
|
95
|
-
const datatable = await utam.load(Datatable, {
|
|
96
|
-
element: await root.shadow$('lightning-datatable'),
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
await datatable.clickSelectAllCheckbox();
|
|
100
|
-
expect(await datatable.getNumSelectedRows()).toBe(4);
|
|
101
|
-
});
|
|
102
|
-
it('should get the number of columns in the table', async () => {
|
|
103
|
-
const datatable = await utam.load(Datatable, {
|
|
104
|
-
element: await root.shadow$('lightning-datatable'),
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
expect(await datatable.getNumColumns()).toBe(5);
|
|
108
|
-
});
|
|
109
|
-
it('should tell whether or not a column is sortable', async () => {
|
|
110
|
-
const datatable = await utam.load(Datatable, {
|
|
111
|
-
element: await root.shadow$('lightning-datatable'),
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
expect(await datatable.isSortableColumn('Age')).toBe(true);
|
|
115
|
-
|
|
116
|
-
// Need to speak to UTAM (about isPresent) or find a better way to write this method
|
|
117
|
-
// If column is not sortable, the test fails with the error:
|
|
118
|
-
// "Can't find elements with locator 'lightning-primitive-header-factory.slds-is-sortable' inside its scope element."
|
|
119
|
-
// expect(await datatable.isSortableColumn('Name')).toBe(false);
|
|
120
|
-
});
|
|
121
|
-
it('should tell whether or not the row is selectable', async () => {
|
|
122
|
-
const datatable = await utam.load(Datatable, {
|
|
123
|
-
element: await root.shadow$('lightning-datatable'),
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
expect(await datatable.isSelectableRow(1)).toBe(true);
|
|
127
|
-
});
|
|
128
|
-
it('should get the width of a column', async () => {
|
|
129
|
-
const datatable = await utam.load(Datatable, {
|
|
130
|
-
element: await root.shadow$('lightning-datatable'),
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
const dt = await root.shadow$('lightning-datatable');
|
|
134
|
-
const columnHeader = await dt.shadow$('thead > tr > th:nth-child(2)');
|
|
135
|
-
const expectedWidth = await columnHeader.getAttribute('style');
|
|
136
|
-
expect(await datatable.getWidth('Name')).toBe(expectedWidth);
|
|
137
|
-
});
|
|
138
|
-
it('should tell whether or not a column has header actions', async () => {
|
|
139
|
-
const datatable = await utam.load(Datatable, {
|
|
140
|
-
element: await root.shadow$('lightning-datatable'),
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
expect(await datatable.hasHeaderActions('Name')).toBe(true);
|
|
144
|
-
expect(await datatable.hasHeaderActions('Age')).toBe(true);
|
|
145
|
-
// false fails; need to check for true or null; check with UTAM if expected
|
|
146
|
-
expect(await datatable.hasHeaderActions('Email')).toBe(null);
|
|
147
|
-
});
|
|
148
|
-
it('should get the text of the rowheader cell of the specified row', async () => {
|
|
149
|
-
const datatable = await utam.load(Datatable, {
|
|
150
|
-
element: await root.shadow$('lightning-datatable'),
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
expect(await datatable.getRowHeaderText(2)).toBe('Kelsey Denesik');
|
|
154
|
-
});
|
|
155
|
-
it('should click column header of the sortable column', async () => {
|
|
156
|
-
const datatable = await utam.load(Datatable, {
|
|
157
|
-
element: await root.shadow$('lightning-datatable'),
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
let cellValue = await datatable.getCellValueByLabel(1, 'Age');
|
|
161
|
-
expect(cellValue).toBe('40');
|
|
162
|
-
|
|
163
|
-
await datatable.clickSortHeaderButton('Age');
|
|
164
|
-
|
|
165
|
-
cellValue = await datatable.getCellValueByLabel(1, 'Age');
|
|
166
|
-
expect(cellValue).toBe('35');
|
|
167
|
-
});
|
|
168
|
-
it('should tell whether the specified row has row actions or not', async () => {
|
|
169
|
-
const datatable = await utam.load(Datatable, {
|
|
170
|
-
element: await root.shadow$('lightning-datatable'),
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
expect(await datatable.hasRowActionInRow(2)).toBe(true);
|
|
174
|
-
});
|
|
175
|
-
it('should tell whether or not the datatable has the loading indicator visible', async () => {
|
|
176
|
-
const datatable = await utam.load(Datatable, {
|
|
177
|
-
element: await root.shadow$('lightning-datatable'),
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
expect(await datatable.isLoading()).toBe(false);
|
|
181
|
-
|
|
182
|
-
const button = await utam.load(Button, {
|
|
183
|
-
element: await root.shadow$('lightning-button'),
|
|
184
|
-
});
|
|
185
|
-
await button.click();
|
|
186
|
-
|
|
187
|
-
expect(await datatable.isLoading()).toBe(true);
|
|
188
213
|
});
|
|
189
214
|
});
|
|
@@ -211,7 +211,6 @@ export default class LightningDatatable extends LightningElement {
|
|
|
211
211
|
_privateWidthObserver = null; // Instance of LightningDatatableResizeObserver
|
|
212
212
|
_renderMode = 'table';
|
|
213
213
|
_shouldResetFocus = false; // used to ensure focus isn't lost from changes in renderedRows
|
|
214
|
-
_shouldResetHeights = false;
|
|
215
214
|
_suppressBottomBar = false;
|
|
216
215
|
|
|
217
216
|
/************************* PUBLIC PROPERTIES *************************/
|
|
@@ -514,8 +513,8 @@ export default class LightningDatatable extends LightningElement {
|
|
|
514
513
|
*/
|
|
515
514
|
|
|
516
515
|
/**
|
|
517
|
-
* Reserved for internal use.
|
|
518
516
|
* Enables and configures advanced rendering modes.
|
|
517
|
+
* It supports properties 'bufferSize', 'fixedHeight', and 'rowHeight'.
|
|
519
518
|
*
|
|
520
519
|
* @type {RenderManagerConfig} value - config object for datatable rendering
|
|
521
520
|
*/
|
|
@@ -1157,7 +1156,12 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1157
1156
|
if (this._shouldResetFocus) {
|
|
1158
1157
|
// since focus is now getting reset, can change this back to false
|
|
1159
1158
|
this._shouldResetFocus = false;
|
|
1160
|
-
|
|
1159
|
+
// don't return focus to active cell when inline edit panel is open
|
|
1160
|
+
if (
|
|
1161
|
+
state.activeCell &&
|
|
1162
|
+
state.activeCell.focused &&
|
|
1163
|
+
!state.inlineEdit.isPanelVisible
|
|
1164
|
+
) {
|
|
1161
1165
|
const cellElement = getActiveCellElement(template, state);
|
|
1162
1166
|
if (
|
|
1163
1167
|
cellElement &&
|
|
@@ -1380,7 +1384,7 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1380
1384
|
handleResizeEnd(event) {
|
|
1381
1385
|
event.stopPropagation();
|
|
1382
1386
|
this._isResizing = false;
|
|
1383
|
-
this.
|
|
1387
|
+
this.state.shouldResetHeights = true;
|
|
1384
1388
|
}
|
|
1385
1389
|
|
|
1386
1390
|
/**
|
|
@@ -1465,7 +1469,9 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1465
1469
|
*/
|
|
1466
1470
|
handleTableFocusOut(event) {
|
|
1467
1471
|
handleDatatableFocusOut.call(this, event);
|
|
1468
|
-
this.state.activeCell
|
|
1472
|
+
if (this.state.activeCell) {
|
|
1473
|
+
this.state.activeCell.focused = this._shouldResetFocus;
|
|
1474
|
+
}
|
|
1469
1475
|
}
|
|
1470
1476
|
|
|
1471
1477
|
/**
|
|
@@ -1650,9 +1656,9 @@ export default class LightningDatatable extends LightningElement {
|
|
|
1650
1656
|
|
|
1651
1657
|
// no need to handle other virtualization/row height logic
|
|
1652
1658
|
// if heights need to be reset
|
|
1653
|
-
if (this.
|
|
1659
|
+
if (this.state.shouldResetHeights) {
|
|
1654
1660
|
resetRowHeights(state);
|
|
1655
|
-
this.
|
|
1661
|
+
this.state.shouldResetHeights = false;
|
|
1656
1662
|
} else if (virtualizedRows && !state.fixedHeight) {
|
|
1657
1663
|
// if row heights aren't fixed, we need to update items
|
|
1658
1664
|
// in state to know where rows should be positioned
|
|
@@ -317,11 +317,6 @@ function openInlineEdit(dt, target) {
|
|
|
317
317
|
|
|
318
318
|
const { rowKeyValue, colKeyValue } = target;
|
|
319
319
|
|
|
320
|
-
// ensure that focus remains on inline edit panel instead of active cell
|
|
321
|
-
if (state.activeCell) {
|
|
322
|
-
state.activeCell.focused = false;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
320
|
inlineEdit.isPanelVisible = true;
|
|
326
321
|
inlineEdit.rowKeyValue = rowKeyValue;
|
|
327
322
|
inlineEdit.colKeyValue = colKeyValue;
|
|
@@ -14,8 +14,10 @@ export function getDirtyValueFromCell(state, rowKeyValue, colKeyValue) {
|
|
|
14
14
|
|
|
15
15
|
if (
|
|
16
16
|
dirtyValues &&
|
|
17
|
-
|
|
18
|
-
dirtyValues
|
|
17
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
18
|
+
dirtyValues.hasOwnProperty(rowKeyValue) &&
|
|
19
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
20
|
+
dirtyValues[rowKeyValue].hasOwnProperty(colKeyValue)
|
|
19
21
|
) {
|
|
20
22
|
return dirtyValues[rowKeyValue][colKeyValue];
|
|
21
23
|
}
|
|
@@ -12,6 +12,8 @@ import { isCellEditable, getRowByKey } from './rows';
|
|
|
12
12
|
import { isRTL, getShadowActiveElements } from 'lightning/utilsPrivate';
|
|
13
13
|
import { findFirstVisibleIndex } from './virtualization';
|
|
14
14
|
|
|
15
|
+
import { escapeDoubleQuotes } from './utils';
|
|
16
|
+
|
|
15
17
|
// Indicator/flag for a header row
|
|
16
18
|
const HEADER_ROW = 'HEADER';
|
|
17
19
|
|
|
@@ -799,7 +801,13 @@ function stillValidActiveCell(state) {
|
|
|
799
801
|
const {
|
|
800
802
|
activeCell: { rowKeyValue, colKeyValue },
|
|
801
803
|
} = state;
|
|
804
|
+
|
|
805
|
+
let sortableColumns = state.columns.filter((column) => column.sortable);
|
|
806
|
+
|
|
802
807
|
if (rowKeyValue === HEADER_ROW) {
|
|
808
|
+
if (state.rows.length && sortableColumns.length === 0) {
|
|
809
|
+
return false;
|
|
810
|
+
}
|
|
803
811
|
return state.headerIndexes[colKeyValue] !== undefined;
|
|
804
812
|
}
|
|
805
813
|
return !!(
|
|
@@ -830,9 +838,7 @@ export function setFocusActiveCell(
|
|
|
830
838
|
const { keyboardMode } = state;
|
|
831
839
|
const { rowIndex, colIndex } = getIndexesActiveCell(state);
|
|
832
840
|
|
|
833
|
-
|
|
834
|
-
state.activeCell.focused =
|
|
835
|
-
!(info && isActiveCellEditable(state)) && isActiveCellValid(state);
|
|
841
|
+
state.activeCell.focused = !(info && isActiveCellValid(state));
|
|
836
842
|
updateTabIndex(state, rowIndex, colIndex);
|
|
837
843
|
|
|
838
844
|
let cellElement = getActiveCellElement(template, state);
|
|
@@ -1314,13 +1320,15 @@ function isHeaderRow(rowIndex) {
|
|
|
1314
1320
|
}
|
|
1315
1321
|
|
|
1316
1322
|
export function getDataRow(rowKeyValue) {
|
|
1317
|
-
return `[data-row-key-value="${rowKeyValue}"]`;
|
|
1323
|
+
return `[data-row-key-value="${escapeDoubleQuotes(rowKeyValue)}"]`;
|
|
1318
1324
|
}
|
|
1319
1325
|
|
|
1320
1326
|
export function getCellElementByKeys(template, rowKeyValue, colKeyValue) {
|
|
1321
1327
|
const selector = `${getDataRow(
|
|
1322
1328
|
rowKeyValue
|
|
1323
|
-
)} [data-col-key-value="${
|
|
1329
|
+
)} [data-col-key-value="${escapeDoubleQuotes(
|
|
1330
|
+
colKeyValue
|
|
1331
|
+
)}"] > :first-child`;
|
|
1324
1332
|
return template.querySelector(selector);
|
|
1325
1333
|
}
|
|
1326
1334
|
|
|
@@ -430,7 +430,7 @@ export function setSelectedRowsKeys(state, value) {
|
|
|
430
430
|
export function syncSelectedRowsKeys(state, selectedRows) {
|
|
431
431
|
let changed = false;
|
|
432
432
|
const { selectedRowsKeys, keyField } = state;
|
|
433
|
-
|
|
433
|
+
const maxRowSelection = getMaxRowSelection(state) || getRowsTotal(state);
|
|
434
434
|
if (Object.keys(selectedRowsKeys).length !== selectedRows.length) {
|
|
435
435
|
changed = true;
|
|
436
436
|
state.selectedRowsKeys = updateSelectedRowsKeysFromSelectedRows(
|
|
@@ -446,7 +446,13 @@ export function syncSelectedRowsKeys(state, selectedRows) {
|
|
|
446
446
|
);
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
|
|
449
|
+
if (maxRowSelection > 1 && changed) {
|
|
450
|
+
if (selectedRows.length < maxRowSelection) {
|
|
451
|
+
markDeselectedRowEnabled(state);
|
|
452
|
+
} else {
|
|
453
|
+
markDeselectedRowDisabled(state);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
450
456
|
updateBulkSelectionState(state);
|
|
451
457
|
|
|
452
458
|
return {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<!-- empty since keyField wasn't provided TODO: Why is this here? Test and remove! -->
|
|
41
41
|
</template>
|
|
42
42
|
<template if:true={hasValidKeyField}>
|
|
43
|
-
<thead>
|
|
43
|
+
<thead data-rowgroup-header>
|
|
44
44
|
<!-- Column Header Row -->
|
|
45
45
|
<tr class="slds-line-height_reset"
|
|
46
46
|
data-row-key-value="HEADER"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
</template>
|
|
102
102
|
</tr>
|
|
103
103
|
</thead>
|
|
104
|
-
<tbody style={computedTbodyStyle}>
|
|
104
|
+
<tbody data-rowgroup-body style={computedTbodyStyle}>
|
|
105
105
|
<template for:each={renderedRows} for:item="row" for:index="rowIndex">
|
|
106
106
|
<!-- Data Rows -->
|
|
107
107
|
<tr class={row.classnames}
|
|
@@ -20,6 +20,17 @@ const CLASSSET_PROTOTYPE = {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* function for escaping double quotes, later can be
|
|
25
|
+
* extended in future for any other usecase
|
|
26
|
+
*/
|
|
27
|
+
export function escapeDoubleQuotes(value) {
|
|
28
|
+
if (typeof value == 'string') {
|
|
29
|
+
return value.replace(/"/g, '\\"');
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
|
|
23
34
|
/**
|
|
24
35
|
* Determines if a given value is object-like.
|
|
25
36
|
*
|