@adyen/adyen-platform-experience-web 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/components/external/BaseElement.js +12 -3
- package/dist/es/components/external/PayoutDetails/PayoutDetails.js +18 -14
- package/dist/es/components/external/PayoutDetails/components/PayoutData.js +200 -85
- package/dist/es/components/external/PayoutDetails/components/constants.js +8 -7
- package/dist/es/components/external/PayoutsOverview/PayoutsOverviewElement.js +14 -20
- package/dist/es/components/external/PayoutsOverview/components/PayoutsOverview/PayoutsOverview.js +137 -116
- package/dist/es/components/external/PayoutsOverview/components/PayoutsOverviewContainer/PayoutsOverviewContainer.js +22 -14
- package/dist/es/components/external/PayoutsOverview/components/PayoutsTable/PayoutsTable.js +92 -56
- package/dist/es/components/external/TransactionDetails/TransactionDetails.js +16 -12
- package/dist/es/components/external/TransactionDetails/components/TransactionData.js +81 -57
- package/dist/es/components/external/TransactionDetails/components/TransactionDataSkeleton.js +12 -9
- package/dist/es/components/external/TransactionsOverview/TransactionsOverviewElement.js +17 -23
- package/dist/es/components/external/TransactionsOverview/components/AmountSkeleton/AmountSkeleton.js +16 -4
- package/dist/es/components/external/TransactionsOverview/components/BalanceItem/BalanceItem.js +35 -34
- package/dist/es/components/external/TransactionsOverview/components/Balances/Balances.js +52 -26
- package/dist/es/components/external/TransactionsOverview/components/Category/Category.js +17 -4
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.js +20 -25
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/constants.js +1 -13
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.js +12 -7
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/utils.js +4 -1
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.js +47 -20
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/SummaryItemLabel.js +22 -13
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotalItem/TransactionTotalItem.js +23 -28
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/TotalsCard.js +30 -30
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.js +72 -41
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.js +215 -186
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewContainer/TransactionsOverviewContainer.js +22 -14
- package/dist/es/components/external/TransactionsOverview/components/TransactionsTable/PaymentMethodCell.js +21 -14
- package/dist/es/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.js +116 -83
- package/dist/es/components/external/TransactionsOverview/hooks/useMaxWidths.js +4 -6
- package/dist/es/components/external/UIElement/UIElement.js +39 -24
- package/dist/es/components/hooks/useBalanceAccountSelection.js +20 -11
- package/dist/es/components/hooks/useBalanceAccounts.js +22 -19
- package/dist/es/components/hooks/useDefaultOverviewFilterParams.js +28 -16
- package/dist/es/components/hooks/useTimezoneAwareDateFormatting.js +31 -0
- package/dist/es/components/internal/Accordion/Accordion.js +58 -0
- package/dist/es/components/internal/Accordion/Accordion.scss.js +4 -0
- package/dist/es/components/internal/Accordion/constants.js +8 -0
- package/dist/es/components/internal/BaseButton/BaseButton.js +26 -12
- package/dist/es/components/internal/BaseList/BaseList.js +8 -3
- package/dist/es/components/internal/Button/Button.js +31 -18
- package/dist/es/components/internal/Button/ButtonActions/ButtonActions.js +19 -13
- package/dist/es/components/internal/Button/ButtonActions/types.js +4 -1
- package/dist/es/components/internal/Button/hooks/useButton.js +7 -10
- package/dist/es/components/internal/Calendar/Calendar.js +16 -15
- package/dist/es/components/internal/Calendar/calendar/facade/Calendar.js +301 -292
- package/dist/es/components/internal/Calendar/calendar/facade/index.js +40 -13
- package/dist/es/components/internal/Calendar/calendar/timeframe/common/flags.js +17 -18
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.js +125 -100
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.js +209 -200
- package/dist/es/components/internal/Calendar/calendar/timerange/factory.js +14 -9
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastNDays.js +23 -19
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetMonth.js +23 -14
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetWeek.js +26 -22
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/yearToDate.js +11 -10
- package/dist/es/components/internal/Calendar/calendar/timerange/utils.js +39 -41
- package/dist/es/components/internal/Calendar/calendar/timeslice/TimeSlice.js +10 -10
- package/dist/es/components/internal/Calendar/calendar/timeslice/index.js +26 -17
- package/dist/es/components/internal/Calendar/calendar/utils.js +64 -16
- package/dist/es/components/internal/Calendar/components/CalendarControls/CalendarControls.js +11 -3
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGrid.js +46 -19
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGridDate.js +57 -39
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGridDayOfWeek.js +44 -26
- package/dist/es/components/internal/Calendar/components/CalendarGrid/utils.js +26 -12
- package/dist/es/components/internal/Calendar/hooks/useCalendar.js +82 -72
- package/dist/es/components/internal/Calendar/hooks/useCalendarControlsRendering.js +33 -38
- package/dist/es/components/internal/Calendar/hooks/useTimezone.js +25 -9
- package/dist/es/components/internal/Card/Card.js +28 -17
- package/dist/es/components/internal/CopyText/CopyText.js +15 -11
- package/dist/es/components/internal/DataGrid/DataGrid.js +104 -68
- package/dist/es/components/internal/DataGrid/DataGridCell.js +24 -23
- package/dist/es/components/internal/DataGrid/components/InteractiveBody.js +20 -12
- package/dist/es/components/internal/DataGrid/components/SkeletonBody.js +24 -14
- package/dist/es/components/internal/DataGrid/components/TableBody.js +14 -9
- package/dist/es/components/internal/DataGrid/components/TableCells.js +31 -10
- package/dist/es/components/internal/DataGrid/components/TableHeaderCell.js +23 -16
- package/dist/es/components/internal/DataGrid/hooks/useInteractiveDataGrid.js +75 -68
- package/dist/es/components/internal/DataGrid/utils/DataGridProvider.js +23 -18
- package/dist/es/components/internal/DataOverviewContainer/DataOverviewContainer.js +15 -15
- package/dist/es/components/internal/DataOverviewDetails/DataOverviewDetails.js +80 -39
- package/dist/es/components/internal/DataOverviewDisplay/DataDetailsModal.js +19 -18
- package/dist/es/components/internal/DataOverviewDisplay/constants.js +20 -1
- package/dist/es/components/internal/DataOverviewError/DataOverviewError.js +13 -16
- package/dist/es/components/internal/DatePicker/DatePicker.js +52 -33
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/TimeRangeSelector.js +24 -15
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/useTimeRangeSelection.js +25 -29
- package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.js +48 -27
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.js +59 -34
- package/dist/es/components/internal/FilterBar/FilterBar.js +29 -28
- package/dist/es/components/internal/FilterBar/components/FilterButton/FilterButton.js +26 -5
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/AmountFilter.js +54 -49
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/RangeSelection.js +64 -55
- package/dist/es/components/internal/FilterBar/filters/BaseFilter/BaseFilter.js +83 -90
- package/dist/es/components/internal/FilterBar/filters/DateFilter/DateFilter.js +40 -44
- package/dist/es/components/internal/FilterBar/filters/DateFilter/DateFilterCore.js +123 -103
- package/dist/es/components/internal/FormFields/InputBase.js +63 -54
- package/dist/es/components/internal/FormFields/InputText.js +11 -5
- package/dist/es/components/internal/FormFields/Select/BalanceAccountSelector/BalanceAccountSelector.js +30 -33
- package/dist/es/components/internal/FormFields/Select/Select.js +142 -149
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +81 -61
- package/dist/es/components/internal/FormFields/Select/components/SelectList.js +59 -54
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +51 -31
- package/dist/es/components/internal/FormFields/Select/hooks/useSelect.js +27 -28
- package/dist/es/components/internal/Image/Image.js +21 -8
- package/dist/es/components/internal/Img/Img.js +25 -9
- package/dist/es/components/internal/Modal/Modal.js +61 -81
- package/dist/es/components/internal/Modal/ModalContent/ModalContent.js +23 -4
- package/dist/es/components/internal/Pagination/Pagination.js +58 -51
- package/dist/es/components/internal/Pagination/hooks/useCursorPagination.js +11 -4
- package/dist/es/components/internal/Pagination/hooks/useOffsetPagination.js +12 -5
- package/dist/es/components/internal/Pagination/hooks/usePageLimit.js +30 -27
- package/dist/es/components/internal/Pagination/hooks/usePaginatedRecords.js +104 -67
- package/dist/es/components/internal/Pagination/hooks/usePaginatedRecordsFilters.js +7 -1
- package/dist/es/components/internal/Pagination/hooks/usePagination.js +34 -13
- package/dist/es/components/internal/Popover/Popover.js +118 -128
- package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.js +27 -20
- package/dist/es/components/internal/Popover/PopoverTitle/PopoverTitle.js +13 -6
- package/dist/es/components/internal/Popover/utils/popoverUtil.js +15 -7
- package/dist/es/components/internal/Popover/utils/utils.js +9 -8
- package/dist/es/components/internal/SVGIcons/CheckedBox.js +18 -10
- package/dist/es/components/internal/SVGIcons/Checkmark.js +20 -12
- package/dist/es/components/internal/SVGIcons/ChevronDown.js +20 -12
- package/dist/es/components/internal/SVGIcons/ChevronLeft.js +18 -10
- package/dist/es/components/internal/SVGIcons/ChevronRight.js +18 -10
- package/dist/es/components/internal/SVGIcons/ChevronUp.js +20 -12
- package/dist/es/components/internal/SVGIcons/Close.js +11 -5
- package/dist/es/components/internal/SVGIcons/Copy.js +13 -1
- package/dist/es/components/internal/SVGIcons/Filter.js +12 -5
- package/dist/es/components/internal/SVGIcons/UncheckedBox.js +18 -4
- package/dist/es/components/internal/Spinner/Spinner.js +14 -0
- package/dist/es/components/internal/Spinner/Spinner.scss.js +4 -0
- package/dist/es/components/internal/StructuredList/StructuredList.js +24 -19
- package/dist/es/components/internal/StructuredList/useStructuredListItem.js +14 -15
- package/dist/es/components/internal/Tag/Tag.js +16 -16
- package/dist/es/components/internal/Tooltip/Tooltip.js +35 -18
- package/dist/es/components/internal/Tooltip/useTooltipListeners.js +7 -10
- package/dist/es/components/internal/Typography/Typography.js +38 -28
- package/dist/es/components/utils/getCommonErrorCode.js +4 -1
- package/dist/es/components/utils/getErrorMessage.js +7 -5
- package/dist/es/core/Auth/context.js +14 -8
- package/dist/es/core/Auth/session/AuthSession.js +53 -73
- package/dist/es/core/Auth/session/AuthSessionSpecification.js +54 -39
- package/dist/es/core/Auth/session/AuthSetupContext.js +67 -43
- package/dist/es/core/Auth/session/constants.js +8 -11
- package/dist/es/core/Context/CoreProvider.js +21 -11
- package/dist/es/core/Http/http.js +43 -33
- package/dist/es/core/Http/utils.js +18 -12
- package/dist/es/core/Localization/Localization.js +98 -82
- package/dist/es/core/Localization/constants/localization.js +5 -1
- package/dist/es/core/Localization/datetime/restamper/constants.js +12 -2
- package/dist/es/core/Localization/datetime/restamper/restamper.js +18 -5
- package/dist/es/core/Localization/datetime/restamper/utils.js +28 -25
- package/dist/es/core/Localization/localization-utils.js +30 -18
- package/dist/es/core/Localization/utils.js +6 -1
- package/dist/es/core/core.js +26 -17
- package/dist/es/hooks/element/useClickOutside.js +29 -35
- package/dist/es/hooks/element/useDetachedRender.js +7 -10
- package/dist/es/hooks/element/useFocusCursor.js +10 -18
- package/dist/es/hooks/element/useFocusTrap.js +3 -6
- package/dist/es/hooks/element/usePopoverPositioner.js +43 -65
- package/dist/es/hooks/element/useUniqueIdentifier.js +3 -9
- package/dist/es/hooks/useCommitAction/useCommitAction.js +25 -19
- package/dist/es/hooks/useFetch/useFetch.js +29 -7
- package/dist/es/hooks/useImageUrl/useImageUrl.js +12 -10
- package/dist/es/hooks/useModalDetails/useModalDetails.js +15 -15
- package/dist/es/hooks/useReactiveState/useReactiveState.js +21 -9
- package/dist/es/index.js +1 -1
- package/dist/es/primitives/async/abortable/main.js +19 -16
- package/dist/es/primitives/async/promisor/main.js +13 -12
- package/dist/es/primitives/auxiliary/indexed/main.js +18 -22
- package/dist/es/primitives/context/session/SessionContext.js +41 -129
- package/dist/es/primitives/context/session/constants.js +9 -6
- package/dist/es/primitives/context/session/internal/autofresher.js +34 -0
- package/dist/es/primitives/context/session/internal/constants.js +7 -0
- package/dist/es/primitives/context/session/internal/deadline.js +62 -0
- package/dist/es/primitives/context/session/internal/refresher.js +66 -0
- package/dist/es/primitives/dom/tabbableRoot/tabbable.js +3 -1
- package/dist/es/primitives/reactive/eventEmitter/main.js +11 -19
- package/dist/es/primitives/reactive/reflex/main.js +33 -19
- package/dist/es/primitives/reactive/reflex/register.js +9 -3
- package/dist/es/primitives/reactive/watchlist/helpers.js +12 -8
- package/dist/es/primitives/reactive/watchlist/main.js +4 -5
- package/dist/es/primitives/time/clock/main.js +6 -1
- package/dist/es/primitives/time/interval/main.js +1 -1
- package/dist/es/primitives/time/today/main.js +41 -39
- package/dist/es/translations/da-DK.json.js +48 -42
- package/dist/es/translations/de-DE.json.js +100 -94
- package/dist/es/translations/es-ES.json.js +48 -42
- package/dist/es/translations/fr-FR.json.js +35 -29
- package/dist/es/translations/index.js +21 -1
- package/dist/es/translations/it-IT.json.js +27 -21
- package/dist/es/translations/nl-NL.json.js +35 -29
- package/dist/es/translations/no-NO.json.js +58 -52
- package/dist/es/translations/pt-BR.json.js +27 -21
- package/dist/es/translations/sv-SE.json.js +53 -47
- package/dist/es/utils/abort/constants.js +5 -0
- package/dist/es/utils/abort/internals.js +29 -0
- package/dist/es/utils/abort/main.js +51 -0
- package/dist/es/utils/preact/memoComparator/main.js +3 -1
- package/dist/es/utils/struct/main.js +5 -1
- package/dist/style.css +1 -1
- package/dist/types/components/external/PayoutDetails/PayoutDetails.d.ts.map +1 -1
- package/dist/types/components/external/PayoutDetails/components/PayoutData.d.ts +40 -3
- package/dist/types/components/external/PayoutDetails/components/PayoutData.d.ts.map +1 -1
- package/dist/types/components/external/PayoutDetails/components/constants.d.ts +1 -0
- package/dist/types/components/external/PayoutDetails/components/constants.d.ts.map +1 -1
- package/dist/types/components/external/PayoutsOverview/PayoutsOverviewElement.d.ts.map +1 -1
- package/dist/types/components/external/PayoutsOverview/components/PayoutsOverview/PayoutsOverview.d.ts +1 -1
- package/dist/types/components/external/PayoutsOverview/components/PayoutsOverview/PayoutsOverview.d.ts.map +1 -1
- package/dist/types/components/external/PayoutsOverview/components/PayoutsTable/PayoutsTable.d.ts +1 -2
- package/dist/types/components/external/PayoutsOverview/components/PayoutsTable/PayoutsTable.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/TransactionDetails.d.ts +2 -2
- package/dist/types/components/external/TransactionDetails/TransactionDetails.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/components/TransactionData.d.ts +1 -1
- package/dist/types/components/external/TransactionDetails/components/TransactionData.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/components/TransactionDataSkeleton.d.ts +2 -2
- package/dist/types/components/external/TransactionDetails/components/TransactionDataSkeleton.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/index.d.ts +1 -1
- package/dist/types/components/external/TransactionDetails/index.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/types.d.ts +2 -5
- package/dist/types/components/external/TransactionDetails/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/TransactionsOverviewElement.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.d.ts +5 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/utils.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/PaymentMethodCell.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/types.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/hooks/useMaxWidths.d.ts.map +1 -1
- package/dist/types/components/external/UIElement/UIElement.d.ts.map +1 -1
- package/dist/types/components/hooks/useBalanceAccounts.d.ts +1 -1
- package/dist/types/components/hooks/useBalanceAccounts.d.ts.map +1 -1
- package/dist/types/components/hooks/useDefaultOverviewFilterParams.d.ts +2 -1
- package/dist/types/components/hooks/useDefaultOverviewFilterParams.d.ts.map +1 -1
- package/dist/types/components/hooks/useTimezoneAwareDateFormatting.d.ts +6 -0
- package/dist/types/components/hooks/useTimezoneAwareDateFormatting.d.ts.map +1 -0
- package/dist/types/components/internal/Accordion/Accordion.d.ts +6 -0
- package/dist/types/components/internal/Accordion/Accordion.d.ts.map +1 -0
- package/dist/types/components/internal/Accordion/constants.d.ts +6 -0
- package/dist/types/components/internal/Accordion/constants.d.ts.map +1 -0
- package/dist/types/components/internal/Accordion/types.d.ts +7 -0
- package/dist/types/components/internal/Accordion/types.d.ts.map +1 -0
- package/dist/types/components/internal/Calendar/calendar/facade/Calendar.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/common/utils.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.d.ts +3 -3
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/YearFrame.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/YearFrame.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/lastNDays.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/shared/offsetMonth.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/shared/offsetWeek.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/yearToDate.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/utils.d.ts +1 -6
- package/dist/types/components/internal/Calendar/calendar/timerange/utils.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeslice/TimeSlice.d.ts +2 -2
- package/dist/types/components/internal/Calendar/calendar/timeslice/TimeSlice.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeslice/index.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/types.d.ts +6 -1
- package/dist/types/components/internal/Calendar/calendar/types.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/utils.d.ts +13 -4
- package/dist/types/components/internal/Calendar/calendar/utils.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/hooks/useCalendar.d.ts +1 -1
- package/dist/types/components/internal/Calendar/hooks/useCalendar.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/types.d.ts +1 -0
- package/dist/types/components/internal/Calendar/types.d.ts.map +1 -1
- package/dist/types/components/internal/CopyText/CopyText.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/InteractiveBody.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/SkeletonBody.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/SkeletonBody.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/TableBody.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/TableBody.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/TableCells.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/TableCells.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/TableHeaderCell.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/hooks/useInteractiveDataGrid.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/utils/DataGridProvider.d.ts.map +1 -1
- package/dist/types/components/internal/DataOverviewDetails/DataOverviewDetails.d.ts.map +1 -1
- package/dist/types/components/internal/DataOverviewDetails/types.d.ts +3 -6
- package/dist/types/components/internal/DataOverviewDetails/types.d.ts.map +1 -1
- package/dist/types/components/internal/DataOverviewDisplay/constants.d.ts +4 -1
- package/dist/types/components/internal/DataOverviewDisplay/constants.d.ts.map +1 -1
- package/dist/types/components/internal/DataOverviewError/DataOverviewError.d.ts +1 -1
- package/dist/types/components/internal/DataOverviewError/DataOverviewError.d.ts.map +1 -1
- package/dist/types/components/internal/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/types/components/internal/DatePicker/components/TimeRangeSelector/TimeRangeSelector.d.ts +1 -1
- package/dist/types/components/internal/DatePicker/components/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
- package/dist/types/components/internal/DatePicker/components/TimeRangeSelector/useTimeRangeSelection.d.ts +2 -2
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/RangeSelection.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/DateFilter/DateFilter.d.ts +7 -1
- package/dist/types/components/internal/FilterBar/filters/DateFilter/DateFilter.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/DateFilter/DateFilterCore.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/Select.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectButton.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectListItem.d.ts +12 -3
- package/dist/types/components/internal/FormFields/Select/components/SelectListItem.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/hooks/useSelect.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/hooks/useSelect.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/index.d.ts.map +1 -1
- package/dist/types/components/internal/Modal/Modal.d.ts +1 -1
- package/dist/types/components/internal/Modal/Modal.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/types.d.ts +0 -1
- package/dist/types/components/internal/Pagination/hooks/types.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/useCursorPaginatedRecords.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/useOffsetPaginatedRecords.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/useOffsetPagination.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePaginatedRecords.d.ts +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePaginatedRecords.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePaginatedRecordsFilters.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePagination.d.ts +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePagination.d.ts.map +1 -1
- package/dist/types/components/internal/Popover/Popover.d.ts.map +1 -1
- package/dist/types/components/internal/Spinner/Spinner.d.ts +18 -0
- package/dist/types/components/internal/Spinner/Spinner.d.ts.map +1 -0
- package/dist/types/components/internal/Spinner/index.d.ts +2 -0
- package/dist/types/components/internal/Spinner/index.d.ts.map +1 -0
- package/dist/types/components/internal/StructuredList/types.d.ts +3 -2
- package/dist/types/components/internal/StructuredList/types.d.ts.map +1 -1
- package/dist/types/components/internal/StructuredList/useStructuredListItem.d.ts +9 -133
- package/dist/types/components/internal/StructuredList/useStructuredListItem.d.ts.map +1 -1
- package/dist/types/components/internal/Tooltip/useTooltipListeners.d.ts.map +1 -1
- package/dist/types/components/types.d.ts +7 -15
- package/dist/types/components/types.d.ts.map +1 -1
- package/dist/types/components/utils/getLabel.d.ts +1 -1
- package/dist/types/core/Auth/context.d.ts +56 -42
- package/dist/types/core/Auth/context.d.ts.map +1 -1
- package/dist/types/core/Auth/session/AuthSession.d.ts +62 -53
- package/dist/types/core/Auth/session/AuthSession.d.ts.map +1 -1
- package/dist/types/core/Auth/session/AuthSessionSpecification.d.ts +7 -4
- package/dist/types/core/Auth/session/AuthSessionSpecification.d.ts.map +1 -1
- package/dist/types/core/Auth/session/AuthSetupContext.d.ts +58 -43
- package/dist/types/core/Auth/session/AuthSetupContext.d.ts.map +1 -1
- package/dist/types/core/Auth/session/constants.d.ts +0 -3
- package/dist/types/core/Auth/session/constants.d.ts.map +1 -1
- package/dist/types/core/Auth/types.d.ts +6 -6
- package/dist/types/core/Auth/types.d.ts.map +1 -1
- package/dist/types/core/Context/CoreProvider.d.ts +1 -1
- package/dist/types/core/Context/CoreProvider.d.ts.map +1 -1
- package/dist/types/core/Context/types.d.ts +2 -0
- package/dist/types/core/Context/types.d.ts.map +1 -1
- package/dist/types/core/Http/http.d.ts.map +1 -1
- package/dist/types/core/Http/utils.d.ts.map +1 -1
- package/dist/types/core/Localization/Localization.d.ts.map +1 -1
- package/dist/types/core/Localization/datetime/restamper/utils.d.ts.map +1 -1
- package/dist/types/core/Localization/localization-utils.d.ts.map +1 -1
- package/dist/types/core/Localization/utils.d.ts +4 -4
- package/dist/types/core/Localization/utils.d.ts.map +1 -1
- package/dist/types/core/core.d.ts +3 -2
- package/dist/types/core/core.d.ts.map +1 -1
- package/dist/types/core/types.d.ts +4 -6
- package/dist/types/core/types.d.ts.map +1 -1
- package/dist/types/hooks/element/useClickOutside.d.ts +2 -1
- package/dist/types/hooks/element/useClickOutside.d.ts.map +1 -1
- package/dist/types/hooks/element/useDetachedRender.d.ts.map +1 -1
- package/dist/types/hooks/element/useFocusTrap.d.ts.map +1 -1
- package/dist/types/hooks/useImageUrl/useImageUrl.d.ts.map +1 -1
- package/dist/types/hooks/useMediaQuery/useMediaQuery.d.ts.map +1 -1
- package/dist/types/hooks/useModalDetails/useModalDetails.d.ts.map +1 -1
- package/dist/types/hooks/useMounted/useMounted.d.ts +1 -1
- package/dist/types/hooks/useMounted/useMounted.d.ts.map +1 -1
- package/dist/types/hooks/useReactiveState/useReactiveState.d.ts.map +1 -1
- package/dist/types/hooks/useReflex/useReflex.d.ts.map +1 -1
- package/dist/types/primitives/async/abortable/main.d.ts +1 -1
- package/dist/types/primitives/async/abortable/main.d.ts.map +1 -1
- package/dist/types/primitives/async/promisor/main.d.ts.map +1 -1
- package/dist/types/primitives/auxiliary/indexed/helpers.d.ts.map +1 -1
- package/dist/types/primitives/auxiliary/indexed/main.d.ts.map +1 -1
- package/dist/types/primitives/context/session/SessionContext.d.ts +6 -27
- package/dist/types/primitives/context/session/SessionContext.d.ts.map +1 -1
- package/dist/types/primitives/context/session/constants.d.ts +6 -3
- package/dist/types/primitives/context/session/constants.d.ts.map +1 -1
- package/dist/types/primitives/context/session/internal/autofresher.d.ts +7 -0
- package/dist/types/primitives/context/session/internal/autofresher.d.ts.map +1 -0
- package/dist/types/primitives/context/session/internal/constants.d.ts +5 -0
- package/dist/types/primitives/context/session/internal/constants.d.ts.map +1 -0
- package/dist/types/primitives/context/session/internal/deadline.d.ts +6 -0
- package/dist/types/primitives/context/session/internal/deadline.d.ts.map +1 -0
- package/dist/types/primitives/context/session/internal/refresher.d.ts +6 -0
- package/dist/types/primitives/context/session/internal/refresher.d.ts.map +1 -0
- package/dist/types/primitives/context/session/internal/types.d.ts +27 -0
- package/dist/types/primitives/context/session/internal/types.d.ts.map +1 -0
- package/dist/types/primitives/context/session/types.d.ts +8 -4
- package/dist/types/primitives/context/session/types.d.ts.map +1 -1
- package/dist/types/primitives/reactive/effectStack/main.d.ts.map +1 -1
- package/dist/types/primitives/reactive/reflex/helpers.d.ts.map +1 -1
- package/dist/types/primitives/reactive/reflex/main.d.ts.map +1 -1
- package/dist/types/primitives/reactive/watchlist/helpers.d.ts.map +1 -1
- package/dist/types/primitives/reactive/watchlist/main.d.ts +1 -1
- package/dist/types/primitives/reactive/watchlist/main.d.ts.map +1 -1
- package/dist/types/primitives/time/interval/main.d.ts.map +1 -1
- package/dist/types/primitives/time/today/main.d.ts.map +1 -1
- package/dist/types/translations/index.d.ts +108 -0
- package/dist/types/translations/index.d.ts.map +1 -1
- package/dist/types/types/api/endpoints.d.ts +18 -2
- package/dist/types/types/api/endpoints.d.ts.map +1 -1
- package/dist/types/types/api/models/index.d.ts +1 -0
- package/dist/types/types/api/models/index.d.ts.map +1 -1
- package/dist/types/types/api/models/reports.d.ts +4 -0
- package/dist/types/types/api/models/reports.d.ts.map +1 -0
- package/dist/types/types/api/resources/BalanceAccountsResource.d.ts +8 -8
- package/dist/types/types/api/resources/BalanceAccountsResource.d.ts.map +1 -1
- package/dist/types/types/api/resources/PayoutsResource.d.ts +19 -19
- package/dist/types/types/api/resources/PayoutsResource.d.ts.map +1 -1
- package/dist/types/types/api/resources/ReportsResource.d.ts +92 -0
- package/dist/types/types/api/resources/ReportsResource.d.ts.map +1 -0
- package/dist/types/types/api/resources/SetupResource.d.ts +1 -1
- package/dist/types/types/api/resources/SetupResource.d.ts.map +1 -1
- package/dist/types/types/api/resources/TransactionsResource.d.ts +25 -25
- package/dist/types/types/api/resources/TransactionsResource.d.ts.map +1 -1
- package/dist/types/utils/abort/constants.d.ts +5 -0
- package/dist/types/utils/abort/constants.d.ts.map +1 -0
- package/dist/types/utils/abort/internals.d.ts +4 -0
- package/dist/types/utils/abort/internals.d.ts.map +1 -0
- package/dist/types/utils/abort/main.d.ts +9 -0
- package/dist/types/utils/abort/main.d.ts.map +1 -0
- package/dist/types/utils/async/main.d.ts.map +1 -1
- package/dist/types/utils/collection/main.d.ts +1 -1
- package/dist/types/utils/collection/main.d.ts.map +1 -1
- package/dist/types/utils/common.d.ts +2 -2
- package/dist/types/utils/common.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/preact/fixedForwardRef.d.ts +3 -3
- package/dist/types/utils/preact/fixedForwardRef.d.ts.map +1 -1
- package/dist/types/utils/struct/main.d.ts +1 -1
- package/dist/types/utils/struct/main.d.ts.map +1 -1
- package/dist/types/utils/struct/property.d.ts.map +1 -1
- package/dist/types/utils/value/is.d.ts +2 -2
- package/dist/types/utils/value/is.d.ts.map +1 -1
- package/dist/types/utils/value/number.d.ts.map +1 -1
- package/package.json +159 -106
- package/dist/es/primitives/auxiliary/abortSink/main.js +0 -42
- package/dist/types/core/Analytics/types.d.ts +0 -28
- package/dist/types/core/Analytics/types.d.ts.map +0 -1
- package/dist/types/primitives/auxiliary/abortSink/index.d.ts +0 -3
- package/dist/types/primitives/auxiliary/abortSink/index.d.ts.map +0 -1
- package/dist/types/primitives/auxiliary/abortSink/main.d.ts +0 -5
- package/dist/types/primitives/auxiliary/abortSink/main.d.ts.map +0 -1
- package/dist/types/primitives/auxiliary/abortSink/types.d.ts +0 -7
- package/dist/types/primitives/auxiliary/abortSink/types.d.ts.map +0 -1
- package/dist/types/types/api/resources/PaymentInstrumentsResource.d.ts +0 -70
- package/dist/types/types/api/resources/PaymentInstrumentsResource.d.ts.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useRef as d, useReducer as f, useCallback as p, useEffect as y } from "../../external/preact/hooks/dist/hooks.module.js";
|
|
2
2
|
import { boolOrTrue as o } from "../../utils/value/bool.js";
|
|
3
3
|
function b({
|
|
4
|
-
fetchOptions: r = {
|
|
4
|
+
fetchOptions: r = {
|
|
5
|
+
keepPrevData: !0
|
|
6
|
+
},
|
|
5
7
|
queryFn: n,
|
|
6
8
|
params: h
|
|
7
9
|
}) {
|
|
@@ -13,25 +15,45 @@ function b({
|
|
|
13
15
|
}, i = (e, s) => {
|
|
14
16
|
switch (s.type) {
|
|
15
17
|
case "loading":
|
|
16
|
-
return {
|
|
18
|
+
return {
|
|
19
|
+
...t,
|
|
20
|
+
isFetching: !0,
|
|
21
|
+
data: r.keepPrevData ? e.data : void 0
|
|
22
|
+
};
|
|
17
23
|
case "fetched":
|
|
18
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
...t,
|
|
26
|
+
data: s.payload,
|
|
27
|
+
isFetching: !1
|
|
28
|
+
};
|
|
19
29
|
case "error":
|
|
20
|
-
return {
|
|
30
|
+
return {
|
|
31
|
+
...t,
|
|
32
|
+
error: s.payload,
|
|
33
|
+
isFetching: !1
|
|
34
|
+
};
|
|
21
35
|
default:
|
|
22
36
|
return e;
|
|
23
37
|
}
|
|
24
38
|
}, [l, c] = f(i, t), u = p(async () => {
|
|
25
|
-
c({
|
|
39
|
+
c({
|
|
40
|
+
type: "loading"
|
|
41
|
+
});
|
|
26
42
|
try {
|
|
27
43
|
if (a.current)
|
|
28
44
|
return;
|
|
29
45
|
const e = await n();
|
|
30
|
-
c({
|
|
46
|
+
c({
|
|
47
|
+
type: "fetched",
|
|
48
|
+
payload: e
|
|
49
|
+
});
|
|
31
50
|
} catch (e) {
|
|
32
51
|
if (a.current)
|
|
33
52
|
return;
|
|
34
|
-
c({
|
|
53
|
+
c({
|
|
54
|
+
type: "error",
|
|
55
|
+
payload: e
|
|
56
|
+
});
|
|
35
57
|
}
|
|
36
58
|
}, [c, n]);
|
|
37
59
|
return y(() => (a.current = !1, o(r.enabled) && u(), () => {
|
|
@@ -12,16 +12,18 @@ const u = "https://cdf6519016.cdn.adyen.com/checkoutshopper/", C = ({
|
|
|
12
12
|
}) => {
|
|
13
13
|
const m = `/images/${t}/${n}/${r}/${e}${c}.${s}`.replace(/\/+/g, "/");
|
|
14
14
|
return `${o}${m}`;
|
|
15
|
-
}, f = ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
}, f = ({
|
|
16
|
+
options: e = p,
|
|
17
|
+
name: o
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
loadingContext: t
|
|
21
|
+
} = a();
|
|
22
|
+
return g(() => C({
|
|
23
|
+
resourceContext: u,
|
|
24
|
+
name: o,
|
|
25
|
+
...e
|
|
26
|
+
}), [t, o, e]);
|
|
25
27
|
};
|
|
26
28
|
export {
|
|
27
29
|
f as useImageUrl
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { useState as f, useCallback as u, useMemo as k } from "../../external/preact/hooks/dist/hooks.module.js";
|
|
2
2
|
import { hasCallback as D } from "./types.js";
|
|
3
3
|
function o(l) {
|
|
4
|
-
const [n, r] = f(null), d = u(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
), i = u(() => r(null), []), b = k(() => {
|
|
4
|
+
const [n, r] = f(null), d = u((e) => {
|
|
5
|
+
var c;
|
|
6
|
+
return e && D(l[e.selection.type]) ? {
|
|
7
|
+
callback: (c = l == null ? void 0 : l[e.selection.type]) != null && c.callback ? (a) => {
|
|
8
|
+
var s, t;
|
|
9
|
+
return (t = (s = l[e.selection.type]) == null ? void 0 : s.callback) == null ? void 0 : t.call(s, {
|
|
10
|
+
showModal: () => r(e),
|
|
11
|
+
...a
|
|
12
|
+
});
|
|
13
|
+
} : () => {
|
|
14
|
+
var a;
|
|
15
|
+
return ((a = l[e.selection.type]) == null ? void 0 : a.showDetails) && r(e);
|
|
16
|
+
}
|
|
17
|
+
} : (r(e), {});
|
|
18
|
+
}, [l]), i = u(() => r(null), []), b = k(() => {
|
|
19
19
|
const e = {};
|
|
20
20
|
for (const c in l) {
|
|
21
21
|
const a = l[c];
|
|
@@ -2,18 +2,19 @@ import { useRef as o, useMemo as h, useReducer as R, useEffect as T } from "../.
|
|
|
2
2
|
import w from "../useMounted/useMounted.js";
|
|
3
3
|
import { EMPTY_OBJECT as F } from "../../utils/value/constants.js";
|
|
4
4
|
const P = (a = F, f = !0) => {
|
|
5
|
-
const n = o(f), e = o(Object.freeze({
|
|
5
|
+
const n = o(f), e = o(Object.freeze({
|
|
6
|
+
...a
|
|
7
|
+
})), S = o(new Set(Object.keys(e.current))), u = o(/* @__PURE__ */ new Set()), i = w(), [d, j] = h(() => {
|
|
6
8
|
const r = (c) => {
|
|
7
9
|
i.current && z(c);
|
|
8
10
|
};
|
|
9
|
-
return [
|
|
10
|
-
() => r("reset"),
|
|
11
|
-
(c) => r(c)
|
|
12
|
-
];
|
|
11
|
+
return [() => r("reset"), (c) => r(c)];
|
|
13
12
|
}, [i]), [$, z] = R((r, c) => {
|
|
14
13
|
if (c === "reset")
|
|
15
14
|
return u.current.clear(), e.current;
|
|
16
|
-
const s = {
|
|
15
|
+
const s = {
|
|
16
|
+
...c
|
|
17
|
+
}, p = [0];
|
|
17
18
|
Object.keys(s).forEach((t, O) => {
|
|
18
19
|
if (!S.current.has(t))
|
|
19
20
|
return;
|
|
@@ -23,12 +24,23 @@ const P = (a = F, f = !0) => {
|
|
|
23
24
|
const v = Math.floor(O / 32), M = 1 << O % 32;
|
|
24
25
|
s[t] = l, p[v] |= M, u.current[l === b ? "delete" : "add"](t);
|
|
25
26
|
});
|
|
26
|
-
const m = p.some((t) => t) ? n.current && u.current.size === 0 ? e.current : Object.freeze({
|
|
27
|
+
const m = p.some((t) => t) ? n.current && u.current.size === 0 ? e.current : Object.freeze({
|
|
28
|
+
...r,
|
|
29
|
+
...s
|
|
30
|
+
}) : r;
|
|
27
31
|
return n.current || (e.current = m, n.current = !0), m;
|
|
28
32
|
}, e.current), E = h(() => !!u.current.size, []);
|
|
29
33
|
return T(() => {
|
|
30
|
-
e.current = Object.freeze({
|
|
31
|
-
|
|
34
|
+
e.current = Object.freeze({
|
|
35
|
+
...a
|
|
36
|
+
}), S.current = new Set(Object.keys(e.current)), n.current = f, d();
|
|
37
|
+
}, [f, a, d]), {
|
|
38
|
+
canResetState: E,
|
|
39
|
+
defaultState: e.current,
|
|
40
|
+
resetState: d,
|
|
41
|
+
state: $,
|
|
42
|
+
updateState: j
|
|
43
|
+
};
|
|
32
44
|
}, q = P;
|
|
33
45
|
export {
|
|
34
46
|
q as default
|
package/dist/es/index.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { struct as
|
|
1
|
+
import { struct as d } from "../../../utils/struct/main.js";
|
|
2
2
|
import { enumerable as n, getter as s } from "../../../utils/struct/property.js";
|
|
3
|
-
import { isUndefined as
|
|
4
|
-
import { noop as
|
|
3
|
+
import { isUndefined as b } from "../../../utils/value/is.js";
|
|
4
|
+
import { noop as u } from "../../../utils/common.js";
|
|
5
5
|
const w = (o) => {
|
|
6
|
-
let r,
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
let r, t, e;
|
|
7
|
+
const l = () => {
|
|
8
|
+
if (b(r))
|
|
9
|
+
return;
|
|
10
|
+
const i = r.abort.bind(r);
|
|
11
|
+
r = void 0, i();
|
|
12
|
+
}, m = () => (e = new Promise((i, c) => {
|
|
13
|
+
if (t.addEventListener("abort", function _() {
|
|
14
|
+
t.removeEventListener("abort", _), c(o);
|
|
15
|
+
}), t.aborted)
|
|
13
16
|
throw o;
|
|
14
|
-
}),
|
|
15
|
-
abort: n(
|
|
16
|
-
promise: s(() =>
|
|
17
|
+
}), e.catch(u), e), a = () => (b(r) && (r = new AbortController(), t = r.signal, e = m()), f), f = d({
|
|
18
|
+
abort: n(l),
|
|
19
|
+
promise: s(() => e),
|
|
17
20
|
reason: n(o),
|
|
18
|
-
refresh: n(
|
|
19
|
-
signal: s(() =>
|
|
21
|
+
refresh: n(a),
|
|
22
|
+
signal: s(() => t)
|
|
20
23
|
});
|
|
21
|
-
return
|
|
24
|
+
return a();
|
|
22
25
|
};
|
|
23
26
|
export {
|
|
24
27
|
w as createAbortable,
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { createAbortable as c } from "../abortable/main.js";
|
|
2
|
-
import { createDeferred as
|
|
2
|
+
import { createDeferred as f } from "../deferred/main.js";
|
|
3
3
|
import { tryResolve as l } from "../../../utils/async/main.js";
|
|
4
4
|
import { enumerable as a, getter as p } from "../../../utils/struct/property.js";
|
|
5
5
|
import { isUndefined as b } from "../../../utils/value/is.js";
|
|
6
6
|
const _ = (m) => {
|
|
7
|
+
const s = c(), r = f();
|
|
7
8
|
let e;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let t;
|
|
12
|
-
const s = e;
|
|
9
|
+
return Object.defineProperties(function(...n) {
|
|
10
|
+
b(e) ? r.refresh() : s.abort();
|
|
11
|
+
const o = l.call(this, m, s.refresh().signal, ...n);
|
|
13
12
|
return (async () => {
|
|
13
|
+
let t = e === (e = o);
|
|
14
14
|
try {
|
|
15
|
-
const i = await
|
|
16
|
-
|
|
15
|
+
const i = await o.finally(() => {
|
|
16
|
+
t = e === o, t && (e = void 0);
|
|
17
|
+
});
|
|
18
|
+
t && r.resolve(i);
|
|
17
19
|
} catch (i) {
|
|
18
|
-
t
|
|
20
|
+
t && r.reject(i);
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
})(), s;
|
|
22
|
+
})(), o;
|
|
22
23
|
}, {
|
|
23
|
-
abort: a(
|
|
24
|
+
abort: a(s.abort),
|
|
24
25
|
promise: p(() => r.promise),
|
|
25
26
|
refresh: a(() => void r.refresh())
|
|
26
27
|
});
|
|
@@ -2,30 +2,26 @@ import { mapIteratorFactory as m, indexedProxyGetTrap as f } from "./helpers.js"
|
|
|
2
2
|
import { truthify as o } from "../../../utils/value/bool.js";
|
|
3
3
|
import { struct as a, structFrom as c } from "../../../utils/struct/main.js";
|
|
4
4
|
import { isFunction as d, isNumber as h } from "../../../utils/value/is.js";
|
|
5
|
-
const l = Object.freeze(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return m.call(this);
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
map: {
|
|
13
|
-
value(t, n) {
|
|
14
|
-
return [...m.call(this, t, n)];
|
|
15
|
-
}
|
|
5
|
+
const l = Object.freeze(a({
|
|
6
|
+
[Symbol.iterator]: {
|
|
7
|
+
value() {
|
|
8
|
+
return m.call(this);
|
|
16
9
|
}
|
|
17
|
-
})
|
|
18
|
-
), u = (t, n) => d(t) ? u(
|
|
19
|
-
{
|
|
20
|
-
length: { get: t }
|
|
21
10
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
map: {
|
|
12
|
+
value(t, n) {
|
|
13
|
+
return [...m.call(this, t, n)];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
})), u = (t, n) => d(t) ? u({
|
|
17
|
+
length: {
|
|
18
|
+
get: t
|
|
19
|
+
}
|
|
20
|
+
}, n) : h(t) ? u({
|
|
21
|
+
length: {
|
|
22
|
+
value: t
|
|
23
|
+
}
|
|
24
|
+
}, n) : new Proxy(c(l, t), {
|
|
29
25
|
get: f(n),
|
|
30
26
|
set: o
|
|
31
27
|
});
|
|
@@ -1,141 +1,53 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
i(this, "_refreshingPromise");
|
|
23
|
-
i(this, "_refreshPending", !1);
|
|
24
|
-
i(this, "_session");
|
|
25
|
-
i(this, "_sessionActivationTimestamp");
|
|
26
|
-
i(this, "_sessionExpirationTimestamp");
|
|
27
|
-
i(this, "_stopSessionClock");
|
|
28
|
-
i(this, "_eventEmitter", P());
|
|
29
|
-
i(this, "_refreshAbortable", y(u));
|
|
30
|
-
i(this, "_sessionPromisor", x(function(s, e) {
|
|
31
|
-
return this._expired = this._refreshPending = !1, this._eventEmitter.emit(c), e;
|
|
32
|
-
}));
|
|
33
|
-
this._specification = s, this.http = this._sessionHttp.bind(this), this.on = this._eventEmitter.on, this.refresh = this._refreshSession.bind(this);
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var h = (i, e, t) => e in i ? _(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var s = (i, e, t) => (h(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { EVT_SESSION_EXPIRED as n, EVT_SESSION_REFRESHING_START as E, EVT_SESSION_REFRESHING_END as o, EVT_SESSION_REFRESHED as S, EVT_SESSION_READY as a, ERR_SESSION_HTTP_UNAVAILABLE as f, ERR_SESSION_EXPIRED as m } from "./constants.js";
|
|
5
|
+
import { INTERNAL_EVT_SESSION_DEADLINE as N, INTERNAL_EVT_SESSION_REFRESHING_START as c, INTERNAL_EVT_SESSION_REFRESHING_END as R, INTERNAL_EVT_SESSION_READY as p } from "./internal/constants.js";
|
|
6
|
+
import { createSessionAutofresher as I } from "./internal/autofresher.js";
|
|
7
|
+
import { createSessionDeadline as d } from "./internal/deadline.js";
|
|
8
|
+
import { createSessionRefresher as T } from "./internal/refresher.js";
|
|
9
|
+
import { createEventEmitter as l } from "../../reactive/eventEmitter/main.js";
|
|
10
|
+
import { isFunction as u } from "../../../utils/value/is.js";
|
|
11
|
+
import { noop as A } from "../../../utils/common.js";
|
|
12
|
+
class x {
|
|
13
|
+
constructor(e) {
|
|
14
|
+
s(this, "_session");
|
|
15
|
+
s(this, "_autofresh");
|
|
16
|
+
s(this, "_deadline");
|
|
17
|
+
s(this, "_refresher");
|
|
18
|
+
s(this, "_eventEmitter", l());
|
|
19
|
+
this._specification = e, this._deadline = d(this._eventEmitter, this._specification), this._refresher = T(this._eventEmitter, this._specification), this._autofresh = I(this._refresher), this._deadline.on(N, () => this._eventEmitter.emit(n)), this._refresher.on(c, () => this._eventEmitter.emit(E)), this._refresher.on(R, () => this._eventEmitter.emit(o)), this._refresher.on(p, () => {
|
|
20
|
+
this._session = this._refresher.session, this._deadline.refresh(this._session).finally(() => this._eventEmitter.emit(S)), this._eventEmitter.emit(a);
|
|
21
|
+
}), this.http = this._sessionHttp.bind(this), this.on = this._eventEmitter.on, this.refresh = this._refresher.refresh;
|
|
34
22
|
}
|
|
35
23
|
get isExpired() {
|
|
36
|
-
return this.
|
|
24
|
+
return this._deadline.elapsed;
|
|
37
25
|
}
|
|
38
26
|
get refreshing() {
|
|
39
|
-
return this.
|
|
27
|
+
return this._refresher.refreshing;
|
|
40
28
|
}
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
_assertSessionHttp(e) {
|
|
30
|
+
if (!u(e))
|
|
31
|
+
throw f;
|
|
43
32
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
throw this._refreshAbortable.reason;
|
|
47
|
-
}
|
|
48
|
-
_assertSession(s) {
|
|
49
|
-
var e, t;
|
|
50
|
-
try {
|
|
51
|
-
(t = (e = this._specification).assert) == null || t.call(e, s);
|
|
52
|
-
} catch {
|
|
53
|
-
throw R;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
_assertSessionFactory(s) {
|
|
57
|
-
if (!_(s))
|
|
58
|
-
throw b;
|
|
59
|
-
}
|
|
60
|
-
_assertSessionHttp(s) {
|
|
61
|
-
if (!_(s))
|
|
62
|
-
throw A;
|
|
63
|
-
}
|
|
64
|
-
async _canFulfillPendingSessionRefresh() {
|
|
65
|
-
const s = await N(async () => {
|
|
66
|
-
const e = this._specification.autoRefresh;
|
|
67
|
-
return _(e) ? e.call(this._specification, this._session) : e;
|
|
68
|
-
}).catch(w);
|
|
69
|
-
return h(s);
|
|
70
|
-
}
|
|
71
|
-
async _fulfillPendingSessionRefresh(s = !1) {
|
|
72
|
-
!h(s) && !await this._canFulfillPendingSessionRefresh() || !this._refreshPending || this._refreshCount > 0 || this._refreshSession().catch(S);
|
|
73
|
-
}
|
|
74
|
-
async _getNextSession(s) {
|
|
75
|
-
this._assertSessionFactory(this._specification.onRefresh);
|
|
76
|
-
const e = await this._specification.onRefresh(this._session, s);
|
|
77
|
-
return this._assertRefreshNotInterruptedByAbort(s), this._assertSession(e), e;
|
|
78
|
-
}
|
|
79
|
-
_onSessionExpired(s = !1) {
|
|
80
|
-
var e;
|
|
81
|
-
this._refreshPending || ((e = this._stopSessionClock) == null || e.call(this), this._expired = this._refreshPending = !0, this._eventEmitter.emit(c), h(s) && this._fulfillPendingSessionRefresh().catch(S));
|
|
82
|
-
}
|
|
83
|
-
_refreshInterruptedByAbort(s, e) {
|
|
84
|
-
return e === this._refreshAbortable.reason || s.aborted;
|
|
85
|
-
}
|
|
86
|
-
async _refreshSession() {
|
|
87
|
-
this._sessionPromisor.refresh(), this._refreshAbortable.abort(), this._refreshAbortable.refresh(), this._refreshCount++;
|
|
88
|
-
const s = this._refreshAbortable.signal;
|
|
89
|
-
await (this._refreshingPromise ?? (this._refreshingPromise = (async () => {
|
|
90
|
-
this._refreshing || (this._refreshing = !0, this._refreshEventPending && await m, this._eventEmitter.emit(p));
|
|
91
|
-
})()));
|
|
92
|
-
try {
|
|
93
|
-
const e = await Promise.race([this._getNextSession(s), this._refreshAbortable.promise]).catch((t) => {
|
|
94
|
-
throw this._assertRefreshNotInterruptedByAbort(s, t), t;
|
|
95
|
-
});
|
|
96
|
-
this._assertRefreshNotInterruptedByAbort(s), await this._setupSessionClock(e), await this._sessionPromisor(this._session = e);
|
|
97
|
-
} finally {
|
|
98
|
-
!s.aborted && this._refreshing && (this._refreshEventPending = !0, this._refreshingPromise = void 0, this._refreshing = !1, this._refreshCount = 0, await m, this._refreshEventPending = !1, this._eventEmitter.emit(p));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
async _sessionHttp(...s) {
|
|
102
|
-
for (await this._fulfillPendingSessionRefresh(!0); ; )
|
|
33
|
+
async _sessionHttp(e, ...t) {
|
|
34
|
+
for (this._autofresh(!0); ; )
|
|
103
35
|
try {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
36
|
+
await this._refresher.promise.catch(A);
|
|
37
|
+
const {
|
|
38
|
+
signal: r
|
|
39
|
+
} = this._deadline;
|
|
40
|
+
return await (e == null ? void 0 : e(this._session, r, ...t)), this._assertSessionHttp(this._specification.http), await this._specification.http(this._session, r, ...t);
|
|
41
|
+
} catch (r) {
|
|
42
|
+
if (r !== m)
|
|
43
|
+
throw r;
|
|
44
|
+
if (this._refresher.pending)
|
|
45
|
+
continue;
|
|
46
|
+
this._deadline.elapse();
|
|
110
47
|
}
|
|
111
48
|
}
|
|
112
|
-
_sessionIsExpired() {
|
|
113
|
-
return this._expired || this._verifyPassedSessionDeadline() && this._expired;
|
|
114
|
-
}
|
|
115
|
-
async _setupSessionClock(s) {
|
|
116
|
-
var e, t, o;
|
|
117
|
-
try {
|
|
118
|
-
if (this._sessionActivationTimestamp = Date.now(), this._sessionExpirationTimestamp = void 0, this._sessionExpirationTimestamp = I(await ((t = (e = this._specification).deadline) == null ? void 0 : t.call(e, s))), l(this._sessionExpirationTimestamp))
|
|
119
|
-
return;
|
|
120
|
-
(o = this._stopSessionClock) == null || o.call(this);
|
|
121
|
-
let n = v.subscribe((a) => {
|
|
122
|
-
var f;
|
|
123
|
-
if (T(a))
|
|
124
|
-
return (f = this._stopSessionClock) == null ? void 0 : f.call(this);
|
|
125
|
-
this._verifyPassedSessionDeadline(a.now) && this._fulfillPendingSessionRefresh();
|
|
126
|
-
});
|
|
127
|
-
this._stopSessionClock = () => {
|
|
128
|
-
n == null || n(), n = this._stopSessionClock = void 0;
|
|
129
|
-
};
|
|
130
|
-
} catch {
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
_verifyPassedSessionDeadline(s = Date.now()) {
|
|
134
|
-
if (!l(this._sessionExpirationTimestamp))
|
|
135
|
-
return s >= this._sessionExpirationTimestamp && this._onSessionExpired(), !0;
|
|
136
|
-
}
|
|
137
49
|
}
|
|
138
50
|
export {
|
|
139
|
-
|
|
140
|
-
|
|
51
|
+
x as SessionContext,
|
|
52
|
+
x as default
|
|
141
53
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E = Symbol("Error<SESSION_EXPIRED>"), S = Symbol("Error<SESSION_FACTORY_UNAVAILABLE>"), _ = Symbol("Error<SESSION_HTTP_UNAVAILABLE>"), R = Symbol("Error<SESSION_INVALID>"), s = Symbol("Error<SESSION_REFRESH_ABORTED>"), I = "_sessionExpired", o = "_sessionReady", N = "_sessionRefreshed", r = "_sessionRefreshingEnd", A = "_sessionRefreshingStart";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
E as ERR_SESSION_EXPIRED,
|
|
4
|
+
S as ERR_SESSION_FACTORY_UNAVAILABLE,
|
|
5
5
|
_ as ERR_SESSION_HTTP_UNAVAILABLE,
|
|
6
6
|
R as ERR_SESSION_INVALID,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
s as ERR_SESSION_REFRESH_ABORTED,
|
|
8
|
+
I as EVT_SESSION_EXPIRED,
|
|
9
|
+
o as EVT_SESSION_READY,
|
|
10
|
+
N as EVT_SESSION_REFRESHED,
|
|
11
|
+
r as EVT_SESSION_REFRESHING_END,
|
|
12
|
+
A as EVT_SESSION_REFRESHING_START
|
|
10
13
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EVT_SESSION_EXPIRED as l } from "../constants.js";
|
|
2
|
+
import { createPromisor as m } from "../../../async/promisor/main.js";
|
|
3
|
+
import { isFunction as p } from "../../../../utils/value/is.js";
|
|
4
|
+
import { boolOrFalse as c, falsify as h } from "../../../../utils/value/bool.js";
|
|
5
|
+
import { noop as i } from "../../../../utils/common.js";
|
|
6
|
+
import { getter as _ } from "../../../../utils/struct/property.js";
|
|
7
|
+
import { tryResolve as d } from "../../../../utils/async/main.js";
|
|
8
|
+
const y = async (t) => {
|
|
9
|
+
const {
|
|
10
|
+
specification: s
|
|
11
|
+
} = t.context, e = await d(async () => {
|
|
12
|
+
const o = s.autoRefresh;
|
|
13
|
+
return p(o) ? o.call(s, t.session) : o;
|
|
14
|
+
}).catch(h);
|
|
15
|
+
return c(e);
|
|
16
|
+
}, v = (t) => {
|
|
17
|
+
let s = t.context.emitter.on(l, () => a(!1)), e, o = m(async (r, f = !1) => {
|
|
18
|
+
e = r;
|
|
19
|
+
const u = c(f) || await y(t);
|
|
20
|
+
e === r && u && t.pending && !t.refreshing && t.refresh(e).catch(i);
|
|
21
|
+
}), a = (r = !1) => {
|
|
22
|
+
t.refreshing || o(r);
|
|
23
|
+
}, n = () => {
|
|
24
|
+
s(), o.abort(), o = e = s = void 0, a = n = i;
|
|
25
|
+
};
|
|
26
|
+
return Object.defineProperties((r = !1) => a(r), {
|
|
27
|
+
destruct: _(() => n, !1)
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
y as _canAutofresh,
|
|
32
|
+
v as createSessionAutofresher,
|
|
33
|
+
v as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const E = "_session.deadline", s = "_session.ready", _ = "_session.refreshingEnd", N = "_session.refreshingStart";
|
|
2
|
+
export {
|
|
3
|
+
E as INTERNAL_EVT_SESSION_DEADLINE,
|
|
4
|
+
s as INTERNAL_EVT_SESSION_READY,
|
|
5
|
+
_ as INTERNAL_EVT_SESSION_REFRESHING_END,
|
|
6
|
+
N as INTERNAL_EVT_SESSION_REFRESHING_START
|
|
7
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { INTERNAL_EVT_SESSION_DEADLINE as v } from "./constants.js";
|
|
2
|
+
import { createAbortable as y } from "../../../async/abortable/main.js";
|
|
3
|
+
import { createEventEmitter as A } from "../../../reactive/eventEmitter/main.js";
|
|
4
|
+
import { createPromisor as g } from "../../../async/promisor/main.js";
|
|
5
|
+
import { parseDate as S } from "../../../../utils/datetime/main.js";
|
|
6
|
+
import { isAbortSignal as D, abortSignalForAny as I, abortedSignal as N } from "../../../../utils/abort/main.js";
|
|
7
|
+
import w from "../../../time/clock/main.js";
|
|
8
|
+
import { isWatchlistUnsubscribeToken as F } from "../../../reactive/watchlist/main.js";
|
|
9
|
+
import { tryResolve as L } from "../../../../utils/async/main.js";
|
|
10
|
+
import { noop as T } from "../../../../utils/common.js";
|
|
11
|
+
import { struct as k } from "../../../../utils/struct/main.js";
|
|
12
|
+
import { enumerable as c, getter as u } from "../../../../utils/struct/property.js";
|
|
13
|
+
import { isFunction as P } from "../../../../utils/value/is.js";
|
|
14
|
+
const O = (R, b) => {
|
|
15
|
+
let r, i = 1 / 0, p, o;
|
|
16
|
+
const n = y(), _ = A(), m = () => {
|
|
17
|
+
r == null || r.removeEventListener("abort", m), i = 1 / 0, o == null || o(), n.refresh(), _.emit(v);
|
|
18
|
+
}, E = g(async (t, a) => {
|
|
19
|
+
p = t;
|
|
20
|
+
const f = await L(() => {
|
|
21
|
+
const e = b.deadline;
|
|
22
|
+
return P(e) ? e.call(b, a, t) : e;
|
|
23
|
+
}).catch(T);
|
|
24
|
+
if (p !== t)
|
|
25
|
+
return;
|
|
26
|
+
const d = (Array.isArray(f) ? f : [f]).filter((e) => e || e === 0);
|
|
27
|
+
if (d.length > 0) {
|
|
28
|
+
let e = !1, s = /* @__PURE__ */ new Set();
|
|
29
|
+
for (const l of d)
|
|
30
|
+
if (D(l)) {
|
|
31
|
+
if (e = l.aborted)
|
|
32
|
+
break;
|
|
33
|
+
s.add(l);
|
|
34
|
+
} else if (i = Math.min(i, S(l) ?? 1 / 0), e = i <= Date.now())
|
|
35
|
+
break;
|
|
36
|
+
e || (e = s.size < 1 && !Number.isFinite(i)), e ? r ?? (r = N()) : (r = I([...s, n.signal]), r.addEventListener("abort", m), h()), d.length = 0, s.clear();
|
|
37
|
+
} else
|
|
38
|
+
r = void 0;
|
|
39
|
+
}), h = () => {
|
|
40
|
+
if (!Number.isFinite(i))
|
|
41
|
+
return;
|
|
42
|
+
let t = w.subscribe((a) => {
|
|
43
|
+
if (F(a))
|
|
44
|
+
return m();
|
|
45
|
+
a.now >= i && n.abort();
|
|
46
|
+
});
|
|
47
|
+
o = () => {
|
|
48
|
+
t == null || t(), t = o = void 0;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
return k({
|
|
52
|
+
elapse: c(n.abort),
|
|
53
|
+
elapsed: u(() => r && r.aborted),
|
|
54
|
+
on: c(_.on),
|
|
55
|
+
refresh: c(E.bind(void 0)),
|
|
56
|
+
signal: u(() => n.signal)
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
O as createSessionDeadline,
|
|
61
|
+
O as default
|
|
62
|
+
};
|