polaris_view_components 1.0.1 → 1.2.0
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.
- checksums.yaml +4 -4
- data/app/assets/icons/polaris/AbandonedCartFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/AbandonedCartMajor.svg +1 -1
- data/app/assets/icons/polaris/AccessibilityMajor.svg +1 -1
- data/app/assets/icons/polaris/ActivitiesMajor.svg +1 -1
- data/app/assets/icons/polaris/AddCodeMajor.svg +1 -1
- data/app/assets/icons/polaris/AddImageMajor.svg +1 -1
- data/app/assets/icons/polaris/AddMajor.svg +1 -1
- data/app/assets/icons/polaris/AddNoteMajor.svg +1 -1
- data/app/assets/icons/polaris/AddProductMajor.svg +1 -1
- data/app/assets/icons/polaris/AdjustMinor.svg +1 -1
- data/app/assets/icons/polaris/AffiliateMajor.svg +1 -1
- data/app/assets/icons/polaris/AlertMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsBarHorizontalMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsBarStackedMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsCohortMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsDonutMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/AnalyticsFunnelMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsLineMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsMajor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsMinor.svg +1 -1
- data/app/assets/icons/polaris/AnalyticsTableMinor.svg +1 -1
- data/app/assets/icons/polaris/AnyClickModelMinor.svg +1 -1
- data/app/assets/icons/polaris/AppExtensionMinor.svg +1 -1
- data/app/assets/icons/polaris/AppsFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/AppsMajor.svg +1 -1
- data/app/assets/icons/polaris/AppsMinor.svg +1 -1
- data/app/assets/icons/polaris/ArchiveMajor.svg +1 -1
- data/app/assets/icons/polaris/ArchiveMinor.svg +1 -1
- data/app/assets/icons/polaris/ArrowDownMinor.svg +1 -1
- data/app/assets/icons/polaris/ArrowLeftMinor.svg +1 -1
- data/app/assets/icons/polaris/ArrowRightMinor.svg +1 -1
- data/app/assets/icons/polaris/ArrowUpMinor.svg +1 -1
- data/app/assets/icons/polaris/AttachmentFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/AttachmentMajor.svg +1 -1
- data/app/assets/icons/polaris/AutomationFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/AutomationMajor.svg +1 -1
- data/app/assets/icons/polaris/BackspaceMajor.svg +1 -1
- data/app/assets/icons/polaris/BalanceFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BalanceMajor.svg +1 -1
- data/app/assets/icons/polaris/BankFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BankMajor.svg +1 -1
- data/app/assets/icons/polaris/BarcodeMajor.svg +1 -1
- data/app/assets/icons/polaris/BehaviorFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BehaviorMajor.svg +1 -1
- data/app/assets/icons/polaris/BehaviorMinor.svg +1 -1
- data/app/assets/icons/polaris/BillingStatementDollarFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementDollarMajor.svg +1 -1
- data/app/assets/icons/polaris/BillingStatementEuroFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementEuroMajor.svg +1 -1
- data/app/assets/icons/polaris/BillingStatementPoundFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementPoundMajor.svg +1 -1
- data/app/assets/icons/polaris/BillingStatementRupeeFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementRupeeMajor.svg +1 -1
- data/app/assets/icons/polaris/BillingStatementYenFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementYenMajor.svg +1 -1
- data/app/assets/icons/polaris/BlockMinor.svg +1 -1
- data/app/assets/icons/polaris/BlockquoteMajor.svg +1 -1
- data/app/assets/icons/polaris/BlogMajor.svg +1 -1
- data/app/assets/icons/polaris/BoldMajor.svg +1 -0
- data/app/assets/icons/polaris/BoldMinor.svg +1 -0
- data/app/assets/icons/polaris/BugMajor.svg +1 -1
- data/app/assets/icons/polaris/ButtonCornerPillMajor.svg +1 -1
- data/app/assets/icons/polaris/ButtonCornerRoundedMajor.svg +1 -1
- data/app/assets/icons/polaris/ButtonCornerSquareMajor.svg +1 -1
- data/app/assets/icons/polaris/ButtonMinor.svg +1 -1
- data/app/assets/icons/polaris/BuyButtonButtonLayoutMajor.svg +1 -1
- data/app/assets/icons/polaris/BuyButtonHorizontalLayoutMajor.svg +1 -1
- data/app/assets/icons/polaris/BuyButtonMajor.svg +1 -1
- data/app/assets/icons/polaris/BuyButtonVerticalLayoutMajor.svg +1 -1
- data/app/assets/icons/polaris/CalendarMajor.svg +1 -1
- data/app/assets/icons/polaris/CalendarMinor.svg +1 -1
- data/app/assets/icons/polaris/CalendarTickMajor.svg +1 -1
- data/app/assets/icons/polaris/CalendarTimeMinor.svg +1 -1
- data/app/assets/icons/polaris/CameraMajor.svg +1 -1
- data/app/assets/icons/polaris/CancelMajor.svg +1 -1
- data/app/assets/icons/polaris/CancelMinor.svg +1 -1
- data/app/assets/icons/polaris/CancelSmallMinor.svg +1 -1
- data/app/assets/icons/polaris/CapitalFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/CapitalMajor.svg +1 -1
- data/app/assets/icons/polaris/CapturePaymentMinor.svg +1 -1
- data/app/assets/icons/polaris/CardReaderChipMajor.svg +1 -1
- data/app/assets/icons/polaris/CardReaderMajor.svg +1 -1
- data/app/assets/icons/polaris/CardReaderTapMajor.svg +1 -1
- data/app/assets/icons/polaris/CaretDownMinor.svg +1 -1
- data/app/assets/icons/polaris/CaretUpMinor.svg +1 -1
- data/app/assets/icons/polaris/CartDownFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/CartDownMajor.svg +1 -1
- data/app/assets/icons/polaris/CartFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/CartMajor.svg +1 -1
- data/app/assets/icons/polaris/CartUpMajor.svg +1 -1
- data/app/assets/icons/polaris/CashDollarFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/CashDollarMajor.svg +1 -1
- data/app/assets/icons/polaris/CashDollarMinor.svg +1 -1
- data/app/assets/icons/polaris/CashEuroMajor.svg +1 -1
- data/app/assets/icons/polaris/CashPoundMajor.svg +1 -1
- data/app/assets/icons/polaris/CashRupeeMajor.svg +1 -1
- data/app/assets/icons/polaris/CashYenMajor.svg +1 -1
- data/app/assets/icons/polaris/CategoriesMajor.svg +1 -1
- data/app/assets/icons/polaris/ChannelsMajor.svg +1 -1
- data/app/assets/icons/polaris/ChatMajor.svg +1 -1
- data/app/assets/icons/polaris/ChecklistAlternateMajor.svg +1 -1
- data/app/assets/icons/polaris/ChecklistMajor.svg +1 -1
- data/app/assets/icons/polaris/CheckoutMajor.svg +1 -1
- data/app/assets/icons/polaris/ChevronDownMinor.svg +1 -1
- data/app/assets/icons/polaris/ChevronLeftMinor.svg +1 -1
- data/app/assets/icons/polaris/ChevronRightMinor.svg +1 -1
- data/app/assets/icons/polaris/ChevronUpMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleAlertMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleCancelMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleCancelMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleChevronDownMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleChevronLeftMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleChevronRightMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleChevronUpMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleDisableMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleDisabledMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleDotsMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleDownMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleInformationMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleLeftMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleMinusMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleMinusMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleMinusOutlineMinor.svg +1 -1
- data/app/assets/icons/polaris/CirclePlusMajor.svg +1 -1
- data/app/assets/icons/polaris/CirclePlusMinor.svg +1 -1
- data/app/assets/icons/polaris/CirclePlusOutlineMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleRightMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleTickMajor.svg +1 -1
- data/app/assets/icons/polaris/CircleTickMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleTickOutlineMinor.svg +1 -1
- data/app/assets/icons/polaris/CircleUpMajor.svg +1 -1
- data/app/assets/icons/polaris/ClipboardMinor.svg +1 -1
- data/app/assets/icons/polaris/ClockMajor.svg +1 -1
- data/app/assets/icons/polaris/ClockMinor.svg +1 -1
- data/app/assets/icons/polaris/CodeMajor.svg +1 -1
- data/app/assets/icons/polaris/CodeMinor.svg +1 -1
- data/app/assets/icons/polaris/CollectionReferenceMinor.svg +1 -1
- data/app/assets/icons/polaris/CollectionsFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/CollectionsMajor.svg +1 -1
- data/app/assets/icons/polaris/ColorNoneMinor.svg +1 -1
- data/app/assets/icons/polaris/ColorsMajor.svg +1 -1
- data/app/assets/icons/polaris/Column1Major.svg +1 -1
- data/app/assets/icons/polaris/ColumnWithTextMajor.svg +1 -1
- data/app/assets/icons/polaris/Columns2Major.svg +1 -1
- data/app/assets/icons/polaris/Columns3Major.svg +1 -1
- data/app/assets/icons/polaris/Columns3Minor.svg +1 -1
- data/app/assets/icons/polaris/ComposeMajor.svg +1 -1
- data/app/assets/icons/polaris/ConfettiMajor.svg +1 -1
- data/app/assets/icons/polaris/ConnectMinor.svg +1 -1
- data/app/assets/icons/polaris/ContentFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/ContentMinor.svg +1 -1
- data/app/assets/icons/polaris/ConversationMinor.svg +1 -1
- data/app/assets/icons/polaris/CreditCardCancelMajor.svg +1 -1
- data/app/assets/icons/polaris/CreditCardMajor.svg +1 -1
- data/app/assets/icons/polaris/CreditCardPercentMajor.svg +1 -1
- data/app/assets/icons/polaris/CreditCardSecureMajor.svg +1 -1
- data/app/assets/icons/polaris/CurrencyConvertMinor.svg +1 -1
- data/app/assets/icons/polaris/CustomerMinusMajor.svg +1 -1
- data/app/assets/icons/polaris/CustomerPlusMajor.svg +1 -1
- data/app/assets/icons/polaris/CustomersFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/CustomersMajor.svg +1 -1
- data/app/assets/icons/polaris/CustomersMinor.svg +1 -1
- data/app/assets/icons/polaris/DataDrivenModelMinor.svg +1 -1
- data/app/assets/icons/polaris/DataVisualizationMajor.svg +1 -1
- data/app/assets/icons/polaris/DecimalMinor.svg +1 -1
- data/app/assets/icons/polaris/DeleteMajor.svg +1 -1
- data/app/assets/icons/polaris/DeleteMinor.svg +1 -1
- data/app/assets/icons/polaris/DesktopMajor.svg +1 -1
- data/app/assets/icons/polaris/DetailedPopUpMajor.svg +1 -1
- data/app/assets/icons/polaris/DiamondAlertMajor.svg +1 -1
- data/app/assets/icons/polaris/DiamondAlertMinor.svg +1 -1
- data/app/assets/icons/polaris/DigitalMediaReceiverMajor.svg +1 -1
- data/app/assets/icons/polaris/DiscountAutomaticMajor.svg +1 -1
- data/app/assets/icons/polaris/DiscountCodeMajor.svg +1 -1
- data/app/assets/icons/polaris/DiscountsFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/DiscountsMajor.svg +1 -1
- data/app/assets/icons/polaris/DiscountsMinor.svg +1 -1
- data/app/assets/icons/polaris/DisputeMinor.svg +1 -1
- data/app/assets/icons/polaris/DnsSettingsMajor.svg +1 -1
- data/app/assets/icons/polaris/DockFloatingMajor.svg +1 -1
- data/app/assets/icons/polaris/DockSideMajor.svg +1 -1
- data/app/assets/icons/polaris/DomainNewMajor.svg +1 -1
- data/app/assets/icons/polaris/DomainRedirectMinor.svg +1 -1
- data/app/assets/icons/polaris/DomainsFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/DomainsMajor.svg +1 -1
- data/app/assets/icons/polaris/DraftOrdersFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/DraftOrdersMajor.svg +1 -1
- data/app/assets/icons/polaris/DragDropMajor.svg +1 -1
- data/app/assets/icons/polaris/DragHandleMinor.svg +1 -1
- data/app/assets/icons/polaris/DropdownMinor.svg +1 -1
- data/app/assets/icons/polaris/DuplicateMinor.svg +1 -1
- data/app/assets/icons/polaris/DynamicSourceMajor.svg +1 -1
- data/app/assets/icons/polaris/DynamicSourceMinor.svg +1 -1
- data/app/assets/icons/polaris/EditMajor.svg +1 -1
- data/app/assets/icons/polaris/EditMinor.svg +1 -1
- data/app/assets/icons/polaris/EmailMajor.svg +1 -1
- data/app/assets/icons/polaris/EmailNewsletterMajor.svg +1 -1
- data/app/assets/icons/polaris/EmbedMinor.svg +1 -1
- data/app/assets/icons/polaris/EnableSelectionMinor.svg +1 -1
- data/app/assets/icons/polaris/EnterMajor.svg +1 -1
- data/app/assets/icons/polaris/EnvelopeMajor.svg +1 -1
- data/app/assets/icons/polaris/ExchangeMajor.svg +1 -1
- data/app/assets/icons/polaris/ExistingInventoryMajor.svg +1 -1
- data/app/assets/icons/polaris/ExitMajor.svg +1 -1
- data/app/assets/icons/polaris/ExploreImagesMajor.svg +1 -1
- data/app/assets/icons/polaris/ExportMinor.svg +1 -1
- data/app/assets/icons/polaris/ExtendMajor.svg +1 -1
- data/app/assets/icons/polaris/ExtendMinor.svg +1 -1
- data/app/assets/icons/polaris/ExternalMinor.svg +1 -1
- data/app/assets/icons/polaris/ExternalSmallMinor.svg +1 -1
- data/app/assets/icons/polaris/EyeDropperMinor.svg +1 -1
- data/app/assets/icons/polaris/FacebookMinor.svg +1 -0
- data/app/assets/icons/polaris/FaviconMajor.svg +1 -1
- data/app/assets/icons/polaris/FavoriteMajor.svg +1 -1
- data/app/assets/icons/polaris/FeaturedCollectionMajor.svg +1 -1
- data/app/assets/icons/polaris/FeaturedContentMajor.svg +1 -1
- data/app/assets/icons/polaris/FileFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/FileMinor.svg +1 -1
- data/app/assets/icons/polaris/FilterMajor.svg +1 -1
- data/app/assets/icons/polaris/FilterMinor.svg +1 -1
- data/app/assets/icons/polaris/FinancesMajor.svg +1 -1
- data/app/assets/icons/polaris/FinancesMinor.svg +1 -1
- data/app/assets/icons/polaris/FirstClickModelMinor.svg +1 -1
- data/app/assets/icons/polaris/FirstOrderMajor.svg +1 -1
- data/app/assets/icons/polaris/FirstVisitMajor.svg +1 -1
- data/app/assets/icons/polaris/FlagMajor.svg +1 -1
- data/app/assets/icons/polaris/FlipCameraMajor.svg +1 -1
- data/app/assets/icons/polaris/FolderDownMajor.svg +1 -1
- data/app/assets/icons/polaris/FolderMajor.svg +1 -1
- data/app/assets/icons/polaris/FolderMinusMajor.svg +1 -1
- data/app/assets/icons/polaris/FolderPlusMajor.svg +1 -1
- data/app/assets/icons/polaris/FolderUpMajor.svg +1 -1
- data/app/assets/icons/polaris/FollowUpEmailMajor.svg +1 -1
- data/app/assets/icons/polaris/FoodMajor.svg +1 -1
- data/app/assets/icons/polaris/FooterMajor.svg +1 -1
- data/app/assets/icons/polaris/FormsMajor.svg +1 -1
- data/app/assets/icons/polaris/FraudProtectMajor.svg +1 -1
- data/app/assets/icons/polaris/FraudProtectMinor.svg +1 -1
- data/app/assets/icons/polaris/FraudProtectPendingMajor.svg +1 -1
- data/app/assets/icons/polaris/FraudProtectPendingMinor.svg +1 -1
- data/app/assets/icons/polaris/FraudProtectUnprotectedMajor.svg +1 -1
- data/app/assets/icons/polaris/FraudProtectUnprotectedMinor.svg +1 -1
- data/app/assets/icons/polaris/FulfillmentFulfilledMajor.svg +1 -1
- data/app/assets/icons/polaris/FulfillmentOnHoldMajor.svg +1 -1
- data/app/assets/icons/polaris/GamesConsoleMajor.svg +1 -1
- data/app/assets/icons/polaris/GaugeMajor.svg +1 -0
- data/app/assets/icons/polaris/GaugeMinor.svg +1 -0
- data/app/assets/icons/polaris/GiftCardFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/GiftCardMajor.svg +1 -1
- data/app/assets/icons/polaris/GiftCardMinor.svg +1 -1
- data/app/assets/icons/polaris/GlobeMajor.svg +1 -1
- data/app/assets/icons/polaris/GlobeMinor.svg +1 -1
- data/app/assets/icons/polaris/GrammarMajor.svg +1 -1
- data/app/assets/icons/polaris/HashtagMajor.svg +1 -1
- data/app/assets/icons/polaris/HashtagMinor.svg +1 -1
- data/app/assets/icons/polaris/HeaderMajor.svg +1 -1
- data/app/assets/icons/polaris/HeartMajor.svg +1 -1
- data/app/assets/icons/polaris/HideKeyboardMajor.svg +1 -1
- data/app/assets/icons/polaris/HideMinor.svg +1 -1
- data/app/assets/icons/polaris/HintMajor.svg +1 -1
- data/app/assets/icons/polaris/HomeFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/HomeMajor.svg +1 -1
- data/app/assets/icons/polaris/HomeMinor.svg +1 -1
- data/app/assets/icons/polaris/HorizontalDotsMinor.svg +1 -1
- data/app/assets/icons/polaris/IconsFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/IconsMajor.svg +1 -1
- data/app/assets/icons/polaris/IdentityCardFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/IdentityCardMajor.svg +1 -1
- data/app/assets/icons/polaris/IllustrationMajor.svg +1 -1
- data/app/assets/icons/polaris/ImageAltMajor.svg +1 -1
- data/app/assets/icons/polaris/ImageAltMinor.svg +1 -1
- data/app/assets/icons/polaris/ImageMajor.svg +1 -1
- data/app/assets/icons/polaris/ImageWithTextMajor.svg +1 -1
- data/app/assets/icons/polaris/ImageWithTextOverlayMajor.svg +1 -1
- data/app/assets/icons/polaris/ImagesMajor.svg +1 -1
- data/app/assets/icons/polaris/ImportMinor.svg +1 -1
- data/app/assets/icons/polaris/ImportStoreMajor.svg +1 -1
- data/app/assets/icons/polaris/InactiveLocationMajor.svg +1 -1
- data/app/assets/icons/polaris/InactiveLocationMinor.svg +1 -1
- data/app/assets/icons/polaris/IncomingMajor.svg +1 -1
- data/app/assets/icons/polaris/IndentMajor.svg +1 -0
- data/app/assets/icons/polaris/IndentMinor.svg +1 -0
- data/app/assets/icons/polaris/InfoMinor.svg +1 -1
- data/app/assets/icons/polaris/InsertDynamicSourceMajor.svg +1 -1
- data/app/assets/icons/polaris/InsertDynamicSourceMinor.svg +1 -1
- data/app/assets/icons/polaris/InstagramMinor.svg +1 -0
- data/app/assets/icons/polaris/InstallMinor.svg +1 -1
- data/app/assets/icons/polaris/InventoryFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/InventoryMajor.svg +1 -1
- data/app/assets/icons/polaris/InviteMinor.svg +1 -1
- data/app/assets/icons/polaris/IqMajor.svg +1 -1
- data/app/assets/icons/polaris/ItalicMajor.svg +1 -0
- data/app/assets/icons/polaris/ItalicMinor.svg +1 -0
- data/app/assets/icons/polaris/JobsFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/JobsMajor.svg +1 -1
- data/app/assets/icons/polaris/KeyMajor.svg +1 -1
- data/app/assets/icons/polaris/KeyboardMajor.svg +1 -1
- data/app/assets/icons/polaris/KeyboardMinor.svg +1 -1
- data/app/assets/icons/polaris/LabelPrinterMajor.svg +1 -1
- data/app/assets/icons/polaris/LandingPageMajor.svg +1 -1
- data/app/assets/icons/polaris/LanguageFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/LanguageMinor.svg +1 -1
- data/app/assets/icons/polaris/LastClickModelMinor.svg +1 -1
- data/app/assets/icons/polaris/LastNonDirectClickModelMinor.svg +1 -1
- data/app/assets/icons/polaris/LegalFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/LegalMajor.svg +1 -1
- data/app/assets/icons/polaris/LinearModelMinor.svg +1 -1
- data/app/assets/icons/polaris/LinkMinor.svg +1 -1
- data/app/assets/icons/polaris/ListFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/ListMajor.svg +1 -1
- data/app/assets/icons/polaris/ListMinor.svg +1 -1
- data/app/assets/icons/polaris/LiveViewFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/LiveViewMajor.svg +1 -1
- data/app/assets/icons/polaris/LocationFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/LocationMajor.svg +1 -1
- data/app/assets/icons/polaris/LocationsMinor.svg +1 -1
- data/app/assets/icons/polaris/LockFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/LockMajor.svg +1 -1
- data/app/assets/icons/polaris/LockMinor.svg +1 -1
- data/app/assets/icons/polaris/LogOutMinor.svg +1 -1
- data/app/assets/icons/polaris/LogoBlockMajor.svg +1 -1
- data/app/assets/icons/polaris/MagicMajor.svg +1 -1
- data/app/assets/icons/polaris/MagicMinor.svg +1 -1
- data/app/assets/icons/polaris/ManagedStoreMajor.svg +1 -1
- data/app/assets/icons/polaris/MarkFulfilledMinor.svg +1 -1
- data/app/assets/icons/polaris/MarkPaidMinor.svg +1 -1
- data/app/assets/icons/polaris/MarketingFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/MarketingMajor.svg +1 -1
- data/app/assets/icons/polaris/MarketingMinor.svg +1 -1
- data/app/assets/icons/polaris/MarketsFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/MarketsMajor.svg +1 -1
- data/app/assets/icons/polaris/MaximizeMajor.svg +1 -1
- data/app/assets/icons/polaris/MaximizeMinor.svg +1 -1
- data/app/assets/icons/polaris/MeasurementMinor.svg +1 -1
- data/app/assets/icons/polaris/MentionMajor.svg +1 -1
- data/app/assets/icons/polaris/MergeMinor.svg +1 -1
- data/app/assets/icons/polaris/MetafieldsFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/MetafieldsMajor.svg +1 -1
- data/app/assets/icons/polaris/MetafieldsMinor.svg +1 -1
- data/app/assets/icons/polaris/MetaobjectMinor.svg +1 -1
- data/app/assets/icons/polaris/MetaobjectReferenceMinor.svg +1 -1
- data/app/assets/icons/polaris/MicrophoneMajor.svg +1 -1
- data/app/assets/icons/polaris/MinimizeMajor.svg +1 -1
- data/app/assets/icons/polaris/MinimizeMinor.svg +1 -1
- data/app/assets/icons/polaris/MinusMajor.svg +1 -1
- data/app/assets/icons/polaris/MinusMinor.svg +1 -1
- data/app/assets/icons/polaris/MobileAcceptMajor.svg +1 -1
- data/app/assets/icons/polaris/MobileBackArrowMajor.svg +1 -1
- data/app/assets/icons/polaris/MobileCancelMajor.svg +1 -1
- data/app/assets/icons/polaris/MobileChevronMajor.svg +1 -1
- data/app/assets/icons/polaris/MobileHamburgerMajor.svg +1 -1
- data/app/assets/icons/polaris/MobileHorizontalDotsMajor.svg +1 -1
- data/app/assets/icons/polaris/MobileMajor.svg +1 -1
- data/app/assets/icons/polaris/MobilePlusMajor.svg +1 -1
- data/app/assets/icons/polaris/MobileVerticalDotsMajor.svg +1 -1
- data/app/assets/icons/polaris/MonerisMajor.svg +1 -1
- data/app/assets/icons/polaris/MoneyFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/MoneyMinor.svg +1 -1
- data/app/assets/icons/polaris/NatureMajor.svg +1 -1
- data/app/assets/icons/polaris/NavigationMajor.svg +1 -1
- data/app/assets/icons/polaris/NoteMajor.svg +1 -1
- data/app/assets/icons/polaris/NoteMinor.svg +1 -1
- data/app/assets/icons/polaris/NotificationFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/NotificationMajor.svg +1 -1
- data/app/assets/icons/polaris/OnlineStoreMajor.svg +1 -1
- data/app/assets/icons/polaris/OnlineStoreMinor.svg +1 -1
- data/app/assets/icons/polaris/OrderStatusMinor.svg +1 -1
- data/app/assets/icons/polaris/OrderedListMajor.svg +1 -0
- data/app/assets/icons/polaris/OrderedListMinor.svg +1 -0
- data/app/assets/icons/polaris/OrdersFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/OrdersMajor.svg +1 -1
- data/app/assets/icons/polaris/OrdersMinor.svg +1 -1
- data/app/assets/icons/polaris/OrganizationMajor.svg +1 -1
- data/app/assets/icons/polaris/OutdentMajor.svg +1 -0
- data/app/assets/icons/polaris/OutdentMinor.svg +1 -0
- data/app/assets/icons/polaris/OutgoingMajor.svg +1 -1
- data/app/assets/icons/polaris/PackageFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/PackageMajor.svg +1 -1
- data/app/assets/icons/polaris/PageDownMajor.svg +1 -1
- data/app/assets/icons/polaris/PageMajor.svg +1 -1
- data/app/assets/icons/polaris/PageMinusMajor.svg +1 -1
- data/app/assets/icons/polaris/PagePlusMajor.svg +1 -1
- data/app/assets/icons/polaris/PageReferenceMinor.svg +1 -1
- data/app/assets/icons/polaris/PageUpMajor.svg +1 -1
- data/app/assets/icons/polaris/PaginationEndMinor.svg +1 -1
- data/app/assets/icons/polaris/PaginationStartMinor.svg +1 -1
- data/app/assets/icons/polaris/PaintBrushMajor.svg +1 -1
- data/app/assets/icons/polaris/PaperCheckMajor.svg +1 -1
- data/app/assets/icons/polaris/PaperCheckMinor.svg +1 -1
- data/app/assets/icons/polaris/PasskeyFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/PasskeyMajor.svg +1 -1
- data/app/assets/icons/polaris/PasskeyMinor.svg +1 -1
- data/app/assets/icons/polaris/PauseCircleMajor.svg +1 -1
- data/app/assets/icons/polaris/PauseMajor.svg +1 -1
- data/app/assets/icons/polaris/PauseMinor.svg +1 -1
- data/app/assets/icons/polaris/PaymentsFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/PaymentsMajor.svg +1 -1
- data/app/assets/icons/polaris/PersonalizedTextMajor.svg +1 -1
- data/app/assets/icons/polaris/PhoneInMajor.svg +1 -1
- data/app/assets/icons/polaris/PhoneMajor.svg +1 -1
- data/app/assets/icons/polaris/PhoneOutMajor.svg +1 -1
- data/app/assets/icons/polaris/PinMajor.svg +1 -1
- data/app/assets/icons/polaris/PinMinor.svg +1 -1
- data/app/assets/icons/polaris/PinUnfilledMajor.svg +1 -1
- data/app/assets/icons/polaris/PinUnfilledMinor.svg +1 -1
- data/app/assets/icons/polaris/PintrestMinor.svg +1 -0
- data/app/assets/icons/polaris/PlanFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/PlanMajor.svg +1 -1
- data/app/assets/icons/polaris/PlanMinor.svg +1 -1
- data/app/assets/icons/polaris/PlayCircleMajor.svg +1 -1
- data/app/assets/icons/polaris/PlayMajor.svg +1 -1
- data/app/assets/icons/polaris/PlayMinor.svg +1 -1
- data/app/assets/icons/polaris/PlusMinor.svg +1 -1
- data/app/assets/icons/polaris/PointOfSaleMajor.svg +1 -1
- data/app/assets/icons/polaris/PopularMajor.svg +1 -1
- data/app/assets/icons/polaris/PositionBasedModelMinor.svg +1 -1
- data/app/assets/icons/polaris/PriceLookupMinor.svg +1 -1
- data/app/assets/icons/polaris/PrintMajor.svg +1 -1
- data/app/assets/icons/polaris/PrintMinor.svg +1 -1
- data/app/assets/icons/polaris/ProductCostMajor.svg +1 -1
- data/app/assets/icons/polaris/ProductReferenceMinor.svg +1 -1
- data/app/assets/icons/polaris/ProductReturnsMinor.svg +1 -1
- data/app/assets/icons/polaris/ProductsFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/ProductsMajor.svg +1 -1
- data/app/assets/icons/polaris/ProductsMinor.svg +1 -1
- data/app/assets/icons/polaris/ProfileMajor.svg +1 -1
- data/app/assets/icons/polaris/ProfileMinor.svg +1 -1
- data/app/assets/icons/polaris/PromoteFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/PromoteMinor.svg +1 -1
- data/app/assets/icons/polaris/QuestionMarkInverseMajor.svg +1 -1
- data/app/assets/icons/polaris/QuestionMarkInverseMinor.svg +1 -1
- data/app/assets/icons/polaris/QuestionMarkMajor.svg +1 -1
- data/app/assets/icons/polaris/QuestionMarkMinor.svg +1 -1
- data/app/assets/icons/polaris/QuickSaleMajor.svg +1 -1
- data/app/assets/icons/polaris/ReadTimeMinor.svg +1 -1
- data/app/assets/icons/polaris/ReceiptMajor.svg +1 -1
- data/app/assets/icons/polaris/RecentSearchesMajor.svg +1 -1
- data/app/assets/icons/polaris/RedoMajor.svg +1 -1
- data/app/assets/icons/polaris/ReferralCodeMajor.svg +1 -1
- data/app/assets/icons/polaris/ReferralMajor.svg +1 -1
- data/app/assets/icons/polaris/RefreshMajor.svg +1 -1
- data/app/assets/icons/polaris/RefreshMinor.svg +1 -1
- data/app/assets/icons/polaris/RefundMajor.svg +1 -1
- data/app/assets/icons/polaris/RefundMinor.svg +1 -1
- data/app/assets/icons/polaris/RemoveProductMajor.svg +1 -1
- data/app/assets/icons/polaris/RepeatOrderMajor.svg +1 -1
- data/app/assets/icons/polaris/ReplaceMajor.svg +1 -1
- data/app/assets/icons/polaris/ReplayMinor.svg +1 -1
- data/app/assets/icons/polaris/ReportFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/ReportMinor.svg +1 -1
- data/app/assets/icons/polaris/ReportsMajor.svg +1 -1
- data/app/assets/icons/polaris/ResetMinor.svg +1 -1
- data/app/assets/icons/polaris/ResourcesMajor.svg +1 -1
- data/app/assets/icons/polaris/ReturnMinor.svg +1 -1
- data/app/assets/icons/polaris/ReturnsMajor.svg +1 -1
- data/app/assets/icons/polaris/RichTextMinor.svg +1 -1
- data/app/assets/icons/polaris/RiskMajor.svg +1 -1
- data/app/assets/icons/polaris/RiskMinor.svg +1 -1
- data/app/assets/icons/polaris/Rows2Major.svg +1 -1
- data/app/assets/icons/polaris/SandboxMajor.svg +1 -1
- data/app/assets/icons/polaris/SaveMinor.svg +1 -1
- data/app/assets/icons/polaris/SearchMajor.svg +1 -1
- data/app/assets/icons/polaris/SearchMinor.svg +1 -1
- data/app/assets/icons/polaris/SectionMajor.svg +1 -1
- data/app/assets/icons/polaris/SecureMajor.svg +1 -1
- data/app/assets/icons/polaris/SelectMinor.svg +1 -1
- data/app/assets/icons/polaris/SendMajor.svg +1 -1
- data/app/assets/icons/polaris/SettingsFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/SettingsMajor.svg +1 -1
- data/app/assets/icons/polaris/SettingsMinor.svg +1 -1
- data/app/assets/icons/polaris/ShareIosMinor.svg +1 -1
- data/app/assets/icons/polaris/ShareMinor.svg +1 -1
- data/app/assets/icons/polaris/ShipmentFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/ShipmentMajor.svg +1 -1
- data/app/assets/icons/polaris/ShopcodesMajor.svg +1 -1
- data/app/assets/icons/polaris/SidebarLeftMajor.svg +1 -1
- data/app/assets/icons/polaris/SidebarRightMajor.svg +1 -1
- data/app/assets/icons/polaris/SidekickMajor.svg +1 -0
- data/app/assets/icons/polaris/SimplifyMajor.svg +1 -1
- data/app/assets/icons/polaris/SimplifyMinor.svg +1 -1
- data/app/assets/icons/polaris/SlideshowMajor.svg +1 -1
- data/app/assets/icons/polaris/SmileyHappyMajor.svg +1 -1
- data/app/assets/icons/polaris/SmileyJoyMajor.svg +1 -1
- data/app/assets/icons/polaris/SmileyNeutralMajor.svg +1 -1
- data/app/assets/icons/polaris/SmileySadMajor.svg +1 -1
- data/app/assets/icons/polaris/SnapchatMinor.svg +1 -0
- data/app/assets/icons/polaris/SocialAdMajor.svg +1 -1
- data/app/assets/icons/polaris/SocialPostMajor.svg +1 -1
- data/app/assets/icons/polaris/SoftPackMajor.svg +1 -1
- data/app/assets/icons/polaris/SortAscendingMajor.svg +1 -1
- data/app/assets/icons/polaris/SortDescendingMajor.svg +1 -1
- data/app/assets/icons/polaris/SortMinor.svg +1 -1
- data/app/assets/icons/polaris/SoundMajor.svg +1 -1
- data/app/assets/icons/polaris/StarFilledMinor.svg +1 -1
- data/app/assets/icons/polaris/StarOutlineMinor.svg +1 -1
- data/app/assets/icons/polaris/StatusActiveMajor.svg +1 -1
- data/app/assets/icons/polaris/StopMajor.svg +1 -0
- data/app/assets/icons/polaris/StoreDetailsFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/StoreDetailsMinor.svg +1 -0
- data/app/assets/icons/polaris/StoreFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/StoreMajor.svg +1 -1
- data/app/assets/icons/polaris/StoreMinor.svg +1 -1
- data/app/assets/icons/polaris/StoreStatusMajor.svg +1 -1
- data/app/assets/icons/polaris/TabletMajor.svg +1 -1
- data/app/assets/icons/polaris/TapChipMajor.svg +1 -1
- data/app/assets/icons/polaris/TaxFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/TaxMajor.svg +1 -1
- data/app/assets/icons/polaris/TeamMajor.svg +1 -1
- data/app/assets/icons/polaris/TemplateMajor.svg +1 -1
- data/app/assets/icons/polaris/TemplateMinor.svg +1 -1
- data/app/assets/icons/polaris/TextAlignmentCenterMajor.svg +1 -1
- data/app/assets/icons/polaris/TextAlignmentLeftMajor.svg +1 -1
- data/app/assets/icons/polaris/TextAlignmentRightMajor.svg +1 -1
- data/app/assets/icons/polaris/TextBlockMajor.svg +1 -1
- data/app/assets/icons/polaris/TextColorMajor.svg +1 -0
- data/app/assets/icons/polaris/TextColorMinor.svg +1 -0
- data/app/assets/icons/polaris/TextMajor.svg +1 -1
- data/app/assets/icons/polaris/ThemeEditMajor.svg +1 -1
- data/app/assets/icons/polaris/ThemeStoreMajor.svg +1 -1
- data/app/assets/icons/polaris/ThemesMajor.svg +1 -1
- data/app/assets/icons/polaris/ThumbsDownMajor.svg +1 -1
- data/app/assets/icons/polaris/ThumbsDownMinor.svg +1 -1
- data/app/assets/icons/polaris/ThumbsUpMajor.svg +1 -1
- data/app/assets/icons/polaris/ThumbsUpMinor.svg +1 -1
- data/app/assets/icons/polaris/TickMinor.svg +1 -1
- data/app/assets/icons/polaris/TickSmallMinor.svg +1 -1
- data/app/assets/icons/polaris/TiktokMinor.svg +1 -0
- data/app/assets/icons/polaris/TimeDecayModelMinor.svg +1 -1
- data/app/assets/icons/polaris/TimelineAttachmentMajor.svg +1 -1
- data/app/assets/icons/polaris/TipsMajor.svg +1 -1
- data/app/assets/icons/polaris/TitleMinor.svg +1 -1
- data/app/assets/icons/polaris/ToggleMinor.svg +1 -1
- data/app/assets/icons/polaris/ToolsMajor.svg +1 -1
- data/app/assets/icons/polaris/TransactionFeeDollarMajor.svg +1 -1
- data/app/assets/icons/polaris/TransactionFeeEuroMajor.svg +1 -1
- data/app/assets/icons/polaris/TransactionFeePoundMajor.svg +1 -1
- data/app/assets/icons/polaris/TransactionFeeRupeeMajor.svg +1 -1
- data/app/assets/icons/polaris/TransactionFeeYenMajor.svg +1 -1
- data/app/assets/icons/polaris/TransactionMajor.svg +1 -1
- data/app/assets/icons/polaris/TransferFilledMajor.svg +1 -0
- data/app/assets/icons/polaris/TransferInMajor.svg +1 -1
- data/app/assets/icons/polaris/TransferMajor.svg +1 -1
- data/app/assets/icons/polaris/TransferOutMajor.svg +1 -1
- data/app/assets/icons/polaris/TransferWithinShopifyMajor.svg +1 -1
- data/app/assets/icons/polaris/TranslateMajor.svg +1 -0
- data/app/assets/icons/polaris/TransportMajor.svg +1 -1
- data/app/assets/icons/polaris/TroubleshootMajor.svg +1 -1
- data/app/assets/icons/polaris/TumblrMinor.svg +1 -0
- data/app/assets/icons/polaris/TwitchMinor.svg +1 -0
- data/app/assets/icons/polaris/TwitterMinor.svg +1 -0
- data/app/assets/icons/polaris/TypeMajor.svg +1 -1
- data/app/assets/icons/polaris/TypeMinor.svg +1 -1
- data/app/assets/icons/polaris/UnderlineMajor.svg +1 -0
- data/app/assets/icons/polaris/UnderlineMinor.svg +1 -0
- data/app/assets/icons/polaris/UndoMajor.svg +1 -1
- data/app/assets/icons/polaris/UnfulfilledMajor.svg +1 -1
- data/app/assets/icons/polaris/UnknownDeviceMajor.svg +1 -1
- data/app/assets/icons/polaris/UpdateInventoryMajor.svg +1 -1
- data/app/assets/icons/polaris/UploadMajor.svg +1 -1
- data/app/assets/icons/polaris/VariantMajor.svg +1 -1
- data/app/assets/icons/polaris/ViewMajor.svg +1 -1
- data/app/assets/icons/polaris/ViewMinor.svg +1 -1
- data/app/assets/icons/polaris/ViewportNarrowMajor.svg +1 -1
- data/app/assets/icons/polaris/ViewportShortMajor.svg +1 -1
- data/app/assets/icons/polaris/ViewportTallMajor.svg +1 -1
- data/app/assets/icons/polaris/ViewportWideMajor.svg +1 -1
- data/app/assets/icons/polaris/VimeoMinor.svg +1 -0
- data/app/assets/icons/polaris/VocabularyMajor.svg +1 -1
- data/app/assets/icons/polaris/VolumeMinor.svg +1 -1
- data/app/assets/icons/polaris/WandMajor.svg +1 -1
- data/app/assets/icons/polaris/WandMinor.svg +1 -1
- data/app/assets/icons/polaris/WearableMajor.svg +1 -1
- data/app/assets/icons/polaris/WeightMinor.svg +1 -1
- data/app/assets/icons/polaris/WholesaleMajor.svg +1 -1
- data/app/assets/icons/polaris/WifiMajor.svg +1 -1
- data/app/assets/icons/polaris/YoutubeMinor.svg +1 -0
- data/app/assets/javascripts/polaris_view_components/index.js +4 -1
- data/app/assets/javascripts/polaris_view_components/popover_controller.js +50 -29
- data/app/assets/javascripts/polaris_view_components/tooltip_controller.js +67 -0
- data/app/assets/javascripts/polaris_view_components.js +1113 -1269
- data/app/assets/stylesheets/polaris_view_components/custom.pcss +45 -16
- data/app/assets/stylesheets/polaris_view_components/shopify_navigation.pcss +8 -8
- data/app/assets/stylesheets/polaris_view_components/tooltip_component.pcss +31 -0
- data/app/assets/stylesheets/polaris_view_components.css +1543 -680
- data/app/assets/stylesheets/polaris_view_components.pcss +1 -0
- data/app/components/polaris/autocomplete_component.rb +1 -0
- data/app/components/polaris/avatar_component.html.erb +1 -1
- data/app/components/polaris/filters_component.html.erb +7 -7
- data/app/components/polaris/filters_component.rb +5 -5
- data/app/components/polaris/frame/top_bar_component.html.erb +46 -22
- data/app/components/polaris/frame/top_bar_component.rb +0 -1
- data/app/components/polaris/popover_component.html.erb +2 -8
- data/app/components/polaris/popover_component.rb +6 -3
- data/app/components/polaris/select_component.html.erb +2 -2
- data/app/components/polaris/select_component.rb +58 -4
- data/app/components/polaris/tooltip_component.html.erb +9 -0
- data/app/components/polaris/tooltip_component.rb +33 -0
- data/app/helpers/polaris/view_helper.rb +1 -0
- data/lib/polaris/view_components/version.rb +1 -1
- metadata +92 -3
@@ -159,7 +159,7 @@ function isEmpty(str) {
|
|
159
159
|
return str.length === 0 || !str.trim();
|
160
160
|
}
|
161
161
|
|
162
|
-
function debounce
|
162
|
+
function debounce(fn, wait) {
|
163
163
|
let timeoutId;
|
164
164
|
return (...args) => {
|
165
165
|
clearTimeout(timeoutId);
|
@@ -210,7 +210,7 @@ class Autocomplete extends Controller {
|
|
210
210
|
if (this.hasHiddenInputTarget) this.hiddenInputTarget.value = input.value;
|
211
211
|
}
|
212
212
|
}
|
213
|
-
onInputChange=debounce
|
213
|
+
onInputChange=debounce((() => {
|
214
214
|
if (this.isRemote) {
|
215
215
|
this.fetchResults();
|
216
216
|
} else {
|
@@ -431,7 +431,7 @@ class Dropzone extends Controller {
|
|
431
431
|
event.preventDefault();
|
432
432
|
this.onClick();
|
433
433
|
};
|
434
|
-
onWindowResize=debounce
|
434
|
+
onWindowResize=debounce((() => {
|
435
435
|
const size = this.calculateSize();
|
436
436
|
if (size !== this.size) {
|
437
437
|
this.size = size;
|
@@ -890,1228 +890,999 @@ class Polaris extends Controller {
|
|
890
890
|
}
|
891
891
|
}
|
892
892
|
|
893
|
-
|
893
|
+
const min = Math.min;
|
894
894
|
|
895
|
-
|
895
|
+
const max = Math.max;
|
896
896
|
|
897
|
-
|
897
|
+
const round = Math.round;
|
898
898
|
|
899
|
-
|
899
|
+
const floor = Math.floor;
|
900
900
|
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
var start = "start";
|
906
|
-
|
907
|
-
var end = "end";
|
908
|
-
|
909
|
-
var clippingParents = "clippingParents";
|
910
|
-
|
911
|
-
var viewport = "viewport";
|
912
|
-
|
913
|
-
var popper = "popper";
|
914
|
-
|
915
|
-
var reference = "reference";
|
916
|
-
|
917
|
-
var variationPlacements = basePlacements.reduce((function(acc, placement) {
|
918
|
-
return acc.concat([ placement + "-" + start, placement + "-" + end ]);
|
919
|
-
}), []);
|
920
|
-
|
921
|
-
var placements = [].concat(basePlacements, [ auto ]).reduce((function(acc, placement) {
|
922
|
-
return acc.concat([ placement, placement + "-" + start, placement + "-" + end ]);
|
923
|
-
}), []);
|
924
|
-
|
925
|
-
var beforeRead = "beforeRead";
|
926
|
-
|
927
|
-
var read = "read";
|
928
|
-
|
929
|
-
var afterRead = "afterRead";
|
930
|
-
|
931
|
-
var beforeMain = "beforeMain";
|
932
|
-
|
933
|
-
var main = "main";
|
934
|
-
|
935
|
-
var afterMain = "afterMain";
|
936
|
-
|
937
|
-
var beforeWrite = "beforeWrite";
|
938
|
-
|
939
|
-
var write = "write";
|
940
|
-
|
941
|
-
var afterWrite = "afterWrite";
|
942
|
-
|
943
|
-
var modifierPhases = [ beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite ];
|
901
|
+
const createCoords = v => ({
|
902
|
+
x: v,
|
903
|
+
y: v
|
904
|
+
});
|
944
905
|
|
945
|
-
|
946
|
-
|
947
|
-
|
906
|
+
const oppositeSideMap = {
|
907
|
+
left: "right",
|
908
|
+
right: "left",
|
909
|
+
bottom: "top",
|
910
|
+
top: "bottom"
|
911
|
+
};
|
948
912
|
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
if (node.toString() !== "[object Window]") {
|
954
|
-
var ownerDocument = node.ownerDocument;
|
955
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
956
|
-
}
|
957
|
-
return node;
|
958
|
-
}
|
913
|
+
const oppositeAlignmentMap = {
|
914
|
+
start: "end",
|
915
|
+
end: "start"
|
916
|
+
};
|
959
917
|
|
960
|
-
function
|
961
|
-
|
962
|
-
return node instanceof OwnElement || node instanceof Element;
|
918
|
+
function clamp(start, value, end) {
|
919
|
+
return max(start, min(value, end));
|
963
920
|
}
|
964
921
|
|
965
|
-
function
|
966
|
-
|
967
|
-
return node instanceof OwnElement || node instanceof HTMLElement;
|
922
|
+
function evaluate(value, param) {
|
923
|
+
return typeof value === "function" ? value(param) : value;
|
968
924
|
}
|
969
925
|
|
970
|
-
function
|
971
|
-
|
972
|
-
return false;
|
973
|
-
}
|
974
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
975
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
926
|
+
function getSide(placement) {
|
927
|
+
return placement.split("-")[0];
|
976
928
|
}
|
977
929
|
|
978
|
-
function
|
979
|
-
|
980
|
-
Object.keys(state.elements).forEach((function(name) {
|
981
|
-
var style = state.styles[name] || {};
|
982
|
-
var attributes = state.attributes[name] || {};
|
983
|
-
var element = state.elements[name];
|
984
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
985
|
-
return;
|
986
|
-
}
|
987
|
-
Object.assign(element.style, style);
|
988
|
-
Object.keys(attributes).forEach((function(name) {
|
989
|
-
var value = attributes[name];
|
990
|
-
if (value === false) {
|
991
|
-
element.removeAttribute(name);
|
992
|
-
} else {
|
993
|
-
element.setAttribute(name, value === true ? "" : value);
|
994
|
-
}
|
995
|
-
}));
|
996
|
-
}));
|
930
|
+
function getAlignment(placement) {
|
931
|
+
return placement.split("-")[1];
|
997
932
|
}
|
998
933
|
|
999
|
-
function
|
1000
|
-
|
1001
|
-
var initialStyles = {
|
1002
|
-
popper: {
|
1003
|
-
position: state.options.strategy,
|
1004
|
-
left: "0",
|
1005
|
-
top: "0",
|
1006
|
-
margin: "0"
|
1007
|
-
},
|
1008
|
-
arrow: {
|
1009
|
-
position: "absolute"
|
1010
|
-
},
|
1011
|
-
reference: {}
|
1012
|
-
};
|
1013
|
-
Object.assign(state.elements.popper.style, initialStyles.popper);
|
1014
|
-
state.styles = initialStyles;
|
1015
|
-
if (state.elements.arrow) {
|
1016
|
-
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
1017
|
-
}
|
1018
|
-
return function() {
|
1019
|
-
Object.keys(state.elements).forEach((function(name) {
|
1020
|
-
var element = state.elements[name];
|
1021
|
-
var attributes = state.attributes[name] || {};
|
1022
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
1023
|
-
var style = styleProperties.reduce((function(style, property) {
|
1024
|
-
style[property] = "";
|
1025
|
-
return style;
|
1026
|
-
}), {});
|
1027
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
1028
|
-
return;
|
1029
|
-
}
|
1030
|
-
Object.assign(element.style, style);
|
1031
|
-
Object.keys(attributes).forEach((function(attribute) {
|
1032
|
-
element.removeAttribute(attribute);
|
1033
|
-
}));
|
1034
|
-
}));
|
1035
|
-
};
|
934
|
+
function getOppositeAxis(axis) {
|
935
|
+
return axis === "x" ? "y" : "x";
|
1036
936
|
}
|
1037
937
|
|
1038
|
-
|
1039
|
-
|
1040
|
-
enabled: true,
|
1041
|
-
phase: "write",
|
1042
|
-
fn: applyStyles,
|
1043
|
-
effect: effect$2,
|
1044
|
-
requires: [ "computeStyles" ]
|
1045
|
-
};
|
1046
|
-
|
1047
|
-
function getBasePlacement(placement) {
|
1048
|
-
return placement.split("-")[0];
|
938
|
+
function getAxisLength(axis) {
|
939
|
+
return axis === "y" ? "height" : "width";
|
1049
940
|
}
|
1050
941
|
|
1051
|
-
|
1052
|
-
|
1053
|
-
var min = Math.min;
|
1054
|
-
|
1055
|
-
var round = Math.round;
|
1056
|
-
|
1057
|
-
function getUAString() {
|
1058
|
-
var uaData = navigator.userAgentData;
|
1059
|
-
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
1060
|
-
return uaData.brands.map((function(item) {
|
1061
|
-
return item.brand + "/" + item.version;
|
1062
|
-
})).join(" ");
|
1063
|
-
}
|
1064
|
-
return navigator.userAgent;
|
942
|
+
function getSideAxis(placement) {
|
943
|
+
return [ "top", "bottom" ].includes(getSide(placement)) ? "y" : "x";
|
1065
944
|
}
|
1066
945
|
|
1067
|
-
function
|
1068
|
-
return
|
946
|
+
function getAlignmentAxis(placement) {
|
947
|
+
return getOppositeAxis(getSideAxis(placement));
|
1069
948
|
}
|
1070
949
|
|
1071
|
-
function
|
1072
|
-
if (
|
1073
|
-
|
950
|
+
function getAlignmentSides(placement, rects, rtl) {
|
951
|
+
if (rtl === void 0) {
|
952
|
+
rtl = false;
|
1074
953
|
}
|
1075
|
-
|
1076
|
-
|
954
|
+
const alignment = getAlignment(placement);
|
955
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
956
|
+
const length = getAxisLength(alignmentAxis);
|
957
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
958
|
+
if (rects.reference[length] > rects.floating[length]) {
|
959
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
1077
960
|
}
|
1078
|
-
|
1079
|
-
var scaleX = 1;
|
1080
|
-
var scaleY = 1;
|
1081
|
-
if (includeScale && isHTMLElement(element)) {
|
1082
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
1083
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
1084
|
-
}
|
1085
|
-
var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
1086
|
-
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
1087
|
-
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
1088
|
-
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
1089
|
-
var width = clientRect.width / scaleX;
|
1090
|
-
var height = clientRect.height / scaleY;
|
1091
|
-
return {
|
1092
|
-
width: width,
|
1093
|
-
height: height,
|
1094
|
-
top: y,
|
1095
|
-
right: x + width,
|
1096
|
-
bottom: y + height,
|
1097
|
-
left: x,
|
1098
|
-
x: x,
|
1099
|
-
y: y
|
1100
|
-
};
|
961
|
+
return [ mainAlignmentSide, getOppositePlacement(mainAlignmentSide) ];
|
1101
962
|
}
|
1102
963
|
|
1103
|
-
function
|
1104
|
-
|
1105
|
-
|
1106
|
-
var height = element.offsetHeight;
|
1107
|
-
if (Math.abs(clientRect.width - width) <= 1) {
|
1108
|
-
width = clientRect.width;
|
1109
|
-
}
|
1110
|
-
if (Math.abs(clientRect.height - height) <= 1) {
|
1111
|
-
height = clientRect.height;
|
1112
|
-
}
|
1113
|
-
return {
|
1114
|
-
x: element.offsetLeft,
|
1115
|
-
y: element.offsetTop,
|
1116
|
-
width: width,
|
1117
|
-
height: height
|
1118
|
-
};
|
964
|
+
function getExpandedPlacements(placement) {
|
965
|
+
const oppositePlacement = getOppositePlacement(placement);
|
966
|
+
return [ getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement) ];
|
1119
967
|
}
|
1120
968
|
|
1121
|
-
function
|
1122
|
-
|
1123
|
-
if (parent.contains(child)) {
|
1124
|
-
return true;
|
1125
|
-
} else if (rootNode && isShadowRoot(rootNode)) {
|
1126
|
-
var next = child;
|
1127
|
-
do {
|
1128
|
-
if (next && parent.isSameNode(next)) {
|
1129
|
-
return true;
|
1130
|
-
}
|
1131
|
-
next = next.parentNode || next.host;
|
1132
|
-
} while (next);
|
1133
|
-
}
|
1134
|
-
return false;
|
969
|
+
function getOppositeAlignmentPlacement(placement) {
|
970
|
+
return placement.replace(/start|end/g, (alignment => oppositeAlignmentMap[alignment]));
|
1135
971
|
}
|
1136
972
|
|
1137
|
-
function
|
1138
|
-
|
1139
|
-
|
973
|
+
function getSideList(side, isStart, rtl) {
|
974
|
+
const lr = [ "left", "right" ];
|
975
|
+
const rl = [ "right", "left" ];
|
976
|
+
const tb = [ "top", "bottom" ];
|
977
|
+
const bt = [ "bottom", "top" ];
|
978
|
+
switch (side) {
|
979
|
+
case "top":
|
980
|
+
case "bottom":
|
981
|
+
if (rtl) return isStart ? rl : lr;
|
982
|
+
return isStart ? lr : rl;
|
1140
983
|
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
984
|
+
case "left":
|
985
|
+
case "right":
|
986
|
+
return isStart ? tb : bt;
|
1144
987
|
|
1145
|
-
|
1146
|
-
|
1147
|
-
}
|
1148
|
-
|
1149
|
-
function getParentNode(element) {
|
1150
|
-
if (getNodeName(element) === "html") {
|
1151
|
-
return element;
|
1152
|
-
}
|
1153
|
-
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
1154
|
-
}
|
1155
|
-
|
1156
|
-
function getTrueOffsetParent(element) {
|
1157
|
-
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
1158
|
-
return null;
|
988
|
+
default:
|
989
|
+
return [];
|
1159
990
|
}
|
1160
|
-
return element.offsetParent;
|
1161
991
|
}
|
1162
992
|
|
1163
|
-
function
|
1164
|
-
|
1165
|
-
|
1166
|
-
if (
|
1167
|
-
|
1168
|
-
if (
|
1169
|
-
|
1170
|
-
}
|
1171
|
-
}
|
1172
|
-
var currentNode = getParentNode(element);
|
1173
|
-
if (isShadowRoot(currentNode)) {
|
1174
|
-
currentNode = currentNode.host;
|
1175
|
-
}
|
1176
|
-
while (isHTMLElement(currentNode) && [ "html", "body" ].indexOf(getNodeName(currentNode)) < 0) {
|
1177
|
-
var css = getComputedStyle$1(currentNode);
|
1178
|
-
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || [ "transform", "perspective" ].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
1179
|
-
return currentNode;
|
1180
|
-
} else {
|
1181
|
-
currentNode = currentNode.parentNode;
|
993
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
994
|
+
const alignment = getAlignment(placement);
|
995
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
996
|
+
if (alignment) {
|
997
|
+
list = list.map((side => side + "-" + alignment));
|
998
|
+
if (flipAlignment) {
|
999
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
1182
1000
|
}
|
1183
1001
|
}
|
1184
|
-
return
|
1185
|
-
}
|
1186
|
-
|
1187
|
-
function getOffsetParent(element) {
|
1188
|
-
var window = getWindow(element);
|
1189
|
-
var offsetParent = getTrueOffsetParent(element);
|
1190
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
1191
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
1192
|
-
}
|
1193
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static")) {
|
1194
|
-
return window;
|
1195
|
-
}
|
1196
|
-
return offsetParent || getContainingBlock(element) || window;
|
1197
|
-
}
|
1198
|
-
|
1199
|
-
function getMainAxisFromPlacement(placement) {
|
1200
|
-
return [ "top", "bottom" ].indexOf(placement) >= 0 ? "x" : "y";
|
1201
|
-
}
|
1202
|
-
|
1203
|
-
function within(min$1, value, max$1) {
|
1204
|
-
return max(min$1, min(value, max$1));
|
1002
|
+
return list;
|
1205
1003
|
}
|
1206
1004
|
|
1207
|
-
function
|
1208
|
-
|
1209
|
-
return v > max ? max : v;
|
1005
|
+
function getOppositePlacement(placement) {
|
1006
|
+
return placement.replace(/left|right|bottom|top/g, (side => oppositeSideMap[side]));
|
1210
1007
|
}
|
1211
1008
|
|
1212
|
-
function
|
1009
|
+
function expandPaddingObject(padding) {
|
1213
1010
|
return {
|
1214
1011
|
top: 0,
|
1215
1012
|
right: 0,
|
1216
1013
|
bottom: 0,
|
1217
|
-
left: 0
|
1014
|
+
left: 0,
|
1015
|
+
...padding
|
1218
1016
|
};
|
1219
1017
|
}
|
1220
1018
|
|
1221
|
-
function
|
1222
|
-
return
|
1019
|
+
function getPaddingObject(padding) {
|
1020
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
1021
|
+
top: padding,
|
1022
|
+
right: padding,
|
1023
|
+
bottom: padding,
|
1024
|
+
left: padding
|
1025
|
+
};
|
1223
1026
|
}
|
1224
1027
|
|
1225
|
-
function
|
1226
|
-
return
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1028
|
+
function rectToClientRect(rect) {
|
1029
|
+
return {
|
1030
|
+
...rect,
|
1031
|
+
top: rect.y,
|
1032
|
+
left: rect.x,
|
1033
|
+
right: rect.x + rect.width,
|
1034
|
+
bottom: rect.y + rect.height
|
1035
|
+
};
|
1230
1036
|
}
|
1231
1037
|
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1038
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
1039
|
+
let {reference: reference, floating: floating} = _ref;
|
1040
|
+
const sideAxis = getSideAxis(placement);
|
1041
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
1042
|
+
const alignLength = getAxisLength(alignmentAxis);
|
1043
|
+
const side = getSide(placement);
|
1044
|
+
const isVertical = sideAxis === "y";
|
1045
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
1046
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
1047
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
1048
|
+
let coords;
|
1049
|
+
switch (side) {
|
1050
|
+
case "top":
|
1051
|
+
coords = {
|
1052
|
+
x: commonX,
|
1053
|
+
y: reference.y - floating.height
|
1054
|
+
};
|
1055
|
+
break;
|
1238
1056
|
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
var axis = getMainAxisFromPlacement(basePlacement);
|
1246
|
-
var isVertical = [ left, right ].indexOf(basePlacement) >= 0;
|
1247
|
-
var len = isVertical ? "height" : "width";
|
1248
|
-
if (!arrowElement || !popperOffsets) {
|
1249
|
-
return;
|
1250
|
-
}
|
1251
|
-
var paddingObject = toPaddingObject(options.padding, state);
|
1252
|
-
var arrowRect = getLayoutRect(arrowElement);
|
1253
|
-
var minProp = axis === "y" ? top : left;
|
1254
|
-
var maxProp = axis === "y" ? bottom : right;
|
1255
|
-
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
1256
|
-
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
1257
|
-
var arrowOffsetParent = getOffsetParent(arrowElement);
|
1258
|
-
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
1259
|
-
var centerToReference = endDiff / 2 - startDiff / 2;
|
1260
|
-
var min = paddingObject[minProp];
|
1261
|
-
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
1262
|
-
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
1263
|
-
var offset = within(min, center, max);
|
1264
|
-
var axisProp = axis;
|
1265
|
-
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset,
|
1266
|
-
_state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
1267
|
-
}
|
1268
|
-
|
1269
|
-
function effect$1(_ref2) {
|
1270
|
-
var state = _ref2.state, options = _ref2.options;
|
1271
|
-
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
1272
|
-
if (arrowElement == null) {
|
1273
|
-
return;
|
1274
|
-
}
|
1275
|
-
if (typeof arrowElement === "string") {
|
1276
|
-
arrowElement = state.elements.popper.querySelector(arrowElement);
|
1277
|
-
if (!arrowElement) {
|
1278
|
-
return;
|
1279
|
-
}
|
1280
|
-
}
|
1281
|
-
if (!contains(state.elements.popper, arrowElement)) {
|
1282
|
-
return;
|
1283
|
-
}
|
1284
|
-
state.elements.arrow = arrowElement;
|
1285
|
-
}
|
1057
|
+
case "bottom":
|
1058
|
+
coords = {
|
1059
|
+
x: commonX,
|
1060
|
+
y: reference.y + reference.height
|
1061
|
+
};
|
1062
|
+
break;
|
1286
1063
|
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
requires: [ "popperOffsets" ],
|
1294
|
-
requiresIfExists: [ "preventOverflow" ]
|
1295
|
-
};
|
1064
|
+
case "right":
|
1065
|
+
coords = {
|
1066
|
+
x: reference.x + reference.width,
|
1067
|
+
y: commonY
|
1068
|
+
};
|
1069
|
+
break;
|
1296
1070
|
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1071
|
+
case "left":
|
1072
|
+
coords = {
|
1073
|
+
x: reference.x - floating.width,
|
1074
|
+
y: commonY
|
1075
|
+
};
|
1076
|
+
break;
|
1300
1077
|
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
}
|
1078
|
+
default:
|
1079
|
+
coords = {
|
1080
|
+
x: reference.x,
|
1081
|
+
y: reference.y
|
1082
|
+
};
|
1083
|
+
}
|
1084
|
+
switch (getAlignment(placement)) {
|
1085
|
+
case "start":
|
1086
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
1087
|
+
break;
|
1307
1088
|
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
y: round(y * dpr) / dpr || 0
|
1314
|
-
};
|
1089
|
+
case "end":
|
1090
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
1091
|
+
break;
|
1092
|
+
}
|
1093
|
+
return coords;
|
1315
1094
|
}
|
1316
1095
|
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1096
|
+
const computePosition$1 = async (reference, floating, config) => {
|
1097
|
+
const {placement: placement = "bottom", strategy: strategy = "absolute", middleware: middleware = [], platform: platform} = config;
|
1098
|
+
const validMiddleware = middleware.filter(Boolean);
|
1099
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
1100
|
+
let rects = await platform.getElementRects({
|
1101
|
+
reference: reference,
|
1102
|
+
floating: floating,
|
1103
|
+
strategy: strategy
|
1104
|
+
});
|
1105
|
+
let {x: x, y: y} = computeCoordsFromPlacement(rects, placement, rtl);
|
1106
|
+
let statefulPlacement = placement;
|
1107
|
+
let middlewareData = {};
|
1108
|
+
let resetCount = 0;
|
1109
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
1110
|
+
const {name: name, fn: fn} = validMiddleware[i];
|
1111
|
+
const {x: nextX, y: nextY, data: data, reset: reset} = await fn({
|
1112
|
+
x: x,
|
1113
|
+
y: y,
|
1114
|
+
initialPlacement: placement,
|
1115
|
+
placement: statefulPlacement,
|
1116
|
+
strategy: strategy,
|
1117
|
+
middlewareData: middlewareData,
|
1118
|
+
rects: rects,
|
1119
|
+
platform: platform,
|
1120
|
+
elements: {
|
1121
|
+
reference: reference,
|
1122
|
+
floating: floating
|
1344
1123
|
}
|
1345
|
-
}
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1124
|
+
});
|
1125
|
+
x = nextX != null ? nextX : x;
|
1126
|
+
y = nextY != null ? nextY : y;
|
1127
|
+
middlewareData = {
|
1128
|
+
...middlewareData,
|
1129
|
+
[name]: {
|
1130
|
+
...middlewareData[name],
|
1131
|
+
...data
|
1132
|
+
}
|
1133
|
+
};
|
1134
|
+
if (reset && resetCount <= 50) {
|
1135
|
+
resetCount++;
|
1136
|
+
if (typeof reset === "object") {
|
1137
|
+
if (reset.placement) {
|
1138
|
+
statefulPlacement = reset.placement;
|
1139
|
+
}
|
1140
|
+
if (reset.rects) {
|
1141
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
1142
|
+
reference: reference,
|
1143
|
+
floating: floating,
|
1144
|
+
strategy: strategy
|
1145
|
+
}) : reset.rects;
|
1146
|
+
}
|
1147
|
+
({x: x, y: y} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
1148
|
+
}
|
1149
|
+
i = -1;
|
1150
|
+
continue;
|
1358
1151
|
}
|
1359
1152
|
}
|
1360
|
-
|
1361
|
-
position: position
|
1362
|
-
}, adaptive && unsetSides);
|
1363
|
-
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
1153
|
+
return {
|
1364
1154
|
x: x,
|
1365
|
-
y: y
|
1366
|
-
|
1155
|
+
y: y,
|
1156
|
+
placement: statefulPlacement,
|
1157
|
+
strategy: strategy,
|
1158
|
+
middlewareData: middlewareData
|
1159
|
+
};
|
1160
|
+
};
|
1161
|
+
|
1162
|
+
async function detectOverflow(state, options) {
|
1163
|
+
var _await$platform$isEle;
|
1164
|
+
if (options === void 0) {
|
1165
|
+
options = {};
|
1166
|
+
}
|
1167
|
+
const {x: x, y: y, platform: platform, rects: rects, elements: elements, strategy: strategy} = state;
|
1168
|
+
const {boundary: boundary = "clippingAncestors", rootBoundary: rootBoundary = "viewport", elementContext: elementContext = "floating", altBoundary: altBoundary = false, padding: padding = 0} = evaluate(options, state);
|
1169
|
+
const paddingObject = getPaddingObject(padding);
|
1170
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
1171
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
1172
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
1173
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
|
1174
|
+
boundary: boundary,
|
1175
|
+
rootBoundary: rootBoundary,
|
1176
|
+
strategy: strategy
|
1177
|
+
}));
|
1178
|
+
const rect = elementContext === "floating" ? {
|
1179
|
+
...rects.floating,
|
1367
1180
|
x: x,
|
1368
1181
|
y: y
|
1182
|
+
} : rects.reference;
|
1183
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
1184
|
+
const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
|
1185
|
+
x: 1,
|
1186
|
+
y: 1
|
1187
|
+
} : {
|
1188
|
+
x: 1,
|
1189
|
+
y: 1
|
1369
1190
|
};
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
}
|
1381
|
-
|
1382
|
-
function computeStyles(_ref5) {
|
1383
|
-
var state = _ref5.state, options = _ref5.options;
|
1384
|
-
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
1385
|
-
var commonStyles = {
|
1386
|
-
placement: getBasePlacement(state.placement),
|
1387
|
-
variation: getVariation(state.placement),
|
1388
|
-
popper: state.elements.popper,
|
1389
|
-
popperRect: state.rects.popper,
|
1390
|
-
gpuAcceleration: gpuAcceleration,
|
1391
|
-
isFixed: state.options.strategy === "fixed"
|
1191
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
1192
|
+
rect: rect,
|
1193
|
+
offsetParent: offsetParent,
|
1194
|
+
strategy: strategy
|
1195
|
+
}) : rect);
|
1196
|
+
return {
|
1197
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
1198
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
1199
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
1200
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
1392
1201
|
};
|
1393
|
-
if (state.modifiersData.popperOffsets != null) {
|
1394
|
-
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
1395
|
-
offsets: state.modifiersData.popperOffsets,
|
1396
|
-
position: state.options.strategy,
|
1397
|
-
adaptive: adaptive,
|
1398
|
-
roundOffsets: roundOffsets
|
1399
|
-
})));
|
1400
|
-
}
|
1401
|
-
if (state.modifiersData.arrow != null) {
|
1402
|
-
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
1403
|
-
offsets: state.modifiersData.arrow,
|
1404
|
-
position: "absolute",
|
1405
|
-
adaptive: false,
|
1406
|
-
roundOffsets: roundOffsets
|
1407
|
-
})));
|
1408
|
-
}
|
1409
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
1410
|
-
"data-popper-placement": state.placement
|
1411
|
-
});
|
1412
1202
|
}
|
1413
1203
|
|
1414
|
-
|
1415
|
-
name: "
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1204
|
+
const arrow = options => ({
|
1205
|
+
name: "arrow",
|
1206
|
+
options: options,
|
1207
|
+
async fn(state) {
|
1208
|
+
const {x: x, y: y, placement: placement, rects: rects, platform: platform, elements: elements, middlewareData: middlewareData} = state;
|
1209
|
+
const {element: element, padding: padding = 0} = evaluate(options, state) || {};
|
1210
|
+
if (element == null) {
|
1211
|
+
return {};
|
1212
|
+
}
|
1213
|
+
const paddingObject = getPaddingObject(padding);
|
1214
|
+
const coords = {
|
1215
|
+
x: x,
|
1216
|
+
y: y
|
1217
|
+
};
|
1218
|
+
const axis = getAlignmentAxis(placement);
|
1219
|
+
const length = getAxisLength(axis);
|
1220
|
+
const arrowDimensions = await platform.getDimensions(element);
|
1221
|
+
const isYAxis = axis === "y";
|
1222
|
+
const minProp = isYAxis ? "top" : "left";
|
1223
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
1224
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
1225
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
1226
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
1227
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
1228
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
1229
|
+
if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) {
|
1230
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
1231
|
+
}
|
1232
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
1233
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
1234
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
1235
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
1236
|
+
const min$1 = minPadding;
|
1237
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
1238
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
1239
|
+
const offset = clamp(min$1, center, max);
|
1240
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
1241
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
1242
|
+
return {
|
1243
|
+
[axis]: coords[axis] + alignmentOffset,
|
1244
|
+
data: {
|
1245
|
+
[axis]: offset,
|
1246
|
+
centerOffset: center - offset - alignmentOffset,
|
1247
|
+
...shouldAddOffset && {
|
1248
|
+
alignmentOffset: alignmentOffset
|
1249
|
+
}
|
1250
|
+
},
|
1251
|
+
reset: shouldAddOffset
|
1252
|
+
};
|
1435
1253
|
}
|
1436
|
-
|
1437
|
-
|
1254
|
+
});
|
1255
|
+
|
1256
|
+
const flip = function(options) {
|
1257
|
+
if (options === void 0) {
|
1258
|
+
options = {};
|
1438
1259
|
}
|
1439
|
-
return
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1260
|
+
return {
|
1261
|
+
name: "flip",
|
1262
|
+
options: options,
|
1263
|
+
async fn(state) {
|
1264
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
1265
|
+
const {placement: placement, middlewareData: middlewareData, rects: rects, initialPlacement: initialPlacement, platform: platform, elements: elements} = state;
|
1266
|
+
const {mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy: fallbackStrategy = "bestFit", fallbackAxisSideDirection: fallbackAxisSideDirection = "none", flipAlignment: flipAlignment = true, ...detectOverflowOptions} = evaluate(options, state);
|
1267
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
1268
|
+
return {};
|
1269
|
+
}
|
1270
|
+
const side = getSide(placement);
|
1271
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
1272
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
1273
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [ getOppositePlacement(initialPlacement) ] : getExpandedPlacements(initialPlacement));
|
1274
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
|
1275
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
1276
|
+
}
|
1277
|
+
const placements = [ initialPlacement, ...fallbackPlacements ];
|
1278
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
1279
|
+
const overflows = [];
|
1280
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
1281
|
+
if (checkMainAxis) {
|
1282
|
+
overflows.push(overflow[side]);
|
1283
|
+
}
|
1284
|
+
if (checkCrossAxis) {
|
1285
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
1286
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
1287
|
+
}
|
1288
|
+
overflowsData = [ ...overflowsData, {
|
1289
|
+
placement: placement,
|
1290
|
+
overflows: overflows
|
1291
|
+
} ];
|
1292
|
+
if (!overflows.every((side => side <= 0))) {
|
1293
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
1294
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
1295
|
+
const nextPlacement = placements[nextIndex];
|
1296
|
+
if (nextPlacement) {
|
1297
|
+
return {
|
1298
|
+
data: {
|
1299
|
+
index: nextIndex,
|
1300
|
+
overflows: overflowsData
|
1301
|
+
},
|
1302
|
+
reset: {
|
1303
|
+
placement: nextPlacement
|
1304
|
+
}
|
1305
|
+
};
|
1306
|
+
}
|
1307
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d => d.overflows[0] <= 0)).sort(((a, b) => a.overflows[1] - b.overflows[1]))[0]) == null ? void 0 : _overflowsData$filter.placement;
|
1308
|
+
if (!resetPlacement) {
|
1309
|
+
switch (fallbackStrategy) {
|
1310
|
+
case "bestFit":
|
1311
|
+
{
|
1312
|
+
var _overflowsData$map$so;
|
1313
|
+
const placement = (_overflowsData$map$so = overflowsData.map((d => [ d.placement, d.overflows.filter((overflow => overflow > 0)).reduce(((acc, overflow) => acc + overflow), 0) ])).sort(((a, b) => a[1] - b[1]))[0]) == null ? void 0 : _overflowsData$map$so[0];
|
1314
|
+
if (placement) {
|
1315
|
+
resetPlacement = placement;
|
1316
|
+
}
|
1317
|
+
break;
|
1318
|
+
}
|
1319
|
+
|
1320
|
+
case "initialPlacement":
|
1321
|
+
resetPlacement = initialPlacement;
|
1322
|
+
break;
|
1323
|
+
}
|
1324
|
+
}
|
1325
|
+
if (placement !== resetPlacement) {
|
1326
|
+
return {
|
1327
|
+
reset: {
|
1328
|
+
placement: resetPlacement
|
1329
|
+
}
|
1330
|
+
};
|
1331
|
+
}
|
1332
|
+
}
|
1333
|
+
return {};
|
1447
1334
|
}
|
1448
1335
|
};
|
1449
|
-
}
|
1450
|
-
|
1451
|
-
var eventListeners = {
|
1452
|
-
name: "eventListeners",
|
1453
|
-
enabled: true,
|
1454
|
-
phase: "write",
|
1455
|
-
fn: function fn() {},
|
1456
|
-
effect: effect,
|
1457
|
-
data: {}
|
1458
|
-
};
|
1459
|
-
|
1460
|
-
var hash$1 = {
|
1461
|
-
left: "right",
|
1462
|
-
right: "left",
|
1463
|
-
bottom: "top",
|
1464
|
-
top: "bottom"
|
1465
1336
|
};
|
1466
1337
|
|
1467
|
-
function
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
}
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1338
|
+
async function convertValueToCoords(state, options) {
|
1339
|
+
const {placement: placement, platform: platform, elements: elements} = state;
|
1340
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
1341
|
+
const side = getSide(placement);
|
1342
|
+
const alignment = getAlignment(placement);
|
1343
|
+
const isVertical = getSideAxis(placement) === "y";
|
1344
|
+
const mainAxisMulti = [ "left", "top" ].includes(side) ? -1 : 1;
|
1345
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
1346
|
+
const rawValue = evaluate(options, state);
|
1347
|
+
let {mainAxis: mainAxis, crossAxis: crossAxis, alignmentAxis: alignmentAxis} = typeof rawValue === "number" ? {
|
1348
|
+
mainAxis: rawValue,
|
1349
|
+
crossAxis: 0,
|
1350
|
+
alignmentAxis: null
|
1351
|
+
} : {
|
1352
|
+
mainAxis: 0,
|
1353
|
+
crossAxis: 0,
|
1354
|
+
alignmentAxis: null,
|
1355
|
+
...rawValue
|
1356
|
+
};
|
1357
|
+
if (alignment && typeof alignmentAxis === "number") {
|
1358
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
1359
|
+
}
|
1360
|
+
return isVertical ? {
|
1361
|
+
x: crossAxis * crossAxisMulti,
|
1362
|
+
y: mainAxis * mainAxisMulti
|
1363
|
+
} : {
|
1364
|
+
x: mainAxis * mainAxisMulti,
|
1365
|
+
y: crossAxis * crossAxisMulti
|
1491
1366
|
};
|
1492
1367
|
}
|
1493
1368
|
|
1494
|
-
function
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
function getViewportRect(element, strategy) {
|
1499
|
-
var win = getWindow(element);
|
1500
|
-
var html = getDocumentElement(element);
|
1501
|
-
var visualViewport = win.visualViewport;
|
1502
|
-
var width = html.clientWidth;
|
1503
|
-
var height = html.clientHeight;
|
1504
|
-
var x = 0;
|
1505
|
-
var y = 0;
|
1506
|
-
if (visualViewport) {
|
1507
|
-
width = visualViewport.width;
|
1508
|
-
height = visualViewport.height;
|
1509
|
-
var layoutViewport = isLayoutViewport();
|
1510
|
-
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
1511
|
-
x = visualViewport.offsetLeft;
|
1512
|
-
y = visualViewport.offsetTop;
|
1513
|
-
}
|
1369
|
+
const offset = function(options) {
|
1370
|
+
if (options === void 0) {
|
1371
|
+
options = 0;
|
1514
1372
|
}
|
1515
1373
|
return {
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1374
|
+
name: "offset",
|
1375
|
+
options: options,
|
1376
|
+
async fn(state) {
|
1377
|
+
const {x: x, y: y} = state;
|
1378
|
+
const diffCoords = await convertValueToCoords(state, options);
|
1379
|
+
return {
|
1380
|
+
x: x + diffCoords.x,
|
1381
|
+
y: y + diffCoords.y,
|
1382
|
+
data: diffCoords
|
1383
|
+
};
|
1384
|
+
}
|
1520
1385
|
};
|
1521
|
-
}
|
1386
|
+
};
|
1522
1387
|
|
1523
|
-
function
|
1524
|
-
|
1525
|
-
|
1526
|
-
var winScroll = getWindowScroll(element);
|
1527
|
-
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
1528
|
-
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
1529
|
-
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
1530
|
-
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
1531
|
-
var y = -winScroll.scrollTop;
|
1532
|
-
if (getComputedStyle$1(body || html).direction === "rtl") {
|
1533
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
1388
|
+
const shift = function(options) {
|
1389
|
+
if (options === void 0) {
|
1390
|
+
options = {};
|
1534
1391
|
}
|
1535
1392
|
return {
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1393
|
+
name: "shift",
|
1394
|
+
options: options,
|
1395
|
+
async fn(state) {
|
1396
|
+
const {x: x, y: y, placement: placement} = state;
|
1397
|
+
const {mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter: limiter = {
|
1398
|
+
fn: _ref => {
|
1399
|
+
let {x: x, y: y} = _ref;
|
1400
|
+
return {
|
1401
|
+
x: x,
|
1402
|
+
y: y
|
1403
|
+
};
|
1404
|
+
}
|
1405
|
+
}, ...detectOverflowOptions} = evaluate(options, state);
|
1406
|
+
const coords = {
|
1407
|
+
x: x,
|
1408
|
+
y: y
|
1409
|
+
};
|
1410
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
1411
|
+
const crossAxis = getSideAxis(getSide(placement));
|
1412
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
1413
|
+
let mainAxisCoord = coords[mainAxis];
|
1414
|
+
let crossAxisCoord = coords[crossAxis];
|
1415
|
+
if (checkMainAxis) {
|
1416
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
1417
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
1418
|
+
const min = mainAxisCoord + overflow[minSide];
|
1419
|
+
const max = mainAxisCoord - overflow[maxSide];
|
1420
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
1421
|
+
}
|
1422
|
+
if (checkCrossAxis) {
|
1423
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
1424
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
1425
|
+
const min = crossAxisCoord + overflow[minSide];
|
1426
|
+
const max = crossAxisCoord - overflow[maxSide];
|
1427
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
1428
|
+
}
|
1429
|
+
const limitedCoords = limiter.fn({
|
1430
|
+
...state,
|
1431
|
+
[mainAxis]: mainAxisCoord,
|
1432
|
+
[crossAxis]: crossAxisCoord
|
1433
|
+
});
|
1434
|
+
return {
|
1435
|
+
...limitedCoords,
|
1436
|
+
data: {
|
1437
|
+
x: limitedCoords.x - x,
|
1438
|
+
y: limitedCoords.y - y
|
1439
|
+
}
|
1440
|
+
};
|
1441
|
+
}
|
1540
1442
|
};
|
1541
|
-
}
|
1542
|
-
|
1543
|
-
function isScrollParent(element) {
|
1544
|
-
var _getComputedStyle = getComputedStyle$1(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
1545
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
1546
|
-
}
|
1443
|
+
};
|
1547
1444
|
|
1548
|
-
function
|
1549
|
-
if (
|
1550
|
-
return node.
|
1445
|
+
function getNodeName(node) {
|
1446
|
+
if (isNode(node)) {
|
1447
|
+
return (node.nodeName || "").toLowerCase();
|
1551
1448
|
}
|
1552
|
-
|
1553
|
-
return node;
|
1554
|
-
}
|
1555
|
-
return getScrollParent(getParentNode(node));
|
1449
|
+
return "#document";
|
1556
1450
|
}
|
1557
1451
|
|
1558
|
-
function
|
1559
|
-
var
|
1560
|
-
|
1561
|
-
list = [];
|
1562
|
-
}
|
1563
|
-
var scrollParent = getScrollParent(element);
|
1564
|
-
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
1565
|
-
var win = getWindow(scrollParent);
|
1566
|
-
var target = isBody ? [ win ].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
1567
|
-
var updatedList = list.concat(target);
|
1568
|
-
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
1452
|
+
function getWindow(node) {
|
1453
|
+
var _node$ownerDocument;
|
1454
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
1569
1455
|
}
|
1570
1456
|
|
1571
|
-
function
|
1572
|
-
|
1573
|
-
|
1574
|
-
top: rect.y,
|
1575
|
-
right: rect.x + rect.width,
|
1576
|
-
bottom: rect.y + rect.height
|
1577
|
-
});
|
1457
|
+
function getDocumentElement(node) {
|
1458
|
+
var _ref;
|
1459
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
1578
1460
|
}
|
1579
1461
|
|
1580
|
-
function
|
1581
|
-
|
1582
|
-
rect.top = rect.top + element.clientTop;
|
1583
|
-
rect.left = rect.left + element.clientLeft;
|
1584
|
-
rect.bottom = rect.top + element.clientHeight;
|
1585
|
-
rect.right = rect.left + element.clientWidth;
|
1586
|
-
rect.width = element.clientWidth;
|
1587
|
-
rect.height = element.clientHeight;
|
1588
|
-
rect.x = rect.left;
|
1589
|
-
rect.y = rect.top;
|
1590
|
-
return rect;
|
1591
|
-
}
|
1592
|
-
|
1593
|
-
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
1594
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
1595
|
-
}
|
1596
|
-
|
1597
|
-
function getClippingParents(element) {
|
1598
|
-
var clippingParents = listScrollParents(getParentNode(element));
|
1599
|
-
var canEscapeClipping = [ "absolute", "fixed" ].indexOf(getComputedStyle$1(element).position) >= 0;
|
1600
|
-
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
1601
|
-
if (!isElement(clipperElement)) {
|
1602
|
-
return [];
|
1603
|
-
}
|
1604
|
-
return clippingParents.filter((function(clippingParent) {
|
1605
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
1606
|
-
}));
|
1462
|
+
function isNode(value) {
|
1463
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
1607
1464
|
}
|
1608
1465
|
|
1609
|
-
function
|
1610
|
-
|
1611
|
-
|
1612
|
-
var firstClippingParent = clippingParents[0];
|
1613
|
-
var clippingRect = clippingParents.reduce((function(accRect, clippingParent) {
|
1614
|
-
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
1615
|
-
accRect.top = max(rect.top, accRect.top);
|
1616
|
-
accRect.right = min(rect.right, accRect.right);
|
1617
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
1618
|
-
accRect.left = max(rect.left, accRect.left);
|
1619
|
-
return accRect;
|
1620
|
-
}), getClientRectFromMixedType(element, firstClippingParent, strategy));
|
1621
|
-
clippingRect.width = clippingRect.right - clippingRect.left;
|
1622
|
-
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
1623
|
-
clippingRect.x = clippingRect.left;
|
1624
|
-
clippingRect.y = clippingRect.top;
|
1625
|
-
return clippingRect;
|
1626
|
-
}
|
1627
|
-
|
1628
|
-
function computeOffsets(_ref) {
|
1629
|
-
var reference = _ref.reference, element = _ref.element, placement = _ref.placement;
|
1630
|
-
var basePlacement = placement ? getBasePlacement(placement) : null;
|
1631
|
-
var variation = placement ? getVariation(placement) : null;
|
1632
|
-
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
1633
|
-
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
1634
|
-
var offsets;
|
1635
|
-
switch (basePlacement) {
|
1636
|
-
case top:
|
1637
|
-
offsets = {
|
1638
|
-
x: commonX,
|
1639
|
-
y: reference.y - element.height
|
1640
|
-
};
|
1641
|
-
break;
|
1466
|
+
function isElement(value) {
|
1467
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
1468
|
+
}
|
1642
1469
|
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
y: reference.y + reference.height
|
1647
|
-
};
|
1648
|
-
break;
|
1470
|
+
function isHTMLElement(value) {
|
1471
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
1472
|
+
}
|
1649
1473
|
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1474
|
+
function isShadowRoot(value) {
|
1475
|
+
if (typeof ShadowRoot === "undefined") {
|
1476
|
+
return false;
|
1477
|
+
}
|
1478
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
1479
|
+
}
|
1656
1480
|
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
};
|
1662
|
-
break;
|
1481
|
+
function isOverflowElement(element) {
|
1482
|
+
const {overflow: overflow, overflowX: overflowX, overflowY: overflowY, display: display} = getComputedStyle$1(element);
|
1483
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && ![ "inline", "contents" ].includes(display);
|
1484
|
+
}
|
1663
1485
|
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
y: reference.y
|
1668
|
-
};
|
1669
|
-
}
|
1670
|
-
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
1671
|
-
if (mainAxis != null) {
|
1672
|
-
var len = mainAxis === "y" ? "height" : "width";
|
1673
|
-
switch (variation) {
|
1674
|
-
case start:
|
1675
|
-
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
1676
|
-
break;
|
1486
|
+
function isTableElement(element) {
|
1487
|
+
return [ "table", "td", "th" ].includes(getNodeName(element));
|
1488
|
+
}
|
1677
1489
|
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1490
|
+
function isContainingBlock(element) {
|
1491
|
+
const webkit = isWebKit();
|
1492
|
+
const css = getComputedStyle$1(element);
|
1493
|
+
return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || [ "transform", "perspective", "filter" ].some((value => (css.willChange || "").includes(value))) || [ "paint", "layout", "strict", "content" ].some((value => (css.contain || "").includes(value)));
|
1494
|
+
}
|
1495
|
+
|
1496
|
+
function getContainingBlock(element) {
|
1497
|
+
let currentNode = getParentNode(element);
|
1498
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
1499
|
+
if (isContainingBlock(currentNode)) {
|
1500
|
+
return currentNode;
|
1501
|
+
} else {
|
1502
|
+
currentNode = getParentNode(currentNode);
|
1681
1503
|
}
|
1682
1504
|
}
|
1683
|
-
return
|
1505
|
+
return null;
|
1684
1506
|
}
|
1685
1507
|
|
1686
|
-
function
|
1687
|
-
if (
|
1688
|
-
|
1508
|
+
function isWebKit() {
|
1509
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
1510
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
1511
|
+
}
|
1512
|
+
|
1513
|
+
function isLastTraversableNode(node) {
|
1514
|
+
return [ "html", "body", "#document" ].includes(getNodeName(node));
|
1515
|
+
}
|
1516
|
+
|
1517
|
+
function getComputedStyle$1(element) {
|
1518
|
+
return getWindow(element).getComputedStyle(element);
|
1519
|
+
}
|
1520
|
+
|
1521
|
+
function getNodeScroll(element) {
|
1522
|
+
if (isElement(element)) {
|
1523
|
+
return {
|
1524
|
+
scrollLeft: element.scrollLeft,
|
1525
|
+
scrollTop: element.scrollTop
|
1526
|
+
};
|
1689
1527
|
}
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
var popperRect = state.rects.popper;
|
1694
|
-
var element = state.elements[altBoundary ? altContext : elementContext];
|
1695
|
-
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
1696
|
-
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
1697
|
-
var popperOffsets = computeOffsets({
|
1698
|
-
reference: referenceClientRect,
|
1699
|
-
element: popperRect,
|
1700
|
-
strategy: "absolute",
|
1701
|
-
placement: placement
|
1702
|
-
});
|
1703
|
-
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
1704
|
-
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
1705
|
-
var overflowOffsets = {
|
1706
|
-
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
1707
|
-
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
1708
|
-
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
1709
|
-
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
1528
|
+
return {
|
1529
|
+
scrollLeft: element.pageXOffset,
|
1530
|
+
scrollTop: element.pageYOffset
|
1710
1531
|
};
|
1711
|
-
var offsetData = state.modifiersData.offset;
|
1712
|
-
if (elementContext === popper && offsetData) {
|
1713
|
-
var offset = offsetData[placement];
|
1714
|
-
Object.keys(overflowOffsets).forEach((function(key) {
|
1715
|
-
var multiply = [ right, bottom ].indexOf(key) >= 0 ? 1 : -1;
|
1716
|
-
var axis = [ top, bottom ].indexOf(key) >= 0 ? "y" : "x";
|
1717
|
-
overflowOffsets[key] += offset[axis] * multiply;
|
1718
|
-
}));
|
1719
|
-
}
|
1720
|
-
return overflowOffsets;
|
1721
1532
|
}
|
1722
1533
|
|
1723
|
-
function
|
1724
|
-
if (
|
1725
|
-
|
1534
|
+
function getParentNode(node) {
|
1535
|
+
if (getNodeName(node) === "html") {
|
1536
|
+
return node;
|
1726
1537
|
}
|
1727
|
-
|
1728
|
-
|
1729
|
-
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter((function(placement) {
|
1730
|
-
return getVariation(placement) === variation;
|
1731
|
-
})) : basePlacements;
|
1732
|
-
var allowedPlacements = placements$1.filter((function(placement) {
|
1733
|
-
return allowedAutoPlacements.indexOf(placement) >= 0;
|
1734
|
-
}));
|
1735
|
-
if (allowedPlacements.length === 0) {
|
1736
|
-
allowedPlacements = placements$1;
|
1737
|
-
}
|
1738
|
-
var overflows = allowedPlacements.reduce((function(acc, placement) {
|
1739
|
-
acc[placement] = detectOverflow(state, {
|
1740
|
-
placement: placement,
|
1741
|
-
boundary: boundary,
|
1742
|
-
rootBoundary: rootBoundary,
|
1743
|
-
padding: padding
|
1744
|
-
})[getBasePlacement(placement)];
|
1745
|
-
return acc;
|
1746
|
-
}), {});
|
1747
|
-
return Object.keys(overflows).sort((function(a, b) {
|
1748
|
-
return overflows[a] - overflows[b];
|
1749
|
-
}));
|
1538
|
+
const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
|
1539
|
+
return isShadowRoot(result) ? result.host : result;
|
1750
1540
|
}
|
1751
1541
|
|
1752
|
-
function
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
var oppositePlacement = getOppositePlacement(placement);
|
1757
|
-
return [ getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement) ];
|
1758
|
-
}
|
1759
|
-
|
1760
|
-
function flip(_ref) {
|
1761
|
-
var state = _ref.state, options = _ref.options, name = _ref.name;
|
1762
|
-
if (state.modifiersData[name]._skip) {
|
1763
|
-
return;
|
1764
|
-
}
|
1765
|
-
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
1766
|
-
var preferredPlacement = state.options.placement;
|
1767
|
-
var basePlacement = getBasePlacement(preferredPlacement);
|
1768
|
-
var isBasePlacement = basePlacement === preferredPlacement;
|
1769
|
-
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [ getOppositePlacement(preferredPlacement) ] : getExpandedFallbackPlacements(preferredPlacement));
|
1770
|
-
var placements = [ preferredPlacement ].concat(fallbackPlacements).reduce((function(acc, placement) {
|
1771
|
-
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
1772
|
-
placement: placement,
|
1773
|
-
boundary: boundary,
|
1774
|
-
rootBoundary: rootBoundary,
|
1775
|
-
padding: padding,
|
1776
|
-
flipVariations: flipVariations,
|
1777
|
-
allowedAutoPlacements: allowedAutoPlacements
|
1778
|
-
}) : placement);
|
1779
|
-
}), []);
|
1780
|
-
var referenceRect = state.rects.reference;
|
1781
|
-
var popperRect = state.rects.popper;
|
1782
|
-
var checksMap = new Map;
|
1783
|
-
var makeFallbackChecks = true;
|
1784
|
-
var firstFittingPlacement = placements[0];
|
1785
|
-
for (var i = 0; i < placements.length; i++) {
|
1786
|
-
var placement = placements[i];
|
1787
|
-
var _basePlacement = getBasePlacement(placement);
|
1788
|
-
var isStartVariation = getVariation(placement) === start;
|
1789
|
-
var isVertical = [ top, bottom ].indexOf(_basePlacement) >= 0;
|
1790
|
-
var len = isVertical ? "width" : "height";
|
1791
|
-
var overflow = detectOverflow(state, {
|
1792
|
-
placement: placement,
|
1793
|
-
boundary: boundary,
|
1794
|
-
rootBoundary: rootBoundary,
|
1795
|
-
altBoundary: altBoundary,
|
1796
|
-
padding: padding
|
1797
|
-
});
|
1798
|
-
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
1799
|
-
if (referenceRect[len] > popperRect[len]) {
|
1800
|
-
mainVariationSide = getOppositePlacement(mainVariationSide);
|
1801
|
-
}
|
1802
|
-
var altVariationSide = getOppositePlacement(mainVariationSide);
|
1803
|
-
var checks = [];
|
1804
|
-
if (checkMainAxis) {
|
1805
|
-
checks.push(overflow[_basePlacement] <= 0);
|
1806
|
-
}
|
1807
|
-
if (checkAltAxis) {
|
1808
|
-
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
1809
|
-
}
|
1810
|
-
if (checks.every((function(check) {
|
1811
|
-
return check;
|
1812
|
-
}))) {
|
1813
|
-
firstFittingPlacement = placement;
|
1814
|
-
makeFallbackChecks = false;
|
1815
|
-
break;
|
1816
|
-
}
|
1817
|
-
checksMap.set(placement, checks);
|
1818
|
-
}
|
1819
|
-
if (makeFallbackChecks) {
|
1820
|
-
var numberOfChecks = flipVariations ? 3 : 1;
|
1821
|
-
var _loop = function _loop(_i) {
|
1822
|
-
var fittingPlacement = placements.find((function(placement) {
|
1823
|
-
var checks = checksMap.get(placement);
|
1824
|
-
if (checks) {
|
1825
|
-
return checks.slice(0, _i).every((function(check) {
|
1826
|
-
return check;
|
1827
|
-
}));
|
1828
|
-
}
|
1829
|
-
}));
|
1830
|
-
if (fittingPlacement) {
|
1831
|
-
firstFittingPlacement = fittingPlacement;
|
1832
|
-
return "break";
|
1833
|
-
}
|
1834
|
-
};
|
1835
|
-
for (var _i = numberOfChecks; _i > 0; _i--) {
|
1836
|
-
var _ret = _loop(_i);
|
1837
|
-
if (_ret === "break") break;
|
1838
|
-
}
|
1542
|
+
function getNearestOverflowAncestor(node) {
|
1543
|
+
const parentNode = getParentNode(node);
|
1544
|
+
if (isLastTraversableNode(parentNode)) {
|
1545
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
1839
1546
|
}
|
1840
|
-
if (
|
1841
|
-
|
1842
|
-
state.placement = firstFittingPlacement;
|
1843
|
-
state.reset = true;
|
1547
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
1548
|
+
return parentNode;
|
1844
1549
|
}
|
1550
|
+
return getNearestOverflowAncestor(parentNode);
|
1845
1551
|
}
|
1846
1552
|
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
fn: flip,
|
1852
|
-
requiresIfExists: [ "offset" ],
|
1853
|
-
data: {
|
1854
|
-
_skip: false
|
1553
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
1554
|
+
var _node$ownerDocument2;
|
1555
|
+
if (list === void 0) {
|
1556
|
+
list = [];
|
1855
1557
|
}
|
1856
|
-
|
1558
|
+
if (traverseIframes === void 0) {
|
1559
|
+
traverseIframes = true;
|
1560
|
+
}
|
1561
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
1562
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
1563
|
+
const win = getWindow(scrollableAncestor);
|
1564
|
+
if (isBody) {
|
1565
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
1566
|
+
}
|
1567
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
1568
|
+
}
|
1857
1569
|
|
1858
|
-
function
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1570
|
+
function getCssDimensions(element) {
|
1571
|
+
const css = getComputedStyle$1(element);
|
1572
|
+
let width = parseFloat(css.width) || 0;
|
1573
|
+
let height = parseFloat(css.height) || 0;
|
1574
|
+
const hasOffset = isHTMLElement(element);
|
1575
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
1576
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
1577
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
1578
|
+
if (shouldFallback) {
|
1579
|
+
width = offsetWidth;
|
1580
|
+
height = offsetHeight;
|
1864
1581
|
}
|
1865
1582
|
return {
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
left: overflow.left - rect.width - preventedOffsets.x
|
1583
|
+
width: width,
|
1584
|
+
height: height,
|
1585
|
+
$: shouldFallback
|
1870
1586
|
};
|
1871
1587
|
}
|
1872
1588
|
|
1873
|
-
function
|
1874
|
-
return
|
1875
|
-
return overflow[side] >= 0;
|
1876
|
-
}));
|
1589
|
+
function unwrapElement(element) {
|
1590
|
+
return !isElement(element) ? element.contextElement : element;
|
1877
1591
|
}
|
1878
1592
|
|
1879
|
-
function
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
isReferenceHidden: isReferenceHidden,
|
1898
|
-
hasPopperEscaped: hasPopperEscaped
|
1593
|
+
function getScale(element) {
|
1594
|
+
const domElement = unwrapElement(element);
|
1595
|
+
if (!isHTMLElement(domElement)) {
|
1596
|
+
return createCoords(1);
|
1597
|
+
}
|
1598
|
+
const rect = domElement.getBoundingClientRect();
|
1599
|
+
const {width: width, height: height, $: $} = getCssDimensions(domElement);
|
1600
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
1601
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
1602
|
+
if (!x || !Number.isFinite(x)) {
|
1603
|
+
x = 1;
|
1604
|
+
}
|
1605
|
+
if (!y || !Number.isFinite(y)) {
|
1606
|
+
y = 1;
|
1607
|
+
}
|
1608
|
+
return {
|
1609
|
+
x: x,
|
1610
|
+
y: y
|
1899
1611
|
};
|
1900
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
1901
|
-
"data-popper-reference-hidden": isReferenceHidden,
|
1902
|
-
"data-popper-escaped": hasPopperEscaped
|
1903
|
-
});
|
1904
1612
|
}
|
1905
1613
|
|
1906
|
-
|
1907
|
-
name: "hide",
|
1908
|
-
enabled: true,
|
1909
|
-
phase: "main",
|
1910
|
-
requiresIfExists: [ "preventOverflow" ],
|
1911
|
-
fn: hide
|
1912
|
-
};
|
1614
|
+
const noOffsets = createCoords(0);
|
1913
1615
|
|
1914
|
-
function
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
return [ left, right ].indexOf(basePlacement) >= 0 ? {
|
1923
|
-
x: distance,
|
1924
|
-
y: skidding
|
1925
|
-
} : {
|
1926
|
-
x: skidding,
|
1927
|
-
y: distance
|
1616
|
+
function getVisualOffsets(element) {
|
1617
|
+
const win = getWindow(element);
|
1618
|
+
if (!isWebKit() || !win.visualViewport) {
|
1619
|
+
return noOffsets;
|
1620
|
+
}
|
1621
|
+
return {
|
1622
|
+
x: win.visualViewport.offsetLeft,
|
1623
|
+
y: win.visualViewport.offsetTop
|
1928
1624
|
};
|
1929
1625
|
}
|
1930
1626
|
|
1931
|
-
function
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
return
|
1937
|
-
}), {});
|
1938
|
-
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
1939
|
-
if (state.modifiersData.popperOffsets != null) {
|
1940
|
-
state.modifiersData.popperOffsets.x += x;
|
1941
|
-
state.modifiersData.popperOffsets.y += y;
|
1627
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
1628
|
+
if (isFixed === void 0) {
|
1629
|
+
isFixed = false;
|
1630
|
+
}
|
1631
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
1632
|
+
return false;
|
1942
1633
|
}
|
1943
|
-
|
1634
|
+
return isFixed;
|
1944
1635
|
}
|
1945
1636
|
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
}
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1637
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
1638
|
+
if (includeScale === void 0) {
|
1639
|
+
includeScale = false;
|
1640
|
+
}
|
1641
|
+
if (isFixedStrategy === void 0) {
|
1642
|
+
isFixedStrategy = false;
|
1643
|
+
}
|
1644
|
+
const clientRect = element.getBoundingClientRect();
|
1645
|
+
const domElement = unwrapElement(element);
|
1646
|
+
let scale = createCoords(1);
|
1647
|
+
if (includeScale) {
|
1648
|
+
if (offsetParent) {
|
1649
|
+
if (isElement(offsetParent)) {
|
1650
|
+
scale = getScale(offsetParent);
|
1651
|
+
}
|
1652
|
+
} else {
|
1653
|
+
scale = getScale(element);
|
1654
|
+
}
|
1655
|
+
}
|
1656
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
1657
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
1658
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
1659
|
+
let width = clientRect.width / scale.x;
|
1660
|
+
let height = clientRect.height / scale.y;
|
1661
|
+
if (domElement) {
|
1662
|
+
const win = getWindow(domElement);
|
1663
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
1664
|
+
let currentIFrame = win.frameElement;
|
1665
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
1666
|
+
const iframeScale = getScale(currentIFrame);
|
1667
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
1668
|
+
const css = getComputedStyle$1(currentIFrame);
|
1669
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
1670
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
1671
|
+
x *= iframeScale.x;
|
1672
|
+
y *= iframeScale.y;
|
1673
|
+
width *= iframeScale.x;
|
1674
|
+
height *= iframeScale.y;
|
1675
|
+
x += left;
|
1676
|
+
y += top;
|
1677
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
1678
|
+
}
|
1679
|
+
}
|
1680
|
+
return rectToClientRect({
|
1681
|
+
width: width,
|
1682
|
+
height: height,
|
1683
|
+
x: x,
|
1684
|
+
y: y
|
1961
1685
|
});
|
1962
1686
|
}
|
1963
1687
|
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
}
|
1688
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
1689
|
+
let {rect: rect, offsetParent: offsetParent, strategy: strategy} = _ref;
|
1690
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
1691
|
+
const documentElement = getDocumentElement(offsetParent);
|
1692
|
+
if (offsetParent === documentElement) {
|
1693
|
+
return rect;
|
1694
|
+
}
|
1695
|
+
let scroll = {
|
1696
|
+
scrollLeft: 0,
|
1697
|
+
scrollTop: 0
|
1698
|
+
};
|
1699
|
+
let scale = createCoords(1);
|
1700
|
+
const offsets = createCoords(0);
|
1701
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
1702
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
1703
|
+
scroll = getNodeScroll(offsetParent);
|
1704
|
+
}
|
1705
|
+
if (isHTMLElement(offsetParent)) {
|
1706
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
1707
|
+
scale = getScale(offsetParent);
|
1708
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
1709
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
1710
|
+
}
|
1711
|
+
}
|
1712
|
+
return {
|
1713
|
+
width: rect.width * scale.x,
|
1714
|
+
height: rect.height * scale.y,
|
1715
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
1716
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
1717
|
+
};
|
1718
|
+
}
|
1971
1719
|
|
1972
|
-
function
|
1973
|
-
return
|
1720
|
+
function getClientRects(element) {
|
1721
|
+
return Array.from(element.getClientRects());
|
1974
1722
|
}
|
1975
1723
|
|
1976
|
-
function
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
1997
|
-
mainAxis: tetherOffsetValue,
|
1998
|
-
altAxis: tetherOffsetValue
|
1999
|
-
} : Object.assign({
|
2000
|
-
mainAxis: 0,
|
2001
|
-
altAxis: 0
|
2002
|
-
}, tetherOffsetValue);
|
2003
|
-
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
2004
|
-
var data = {
|
2005
|
-
x: 0,
|
2006
|
-
y: 0
|
1724
|
+
function getWindowScrollBarX(element) {
|
1725
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
1726
|
+
}
|
1727
|
+
|
1728
|
+
function getDocumentRect(element) {
|
1729
|
+
const html = getDocumentElement(element);
|
1730
|
+
const scroll = getNodeScroll(element);
|
1731
|
+
const body = element.ownerDocument.body;
|
1732
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
1733
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
1734
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
1735
|
+
const y = -scroll.scrollTop;
|
1736
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
1737
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
1738
|
+
}
|
1739
|
+
return {
|
1740
|
+
width: width,
|
1741
|
+
height: height,
|
1742
|
+
x: x,
|
1743
|
+
y: y
|
2007
1744
|
};
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
2035
|
-
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
2036
|
-
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
2037
|
-
var tetherMax = offset + maxOffset - offsetModifierValue;
|
2038
|
-
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
2039
|
-
popperOffsets[mainAxis] = preventedOffset;
|
2040
|
-
data[mainAxis] = preventedOffset - offset;
|
2041
|
-
}
|
2042
|
-
if (checkAltAxis) {
|
2043
|
-
var _offsetModifierState$2;
|
2044
|
-
var _mainSide = mainAxis === "x" ? top : left;
|
2045
|
-
var _altSide = mainAxis === "x" ? bottom : right;
|
2046
|
-
var _offset = popperOffsets[altAxis];
|
2047
|
-
var _len = altAxis === "y" ? "height" : "width";
|
2048
|
-
var _min = _offset + overflow[_mainSide];
|
2049
|
-
var _max = _offset - overflow[_altSide];
|
2050
|
-
var isOriginSide = [ top, left ].indexOf(basePlacement) !== -1;
|
2051
|
-
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
2052
|
-
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
2053
|
-
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
2054
|
-
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
2055
|
-
popperOffsets[altAxis] = _preventedOffset;
|
2056
|
-
data[altAxis] = _preventedOffset - _offset;
|
2057
|
-
}
|
2058
|
-
state.modifiersData[name] = data;
|
2059
|
-
}
|
2060
|
-
|
2061
|
-
var preventOverflow$1 = {
|
2062
|
-
name: "preventOverflow",
|
2063
|
-
enabled: true,
|
2064
|
-
phase: "main",
|
2065
|
-
fn: preventOverflow,
|
2066
|
-
requiresIfExists: [ "offset" ]
|
2067
|
-
};
|
1745
|
+
}
|
1746
|
+
|
1747
|
+
function getViewportRect(element, strategy) {
|
1748
|
+
const win = getWindow(element);
|
1749
|
+
const html = getDocumentElement(element);
|
1750
|
+
const visualViewport = win.visualViewport;
|
1751
|
+
let width = html.clientWidth;
|
1752
|
+
let height = html.clientHeight;
|
1753
|
+
let x = 0;
|
1754
|
+
let y = 0;
|
1755
|
+
if (visualViewport) {
|
1756
|
+
width = visualViewport.width;
|
1757
|
+
height = visualViewport.height;
|
1758
|
+
const visualViewportBased = isWebKit();
|
1759
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
1760
|
+
x = visualViewport.offsetLeft;
|
1761
|
+
y = visualViewport.offsetTop;
|
1762
|
+
}
|
1763
|
+
}
|
1764
|
+
return {
|
1765
|
+
width: width,
|
1766
|
+
height: height,
|
1767
|
+
x: x,
|
1768
|
+
y: y
|
1769
|
+
};
|
1770
|
+
}
|
2068
1771
|
|
2069
|
-
function
|
1772
|
+
function getInnerBoundingClientRect(element, strategy) {
|
1773
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
1774
|
+
const top = clientRect.top + element.clientTop;
|
1775
|
+
const left = clientRect.left + element.clientLeft;
|
1776
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
1777
|
+
const width = element.clientWidth * scale.x;
|
1778
|
+
const height = element.clientHeight * scale.y;
|
1779
|
+
const x = left * scale.x;
|
1780
|
+
const y = top * scale.y;
|
2070
1781
|
return {
|
2071
|
-
|
2072
|
-
|
1782
|
+
width: width,
|
1783
|
+
height: height,
|
1784
|
+
x: x,
|
1785
|
+
y: y
|
2073
1786
|
};
|
2074
1787
|
}
|
2075
1788
|
|
2076
|
-
function
|
2077
|
-
|
2078
|
-
|
1789
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
1790
|
+
let rect;
|
1791
|
+
if (clippingAncestor === "viewport") {
|
1792
|
+
rect = getViewportRect(element, strategy);
|
1793
|
+
} else if (clippingAncestor === "document") {
|
1794
|
+
rect = getDocumentRect(getDocumentElement(element));
|
1795
|
+
} else if (isElement(clippingAncestor)) {
|
1796
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
2079
1797
|
} else {
|
2080
|
-
|
1798
|
+
const visualOffsets = getVisualOffsets(element);
|
1799
|
+
rect = {
|
1800
|
+
...clippingAncestor,
|
1801
|
+
x: clippingAncestor.x - visualOffsets.x,
|
1802
|
+
y: clippingAncestor.y - visualOffsets.y
|
1803
|
+
};
|
2081
1804
|
}
|
1805
|
+
return rectToClientRect(rect);
|
2082
1806
|
}
|
2083
1807
|
|
2084
|
-
function
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
1808
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
1809
|
+
const parentNode = getParentNode(element);
|
1810
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
1811
|
+
return false;
|
1812
|
+
}
|
1813
|
+
return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
2089
1814
|
}
|
2090
1815
|
|
2091
|
-
function
|
2092
|
-
|
2093
|
-
|
1816
|
+
function getClippingElementAncestors(element, cache) {
|
1817
|
+
const cachedResult = cache.get(element);
|
1818
|
+
if (cachedResult) {
|
1819
|
+
return cachedResult;
|
1820
|
+
}
|
1821
|
+
let result = getOverflowAncestors(element, [], false).filter((el => isElement(el) && getNodeName(el) !== "body"));
|
1822
|
+
let currentContainingBlockComputedStyle = null;
|
1823
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
1824
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
1825
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
1826
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
1827
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
1828
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
1829
|
+
currentContainingBlockComputedStyle = null;
|
1830
|
+
}
|
1831
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && [ "absolute", "fixed" ].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
1832
|
+
if (shouldDropCurrentNode) {
|
1833
|
+
result = result.filter((ancestor => ancestor !== currentNode));
|
1834
|
+
} else {
|
1835
|
+
currentContainingBlockComputedStyle = computedStyle;
|
1836
|
+
}
|
1837
|
+
currentNode = getParentNode(currentNode);
|
2094
1838
|
}
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
1839
|
+
cache.set(element, result);
|
1840
|
+
return result;
|
1841
|
+
}
|
1842
|
+
|
1843
|
+
function getClippingRect(_ref) {
|
1844
|
+
let {element: element, boundary: boundary, rootBoundary: rootBoundary, strategy: strategy} = _ref;
|
1845
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
1846
|
+
const clippingAncestors = [ ...elementClippingAncestors, rootBoundary ];
|
1847
|
+
const firstClippingAncestor = clippingAncestors[0];
|
1848
|
+
const clippingRect = clippingAncestors.reduce(((accRect, clippingAncestor) => {
|
1849
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
1850
|
+
accRect.top = max(rect.top, accRect.top);
|
1851
|
+
accRect.right = min(rect.right, accRect.right);
|
1852
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
1853
|
+
accRect.left = max(rect.left, accRect.left);
|
1854
|
+
return accRect;
|
1855
|
+
}), getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
1856
|
+
return {
|
1857
|
+
width: clippingRect.right - clippingRect.left,
|
1858
|
+
height: clippingRect.bottom - clippingRect.top,
|
1859
|
+
x: clippingRect.left,
|
1860
|
+
y: clippingRect.top
|
1861
|
+
};
|
1862
|
+
}
|
1863
|
+
|
1864
|
+
function getDimensions(element) {
|
1865
|
+
return getCssDimensions(element);
|
1866
|
+
}
|
1867
|
+
|
1868
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
1869
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
1870
|
+
const documentElement = getDocumentElement(offsetParent);
|
1871
|
+
const isFixed = strategy === "fixed";
|
1872
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
1873
|
+
let scroll = {
|
2100
1874
|
scrollLeft: 0,
|
2101
1875
|
scrollTop: 0
|
2102
1876
|
};
|
2103
|
-
|
2104
|
-
x: 0,
|
2105
|
-
y: 0
|
2106
|
-
};
|
1877
|
+
const offsets = createCoords(0);
|
2107
1878
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
2108
|
-
if (getNodeName(offsetParent) !== "body" ||
|
1879
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
2109
1880
|
scroll = getNodeScroll(offsetParent);
|
2110
1881
|
}
|
2111
|
-
if (
|
2112
|
-
|
2113
|
-
offsets.x
|
2114
|
-
offsets.y
|
1882
|
+
if (isOffsetParentAnElement) {
|
1883
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
1884
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
1885
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
2115
1886
|
} else if (documentElement) {
|
2116
1887
|
offsets.x = getWindowScrollBarX(documentElement);
|
2117
1888
|
}
|
@@ -2124,210 +1895,202 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
2124
1895
|
};
|
2125
1896
|
}
|
2126
1897
|
|
2127
|
-
function
|
2128
|
-
|
2129
|
-
|
2130
|
-
var result = [];
|
2131
|
-
modifiers.forEach((function(modifier) {
|
2132
|
-
map.set(modifier.name, modifier);
|
2133
|
-
}));
|
2134
|
-
function sort(modifier) {
|
2135
|
-
visited.add(modifier.name);
|
2136
|
-
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
2137
|
-
requires.forEach((function(dep) {
|
2138
|
-
if (!visited.has(dep)) {
|
2139
|
-
var depModifier = map.get(dep);
|
2140
|
-
if (depModifier) {
|
2141
|
-
sort(depModifier);
|
2142
|
-
}
|
2143
|
-
}
|
2144
|
-
}));
|
2145
|
-
result.push(modifier);
|
1898
|
+
function getTrueOffsetParent(element, polyfill) {
|
1899
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
1900
|
+
return null;
|
2146
1901
|
}
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
}));
|
2152
|
-
return result;
|
1902
|
+
if (polyfill) {
|
1903
|
+
return polyfill(element);
|
1904
|
+
}
|
1905
|
+
return element.offsetParent;
|
2153
1906
|
}
|
2154
1907
|
|
2155
|
-
function
|
2156
|
-
|
2157
|
-
|
2158
|
-
return
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
1908
|
+
function getOffsetParent(element, polyfill) {
|
1909
|
+
const window = getWindow(element);
|
1910
|
+
if (!isHTMLElement(element)) {
|
1911
|
+
return window;
|
1912
|
+
}
|
1913
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
1914
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
1915
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
1916
|
+
}
|
1917
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
1918
|
+
return window;
|
1919
|
+
}
|
1920
|
+
return offsetParent || getContainingBlock(element) || window;
|
2162
1921
|
}
|
2163
1922
|
|
2164
|
-
function
|
2165
|
-
|
2166
|
-
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
1923
|
+
const getElementRects = async function(_ref) {
|
1924
|
+
let {reference: reference, floating: floating, strategy: strategy} = _ref;
|
1925
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
1926
|
+
const getDimensionsFn = this.getDimensions;
|
1927
|
+
return {
|
1928
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
1929
|
+
floating: {
|
1930
|
+
x: 0,
|
1931
|
+
y: 0,
|
1932
|
+
...await getDimensionsFn(floating)
|
2174
1933
|
}
|
2175
|
-
return pending;
|
2176
1934
|
};
|
2177
|
-
}
|
2178
|
-
|
2179
|
-
function mergeByName(modifiers) {
|
2180
|
-
var merged = modifiers.reduce((function(merged, current) {
|
2181
|
-
var existing = merged[current.name];
|
2182
|
-
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
2183
|
-
options: Object.assign({}, existing.options, current.options),
|
2184
|
-
data: Object.assign({}, existing.data, current.data)
|
2185
|
-
}) : current;
|
2186
|
-
return merged;
|
2187
|
-
}), {});
|
2188
|
-
return Object.keys(merged).map((function(key) {
|
2189
|
-
return merged[key];
|
2190
|
-
}));
|
2191
|
-
}
|
2192
|
-
|
2193
|
-
var DEFAULT_OPTIONS = {
|
2194
|
-
placement: "bottom",
|
2195
|
-
modifiers: [],
|
2196
|
-
strategy: "absolute"
|
2197
1935
|
};
|
2198
1936
|
|
2199
|
-
function
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
1937
|
+
function isRTL(element) {
|
1938
|
+
return getComputedStyle$1(element).direction === "rtl";
|
1939
|
+
}
|
1940
|
+
|
1941
|
+
const platform = {
|
1942
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect,
|
1943
|
+
getDocumentElement: getDocumentElement,
|
1944
|
+
getClippingRect: getClippingRect,
|
1945
|
+
getOffsetParent: getOffsetParent,
|
1946
|
+
getElementRects: getElementRects,
|
1947
|
+
getClientRects: getClientRects,
|
1948
|
+
getDimensions: getDimensions,
|
1949
|
+
getScale: getScale,
|
1950
|
+
isElement: isElement,
|
1951
|
+
isRTL: isRTL
|
1952
|
+
};
|
2207
1953
|
|
2208
|
-
function
|
2209
|
-
|
2210
|
-
|
1954
|
+
function observeMove(element, onMove) {
|
1955
|
+
let io = null;
|
1956
|
+
let timeoutId;
|
1957
|
+
const root = getDocumentElement(element);
|
1958
|
+
function cleanup() {
|
1959
|
+
clearTimeout(timeoutId);
|
1960
|
+
io && io.disconnect();
|
1961
|
+
io = null;
|
2211
1962
|
}
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
options = defaultOptions;
|
1963
|
+
function refresh(skip, threshold) {
|
1964
|
+
if (skip === void 0) {
|
1965
|
+
skip = false;
|
2216
1966
|
}
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
1967
|
+
if (threshold === void 0) {
|
1968
|
+
threshold = 1;
|
1969
|
+
}
|
1970
|
+
cleanup();
|
1971
|
+
const {left: left, top: top, width: width, height: height} = element.getBoundingClientRect();
|
1972
|
+
if (!skip) {
|
1973
|
+
onMove();
|
1974
|
+
}
|
1975
|
+
if (!width || !height) {
|
1976
|
+
return;
|
1977
|
+
}
|
1978
|
+
const insetTop = floor(top);
|
1979
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
1980
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
1981
|
+
const insetLeft = floor(left);
|
1982
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
1983
|
+
const options = {
|
1984
|
+
rootMargin: rootMargin,
|
1985
|
+
threshold: max(0, min(1, threshold)) || 1
|
2228
1986
|
};
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
cleanupModifierEffects();
|
2236
|
-
state.options = Object.assign({}, defaultOptions, state.options, options);
|
2237
|
-
state.scrollParents = {
|
2238
|
-
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
2239
|
-
popper: listScrollParents(popper)
|
2240
|
-
};
|
2241
|
-
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers)));
|
2242
|
-
state.orderedModifiers = orderedModifiers.filter((function(m) {
|
2243
|
-
return m.enabled;
|
2244
|
-
}));
|
2245
|
-
runModifierEffects();
|
2246
|
-
return instance.update();
|
2247
|
-
},
|
2248
|
-
forceUpdate: function forceUpdate() {
|
2249
|
-
if (isDestroyed) {
|
2250
|
-
return;
|
1987
|
+
let isFirstUpdate = true;
|
1988
|
+
function handleObserve(entries) {
|
1989
|
+
const ratio = entries[0].intersectionRatio;
|
1990
|
+
if (ratio !== threshold) {
|
1991
|
+
if (!isFirstUpdate) {
|
1992
|
+
return refresh();
|
2251
1993
|
}
|
2252
|
-
|
2253
|
-
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2257
|
-
|
2258
|
-
popper: getLayoutRect(popper)
|
2259
|
-
};
|
2260
|
-
state.reset = false;
|
2261
|
-
state.placement = state.options.placement;
|
2262
|
-
state.orderedModifiers.forEach((function(modifier) {
|
2263
|
-
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
2264
|
-
}));
|
2265
|
-
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
2266
|
-
if (state.reset === true) {
|
2267
|
-
state.reset = false;
|
2268
|
-
index = -1;
|
2269
|
-
continue;
|
2270
|
-
}
|
2271
|
-
var _state$orderedModifie = state.orderedModifiers[index], fn = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
2272
|
-
if (typeof fn === "function") {
|
2273
|
-
state = fn({
|
2274
|
-
state: state,
|
2275
|
-
options: _options,
|
2276
|
-
name: name,
|
2277
|
-
instance: instance
|
2278
|
-
}) || state;
|
2279
|
-
}
|
1994
|
+
if (!ratio) {
|
1995
|
+
timeoutId = setTimeout((() => {
|
1996
|
+
refresh(false, 1e-7);
|
1997
|
+
}), 100);
|
1998
|
+
} else {
|
1999
|
+
refresh(false, ratio);
|
2280
2000
|
}
|
2281
|
-
},
|
2282
|
-
update: debounce((function() {
|
2283
|
-
return new Promise((function(resolve) {
|
2284
|
-
instance.forceUpdate();
|
2285
|
-
resolve(state);
|
2286
|
-
}));
|
2287
|
-
})),
|
2288
|
-
destroy: function destroy() {
|
2289
|
-
cleanupModifierEffects();
|
2290
|
-
isDestroyed = true;
|
2291
2001
|
}
|
2292
|
-
|
2293
|
-
if (!areValidElements(reference, popper)) {
|
2294
|
-
return instance;
|
2002
|
+
isFirstUpdate = false;
|
2295
2003
|
}
|
2296
|
-
|
2297
|
-
|
2298
|
-
options
|
2004
|
+
try {
|
2005
|
+
io = new IntersectionObserver(handleObserve, {
|
2006
|
+
...options,
|
2007
|
+
root: root.ownerDocument
|
2008
|
+
});
|
2009
|
+
} catch (e) {
|
2010
|
+
io = new IntersectionObserver(handleObserve, options);
|
2011
|
+
}
|
2012
|
+
io.observe(element);
|
2013
|
+
}
|
2014
|
+
refresh(true);
|
2015
|
+
return cleanup;
|
2016
|
+
}
|
2017
|
+
|
2018
|
+
function autoUpdate(reference, floating, update, options) {
|
2019
|
+
if (options === void 0) {
|
2020
|
+
options = {};
|
2021
|
+
}
|
2022
|
+
const {ancestorScroll: ancestorScroll = true, ancestorResize: ancestorResize = true, elementResize: elementResize = typeof ResizeObserver === "function", layoutShift: layoutShift = typeof IntersectionObserver === "function", animationFrame: animationFrame = false} = options;
|
2023
|
+
const referenceEl = unwrapElement(reference);
|
2024
|
+
const ancestors = ancestorScroll || ancestorResize ? [ ...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating) ] : [];
|
2025
|
+
ancestors.forEach((ancestor => {
|
2026
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
2027
|
+
passive: true
|
2028
|
+
});
|
2029
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
2030
|
+
}));
|
2031
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
2032
|
+
let reobserveFrame = -1;
|
2033
|
+
let resizeObserver = null;
|
2034
|
+
if (elementResize) {
|
2035
|
+
resizeObserver = new ResizeObserver((_ref => {
|
2036
|
+
let [firstEntry] = _ref;
|
2037
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
2038
|
+
resizeObserver.unobserve(floating);
|
2039
|
+
cancelAnimationFrame(reobserveFrame);
|
2040
|
+
reobserveFrame = requestAnimationFrame((() => {
|
2041
|
+
resizeObserver && resizeObserver.observe(floating);
|
2042
|
+
}));
|
2299
2043
|
}
|
2044
|
+
update();
|
2300
2045
|
}));
|
2301
|
-
|
2302
|
-
|
2303
|
-
var name = _ref3.name, _ref3$options = _ref3.options, options = _ref3$options === void 0 ? {} : _ref3$options, effect = _ref3.effect;
|
2304
|
-
if (typeof effect === "function") {
|
2305
|
-
var cleanupFn = effect({
|
2306
|
-
state: state,
|
2307
|
-
name: name,
|
2308
|
-
instance: instance,
|
2309
|
-
options: options
|
2310
|
-
});
|
2311
|
-
var noopFn = function noopFn() {};
|
2312
|
-
effectCleanupFns.push(cleanupFn || noopFn);
|
2313
|
-
}
|
2314
|
-
}));
|
2046
|
+
if (referenceEl && !animationFrame) {
|
2047
|
+
resizeObserver.observe(referenceEl);
|
2315
2048
|
}
|
2316
|
-
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2320
|
-
|
2049
|
+
resizeObserver.observe(floating);
|
2050
|
+
}
|
2051
|
+
let frameId;
|
2052
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
2053
|
+
if (animationFrame) {
|
2054
|
+
frameLoop();
|
2055
|
+
}
|
2056
|
+
function frameLoop() {
|
2057
|
+
const nextRefRect = getBoundingClientRect(reference);
|
2058
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
2059
|
+
update();
|
2060
|
+
}
|
2061
|
+
prevRefRect = nextRefRect;
|
2062
|
+
frameId = requestAnimationFrame(frameLoop);
|
2063
|
+
}
|
2064
|
+
update();
|
2065
|
+
return () => {
|
2066
|
+
ancestors.forEach((ancestor => {
|
2067
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
2068
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
2069
|
+
}));
|
2070
|
+
cleanupIo && cleanupIo();
|
2071
|
+
resizeObserver && resizeObserver.disconnect();
|
2072
|
+
resizeObserver = null;
|
2073
|
+
if (animationFrame) {
|
2074
|
+
cancelAnimationFrame(frameId);
|
2321
2075
|
}
|
2322
|
-
return instance;
|
2323
2076
|
};
|
2324
2077
|
}
|
2325
2078
|
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2079
|
+
const computePosition = (reference, floating, options) => {
|
2080
|
+
const cache = new Map;
|
2081
|
+
const mergedOptions = {
|
2082
|
+
platform: platform,
|
2083
|
+
...options
|
2084
|
+
};
|
2085
|
+
const platformWithCache = {
|
2086
|
+
...mergedOptions.platform,
|
2087
|
+
_c: cache
|
2088
|
+
};
|
2089
|
+
return computePosition$1(reference, floating, {
|
2090
|
+
...mergedOptions,
|
2091
|
+
platform: platformWithCache
|
2092
|
+
});
|
2093
|
+
};
|
2331
2094
|
|
2332
2095
|
class Popover extends Controller {
|
2333
2096
|
static targets=[ "activator", "popover", "template" ];
|
@@ -2335,43 +2098,55 @@ class Popover extends Controller {
|
|
2335
2098
|
static values={
|
2336
2099
|
appendToBody: Boolean,
|
2337
2100
|
placement: String,
|
2338
|
-
active: Boolean
|
2101
|
+
active: Boolean,
|
2102
|
+
textFieldActivator: Boolean
|
2339
2103
|
};
|
2340
2104
|
connect() {
|
2341
|
-
const popperOptions = {
|
2342
|
-
placement: this.placementValue,
|
2343
|
-
modifiers: [ {
|
2344
|
-
name: "offset",
|
2345
|
-
options: {
|
2346
|
-
offset: [ 0, 5 ]
|
2347
|
-
}
|
2348
|
-
}, {
|
2349
|
-
name: "flip",
|
2350
|
-
options: {
|
2351
|
-
allowedAutoPlacements: [ "top-start", "bottom-start", "top-end", "bottom-end" ]
|
2352
|
-
}
|
2353
|
-
} ]
|
2354
|
-
};
|
2355
2105
|
if (this.appendToBodyValue) {
|
2356
2106
|
const clonedTemplate = this.templateTarget.content.cloneNode(true);
|
2357
2107
|
this.target = clonedTemplate.firstElementChild;
|
2358
|
-
popperOptions["strategy"] = "fixed";
|
2359
2108
|
document.body.appendChild(clonedTemplate);
|
2360
2109
|
}
|
2361
|
-
this.
|
2110
|
+
this.target.style.display = "none";
|
2362
2111
|
if (this.activeValue) {
|
2363
2112
|
this.show();
|
2364
2113
|
}
|
2365
2114
|
}
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2115
|
+
disconnect() {
|
2116
|
+
if (this.cleanup) {
|
2117
|
+
this.cleanup();
|
2118
|
+
}
|
2119
|
+
}
|
2120
|
+
updatePosition() {
|
2121
|
+
if (this.cleanup) {
|
2122
|
+
this.cleanup();
|
2123
|
+
}
|
2124
|
+
this.cleanup = autoUpdate(this.activator, this.target, (() => {
|
2125
|
+
computePosition(this.activator, this.target, {
|
2126
|
+
placement: this.placementValue,
|
2127
|
+
middleware: [ offset(5), flip(), shift({
|
2128
|
+
padding: 5
|
2129
|
+
}) ]
|
2130
|
+
}).then((({x: x, y: y}) => {
|
2131
|
+
Object.assign(this.target.style, {
|
2132
|
+
left: `${x}px`,
|
2133
|
+
top: `${y}px`
|
2134
|
+
});
|
2135
|
+
}));
|
2136
|
+
}));
|
2137
|
+
}
|
2138
|
+
toggle() {
|
2139
|
+
if (this.target.classList.contains(this.openClass)) {
|
2140
|
+
this.forceHide();
|
2141
|
+
} else {
|
2142
|
+
this.show();
|
2143
|
+
}
|
2370
2144
|
}
|
2371
|
-
|
2145
|
+
show() {
|
2146
|
+
this.target.style.display = "block";
|
2372
2147
|
this.target.classList.remove(this.closedClass);
|
2373
2148
|
this.target.classList.add(this.openClass);
|
2374
|
-
|
2149
|
+
this.updatePosition();
|
2375
2150
|
}
|
2376
2151
|
hide(event) {
|
2377
2152
|
if (this.element.contains(event.target)) return;
|
@@ -2380,9 +2155,17 @@ class Popover extends Controller {
|
|
2380
2155
|
this.forceHide();
|
2381
2156
|
}
|
2382
2157
|
forceHide() {
|
2158
|
+
this.target.style.display = "none";
|
2383
2159
|
this.target.classList.remove(this.openClass);
|
2384
2160
|
this.target.classList.add(this.closedClass);
|
2385
2161
|
}
|
2162
|
+
get activator() {
|
2163
|
+
if (this.textFieldActivatorValue) {
|
2164
|
+
return this.activatorTarget.querySelector('[data-controller="polaris-text-field"]');
|
2165
|
+
} else {
|
2166
|
+
return this.activatorTarget;
|
2167
|
+
}
|
2168
|
+
}
|
2386
2169
|
get target() {
|
2387
2170
|
if (this.hasPopoverTarget) {
|
2388
2171
|
return this.popoverTarget;
|
@@ -2616,6 +2399,66 @@ class Toast extends Controller {
|
|
2616
2399
|
}
|
2617
2400
|
}
|
2618
2401
|
|
2402
|
+
class Tooltip extends Controller {
|
2403
|
+
static targets=[ "template" ];
|
2404
|
+
static values={
|
2405
|
+
active: Boolean,
|
2406
|
+
position: String
|
2407
|
+
};
|
2408
|
+
show(event) {
|
2409
|
+
if (!this.activeValue) return;
|
2410
|
+
const element = event.currentTarget;
|
2411
|
+
let tooltip = document.createElement("span");
|
2412
|
+
tooltip.className = "Polaris-Tooltip";
|
2413
|
+
tooltip.innerHTML = this.templateTarget.innerHTML;
|
2414
|
+
this.tooltip = element.appendChild(tooltip);
|
2415
|
+
const arrowElement = element.querySelector("[data-tooltip-arrow]");
|
2416
|
+
computePosition(element, this.tooltip, {
|
2417
|
+
placement: this.positionValue,
|
2418
|
+
middleware: [ offset(this.offsetValue), flip(), shift({
|
2419
|
+
padding: 5
|
2420
|
+
}), arrow({
|
2421
|
+
element: arrowElement
|
2422
|
+
}) ]
|
2423
|
+
}).then((({x: x, y: y, placement: placement, middlewareData: middlewareData}) => {
|
2424
|
+
Object.assign(this.tooltip.style, {
|
2425
|
+
left: `${x}px`,
|
2426
|
+
top: `${y}px`
|
2427
|
+
});
|
2428
|
+
const {x: arrowX, y: arrowY} = middlewareData.arrow;
|
2429
|
+
const staticSide = {
|
2430
|
+
top: "bottom",
|
2431
|
+
right: "left",
|
2432
|
+
bottom: "top",
|
2433
|
+
left: "right"
|
2434
|
+
}[placement.split("-")[0]];
|
2435
|
+
Object.assign(arrowElement.style, {
|
2436
|
+
left: arrowX != null ? `${arrowX}px` : "",
|
2437
|
+
top: arrowY != null ? `${arrowY}px` : "",
|
2438
|
+
right: "",
|
2439
|
+
bottom: "",
|
2440
|
+
[staticSide]: "-4px"
|
2441
|
+
});
|
2442
|
+
}));
|
2443
|
+
}
|
2444
|
+
hide() {
|
2445
|
+
if (this.tooltip) {
|
2446
|
+
this.tooltip.remove();
|
2447
|
+
}
|
2448
|
+
}
|
2449
|
+
get offsetValue() {
|
2450
|
+
switch (this.positionValue) {
|
2451
|
+
case "top":
|
2452
|
+
case "bottom":
|
2453
|
+
case "left":
|
2454
|
+
return 8;
|
2455
|
+
|
2456
|
+
case "right":
|
2457
|
+
return 6;
|
2458
|
+
}
|
2459
|
+
}
|
2460
|
+
}
|
2461
|
+
|
2619
2462
|
function registerPolarisControllers(application) {
|
2620
2463
|
application.register("polaris-autocomplete", Autocomplete);
|
2621
2464
|
application.register("polaris-button", Button);
|
@@ -2632,6 +2475,7 @@ function registerPolarisControllers(application) {
|
|
2632
2475
|
application.register("polaris-select", Select);
|
2633
2476
|
application.register("polaris-text-field", TextField);
|
2634
2477
|
application.register("polaris-toast", Toast);
|
2478
|
+
application.register("polaris-tooltip", Tooltip);
|
2635
2479
|
}
|
2636
2480
|
|
2637
|
-
export { Frame, Modal, Polaris, Popover, ResourceItem, Scrollable, Select, TextField, registerPolarisControllers };
|
2481
|
+
export { Frame, Modal, Polaris, Popover, ResourceItem, Scrollable, Select, TextField, Tooltip, registerPolarisControllers };
|