polaris_view_components 1.1.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/button_controller.js +9 -0
- data/app/assets/javascripts/polaris_view_components/polaris_controller.js +4 -0
- data/app/assets/javascripts/polaris_view_components/popover_controller.js +50 -29
- data/app/assets/javascripts/polaris_view_components/text_field_controller.js +12 -0
- data/app/assets/javascripts/polaris_view_components/tooltip_controller.js +47 -34
- data/app/assets/javascripts/polaris_view_components.js +1102 -1284
- data/app/assets/stylesheets/polaris_view_components/custom.pcss +39 -57
- 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 -719
- 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/base_checkbox.rb +3 -1
- data/app/components/polaris/checkbox_component.rb +3 -0
- data/app/components/polaris/choice_list_component.rb +1 -0
- 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/text_field_component.rb +11 -2
- data/app/components/polaris/tooltip_component.html.erb +1 -1
- data/app/components/polaris/tooltip_component.rb +6 -1
- data/app/helpers/polaris/form_builder.rb +25 -0
- data/lib/polaris/view_components/version.rb +1 -1
- metadata +89 -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 {
|
@@ -307,6 +307,14 @@ class Button extends Controller {
|
|
307
307
|
this.buttonContent.insertAdjacentHTML("afterbegin", this.spinnerHTML);
|
308
308
|
}
|
309
309
|
}
|
310
|
+
disableWithoutLoader(event) {
|
311
|
+
if (this.button.disabled) {
|
312
|
+
event.preventDefault();
|
313
|
+
} else {
|
314
|
+
this.button.disabled = true;
|
315
|
+
this.button.classList.add("Polaris-Button--disabled");
|
316
|
+
}
|
317
|
+
}
|
310
318
|
enable() {
|
311
319
|
if (this.button.disabled) {
|
312
320
|
this.button.disabled = false;
|
@@ -431,7 +439,7 @@ class Dropzone extends Controller {
|
|
431
439
|
event.preventDefault();
|
432
440
|
this.onClick();
|
433
441
|
};
|
434
|
-
onWindowResize=debounce
|
442
|
+
onWindowResize=debounce((() => {
|
435
443
|
const size = this.calculateSize();
|
436
444
|
if (size !== this.size) {
|
437
445
|
this.size = size;
|
@@ -873,6 +881,9 @@ class Polaris extends Controller {
|
|
873
881
|
disableButton() {
|
874
882
|
this.findElement("button").disable();
|
875
883
|
}
|
884
|
+
disableButtonWithoutLoader() {
|
885
|
+
this.findElement("button").disableWithoutLoader();
|
886
|
+
}
|
876
887
|
enableButton() {
|
877
888
|
this.findElement("button").enable();
|
878
889
|
}
|
@@ -890,624 +901,873 @@ class Polaris extends Controller {
|
|
890
901
|
}
|
891
902
|
}
|
892
903
|
|
893
|
-
|
894
|
-
|
895
|
-
var bottom = "bottom";
|
896
|
-
|
897
|
-
var right = "right";
|
898
|
-
|
899
|
-
var left = "left";
|
900
|
-
|
901
|
-
var auto = "auto";
|
902
|
-
|
903
|
-
var basePlacements = [ top, bottom, right, left ];
|
904
|
-
|
905
|
-
var start = "start";
|
906
|
-
|
907
|
-
var end = "end";
|
908
|
-
|
909
|
-
var clippingParents = "clippingParents";
|
910
|
-
|
911
|
-
var viewport = "viewport";
|
904
|
+
const min = Math.min;
|
912
905
|
|
913
|
-
|
906
|
+
const max = Math.max;
|
914
907
|
|
915
|
-
|
908
|
+
const round = Math.round;
|
916
909
|
|
917
|
-
|
918
|
-
return acc.concat([ placement + "-" + start, placement + "-" + end ]);
|
919
|
-
}), []);
|
910
|
+
const floor = Math.floor;
|
920
911
|
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
var beforeRead = "beforeRead";
|
912
|
+
const createCoords = v => ({
|
913
|
+
x: v,
|
914
|
+
y: v
|
915
|
+
});
|
926
916
|
|
927
|
-
|
917
|
+
const oppositeSideMap = {
|
918
|
+
left: "right",
|
919
|
+
right: "left",
|
920
|
+
bottom: "top",
|
921
|
+
top: "bottom"
|
922
|
+
};
|
928
923
|
|
929
|
-
|
924
|
+
const oppositeAlignmentMap = {
|
925
|
+
start: "end",
|
926
|
+
end: "start"
|
927
|
+
};
|
930
928
|
|
931
|
-
|
929
|
+
function clamp(start, value, end) {
|
930
|
+
return max(start, min(value, end));
|
931
|
+
}
|
932
932
|
|
933
|
-
|
933
|
+
function evaluate(value, param) {
|
934
|
+
return typeof value === "function" ? value(param) : value;
|
935
|
+
}
|
934
936
|
|
935
|
-
|
937
|
+
function getSide(placement) {
|
938
|
+
return placement.split("-")[0];
|
939
|
+
}
|
936
940
|
|
937
|
-
|
941
|
+
function getAlignment(placement) {
|
942
|
+
return placement.split("-")[1];
|
943
|
+
}
|
938
944
|
|
939
|
-
|
945
|
+
function getOppositeAxis(axis) {
|
946
|
+
return axis === "x" ? "y" : "x";
|
947
|
+
}
|
940
948
|
|
941
|
-
|
949
|
+
function getAxisLength(axis) {
|
950
|
+
return axis === "y" ? "height" : "width";
|
951
|
+
}
|
942
952
|
|
943
|
-
|
953
|
+
function getSideAxis(placement) {
|
954
|
+
return [ "top", "bottom" ].includes(getSide(placement)) ? "y" : "x";
|
955
|
+
}
|
944
956
|
|
945
|
-
function
|
946
|
-
return
|
957
|
+
function getAlignmentAxis(placement) {
|
958
|
+
return getOppositeAxis(getSideAxis(placement));
|
947
959
|
}
|
948
960
|
|
949
|
-
function
|
950
|
-
if (
|
951
|
-
|
961
|
+
function getAlignmentSides(placement, rects, rtl) {
|
962
|
+
if (rtl === void 0) {
|
963
|
+
rtl = false;
|
952
964
|
}
|
953
|
-
|
954
|
-
|
955
|
-
|
965
|
+
const alignment = getAlignment(placement);
|
966
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
967
|
+
const length = getAxisLength(alignmentAxis);
|
968
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
969
|
+
if (rects.reference[length] > rects.floating[length]) {
|
970
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
956
971
|
}
|
957
|
-
return
|
972
|
+
return [ mainAlignmentSide, getOppositePlacement(mainAlignmentSide) ];
|
958
973
|
}
|
959
974
|
|
960
|
-
function
|
961
|
-
|
962
|
-
return
|
975
|
+
function getExpandedPlacements(placement) {
|
976
|
+
const oppositePlacement = getOppositePlacement(placement);
|
977
|
+
return [ getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement) ];
|
963
978
|
}
|
964
979
|
|
965
|
-
function
|
966
|
-
|
967
|
-
return node instanceof OwnElement || node instanceof HTMLElement;
|
980
|
+
function getOppositeAlignmentPlacement(placement) {
|
981
|
+
return placement.replace(/start|end/g, (alignment => oppositeAlignmentMap[alignment]));
|
968
982
|
}
|
969
983
|
|
970
|
-
function
|
971
|
-
|
972
|
-
|
984
|
+
function getSideList(side, isStart, rtl) {
|
985
|
+
const lr = [ "left", "right" ];
|
986
|
+
const rl = [ "right", "left" ];
|
987
|
+
const tb = [ "top", "bottom" ];
|
988
|
+
const bt = [ "bottom", "top" ];
|
989
|
+
switch (side) {
|
990
|
+
case "top":
|
991
|
+
case "bottom":
|
992
|
+
if (rtl) return isStart ? rl : lr;
|
993
|
+
return isStart ? lr : rl;
|
994
|
+
|
995
|
+
case "left":
|
996
|
+
case "right":
|
997
|
+
return isStart ? tb : bt;
|
998
|
+
|
999
|
+
default:
|
1000
|
+
return [];
|
973
1001
|
}
|
974
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
975
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
976
1002
|
}
|
977
1003
|
|
978
|
-
function
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
return;
|
1004
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
1005
|
+
const alignment = getAlignment(placement);
|
1006
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
1007
|
+
if (alignment) {
|
1008
|
+
list = list.map((side => side + "-" + alignment));
|
1009
|
+
if (flipAlignment) {
|
1010
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
986
1011
|
}
|
987
|
-
|
988
|
-
|
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
|
-
}));
|
1012
|
+
}
|
1013
|
+
return list;
|
997
1014
|
}
|
998
1015
|
|
999
|
-
function
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
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
|
-
}));
|
1016
|
+
function getOppositePlacement(placement) {
|
1017
|
+
return placement.replace(/left|right|bottom|top/g, (side => oppositeSideMap[side]));
|
1018
|
+
}
|
1019
|
+
|
1020
|
+
function expandPaddingObject(padding) {
|
1021
|
+
return {
|
1022
|
+
top: 0,
|
1023
|
+
right: 0,
|
1024
|
+
bottom: 0,
|
1025
|
+
left: 0,
|
1026
|
+
...padding
|
1035
1027
|
};
|
1036
1028
|
}
|
1037
1029
|
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
}
|
1030
|
+
function getPaddingObject(padding) {
|
1031
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
1032
|
+
top: padding,
|
1033
|
+
right: padding,
|
1034
|
+
bottom: padding,
|
1035
|
+
left: padding
|
1036
|
+
};
|
1037
|
+
}
|
1046
1038
|
|
1047
|
-
function
|
1048
|
-
return
|
1039
|
+
function rectToClientRect(rect) {
|
1040
|
+
return {
|
1041
|
+
...rect,
|
1042
|
+
top: rect.y,
|
1043
|
+
left: rect.x,
|
1044
|
+
right: rect.x + rect.width,
|
1045
|
+
bottom: rect.y + rect.height
|
1046
|
+
};
|
1049
1047
|
}
|
1050
1048
|
|
1051
|
-
|
1049
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
1050
|
+
let {reference: reference, floating: floating} = _ref;
|
1051
|
+
const sideAxis = getSideAxis(placement);
|
1052
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
1053
|
+
const alignLength = getAxisLength(alignmentAxis);
|
1054
|
+
const side = getSide(placement);
|
1055
|
+
const isVertical = sideAxis === "y";
|
1056
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
1057
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
1058
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
1059
|
+
let coords;
|
1060
|
+
switch (side) {
|
1061
|
+
case "top":
|
1062
|
+
coords = {
|
1063
|
+
x: commonX,
|
1064
|
+
y: reference.y - floating.height
|
1065
|
+
};
|
1066
|
+
break;
|
1067
|
+
|
1068
|
+
case "bottom":
|
1069
|
+
coords = {
|
1070
|
+
x: commonX,
|
1071
|
+
y: reference.y + reference.height
|
1072
|
+
};
|
1073
|
+
break;
|
1052
1074
|
|
1053
|
-
|
1075
|
+
case "right":
|
1076
|
+
coords = {
|
1077
|
+
x: reference.x + reference.width,
|
1078
|
+
y: commonY
|
1079
|
+
};
|
1080
|
+
break;
|
1054
1081
|
|
1055
|
-
|
1082
|
+
case "left":
|
1083
|
+
coords = {
|
1084
|
+
x: reference.x - floating.width,
|
1085
|
+
y: commonY
|
1086
|
+
};
|
1087
|
+
break;
|
1056
1088
|
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
})).join(" ");
|
1089
|
+
default:
|
1090
|
+
coords = {
|
1091
|
+
x: reference.x,
|
1092
|
+
y: reference.y
|
1093
|
+
};
|
1063
1094
|
}
|
1064
|
-
|
1065
|
-
|
1095
|
+
switch (getAlignment(placement)) {
|
1096
|
+
case "start":
|
1097
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
1098
|
+
break;
|
1066
1099
|
|
1067
|
-
|
1068
|
-
|
1100
|
+
case "end":
|
1101
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
1102
|
+
break;
|
1103
|
+
}
|
1104
|
+
return coords;
|
1069
1105
|
}
|
1070
1106
|
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1107
|
+
const computePosition$1 = async (reference, floating, config) => {
|
1108
|
+
const {placement: placement = "bottom", strategy: strategy = "absolute", middleware: middleware = [], platform: platform} = config;
|
1109
|
+
const validMiddleware = middleware.filter(Boolean);
|
1110
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
1111
|
+
let rects = await platform.getElementRects({
|
1112
|
+
reference: reference,
|
1113
|
+
floating: floating,
|
1114
|
+
strategy: strategy
|
1115
|
+
});
|
1116
|
+
let {x: x, y: y} = computeCoordsFromPlacement(rects, placement, rtl);
|
1117
|
+
let statefulPlacement = placement;
|
1118
|
+
let middlewareData = {};
|
1119
|
+
let resetCount = 0;
|
1120
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
1121
|
+
const {name: name, fn: fn} = validMiddleware[i];
|
1122
|
+
const {x: nextX, y: nextY, data: data, reset: reset} = await fn({
|
1123
|
+
x: x,
|
1124
|
+
y: y,
|
1125
|
+
initialPlacement: placement,
|
1126
|
+
placement: statefulPlacement,
|
1127
|
+
strategy: strategy,
|
1128
|
+
middlewareData: middlewareData,
|
1129
|
+
rects: rects,
|
1130
|
+
platform: platform,
|
1131
|
+
elements: {
|
1132
|
+
reference: reference,
|
1133
|
+
floating: floating
|
1134
|
+
}
|
1135
|
+
});
|
1136
|
+
x = nextX != null ? nextX : x;
|
1137
|
+
y = nextY != null ? nextY : y;
|
1138
|
+
middlewareData = {
|
1139
|
+
...middlewareData,
|
1140
|
+
[name]: {
|
1141
|
+
...middlewareData[name],
|
1142
|
+
...data
|
1143
|
+
}
|
1144
|
+
};
|
1145
|
+
if (reset && resetCount <= 50) {
|
1146
|
+
resetCount++;
|
1147
|
+
if (typeof reset === "object") {
|
1148
|
+
if (reset.placement) {
|
1149
|
+
statefulPlacement = reset.placement;
|
1150
|
+
}
|
1151
|
+
if (reset.rects) {
|
1152
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
1153
|
+
reference: reference,
|
1154
|
+
floating: floating,
|
1155
|
+
strategy: strategy
|
1156
|
+
}) : reset.rects;
|
1157
|
+
}
|
1158
|
+
({x: x, y: y} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
1159
|
+
}
|
1160
|
+
i = -1;
|
1161
|
+
continue;
|
1162
|
+
}
|
1077
1163
|
}
|
1078
|
-
var clientRect = element.getBoundingClientRect();
|
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
1164
|
return {
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1165
|
+
x: x,
|
1166
|
+
y: y,
|
1167
|
+
placement: statefulPlacement,
|
1168
|
+
strategy: strategy,
|
1169
|
+
middlewareData: middlewareData
|
1170
|
+
};
|
1171
|
+
};
|
1172
|
+
|
1173
|
+
async function detectOverflow(state, options) {
|
1174
|
+
var _await$platform$isEle;
|
1175
|
+
if (options === void 0) {
|
1176
|
+
options = {};
|
1177
|
+
}
|
1178
|
+
const {x: x, y: y, platform: platform, rects: rects, elements: elements, strategy: strategy} = state;
|
1179
|
+
const {boundary: boundary = "clippingAncestors", rootBoundary: rootBoundary = "viewport", elementContext: elementContext = "floating", altBoundary: altBoundary = false, padding: padding = 0} = evaluate(options, state);
|
1180
|
+
const paddingObject = getPaddingObject(padding);
|
1181
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
1182
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
1183
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
1184
|
+
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)),
|
1185
|
+
boundary: boundary,
|
1186
|
+
rootBoundary: rootBoundary,
|
1187
|
+
strategy: strategy
|
1188
|
+
}));
|
1189
|
+
const rect = elementContext === "floating" ? {
|
1190
|
+
...rects.floating,
|
1098
1191
|
x: x,
|
1099
1192
|
y: y
|
1193
|
+
} : rects.reference;
|
1194
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
1195
|
+
const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
|
1196
|
+
x: 1,
|
1197
|
+
y: 1
|
1198
|
+
} : {
|
1199
|
+
x: 1,
|
1200
|
+
y: 1
|
1201
|
+
};
|
1202
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
1203
|
+
rect: rect,
|
1204
|
+
offsetParent: offsetParent,
|
1205
|
+
strategy: strategy
|
1206
|
+
}) : rect);
|
1207
|
+
return {
|
1208
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
1209
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
1210
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
1211
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
1100
1212
|
};
|
1101
1213
|
}
|
1102
1214
|
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1215
|
+
const arrow = options => ({
|
1216
|
+
name: "arrow",
|
1217
|
+
options: options,
|
1218
|
+
async fn(state) {
|
1219
|
+
const {x: x, y: y, placement: placement, rects: rects, platform: platform, elements: elements, middlewareData: middlewareData} = state;
|
1220
|
+
const {element: element, padding: padding = 0} = evaluate(options, state) || {};
|
1221
|
+
if (element == null) {
|
1222
|
+
return {};
|
1223
|
+
}
|
1224
|
+
const paddingObject = getPaddingObject(padding);
|
1225
|
+
const coords = {
|
1226
|
+
x: x,
|
1227
|
+
y: y
|
1228
|
+
};
|
1229
|
+
const axis = getAlignmentAxis(placement);
|
1230
|
+
const length = getAxisLength(axis);
|
1231
|
+
const arrowDimensions = await platform.getDimensions(element);
|
1232
|
+
const isYAxis = axis === "y";
|
1233
|
+
const minProp = isYAxis ? "top" : "left";
|
1234
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
1235
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
1236
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
1237
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
1238
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
1239
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
1240
|
+
if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) {
|
1241
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
1242
|
+
}
|
1243
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
1244
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
1245
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
1246
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
1247
|
+
const min$1 = minPadding;
|
1248
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
1249
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
1250
|
+
const offset = clamp(min$1, center, max);
|
1251
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
1252
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
1253
|
+
return {
|
1254
|
+
[axis]: coords[axis] + alignmentOffset,
|
1255
|
+
data: {
|
1256
|
+
[axis]: offset,
|
1257
|
+
centerOffset: center - offset - alignmentOffset,
|
1258
|
+
...shouldAddOffset && {
|
1259
|
+
alignmentOffset: alignmentOffset
|
1260
|
+
}
|
1261
|
+
},
|
1262
|
+
reset: shouldAddOffset
|
1263
|
+
};
|
1109
1264
|
}
|
1110
|
-
|
1111
|
-
|
1265
|
+
});
|
1266
|
+
|
1267
|
+
const flip = function(options) {
|
1268
|
+
if (options === void 0) {
|
1269
|
+
options = {};
|
1112
1270
|
}
|
1113
1271
|
return {
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1272
|
+
name: "flip",
|
1273
|
+
options: options,
|
1274
|
+
async fn(state) {
|
1275
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
1276
|
+
const {placement: placement, middlewareData: middlewareData, rects: rects, initialPlacement: initialPlacement, platform: platform, elements: elements} = state;
|
1277
|
+
const {mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy: fallbackStrategy = "bestFit", fallbackAxisSideDirection: fallbackAxisSideDirection = "none", flipAlignment: flipAlignment = true, ...detectOverflowOptions} = evaluate(options, state);
|
1278
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
1279
|
+
return {};
|
1280
|
+
}
|
1281
|
+
const side = getSide(placement);
|
1282
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
1283
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
1284
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [ getOppositePlacement(initialPlacement) ] : getExpandedPlacements(initialPlacement));
|
1285
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
|
1286
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
1287
|
+
}
|
1288
|
+
const placements = [ initialPlacement, ...fallbackPlacements ];
|
1289
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
1290
|
+
const overflows = [];
|
1291
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
1292
|
+
if (checkMainAxis) {
|
1293
|
+
overflows.push(overflow[side]);
|
1294
|
+
}
|
1295
|
+
if (checkCrossAxis) {
|
1296
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
1297
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
1298
|
+
}
|
1299
|
+
overflowsData = [ ...overflowsData, {
|
1300
|
+
placement: placement,
|
1301
|
+
overflows: overflows
|
1302
|
+
} ];
|
1303
|
+
if (!overflows.every((side => side <= 0))) {
|
1304
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
1305
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
1306
|
+
const nextPlacement = placements[nextIndex];
|
1307
|
+
if (nextPlacement) {
|
1308
|
+
return {
|
1309
|
+
data: {
|
1310
|
+
index: nextIndex,
|
1311
|
+
overflows: overflowsData
|
1312
|
+
},
|
1313
|
+
reset: {
|
1314
|
+
placement: nextPlacement
|
1315
|
+
}
|
1316
|
+
};
|
1317
|
+
}
|
1318
|
+
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;
|
1319
|
+
if (!resetPlacement) {
|
1320
|
+
switch (fallbackStrategy) {
|
1321
|
+
case "bestFit":
|
1322
|
+
{
|
1323
|
+
var _overflowsData$map$so;
|
1324
|
+
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];
|
1325
|
+
if (placement) {
|
1326
|
+
resetPlacement = placement;
|
1327
|
+
}
|
1328
|
+
break;
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
case "initialPlacement":
|
1332
|
+
resetPlacement = initialPlacement;
|
1333
|
+
break;
|
1334
|
+
}
|
1335
|
+
}
|
1336
|
+
if (placement !== resetPlacement) {
|
1337
|
+
return {
|
1338
|
+
reset: {
|
1339
|
+
placement: resetPlacement
|
1340
|
+
}
|
1341
|
+
};
|
1342
|
+
}
|
1343
|
+
}
|
1344
|
+
return {};
|
1345
|
+
}
|
1346
|
+
};
|
1347
|
+
};
|
1348
|
+
|
1349
|
+
async function convertValueToCoords(state, options) {
|
1350
|
+
const {placement: placement, platform: platform, elements: elements} = state;
|
1351
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
1352
|
+
const side = getSide(placement);
|
1353
|
+
const alignment = getAlignment(placement);
|
1354
|
+
const isVertical = getSideAxis(placement) === "y";
|
1355
|
+
const mainAxisMulti = [ "left", "top" ].includes(side) ? -1 : 1;
|
1356
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
1357
|
+
const rawValue = evaluate(options, state);
|
1358
|
+
let {mainAxis: mainAxis, crossAxis: crossAxis, alignmentAxis: alignmentAxis} = typeof rawValue === "number" ? {
|
1359
|
+
mainAxis: rawValue,
|
1360
|
+
crossAxis: 0,
|
1361
|
+
alignmentAxis: null
|
1362
|
+
} : {
|
1363
|
+
mainAxis: 0,
|
1364
|
+
crossAxis: 0,
|
1365
|
+
alignmentAxis: null,
|
1366
|
+
...rawValue
|
1367
|
+
};
|
1368
|
+
if (alignment && typeof alignmentAxis === "number") {
|
1369
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
1370
|
+
}
|
1371
|
+
return isVertical ? {
|
1372
|
+
x: crossAxis * crossAxisMulti,
|
1373
|
+
y: mainAxis * mainAxisMulti
|
1374
|
+
} : {
|
1375
|
+
x: mainAxis * mainAxisMulti,
|
1376
|
+
y: crossAxis * crossAxisMulti
|
1118
1377
|
};
|
1119
1378
|
}
|
1120
1379
|
|
1121
|
-
function
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1380
|
+
const offset = function(options) {
|
1381
|
+
if (options === void 0) {
|
1382
|
+
options = 0;
|
1383
|
+
}
|
1384
|
+
return {
|
1385
|
+
name: "offset",
|
1386
|
+
options: options,
|
1387
|
+
async fn(state) {
|
1388
|
+
const {x: x, y: y} = state;
|
1389
|
+
const diffCoords = await convertValueToCoords(state, options);
|
1390
|
+
return {
|
1391
|
+
x: x + diffCoords.x,
|
1392
|
+
y: y + diffCoords.y,
|
1393
|
+
data: diffCoords
|
1394
|
+
};
|
1395
|
+
}
|
1396
|
+
};
|
1397
|
+
};
|
1398
|
+
|
1399
|
+
const shift = function(options) {
|
1400
|
+
if (options === void 0) {
|
1401
|
+
options = {};
|
1402
|
+
}
|
1403
|
+
return {
|
1404
|
+
name: "shift",
|
1405
|
+
options: options,
|
1406
|
+
async fn(state) {
|
1407
|
+
const {x: x, y: y, placement: placement} = state;
|
1408
|
+
const {mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter: limiter = {
|
1409
|
+
fn: _ref => {
|
1410
|
+
let {x: x, y: y} = _ref;
|
1411
|
+
return {
|
1412
|
+
x: x,
|
1413
|
+
y: y
|
1414
|
+
};
|
1415
|
+
}
|
1416
|
+
}, ...detectOverflowOptions} = evaluate(options, state);
|
1417
|
+
const coords = {
|
1418
|
+
x: x,
|
1419
|
+
y: y
|
1420
|
+
};
|
1421
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
1422
|
+
const crossAxis = getSideAxis(getSide(placement));
|
1423
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
1424
|
+
let mainAxisCoord = coords[mainAxis];
|
1425
|
+
let crossAxisCoord = coords[crossAxis];
|
1426
|
+
if (checkMainAxis) {
|
1427
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
1428
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
1429
|
+
const min = mainAxisCoord + overflow[minSide];
|
1430
|
+
const max = mainAxisCoord - overflow[maxSide];
|
1431
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
1432
|
+
}
|
1433
|
+
if (checkCrossAxis) {
|
1434
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
1435
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
1436
|
+
const min = crossAxisCoord + overflow[minSide];
|
1437
|
+
const max = crossAxisCoord - overflow[maxSide];
|
1438
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
1130
1439
|
}
|
1131
|
-
|
1132
|
-
|
1440
|
+
const limitedCoords = limiter.fn({
|
1441
|
+
...state,
|
1442
|
+
[mainAxis]: mainAxisCoord,
|
1443
|
+
[crossAxis]: crossAxisCoord
|
1444
|
+
});
|
1445
|
+
return {
|
1446
|
+
...limitedCoords,
|
1447
|
+
data: {
|
1448
|
+
x: limitedCoords.x - x,
|
1449
|
+
y: limitedCoords.y - y
|
1450
|
+
}
|
1451
|
+
};
|
1452
|
+
}
|
1453
|
+
};
|
1454
|
+
};
|
1455
|
+
|
1456
|
+
function getNodeName(node) {
|
1457
|
+
if (isNode(node)) {
|
1458
|
+
return (node.nodeName || "").toLowerCase();
|
1133
1459
|
}
|
1134
|
-
return
|
1460
|
+
return "#document";
|
1135
1461
|
}
|
1136
1462
|
|
1137
|
-
function
|
1138
|
-
|
1463
|
+
function getWindow(node) {
|
1464
|
+
var _node$ownerDocument;
|
1465
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
1139
1466
|
}
|
1140
1467
|
|
1141
|
-
function
|
1142
|
-
|
1468
|
+
function getDocumentElement(node) {
|
1469
|
+
var _ref;
|
1470
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
1143
1471
|
}
|
1144
1472
|
|
1145
|
-
function
|
1146
|
-
return
|
1473
|
+
function isNode(value) {
|
1474
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
1147
1475
|
}
|
1148
1476
|
|
1149
|
-
function
|
1150
|
-
|
1151
|
-
return element;
|
1152
|
-
}
|
1153
|
-
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
1477
|
+
function isElement(value) {
|
1478
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
1154
1479
|
}
|
1155
1480
|
|
1156
|
-
function
|
1157
|
-
|
1158
|
-
|
1481
|
+
function isHTMLElement(value) {
|
1482
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
1483
|
+
}
|
1484
|
+
|
1485
|
+
function isShadowRoot(value) {
|
1486
|
+
if (typeof ShadowRoot === "undefined") {
|
1487
|
+
return false;
|
1159
1488
|
}
|
1160
|
-
return
|
1489
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
function isOverflowElement(element) {
|
1493
|
+
const {overflow: overflow, overflowX: overflowX, overflowY: overflowY, display: display} = getComputedStyle$1(element);
|
1494
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && ![ "inline", "contents" ].includes(display);
|
1495
|
+
}
|
1496
|
+
|
1497
|
+
function isTableElement(element) {
|
1498
|
+
return [ "table", "td", "th" ].includes(getNodeName(element));
|
1499
|
+
}
|
1500
|
+
|
1501
|
+
function isContainingBlock(element) {
|
1502
|
+
const webkit = isWebKit();
|
1503
|
+
const css = getComputedStyle$1(element);
|
1504
|
+
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)));
|
1161
1505
|
}
|
1162
1506
|
|
1163
1507
|
function getContainingBlock(element) {
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
var elementCss = getComputedStyle$1(element);
|
1168
|
-
if (elementCss.position === "fixed") {
|
1169
|
-
return null;
|
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") {
|
1508
|
+
let currentNode = getParentNode(element);
|
1509
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
1510
|
+
if (isContainingBlock(currentNode)) {
|
1179
1511
|
return currentNode;
|
1180
1512
|
} else {
|
1181
|
-
currentNode = currentNode
|
1513
|
+
currentNode = getParentNode(currentNode);
|
1182
1514
|
}
|
1183
1515
|
}
|
1184
1516
|
return null;
|
1185
1517
|
}
|
1186
1518
|
|
1187
|
-
function
|
1188
|
-
|
1189
|
-
|
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";
|
1519
|
+
function isWebKit() {
|
1520
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
1521
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
1201
1522
|
}
|
1202
1523
|
|
1203
|
-
function
|
1204
|
-
return
|
1524
|
+
function isLastTraversableNode(node) {
|
1525
|
+
return [ "html", "body", "#document" ].includes(getNodeName(node));
|
1205
1526
|
}
|
1206
1527
|
|
1207
|
-
function
|
1208
|
-
|
1209
|
-
return v > max ? max : v;
|
1528
|
+
function getComputedStyle$1(element) {
|
1529
|
+
return getWindow(element).getComputedStyle(element);
|
1210
1530
|
}
|
1211
1531
|
|
1212
|
-
function
|
1532
|
+
function getNodeScroll(element) {
|
1533
|
+
if (isElement(element)) {
|
1534
|
+
return {
|
1535
|
+
scrollLeft: element.scrollLeft,
|
1536
|
+
scrollTop: element.scrollTop
|
1537
|
+
};
|
1538
|
+
}
|
1213
1539
|
return {
|
1214
|
-
|
1215
|
-
|
1216
|
-
bottom: 0,
|
1217
|
-
left: 0
|
1540
|
+
scrollLeft: element.pageXOffset,
|
1541
|
+
scrollTop: element.pageYOffset
|
1218
1542
|
};
|
1219
1543
|
}
|
1220
1544
|
|
1221
|
-
function
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
return
|
1227
|
-
hashMap[key] = value;
|
1228
|
-
return hashMap;
|
1229
|
-
}), {});
|
1545
|
+
function getParentNode(node) {
|
1546
|
+
if (getNodeName(node) === "html") {
|
1547
|
+
return node;
|
1548
|
+
}
|
1549
|
+
const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
|
1550
|
+
return isShadowRoot(result) ? result.host : result;
|
1230
1551
|
}
|
1231
1552
|
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
1237
|
-
};
|
1238
|
-
|
1239
|
-
function arrow(_ref) {
|
1240
|
-
var _state$modifiersData$;
|
1241
|
-
var state = _ref.state, name = _ref.name, options = _ref.options;
|
1242
|
-
var arrowElement = state.elements.arrow;
|
1243
|
-
var popperOffsets = state.modifiersData.popperOffsets;
|
1244
|
-
var basePlacement = getBasePlacement(state.placement);
|
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
|
-
}
|
1553
|
+
function getNearestOverflowAncestor(node) {
|
1554
|
+
const parentNode = getParentNode(node);
|
1555
|
+
if (isLastTraversableNode(parentNode)) {
|
1556
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
1280
1557
|
}
|
1281
|
-
if (
|
1282
|
-
return;
|
1558
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
1559
|
+
return parentNode;
|
1283
1560
|
}
|
1284
|
-
|
1561
|
+
return getNearestOverflowAncestor(parentNode);
|
1285
1562
|
}
|
1286
1563
|
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1564
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
1565
|
+
var _node$ownerDocument2;
|
1566
|
+
if (list === void 0) {
|
1567
|
+
list = [];
|
1568
|
+
}
|
1569
|
+
if (traverseIframes === void 0) {
|
1570
|
+
traverseIframes = true;
|
1571
|
+
}
|
1572
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
1573
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
1574
|
+
const win = getWindow(scrollableAncestor);
|
1575
|
+
if (isBody) {
|
1576
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
1577
|
+
}
|
1578
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
1299
1579
|
}
|
1300
1580
|
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1581
|
+
function getCssDimensions(element) {
|
1582
|
+
const css = getComputedStyle$1(element);
|
1583
|
+
let width = parseFloat(css.width) || 0;
|
1584
|
+
let height = parseFloat(css.height) || 0;
|
1585
|
+
const hasOffset = isHTMLElement(element);
|
1586
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
1587
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
1588
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
1589
|
+
if (shouldFallback) {
|
1590
|
+
width = offsetWidth;
|
1591
|
+
height = offsetHeight;
|
1592
|
+
}
|
1311
1593
|
return {
|
1312
|
-
|
1313
|
-
|
1594
|
+
width: width,
|
1595
|
+
height: height,
|
1596
|
+
$: shouldFallback
|
1314
1597
|
};
|
1315
1598
|
}
|
1316
1599
|
|
1317
|
-
function
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
x: x,
|
1326
|
-
y: y
|
1327
|
-
};
|
1328
|
-
x = _ref3.x;
|
1329
|
-
y = _ref3.y;
|
1330
|
-
var hasX = offsets.hasOwnProperty("x");
|
1331
|
-
var hasY = offsets.hasOwnProperty("y");
|
1332
|
-
var sideX = left;
|
1333
|
-
var sideY = top;
|
1334
|
-
var win = window;
|
1335
|
-
if (adaptive) {
|
1336
|
-
var offsetParent = getOffsetParent(popper);
|
1337
|
-
var heightProp = "clientHeight";
|
1338
|
-
var widthProp = "clientWidth";
|
1339
|
-
if (offsetParent === getWindow(popper)) {
|
1340
|
-
offsetParent = getDocumentElement(popper);
|
1341
|
-
if (getComputedStyle$1(offsetParent).position !== "static" && position === "absolute") {
|
1342
|
-
heightProp = "scrollHeight";
|
1343
|
-
widthProp = "scrollWidth";
|
1344
|
-
}
|
1345
|
-
}
|
1346
|
-
offsetParent = offsetParent;
|
1347
|
-
if (placement === top || (placement === left || placement === right) && variation === end) {
|
1348
|
-
sideY = bottom;
|
1349
|
-
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
|
1350
|
-
y -= offsetY - popperRect.height;
|
1351
|
-
y *= gpuAcceleration ? 1 : -1;
|
1352
|
-
}
|
1353
|
-
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
1354
|
-
sideX = right;
|
1355
|
-
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
|
1356
|
-
x -= offsetX - popperRect.width;
|
1357
|
-
x *= gpuAcceleration ? 1 : -1;
|
1358
|
-
}
|
1600
|
+
function unwrapElement(element) {
|
1601
|
+
return !isElement(element) ? element.contextElement : element;
|
1602
|
+
}
|
1603
|
+
|
1604
|
+
function getScale(element) {
|
1605
|
+
const domElement = unwrapElement(element);
|
1606
|
+
if (!isHTMLElement(domElement)) {
|
1607
|
+
return createCoords(1);
|
1359
1608
|
}
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
}
|
1609
|
+
const rect = domElement.getBoundingClientRect();
|
1610
|
+
const {width: width, height: height, $: $} = getCssDimensions(domElement);
|
1611
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
1612
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
1613
|
+
if (!x || !Number.isFinite(x)) {
|
1614
|
+
x = 1;
|
1615
|
+
}
|
1616
|
+
if (!y || !Number.isFinite(y)) {
|
1617
|
+
y = 1;
|
1618
|
+
}
|
1619
|
+
return {
|
1367
1620
|
x: x,
|
1368
1621
|
y: y
|
1369
1622
|
};
|
1370
|
-
x = _ref4.x;
|
1371
|
-
y = _ref4.y;
|
1372
|
-
if (gpuAcceleration) {
|
1373
|
-
var _Object$assign;
|
1374
|
-
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "",
|
1375
|
-
_Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)",
|
1376
|
-
_Object$assign));
|
1377
|
-
}
|
1378
|
-
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "",
|
1379
|
-
_Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
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"
|
1392
|
-
};
|
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
1623
|
}
|
1413
1624
|
|
1414
|
-
|
1415
|
-
name: "computeStyles",
|
1416
|
-
enabled: true,
|
1417
|
-
phase: "beforeWrite",
|
1418
|
-
fn: computeStyles,
|
1419
|
-
data: {}
|
1420
|
-
};
|
1421
|
-
|
1422
|
-
var passive = {
|
1423
|
-
passive: true
|
1424
|
-
};
|
1625
|
+
const noOffsets = createCoords(0);
|
1425
1626
|
|
1426
|
-
function
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
1431
|
-
if (scroll) {
|
1432
|
-
scrollParents.forEach((function(scrollParent) {
|
1433
|
-
scrollParent.addEventListener("scroll", instance.update, passive);
|
1434
|
-
}));
|
1435
|
-
}
|
1436
|
-
if (resize) {
|
1437
|
-
window.addEventListener("resize", instance.update, passive);
|
1627
|
+
function getVisualOffsets(element) {
|
1628
|
+
const win = getWindow(element);
|
1629
|
+
if (!isWebKit() || !win.visualViewport) {
|
1630
|
+
return noOffsets;
|
1438
1631
|
}
|
1439
|
-
return
|
1440
|
-
|
1441
|
-
|
1442
|
-
scrollParent.removeEventListener("scroll", instance.update, passive);
|
1443
|
-
}));
|
1444
|
-
}
|
1445
|
-
if (resize) {
|
1446
|
-
window.removeEventListener("resize", instance.update, passive);
|
1447
|
-
}
|
1632
|
+
return {
|
1633
|
+
x: win.visualViewport.offsetLeft,
|
1634
|
+
y: win.visualViewport.offsetTop
|
1448
1635
|
};
|
1449
1636
|
}
|
1450
1637
|
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
var hash$1 = {
|
1461
|
-
left: "right",
|
1462
|
-
right: "left",
|
1463
|
-
bottom: "top",
|
1464
|
-
top: "bottom"
|
1465
|
-
};
|
1466
|
-
|
1467
|
-
function getOppositePlacement(placement) {
|
1468
|
-
return placement.replace(/left|right|bottom|top/g, (function(matched) {
|
1469
|
-
return hash$1[matched];
|
1470
|
-
}));
|
1638
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
1639
|
+
if (isFixed === void 0) {
|
1640
|
+
isFixed = false;
|
1641
|
+
}
|
1642
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
1643
|
+
return false;
|
1644
|
+
}
|
1645
|
+
return isFixed;
|
1471
1646
|
}
|
1472
1647
|
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
}
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1648
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
1649
|
+
if (includeScale === void 0) {
|
1650
|
+
includeScale = false;
|
1651
|
+
}
|
1652
|
+
if (isFixedStrategy === void 0) {
|
1653
|
+
isFixedStrategy = false;
|
1654
|
+
}
|
1655
|
+
const clientRect = element.getBoundingClientRect();
|
1656
|
+
const domElement = unwrapElement(element);
|
1657
|
+
let scale = createCoords(1);
|
1658
|
+
if (includeScale) {
|
1659
|
+
if (offsetParent) {
|
1660
|
+
if (isElement(offsetParent)) {
|
1661
|
+
scale = getScale(offsetParent);
|
1662
|
+
}
|
1663
|
+
} else {
|
1664
|
+
scale = getScale(element);
|
1665
|
+
}
|
1666
|
+
}
|
1667
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
1668
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
1669
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
1670
|
+
let width = clientRect.width / scale.x;
|
1671
|
+
let height = clientRect.height / scale.y;
|
1672
|
+
if (domElement) {
|
1673
|
+
const win = getWindow(domElement);
|
1674
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
1675
|
+
let currentIFrame = win.frameElement;
|
1676
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
1677
|
+
const iframeScale = getScale(currentIFrame);
|
1678
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
1679
|
+
const css = getComputedStyle$1(currentIFrame);
|
1680
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
1681
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
1682
|
+
x *= iframeScale.x;
|
1683
|
+
y *= iframeScale.y;
|
1684
|
+
width *= iframeScale.x;
|
1685
|
+
height *= iframeScale.y;
|
1686
|
+
x += left;
|
1687
|
+
y += top;
|
1688
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
1689
|
+
}
|
1690
|
+
}
|
1691
|
+
return rectToClientRect({
|
1692
|
+
width: width,
|
1693
|
+
height: height,
|
1694
|
+
x: x,
|
1695
|
+
y: y
|
1696
|
+
});
|
1482
1697
|
}
|
1483
1698
|
|
1484
|
-
function
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1699
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
1700
|
+
let {rect: rect, offsetParent: offsetParent, strategy: strategy} = _ref;
|
1701
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
1702
|
+
const documentElement = getDocumentElement(offsetParent);
|
1703
|
+
if (offsetParent === documentElement) {
|
1704
|
+
return rect;
|
1705
|
+
}
|
1706
|
+
let scroll = {
|
1707
|
+
scrollLeft: 0,
|
1708
|
+
scrollTop: 0
|
1709
|
+
};
|
1710
|
+
let scale = createCoords(1);
|
1711
|
+
const offsets = createCoords(0);
|
1712
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
1713
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
1714
|
+
scroll = getNodeScroll(offsetParent);
|
1715
|
+
}
|
1716
|
+
if (isHTMLElement(offsetParent)) {
|
1717
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
1718
|
+
scale = getScale(offsetParent);
|
1719
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
1720
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
1721
|
+
}
|
1722
|
+
}
|
1488
1723
|
return {
|
1489
|
-
|
1490
|
-
|
1724
|
+
width: rect.width * scale.x,
|
1725
|
+
height: rect.height * scale.y,
|
1726
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
1727
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
1491
1728
|
};
|
1492
1729
|
}
|
1493
1730
|
|
1731
|
+
function getClientRects(element) {
|
1732
|
+
return Array.from(element.getClientRects());
|
1733
|
+
}
|
1734
|
+
|
1494
1735
|
function getWindowScrollBarX(element) {
|
1495
|
-
return getBoundingClientRect(getDocumentElement(element)).left +
|
1736
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
1737
|
+
}
|
1738
|
+
|
1739
|
+
function getDocumentRect(element) {
|
1740
|
+
const html = getDocumentElement(element);
|
1741
|
+
const scroll = getNodeScroll(element);
|
1742
|
+
const body = element.ownerDocument.body;
|
1743
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
1744
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
1745
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
1746
|
+
const y = -scroll.scrollTop;
|
1747
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
1748
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
1749
|
+
}
|
1750
|
+
return {
|
1751
|
+
width: width,
|
1752
|
+
height: height,
|
1753
|
+
x: x,
|
1754
|
+
y: y
|
1755
|
+
};
|
1496
1756
|
}
|
1497
1757
|
|
1498
1758
|
function getViewportRect(element, strategy) {
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1759
|
+
const win = getWindow(element);
|
1760
|
+
const html = getDocumentElement(element);
|
1761
|
+
const visualViewport = win.visualViewport;
|
1762
|
+
let width = html.clientWidth;
|
1763
|
+
let height = html.clientHeight;
|
1764
|
+
let x = 0;
|
1765
|
+
let y = 0;
|
1506
1766
|
if (visualViewport) {
|
1507
1767
|
width = visualViewport.width;
|
1508
1768
|
height = visualViewport.height;
|
1509
|
-
|
1510
|
-
if (
|
1769
|
+
const visualViewportBased = isWebKit();
|
1770
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
1511
1771
|
x = visualViewport.offsetLeft;
|
1512
1772
|
y = visualViewport.offsetTop;
|
1513
1773
|
}
|
@@ -1515,23 +1775,20 @@ function getViewportRect(element, strategy) {
|
|
1515
1775
|
return {
|
1516
1776
|
width: width,
|
1517
1777
|
height: height,
|
1518
|
-
x: x
|
1778
|
+
x: x,
|
1519
1779
|
y: y
|
1520
1780
|
};
|
1521
1781
|
}
|
1522
1782
|
|
1523
|
-
function
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
if (getComputedStyle$1(body || html).direction === "rtl") {
|
1533
|
-
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
1534
|
-
}
|
1783
|
+
function getInnerBoundingClientRect(element, strategy) {
|
1784
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
1785
|
+
const top = clientRect.top + element.clientTop;
|
1786
|
+
const left = clientRect.left + element.clientLeft;
|
1787
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
1788
|
+
const width = element.clientWidth * scale.x;
|
1789
|
+
const height = element.clientHeight * scale.y;
|
1790
|
+
const x = left * scale.x;
|
1791
|
+
const y = top * scale.y;
|
1535
1792
|
return {
|
1536
1793
|
width: width,
|
1537
1794
|
height: height,
|
@@ -1540,578 +1797,103 @@ function getDocumentRect(element) {
|
|
1540
1797
|
};
|
1541
1798
|
}
|
1542
1799
|
|
1543
|
-
function
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
}
|
1552
|
-
|
1553
|
-
|
1800
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
1801
|
+
let rect;
|
1802
|
+
if (clippingAncestor === "viewport") {
|
1803
|
+
rect = getViewportRect(element, strategy);
|
1804
|
+
} else if (clippingAncestor === "document") {
|
1805
|
+
rect = getDocumentRect(getDocumentElement(element));
|
1806
|
+
} else if (isElement(clippingAncestor)) {
|
1807
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
1808
|
+
} else {
|
1809
|
+
const visualOffsets = getVisualOffsets(element);
|
1810
|
+
rect = {
|
1811
|
+
...clippingAncestor,
|
1812
|
+
x: clippingAncestor.x - visualOffsets.x,
|
1813
|
+
y: clippingAncestor.y - visualOffsets.y
|
1814
|
+
};
|
1554
1815
|
}
|
1555
|
-
return
|
1816
|
+
return rectToClientRect(rect);
|
1556
1817
|
}
|
1557
1818
|
|
1558
|
-
function
|
1559
|
-
|
1560
|
-
if (
|
1561
|
-
|
1819
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
1820
|
+
const parentNode = getParentNode(element);
|
1821
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
1822
|
+
return false;
|
1562
1823
|
}
|
1563
|
-
|
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)));
|
1569
|
-
}
|
1570
|
-
|
1571
|
-
function rectToClientRect(rect) {
|
1572
|
-
return Object.assign({}, rect, {
|
1573
|
-
left: rect.x,
|
1574
|
-
top: rect.y,
|
1575
|
-
right: rect.x + rect.width,
|
1576
|
-
bottom: rect.y + rect.height
|
1577
|
-
});
|
1824
|
+
return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
1578
1825
|
}
|
1579
1826
|
|
1580
|
-
function
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
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 [];
|
1827
|
+
function getClippingElementAncestors(element, cache) {
|
1828
|
+
const cachedResult = cache.get(element);
|
1829
|
+
if (cachedResult) {
|
1830
|
+
return cachedResult;
|
1603
1831
|
}
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1832
|
+
let result = getOverflowAncestors(element, [], false).filter((el => isElement(el) && getNodeName(el) !== "body"));
|
1833
|
+
let currentContainingBlockComputedStyle = null;
|
1834
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
1835
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
1836
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
1837
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
1838
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
1839
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
1840
|
+
currentContainingBlockComputedStyle = null;
|
1841
|
+
}
|
1842
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && [ "absolute", "fixed" ].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
1843
|
+
if (shouldDropCurrentNode) {
|
1844
|
+
result = result.filter((ancestor => ancestor !== currentNode));
|
1845
|
+
} else {
|
1846
|
+
currentContainingBlockComputedStyle = computedStyle;
|
1847
|
+
}
|
1848
|
+
currentNode = getParentNode(currentNode);
|
1849
|
+
}
|
1850
|
+
cache.set(element, result);
|
1851
|
+
return result;
|
1607
1852
|
}
|
1608
1853
|
|
1609
|
-
function getClippingRect(
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1854
|
+
function getClippingRect(_ref) {
|
1855
|
+
let {element: element, boundary: boundary, rootBoundary: rootBoundary, strategy: strategy} = _ref;
|
1856
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
1857
|
+
const clippingAncestors = [ ...elementClippingAncestors, rootBoundary ];
|
1858
|
+
const firstClippingAncestor = clippingAncestors[0];
|
1859
|
+
const clippingRect = clippingAncestors.reduce(((accRect, clippingAncestor) => {
|
1860
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
1615
1861
|
accRect.top = max(rect.top, accRect.top);
|
1616
1862
|
accRect.right = min(rect.right, accRect.right);
|
1617
1863
|
accRect.bottom = min(rect.bottom, accRect.bottom);
|
1618
1864
|
accRect.left = max(rect.left, accRect.left);
|
1619
1865
|
return accRect;
|
1620
|
-
}),
|
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;
|
1642
|
-
|
1643
|
-
case bottom:
|
1644
|
-
offsets = {
|
1645
|
-
x: commonX,
|
1646
|
-
y: reference.y + reference.height
|
1647
|
-
};
|
1648
|
-
break;
|
1649
|
-
|
1650
|
-
case right:
|
1651
|
-
offsets = {
|
1652
|
-
x: reference.x + reference.width,
|
1653
|
-
y: commonY
|
1654
|
-
};
|
1655
|
-
break;
|
1656
|
-
|
1657
|
-
case left:
|
1658
|
-
offsets = {
|
1659
|
-
x: reference.x - element.width,
|
1660
|
-
y: commonY
|
1661
|
-
};
|
1662
|
-
break;
|
1663
|
-
|
1664
|
-
default:
|
1665
|
-
offsets = {
|
1666
|
-
x: reference.x,
|
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;
|
1677
|
-
|
1678
|
-
case end:
|
1679
|
-
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
1680
|
-
break;
|
1681
|
-
}
|
1682
|
-
}
|
1683
|
-
return offsets;
|
1684
|
-
}
|
1685
|
-
|
1686
|
-
function detectOverflow(state, options) {
|
1687
|
-
if (options === void 0) {
|
1688
|
-
options = {};
|
1689
|
-
}
|
1690
|
-
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
1691
|
-
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
1692
|
-
var altContext = elementContext === popper ? reference : popper;
|
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
|
1710
|
-
};
|
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
|
-
}
|
1722
|
-
|
1723
|
-
function computeAutoPlacement(state, options) {
|
1724
|
-
if (options === void 0) {
|
1725
|
-
options = {};
|
1726
|
-
}
|
1727
|
-
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
1728
|
-
var variation = getVariation(placement);
|
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
|
-
}));
|
1750
|
-
}
|
1751
|
-
|
1752
|
-
function getExpandedFallbackPlacements(placement) {
|
1753
|
-
if (getBasePlacement(placement) === auto) {
|
1754
|
-
return [];
|
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
|
-
}
|
1839
|
-
}
|
1840
|
-
if (state.placement !== firstFittingPlacement) {
|
1841
|
-
state.modifiersData[name]._skip = true;
|
1842
|
-
state.placement = firstFittingPlacement;
|
1843
|
-
state.reset = true;
|
1844
|
-
}
|
1845
|
-
}
|
1846
|
-
|
1847
|
-
var flip$1 = {
|
1848
|
-
name: "flip",
|
1849
|
-
enabled: true,
|
1850
|
-
phase: "main",
|
1851
|
-
fn: flip,
|
1852
|
-
requiresIfExists: [ "offset" ],
|
1853
|
-
data: {
|
1854
|
-
_skip: false
|
1855
|
-
}
|
1856
|
-
};
|
1857
|
-
|
1858
|
-
function getSideOffsets(overflow, rect, preventedOffsets) {
|
1859
|
-
if (preventedOffsets === void 0) {
|
1860
|
-
preventedOffsets = {
|
1861
|
-
x: 0,
|
1862
|
-
y: 0
|
1863
|
-
};
|
1864
|
-
}
|
1866
|
+
}), getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
1865
1867
|
return {
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1868
|
+
width: clippingRect.right - clippingRect.left,
|
1869
|
+
height: clippingRect.bottom - clippingRect.top,
|
1870
|
+
x: clippingRect.left,
|
1871
|
+
y: clippingRect.top
|
1870
1872
|
};
|
1871
1873
|
}
|
1872
1874
|
|
1873
|
-
function
|
1874
|
-
return
|
1875
|
-
return overflow[side] >= 0;
|
1876
|
-
}));
|
1875
|
+
function getDimensions(element) {
|
1876
|
+
return getCssDimensions(element);
|
1877
1877
|
}
|
1878
1878
|
|
1879
|
-
function
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
elementContext: "reference"
|
1886
|
-
});
|
1887
|
-
var popperAltOverflow = detectOverflow(state, {
|
1888
|
-
altBoundary: true
|
1889
|
-
});
|
1890
|
-
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
1891
|
-
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
1892
|
-
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
1893
|
-
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
1894
|
-
state.modifiersData[name] = {
|
1895
|
-
referenceClippingOffsets: referenceClippingOffsets,
|
1896
|
-
popperEscapeOffsets: popperEscapeOffsets,
|
1897
|
-
isReferenceHidden: isReferenceHidden,
|
1898
|
-
hasPopperEscaped: hasPopperEscaped
|
1899
|
-
};
|
1900
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
1901
|
-
"data-popper-reference-hidden": isReferenceHidden,
|
1902
|
-
"data-popper-escaped": hasPopperEscaped
|
1903
|
-
});
|
1904
|
-
}
|
1905
|
-
|
1906
|
-
var hide$1 = {
|
1907
|
-
name: "hide",
|
1908
|
-
enabled: true,
|
1909
|
-
phase: "main",
|
1910
|
-
requiresIfExists: [ "preventOverflow" ],
|
1911
|
-
fn: hide
|
1912
|
-
};
|
1913
|
-
|
1914
|
-
function distanceAndSkiddingToXY(placement, rects, offset) {
|
1915
|
-
var basePlacement = getBasePlacement(placement);
|
1916
|
-
var invertDistance = [ left, top ].indexOf(basePlacement) >= 0 ? -1 : 1;
|
1917
|
-
var _ref = typeof offset === "function" ? offset(Object.assign({}, rects, {
|
1918
|
-
placement: placement
|
1919
|
-
})) : offset, skidding = _ref[0], distance = _ref[1];
|
1920
|
-
skidding = skidding || 0;
|
1921
|
-
distance = (distance || 0) * invertDistance;
|
1922
|
-
return [ left, right ].indexOf(basePlacement) >= 0 ? {
|
1923
|
-
x: distance,
|
1924
|
-
y: skidding
|
1925
|
-
} : {
|
1926
|
-
x: skidding,
|
1927
|
-
y: distance
|
1928
|
-
};
|
1929
|
-
}
|
1930
|
-
|
1931
|
-
function offset(_ref2) {
|
1932
|
-
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
1933
|
-
var _options$offset = options.offset, offset = _options$offset === void 0 ? [ 0, 0 ] : _options$offset;
|
1934
|
-
var data = placements.reduce((function(acc, placement) {
|
1935
|
-
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
1936
|
-
return acc;
|
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;
|
1942
|
-
}
|
1943
|
-
state.modifiersData[name] = data;
|
1944
|
-
}
|
1945
|
-
|
1946
|
-
var offset$1 = {
|
1947
|
-
name: "offset",
|
1948
|
-
enabled: true,
|
1949
|
-
phase: "main",
|
1950
|
-
requires: [ "popperOffsets" ],
|
1951
|
-
fn: offset
|
1952
|
-
};
|
1953
|
-
|
1954
|
-
function popperOffsets(_ref) {
|
1955
|
-
var state = _ref.state, name = _ref.name;
|
1956
|
-
state.modifiersData[name] = computeOffsets({
|
1957
|
-
reference: state.rects.reference,
|
1958
|
-
element: state.rects.popper,
|
1959
|
-
strategy: "absolute",
|
1960
|
-
placement: state.placement
|
1961
|
-
});
|
1962
|
-
}
|
1963
|
-
|
1964
|
-
var popperOffsets$1 = {
|
1965
|
-
name: "popperOffsets",
|
1966
|
-
enabled: true,
|
1967
|
-
phase: "read",
|
1968
|
-
fn: popperOffsets,
|
1969
|
-
data: {}
|
1970
|
-
};
|
1971
|
-
|
1972
|
-
function getAltAxis(axis) {
|
1973
|
-
return axis === "x" ? "y" : "x";
|
1974
|
-
}
|
1975
|
-
|
1976
|
-
function preventOverflow(_ref) {
|
1977
|
-
var state = _ref.state, options = _ref.options, name = _ref.name;
|
1978
|
-
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
1979
|
-
var overflow = detectOverflow(state, {
|
1980
|
-
boundary: boundary,
|
1981
|
-
rootBoundary: rootBoundary,
|
1982
|
-
padding: padding,
|
1983
|
-
altBoundary: altBoundary
|
1984
|
-
});
|
1985
|
-
var basePlacement = getBasePlacement(state.placement);
|
1986
|
-
var variation = getVariation(state.placement);
|
1987
|
-
var isBasePlacement = !variation;
|
1988
|
-
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
1989
|
-
var altAxis = getAltAxis(mainAxis);
|
1990
|
-
var popperOffsets = state.modifiersData.popperOffsets;
|
1991
|
-
var referenceRect = state.rects.reference;
|
1992
|
-
var popperRect = state.rects.popper;
|
1993
|
-
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
1994
|
-
placement: state.placement
|
1995
|
-
})) : tetherOffset;
|
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
|
2007
|
-
};
|
2008
|
-
if (!popperOffsets) {
|
2009
|
-
return;
|
2010
|
-
}
|
2011
|
-
if (checkMainAxis) {
|
2012
|
-
var _offsetModifierState$;
|
2013
|
-
var mainSide = mainAxis === "y" ? top : left;
|
2014
|
-
var altSide = mainAxis === "y" ? bottom : right;
|
2015
|
-
var len = mainAxis === "y" ? "height" : "width";
|
2016
|
-
var offset = popperOffsets[mainAxis];
|
2017
|
-
var min$1 = offset + overflow[mainSide];
|
2018
|
-
var max$1 = offset - overflow[altSide];
|
2019
|
-
var additive = tether ? -popperRect[len] / 2 : 0;
|
2020
|
-
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
2021
|
-
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
2022
|
-
var arrowElement = state.elements.arrow;
|
2023
|
-
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
2024
|
-
width: 0,
|
2025
|
-
height: 0
|
2026
|
-
};
|
2027
|
-
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
2028
|
-
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
2029
|
-
var arrowPaddingMax = arrowPaddingObject[altSide];
|
2030
|
-
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
2031
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
2032
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
2033
|
-
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
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
|
-
};
|
2068
|
-
|
2069
|
-
function getHTMLElementScroll(element) {
|
2070
|
-
return {
|
2071
|
-
scrollLeft: element.scrollLeft,
|
2072
|
-
scrollTop: element.scrollTop
|
2073
|
-
};
|
2074
|
-
}
|
2075
|
-
|
2076
|
-
function getNodeScroll(node) {
|
2077
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
2078
|
-
return getWindowScroll(node);
|
2079
|
-
} else {
|
2080
|
-
return getHTMLElementScroll(node);
|
2081
|
-
}
|
2082
|
-
}
|
2083
|
-
|
2084
|
-
function isElementScaled(element) {
|
2085
|
-
var rect = element.getBoundingClientRect();
|
2086
|
-
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
2087
|
-
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
2088
|
-
return scaleX !== 1 || scaleY !== 1;
|
2089
|
-
}
|
2090
|
-
|
2091
|
-
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
2092
|
-
if (isFixed === void 0) {
|
2093
|
-
isFixed = false;
|
2094
|
-
}
|
2095
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
2096
|
-
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
2097
|
-
var documentElement = getDocumentElement(offsetParent);
|
2098
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
2099
|
-
var scroll = {
|
1879
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
1880
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
1881
|
+
const documentElement = getDocumentElement(offsetParent);
|
1882
|
+
const isFixed = strategy === "fixed";
|
1883
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
1884
|
+
let scroll = {
|
2100
1885
|
scrollLeft: 0,
|
2101
1886
|
scrollTop: 0
|
2102
1887
|
};
|
2103
|
-
|
2104
|
-
x: 0,
|
2105
|
-
y: 0
|
2106
|
-
};
|
1888
|
+
const offsets = createCoords(0);
|
2107
1889
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
2108
|
-
if (getNodeName(offsetParent) !== "body" ||
|
1890
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
2109
1891
|
scroll = getNodeScroll(offsetParent);
|
2110
1892
|
}
|
2111
|
-
if (
|
2112
|
-
|
2113
|
-
offsets.x
|
2114
|
-
offsets.y
|
1893
|
+
if (isOffsetParentAnElement) {
|
1894
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
1895
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
1896
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
2115
1897
|
} else if (documentElement) {
|
2116
1898
|
offsets.x = getWindowScrollBarX(documentElement);
|
2117
1899
|
}
|
@@ -2124,210 +1906,202 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
2124
1906
|
};
|
2125
1907
|
}
|
2126
1908
|
|
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);
|
1909
|
+
function getTrueOffsetParent(element, polyfill) {
|
1910
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
1911
|
+
return null;
|
2146
1912
|
}
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
}));
|
2152
|
-
return result;
|
1913
|
+
if (polyfill) {
|
1914
|
+
return polyfill(element);
|
1915
|
+
}
|
1916
|
+
return element.offsetParent;
|
2153
1917
|
}
|
2154
1918
|
|
2155
|
-
function
|
2156
|
-
|
2157
|
-
|
2158
|
-
return
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
1919
|
+
function getOffsetParent(element, polyfill) {
|
1920
|
+
const window = getWindow(element);
|
1921
|
+
if (!isHTMLElement(element)) {
|
1922
|
+
return window;
|
1923
|
+
}
|
1924
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
1925
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
|
1926
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
1927
|
+
}
|
1928
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
1929
|
+
return window;
|
1930
|
+
}
|
1931
|
+
return offsetParent || getContainingBlock(element) || window;
|
2162
1932
|
}
|
2163
1933
|
|
2164
|
-
function
|
2165
|
-
|
2166
|
-
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
1934
|
+
const getElementRects = async function(_ref) {
|
1935
|
+
let {reference: reference, floating: floating, strategy: strategy} = _ref;
|
1936
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
1937
|
+
const getDimensionsFn = this.getDimensions;
|
1938
|
+
return {
|
1939
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
1940
|
+
floating: {
|
1941
|
+
x: 0,
|
1942
|
+
y: 0,
|
1943
|
+
...await getDimensionsFn(floating)
|
2174
1944
|
}
|
2175
|
-
return pending;
|
2176
1945
|
};
|
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
1946
|
};
|
2198
1947
|
|
2199
|
-
function
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
1948
|
+
function isRTL(element) {
|
1949
|
+
return getComputedStyle$1(element).direction === "rtl";
|
1950
|
+
}
|
1951
|
+
|
1952
|
+
const platform = {
|
1953
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect,
|
1954
|
+
getDocumentElement: getDocumentElement,
|
1955
|
+
getClippingRect: getClippingRect,
|
1956
|
+
getOffsetParent: getOffsetParent,
|
1957
|
+
getElementRects: getElementRects,
|
1958
|
+
getClientRects: getClientRects,
|
1959
|
+
getDimensions: getDimensions,
|
1960
|
+
getScale: getScale,
|
1961
|
+
isElement: isElement,
|
1962
|
+
isRTL: isRTL
|
1963
|
+
};
|
2207
1964
|
|
2208
|
-
function
|
2209
|
-
|
2210
|
-
|
1965
|
+
function observeMove(element, onMove) {
|
1966
|
+
let io = null;
|
1967
|
+
let timeoutId;
|
1968
|
+
const root = getDocumentElement(element);
|
1969
|
+
function cleanup() {
|
1970
|
+
clearTimeout(timeoutId);
|
1971
|
+
io && io.disconnect();
|
1972
|
+
io = null;
|
2211
1973
|
}
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
options = defaultOptions;
|
1974
|
+
function refresh(skip, threshold) {
|
1975
|
+
if (skip === void 0) {
|
1976
|
+
skip = false;
|
2216
1977
|
}
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
1978
|
+
if (threshold === void 0) {
|
1979
|
+
threshold = 1;
|
1980
|
+
}
|
1981
|
+
cleanup();
|
1982
|
+
const {left: left, top: top, width: width, height: height} = element.getBoundingClientRect();
|
1983
|
+
if (!skip) {
|
1984
|
+
onMove();
|
1985
|
+
}
|
1986
|
+
if (!width || !height) {
|
1987
|
+
return;
|
1988
|
+
}
|
1989
|
+
const insetTop = floor(top);
|
1990
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
1991
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
1992
|
+
const insetLeft = floor(left);
|
1993
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
1994
|
+
const options = {
|
1995
|
+
rootMargin: rootMargin,
|
1996
|
+
threshold: max(0, min(1, threshold)) || 1
|
2228
1997
|
};
|
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;
|
1998
|
+
let isFirstUpdate = true;
|
1999
|
+
function handleObserve(entries) {
|
2000
|
+
const ratio = entries[0].intersectionRatio;
|
2001
|
+
if (ratio !== threshold) {
|
2002
|
+
if (!isFirstUpdate) {
|
2003
|
+
return refresh();
|
2251
2004
|
}
|
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
|
-
}
|
2005
|
+
if (!ratio) {
|
2006
|
+
timeoutId = setTimeout((() => {
|
2007
|
+
refresh(false, 1e-7);
|
2008
|
+
}), 100);
|
2009
|
+
} else {
|
2010
|
+
refresh(false, ratio);
|
2280
2011
|
}
|
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
2012
|
}
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2013
|
+
isFirstUpdate = false;
|
2014
|
+
}
|
2015
|
+
try {
|
2016
|
+
io = new IntersectionObserver(handleObserve, {
|
2017
|
+
...options,
|
2018
|
+
root: root.ownerDocument
|
2019
|
+
});
|
2020
|
+
} catch (e) {
|
2021
|
+
io = new IntersectionObserver(handleObserve, options);
|
2295
2022
|
}
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2023
|
+
io.observe(element);
|
2024
|
+
}
|
2025
|
+
refresh(true);
|
2026
|
+
return cleanup;
|
2027
|
+
}
|
2028
|
+
|
2029
|
+
function autoUpdate(reference, floating, update, options) {
|
2030
|
+
if (options === void 0) {
|
2031
|
+
options = {};
|
2032
|
+
}
|
2033
|
+
const {ancestorScroll: ancestorScroll = true, ancestorResize: ancestorResize = true, elementResize: elementResize = typeof ResizeObserver === "function", layoutShift: layoutShift = typeof IntersectionObserver === "function", animationFrame: animationFrame = false} = options;
|
2034
|
+
const referenceEl = unwrapElement(reference);
|
2035
|
+
const ancestors = ancestorScroll || ancestorResize ? [ ...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating) ] : [];
|
2036
|
+
ancestors.forEach((ancestor => {
|
2037
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
2038
|
+
passive: true
|
2039
|
+
});
|
2040
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
2041
|
+
}));
|
2042
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
2043
|
+
let reobserveFrame = -1;
|
2044
|
+
let resizeObserver = null;
|
2045
|
+
if (elementResize) {
|
2046
|
+
resizeObserver = new ResizeObserver((_ref => {
|
2047
|
+
let [firstEntry] = _ref;
|
2048
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
2049
|
+
resizeObserver.unobserve(floating);
|
2050
|
+
cancelAnimationFrame(reobserveFrame);
|
2051
|
+
reobserveFrame = requestAnimationFrame((() => {
|
2052
|
+
resizeObserver && resizeObserver.observe(floating);
|
2053
|
+
}));
|
2299
2054
|
}
|
2055
|
+
update();
|
2300
2056
|
}));
|
2301
|
-
|
2302
|
-
|
2303
|
-
var name = _ref.name, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options, effect = _ref.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
|
-
}));
|
2057
|
+
if (referenceEl && !animationFrame) {
|
2058
|
+
resizeObserver.observe(referenceEl);
|
2315
2059
|
}
|
2316
|
-
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2320
|
-
|
2060
|
+
resizeObserver.observe(floating);
|
2061
|
+
}
|
2062
|
+
let frameId;
|
2063
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
2064
|
+
if (animationFrame) {
|
2065
|
+
frameLoop();
|
2066
|
+
}
|
2067
|
+
function frameLoop() {
|
2068
|
+
const nextRefRect = getBoundingClientRect(reference);
|
2069
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
2070
|
+
update();
|
2071
|
+
}
|
2072
|
+
prevRefRect = nextRefRect;
|
2073
|
+
frameId = requestAnimationFrame(frameLoop);
|
2074
|
+
}
|
2075
|
+
update();
|
2076
|
+
return () => {
|
2077
|
+
ancestors.forEach((ancestor => {
|
2078
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
2079
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
2080
|
+
}));
|
2081
|
+
cleanupIo && cleanupIo();
|
2082
|
+
resizeObserver && resizeObserver.disconnect();
|
2083
|
+
resizeObserver = null;
|
2084
|
+
if (animationFrame) {
|
2085
|
+
cancelAnimationFrame(frameId);
|
2321
2086
|
}
|
2322
|
-
return instance;
|
2323
2087
|
};
|
2324
2088
|
}
|
2325
2089
|
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2090
|
+
const computePosition = (reference, floating, options) => {
|
2091
|
+
const cache = new Map;
|
2092
|
+
const mergedOptions = {
|
2093
|
+
platform: platform,
|
2094
|
+
...options
|
2095
|
+
};
|
2096
|
+
const platformWithCache = {
|
2097
|
+
...mergedOptions.platform,
|
2098
|
+
_c: cache
|
2099
|
+
};
|
2100
|
+
return computePosition$1(reference, floating, {
|
2101
|
+
...mergedOptions,
|
2102
|
+
platform: platformWithCache
|
2103
|
+
});
|
2104
|
+
};
|
2331
2105
|
|
2332
2106
|
class Popover extends Controller {
|
2333
2107
|
static targets=[ "activator", "popover", "template" ];
|
@@ -2335,43 +2109,55 @@ class Popover extends Controller {
|
|
2335
2109
|
static values={
|
2336
2110
|
appendToBody: Boolean,
|
2337
2111
|
placement: String,
|
2338
|
-
active: Boolean
|
2112
|
+
active: Boolean,
|
2113
|
+
textFieldActivator: Boolean
|
2339
2114
|
};
|
2340
2115
|
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
2116
|
if (this.appendToBodyValue) {
|
2356
2117
|
const clonedTemplate = this.templateTarget.content.cloneNode(true);
|
2357
2118
|
this.target = clonedTemplate.firstElementChild;
|
2358
|
-
popperOptions["strategy"] = "fixed";
|
2359
2119
|
document.body.appendChild(clonedTemplate);
|
2360
2120
|
}
|
2361
|
-
this.
|
2121
|
+
this.target.style.display = "none";
|
2362
2122
|
if (this.activeValue) {
|
2363
2123
|
this.show();
|
2364
2124
|
}
|
2365
2125
|
}
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2126
|
+
disconnect() {
|
2127
|
+
if (this.cleanup) {
|
2128
|
+
this.cleanup();
|
2129
|
+
}
|
2130
|
+
}
|
2131
|
+
updatePosition() {
|
2132
|
+
if (this.cleanup) {
|
2133
|
+
this.cleanup();
|
2134
|
+
}
|
2135
|
+
this.cleanup = autoUpdate(this.activator, this.target, (() => {
|
2136
|
+
computePosition(this.activator, this.target, {
|
2137
|
+
placement: this.placementValue,
|
2138
|
+
middleware: [ offset(5), flip(), shift({
|
2139
|
+
padding: 5
|
2140
|
+
}) ]
|
2141
|
+
}).then((({x: x, y: y}) => {
|
2142
|
+
Object.assign(this.target.style, {
|
2143
|
+
left: `${x}px`,
|
2144
|
+
top: `${y}px`
|
2145
|
+
});
|
2146
|
+
}));
|
2147
|
+
}));
|
2148
|
+
}
|
2149
|
+
toggle() {
|
2150
|
+
if (this.target.classList.contains(this.openClass)) {
|
2151
|
+
this.forceHide();
|
2152
|
+
} else {
|
2153
|
+
this.show();
|
2154
|
+
}
|
2370
2155
|
}
|
2371
|
-
|
2156
|
+
show() {
|
2157
|
+
this.target.style.display = "block";
|
2372
2158
|
this.target.classList.remove(this.closedClass);
|
2373
2159
|
this.target.classList.add(this.openClass);
|
2374
|
-
|
2160
|
+
this.updatePosition();
|
2375
2161
|
}
|
2376
2162
|
hide(event) {
|
2377
2163
|
if (this.element.contains(event.target)) return;
|
@@ -2380,9 +2166,17 @@ class Popover extends Controller {
|
|
2380
2166
|
this.forceHide();
|
2381
2167
|
}
|
2382
2168
|
forceHide() {
|
2169
|
+
this.target.style.display = "none";
|
2383
2170
|
this.target.classList.remove(this.openClass);
|
2384
2171
|
this.target.classList.add(this.closedClass);
|
2385
2172
|
}
|
2173
|
+
get activator() {
|
2174
|
+
if (this.textFieldActivatorValue) {
|
2175
|
+
return this.activatorTarget.querySelector('[data-controller="polaris-text-field"]');
|
2176
|
+
} else {
|
2177
|
+
return this.activatorTarget;
|
2178
|
+
}
|
2179
|
+
}
|
2386
2180
|
get target() {
|
2387
2181
|
if (this.hasPopoverTarget) {
|
2388
2182
|
return this.popoverTarget;
|
@@ -2497,6 +2291,16 @@ class TextField extends Controller {
|
|
2497
2291
|
this.inputTarget.dispatchEvent(new Event("change"));
|
2498
2292
|
}
|
2499
2293
|
}
|
2294
|
+
clearErrorMessages() {
|
2295
|
+
const wrapper = this.inputTarget.parentElement;
|
2296
|
+
const inlineError = this.inputTarget.closest(".polaris-text-field-wrapper").querySelector(".Polaris-InlineError");
|
2297
|
+
if (wrapper) {
|
2298
|
+
wrapper.classList.remove("Polaris-TextField--error");
|
2299
|
+
}
|
2300
|
+
if (inlineError) {
|
2301
|
+
inlineError.remove();
|
2302
|
+
}
|
2303
|
+
}
|
2500
2304
|
increase() {
|
2501
2305
|
this.changeNumber(1);
|
2502
2306
|
}
|
@@ -2622,42 +2426,56 @@ class Tooltip extends Controller {
|
|
2622
2426
|
active: Boolean,
|
2623
2427
|
position: String
|
2624
2428
|
};
|
2625
|
-
initialize() {
|
2626
|
-
this.shownTooltip = null;
|
2627
|
-
}
|
2628
|
-
getOffset() {
|
2629
|
-
switch (this.positionValue) {
|
2630
|
-
case "bottom":
|
2631
|
-
return [ 0, 8 ];
|
2632
|
-
|
2633
|
-
case "right":
|
2634
|
-
return [ 0, 6 ];
|
2635
|
-
|
2636
|
-
default:
|
2637
|
-
return [ 0, 8 ];
|
2638
|
-
}
|
2639
|
-
}
|
2640
2429
|
show(event) {
|
2641
2430
|
if (!this.activeValue) return;
|
2642
|
-
const popperOptions = {
|
2643
|
-
placement: this.positionValue,
|
2644
|
-
modifiers: [ {
|
2645
|
-
name: "offset",
|
2646
|
-
options: {
|
2647
|
-
offset: this.getOffset()
|
2648
|
-
}
|
2649
|
-
} ]
|
2650
|
-
};
|
2651
2431
|
const element = event.currentTarget;
|
2652
2432
|
let tooltip = document.createElement("span");
|
2653
2433
|
tooltip.className = "Polaris-Tooltip";
|
2654
2434
|
tooltip.innerHTML = this.templateTarget.innerHTML;
|
2655
|
-
this.
|
2656
|
-
|
2435
|
+
this.tooltip = element.appendChild(tooltip);
|
2436
|
+
const arrowElement = element.querySelector("[data-tooltip-arrow]");
|
2437
|
+
computePosition(element, this.tooltip, {
|
2438
|
+
placement: this.positionValue,
|
2439
|
+
middleware: [ offset(this.offsetValue), flip(), shift({
|
2440
|
+
padding: 5
|
2441
|
+
}), arrow({
|
2442
|
+
element: arrowElement
|
2443
|
+
}) ]
|
2444
|
+
}).then((({x: x, y: y, placement: placement, middlewareData: middlewareData}) => {
|
2445
|
+
Object.assign(this.tooltip.style, {
|
2446
|
+
left: `${x}px`,
|
2447
|
+
top: `${y}px`
|
2448
|
+
});
|
2449
|
+
const {x: arrowX, y: arrowY} = middlewareData.arrow;
|
2450
|
+
const staticSide = {
|
2451
|
+
top: "bottom",
|
2452
|
+
right: "left",
|
2453
|
+
bottom: "top",
|
2454
|
+
left: "right"
|
2455
|
+
}[placement.split("-")[0]];
|
2456
|
+
Object.assign(arrowElement.style, {
|
2457
|
+
left: arrowX != null ? `${arrowX}px` : "",
|
2458
|
+
top: arrowY != null ? `${arrowY}px` : "",
|
2459
|
+
right: "",
|
2460
|
+
bottom: "",
|
2461
|
+
[staticSide]: "-4px"
|
2462
|
+
});
|
2463
|
+
}));
|
2657
2464
|
}
|
2658
2465
|
hide() {
|
2659
|
-
if (this.
|
2660
|
-
this.
|
2466
|
+
if (this.tooltip) {
|
2467
|
+
this.tooltip.remove();
|
2468
|
+
}
|
2469
|
+
}
|
2470
|
+
get offsetValue() {
|
2471
|
+
switch (this.positionValue) {
|
2472
|
+
case "top":
|
2473
|
+
case "bottom":
|
2474
|
+
case "left":
|
2475
|
+
return 8;
|
2476
|
+
|
2477
|
+
case "right":
|
2478
|
+
return 6;
|
2661
2479
|
}
|
2662
2480
|
}
|
2663
2481
|
}
|