@jetbrains/ring-ui 4.1.12 → 5.0.0-beta.11
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/CHANGELOG.md +54 -0
- package/README.md +0 -11
- package/babel.config.js +2 -12
- package/components/alert/alert.css +4 -14
- package/components/alert/alert.d.ts +113 -0
- package/components/alert/alert.js +140 -196
- package/components/alert/container.css +0 -2
- package/components/alert/container.d.ts +15 -0
- package/components/alert/container.js +24 -41
- package/components/alert-service/alert-service.d.ts +34 -0
- package/components/alert-service/alert-service.examples.css +5 -3
- package/components/alert-service/alert-service.js +94 -124
- package/components/analytics/analytics.d.ts +24 -0
- package/components/analytics/analytics.js +75 -89
- package/components/analytics/analytics__custom-plugin.d.ts +39 -0
- package/components/analytics/analytics__custom-plugin.js +90 -111
- package/components/analytics/analytics__fus-plugin.d.ts +62 -0
- package/components/analytics/analytics__fus-plugin.js +62 -75
- package/components/analytics/analytics__ga-plugin.d.ts +17 -0
- package/components/analytics/analytics__ga-plugin.js +40 -43
- package/components/analytics/analytics__plugin-utils.d.ts +15 -0
- package/components/analytics/analytics__plugin-utils.js +61 -68
- package/components/analytics-ng/analytics-ng.examples.js +2 -2
- package/components/auth/auth.d.ts +3 -0
- package/components/auth/auth.js +3 -6
- package/components/auth/auth__core.d.ts +235 -0
- package/components/auth/auth__core.js +780 -878
- package/components/auth/background-flow.d.ts +31 -0
- package/components/auth/background-flow.js +91 -108
- package/components/auth/down-notification.css +1 -1
- package/components/auth/down-notification.d.ts +15 -0
- package/components/auth/down-notification.js +32 -52
- package/components/auth/iframe-flow.d.ts +20 -0
- package/components/auth/iframe-flow.js +71 -89
- package/components/auth/landing-entry.d.ts +3 -0
- package/components/auth/landing-entry.js +0 -1
- package/components/auth/landing.d.ts +2 -0
- package/components/auth/landing.html +1 -1
- package/components/auth/landing.js +19 -23
- package/components/auth/request-builder.d.ts +47 -0
- package/components/auth/request-builder.js +61 -68
- package/components/auth/response-parser.d.ts +70 -0
- package/components/auth/response-parser.js +84 -94
- package/components/auth/storage.d.ts +112 -0
- package/components/auth/storage.js +199 -214
- package/components/auth/token-validator.d.ts +93 -0
- package/components/auth/token-validator.js +160 -172
- package/components/auth/window-flow.d.ts +26 -0
- package/components/auth/window-flow.js +91 -112
- package/components/auth-dialog/auth-dialog.d.ts +60 -0
- package/components/auth-dialog/auth-dialog.js +72 -139
- package/components/auth-dialog-service/auth-dialog-service.d.ts +5 -0
- package/components/auth-dialog-service/auth-dialog-service.js +9 -15
- package/components/auth-ng/auth-ng.examples.js +1 -1
- package/components/autofocus-ng/autofocus-ng.examples.js +3 -3
- package/components/autofocus-ng/autofocus-ng.js +1 -1
- package/components/autofocus-ng/autofocus-ng.test.js +1 -1
- package/components/avatar/avatar-example-datauri.d.ts +1 -0
- package/components/avatar/avatar-example-datauri.js +0 -1
- package/components/avatar/avatar.d.ts +51 -0
- package/components/avatar/avatar.js +86 -157
- package/components/avatar/fallback-avatar.d.ts +17 -0
- package/components/avatar/fallback-avatar.js +84 -108
- package/components/avatar-editor-ng/avatar-editor-ng.examples.js +1 -1
- package/components/avatar-ng/avatar-ng.examples.js +3 -3
- package/components/badge/badge.d.ts +24 -0
- package/components/badge/badge.js +25 -49
- package/components/badge-ng/badge-ng.examples.js +2 -2
- package/components/breadcrumb-ng/breadcrumb-ng.examples.js +1 -1
- package/components/button/button.css +95 -206
- package/components/button/button.d.ts +67 -0
- package/components/button/button.js +56 -107
- package/components/button/button__classes.d.ts +2 -0
- package/components/button/button__classes.js +15 -37
- package/components/button-group/button-group.css +136 -19
- package/components/button-group/button-group.d.ts +17 -0
- package/components/button-group/button-group.js +11 -21
- package/components/button-group/caption.d.ts +8 -0
- package/components/button-group/caption.js +9 -18
- package/components/button-group-ng/button-group-ng.css +1 -0
- package/components/button-group-ng/button-group-ng.examples.js +3 -3
- package/components/button-ng/button-ng.examples.js +11 -12
- package/components/button-ng/button-ng.js +6 -25
- package/components/button-set/button-set.css +1 -0
- package/components/button-set/button-set.d.ts +12 -0
- package/components/button-set/button-set.js +10 -18
- package/components/button-set-ng/button-set-ng.examples.js +2 -2
- package/components/button-toolbar/button-toolbar.css +2 -0
- package/components/button-toolbar/button-toolbar.d.ts +12 -0
- package/components/button-toolbar/button-toolbar.js +10 -21
- package/components/button-toolbar-ng/button-toolbar-ng.examples.js +3 -3
- package/components/caret/caret.d.ts +66 -0
- package/components/caret/caret.js +200 -209
- package/components/checkbox/checkbox.css +10 -4
- package/components/checkbox/checkbox.d.ts +41 -0
- package/components/checkbox/checkbox.js +47 -81
- package/components/checkbox-ng/checkbox-ng.examples.js +2 -2
- package/components/code/code.d.ts +43 -0
- package/components/code/code.js +74 -98
- package/components/compiler-ng/compiler-ng.examples.js +1 -1
- package/components/confirm/confirm.d.ts +48 -0
- package/components/confirm/confirm.js +39 -81
- package/components/confirm-ng/confirm-ng.examples.js +2 -2
- package/components/confirm-service/confirm-service.d.ts +15 -0
- package/components/confirm-service/confirm-service.js +35 -51
- package/components/content-layout/content-layout.d.ts +26 -0
- package/components/content-layout/content-layout.js +33 -52
- package/components/content-layout/sidebar.d.ts +31 -0
- package/components/content-layout/sidebar.js +62 -91
- package/components/contenteditable/contenteditable.d.ts +47 -0
- package/components/contenteditable/contenteditable.js +36 -55
- package/components/data-list/data-list.d.ts +89 -0
- package/components/data-list/data-list.js +95 -146
- package/components/data-list/data-list.mock.d.ts +16 -0
- package/components/data-list/data-list.mock.js +166 -207
- package/components/data-list/item.d.ts +50 -0
- package/components/data-list/item.js +87 -187
- package/components/data-list/selection.d.ts +16 -0
- package/components/data-list/selection.js +75 -90
- package/components/data-list/title.d.ts +26 -0
- package/components/data-list/title.js +48 -79
- package/components/data-list-ng/data-list-ng.examples.js +3 -3
- package/components/date-picker/consts.d.ts +99 -0
- package/components/date-picker/consts.js +26 -53
- package/components/date-picker/date-input.d.ts +57 -0
- package/components/date-picker/date-input.js +88 -122
- package/components/date-picker/date-picker.css +2 -1
- package/components/date-picker/date-picker.d.ts +70 -0
- package/components/date-picker/date-picker.js +180 -260
- package/components/date-picker/date-popup.d.ts +56 -0
- package/components/date-picker/date-popup.js +308 -405
- package/components/date-picker/day.d.ts +30 -0
- package/components/date-picker/day.js +71 -104
- package/components/date-picker/formats.d.ts +2 -0
- package/components/date-picker/month-names.d.ts +13 -0
- package/components/date-picker/month-names.js +44 -86
- package/components/date-picker/month-slider.d.ts +29 -0
- package/components/date-picker/month-slider.js +44 -71
- package/components/date-picker/month.d.ts +14 -0
- package/components/date-picker/month.js +18 -33
- package/components/date-picker/months.d.ts +11 -0
- package/components/date-picker/months.js +52 -79
- package/components/date-picker/weekdays.d.ts +13 -0
- package/components/date-picker/weekdays.js +12 -28
- package/components/date-picker/years.d.ts +21 -0
- package/components/date-picker/years.js +55 -91
- package/components/dialog/dialog.css +10 -3
- package/components/dialog/dialog.d.ts +73 -0
- package/components/dialog/dialog.js +100 -158
- package/components/dialog/dialog__body-scroll-preventer.d.ts +9 -0
- package/components/dialog/dialog__body-scroll-preventer.js +35 -51
- package/components/dialog-ng/dialog-ng.examples.js +5 -5
- package/components/dialog-ng/dialog-ng__template.js +1 -0
- package/components/docked-panel-ng/docked-panel-ng.examples.js +3 -3
- package/components/dropdown/anchor.d.ts +11 -0
- package/components/dropdown/anchor.js +6 -22
- package/components/dropdown/dropdown.d.ts +77 -0
- package/components/dropdown/dropdown.js +131 -168
- package/components/dropdown-menu/dropdown-menu.d.ts +26 -0
- package/components/dropdown-menu/dropdown-menu.js +43 -104
- package/components/error-bubble/error-bubble-legacy.css +1 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/error-bubble/error-bubble.d.ts +18 -0
- package/components/error-bubble/error-bubble.js +17 -39
- package/components/error-message/error-message.d.ts +25 -0
- package/components/error-message/error-message.js +19 -38
- package/components/error-message-ng/error-message-ng.examples.js +1 -1
- package/components/error-page-ng/error-page-ng.examples.js +2 -2
- package/components/footer/footer.d.ts +28 -0
- package/components/footer/footer.js +61 -103
- package/components/footer-ng/footer-ng.examples.js +2 -2
- package/components/form/form.examples.js +4 -4
- package/components/form-ng/form-ng.examples.js +6 -6
- package/components/global/compose.d.ts +7 -0
- package/components/global/compose.js +3 -3
- package/components/global/composeRefs.d.ts +3 -0
- package/components/global/composeRefs.js +7 -6
- package/components/global/controls-height.d.ts +7 -0
- package/components/global/controls-height.js +8 -0
- package/components/global/create-stateful-context.d.ts +27 -0
- package/components/global/create-stateful-context.js +32 -40
- package/components/global/data-tests.d.ts +3 -0
- package/components/global/data-tests.js +12 -12
- package/components/global/dom.d.ts +37 -0
- package/components/global/dom.js +51 -73
- package/components/global/focus-sensor-hoc.d.ts +18 -0
- package/components/global/focus-sensor-hoc.js +94 -105
- package/components/global/fuzzy-highlight.d.ts +5 -0
- package/components/global/fuzzy-highlight.js +38 -40
- package/components/global/get-event-key.d.ts +2 -0
- package/components/global/get-event-key.js +88 -100
- package/components/global/get-uid.d.ts +1 -0
- package/components/global/get-uid.js +8 -12
- package/components/global/inject-styles.d.ts +3 -0
- package/components/global/inject-styles.js +7 -9
- package/components/global/linear-function.d.ts +6 -0
- package/components/global/linear-function.js +9 -12
- package/components/global/listeners.d.ts +8 -0
- package/components/global/listeners.js +22 -33
- package/components/global/memoize.d.ts +1 -0
- package/components/global/memoize.js +13 -12
- package/components/global/normalize-indent.d.ts +1 -0
- package/components/global/normalize-indent.js +26 -30
- package/components/global/promise-with-timeout.d.ts +4 -0
- package/components/global/promise-with-timeout.js +5 -7
- package/components/global/prop-types.d.ts +4 -0
- package/components/global/prop-types.js +4 -0
- package/components/global/react-dom-renderer.d.ts +16 -0
- package/components/global/react-dom-renderer.js +21 -30
- package/components/global/rerender-hoc.d.ts +45 -0
- package/components/global/rerender-hoc.js +18 -27
- package/components/global/schedule-raf.d.ts +1 -0
- package/components/global/schedule-raf.js +24 -24
- package/components/global/sniffer.d.ts +3 -0
- package/components/global/sniffer.js +0 -2
- package/components/global/theme.d.ts +13 -0
- package/components/global/theme.js +31 -49
- package/components/global/trivial-template-tag.d.ts +1 -0
- package/components/global/trivial-template-tag.js +6 -8
- package/components/global/typescript-utils.d.ts +2 -0
- package/components/global/typescript-utils.js +2 -0
- package/components/global/url.d.ts +57 -0
- package/components/global/url.js +58 -84
- package/components/global/variables.css +30 -25
- package/components/global/variables.d.ts +90 -0
- package/components/global/variables.js +1 -0
- package/components/global/variables_dark.css +68 -0
- package/components/grid/col.d.ts +31 -0
- package/components/grid/col.js +33 -42
- package/components/grid/grid.d.ts +14 -0
- package/components/grid/grid.js +13 -24
- package/components/grid/row.d.ts +40 -0
- package/components/grid/row.js +35 -44
- package/components/group/group.d.ts +12 -0
- package/components/group/group.js +11 -21
- package/components/group-ng/group.examples.js +2 -2
- package/components/header/header.css +19 -10
- package/components/header/header.d.ts +34 -0
- package/components/header/header.js +30 -44
- package/components/header/logo.d.ts +14 -0
- package/components/header/logo.js +16 -25
- package/components/header/profile.d.ts +73 -0
- package/components/header/profile.js +102 -168
- package/components/header/services-link.d.ts +25 -0
- package/components/header/services-link.js +20 -37
- package/components/header/services.css +3 -3
- package/components/header/services.d.ts +33 -0
- package/components/header/services.js +49 -102
- package/components/header/smart-profile.d.ts +36 -0
- package/components/header/smart-profile.js +76 -111
- package/components/header/smart-services.d.ts +25 -0
- package/components/header/smart-services.js +42 -66
- package/components/header/tray-icon.d.ts +32 -0
- package/components/header/tray-icon.js +14 -27
- package/components/header/tray.d.ts +9 -0
- package/components/header/tray.js +12 -24
- package/components/heading/heading.css +4 -1
- package/components/heading/heading.d.ts +25 -0
- package/components/heading/heading.js +33 -63
- package/components/http/http.d.ts +49 -0
- package/components/http/http.js +144 -174
- package/components/http/http.mock.d.ts +20 -0
- package/components/http/http.mock.js +46 -56
- package/components/hub-source/hub-source.d.ts +42 -0
- package/components/hub-source/hub-source.js +89 -105
- package/components/hub-source/hub-source__user.d.ts +4 -0
- package/components/hub-source/hub-source__user.js +14 -21
- package/components/hub-source/hub-source__users-groups.d.ts +24 -0
- package/components/hub-source/hub-source__users-groups.js +46 -53
- package/components/icon/icon.css +1 -1
- package/components/icon/icon.d.ts +43 -0
- package/components/icon/icon.js +55 -83
- package/components/icon/icon__constants.d.ts +30 -0
- package/components/icon/icon__constants.js +25 -24
- package/components/icon/icon__svg.d.ts +15 -0
- package/components/icon/icon__svg.js +39 -58
- package/components/icon/index.d.ts +2 -0
- package/components/icon/index.js +1 -1
- package/components/icon-ng/icon-ng.examples.js +1 -1
- package/components/input/input.css +87 -149
- package/components/input/input.d.ts +69 -0
- package/components/input/input.js +136 -203
- package/components/input-ng/input-ng.examples.js +2 -2
- package/components/input-ng/input-ng.js +45 -49
- package/components/input-size/input-size.examples.js +5 -5
- package/components/island/adaptive-island-hoc.d.ts +65 -0
- package/components/island/adaptive-island-hoc.js +21 -31
- package/components/island/content.d.ts +12 -0
- package/components/island/content.js +81 -123
- package/components/island/header.d.ts +8 -0
- package/components/island/header.js +60 -84
- package/components/island/island.css +8 -5
- package/components/island/island.d.ts +82 -0
- package/components/island/island.js +19 -41
- package/components/island-legacy/content-legacy.d.ts +10 -0
- package/components/island-legacy/content-legacy.js +11 -20
- package/components/island-legacy/header-legacy.d.ts +10 -0
- package/components/island-legacy/header-legacy.js +11 -20
- package/components/island-legacy/island-legacy.css +1 -1
- package/components/island-legacy/island-legacy.d.ts +12 -0
- package/components/island-legacy/island-legacy.js +13 -23
- package/components/island-ng/island-ng.examples.js +1 -1
- package/components/link/clickableLink.d.ts +20 -0
- package/components/link/clickableLink.js +27 -42
- package/components/link/link.css +0 -2
- package/components/link/link.d.ts +157 -0
- package/components/link/link.js +56 -101
- package/components/link-ng/link-ng.examples.js +1 -1
- package/components/list/consts.d.ts +74 -0
- package/components/list/consts.js +22 -22
- package/components/list/list.d.ts +191 -0
- package/components/list/list.js +505 -691
- package/components/list/list__custom.d.ts +6 -0
- package/components/list/list__custom.js +37 -75
- package/components/list/list__hint.d.ts +15 -0
- package/components/list/list__hint.js +7 -15
- package/components/list/list__item.d.ts +8 -0
- package/components/list/list__item.js +81 -185
- package/components/list/list__link.d.ts +9 -0
- package/components/list/list__link.js +25 -54
- package/components/list/list__separator.d.ts +5 -0
- package/components/list/list__separator.js +13 -22
- package/components/list/list__title.d.ts +5 -0
- package/components/list/list__title.js +18 -34
- package/components/list/list__users-groups-source.d.ts +27 -0
- package/components/list/list__users-groups-source.js +63 -78
- package/components/loader/loader.d.ts +28 -0
- package/components/loader/loader.js +31 -51
- package/components/loader/loader__core.d.ts +75 -0
- package/components/loader/loader__core.js +208 -240
- package/components/loader-inline/loader-inline.css +14 -0
- package/components/loader-inline/loader-inline.d.ts +18 -0
- package/components/loader-inline/loader-inline.js +16 -46
- package/components/loader-inline-ng/loader-inline-ng.examples.js +1 -1
- package/components/loader-inline-ng/loader-inline-ng.js +1 -17
- package/components/loader-inline-ng/loader-inline-ng.test.js +0 -11
- package/components/loader-ng/loader-ng.examples.js +1 -1
- package/components/loader-screen/loader-screen.d.ts +17 -0
- package/components/loader-screen/loader-screen.js +16 -29
- package/components/loader-screen-ng/loader-screen-ng.examples.js +1 -1
- package/components/login-dialog/login-dialog.d.ts +47 -0
- package/components/login-dialog/login-dialog.js +63 -104
- package/components/login-dialog/service.d.ts +2 -0
- package/components/login-dialog/service.js +11 -15
- package/components/markdown/code.d.ts +9 -0
- package/components/markdown/code.js +4 -14
- package/components/markdown/heading.d.ts +11 -0
- package/components/markdown/heading.js +3 -7
- package/components/markdown/link.d.ts +12 -0
- package/components/markdown/link.js +4 -8
- package/components/markdown/markdown.d.ts +14 -0
- package/components/markdown/markdown.js +26 -40
- package/components/message/message.css +7 -3
- package/components/message/message.d.ts +59 -0
- package/components/message/message.js +84 -127
- package/components/old-browsers-message/old-browsers-message.d.ts +2 -0
- package/components/old-browsers-message/old-browsers-message.js +57 -73
- package/components/old-browsers-message/old-browsers-message__stop.d.ts +1 -0
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -1
- package/components/old-browsers-message/white-list.d.ts +2 -0
- package/components/old-browsers-message/white-list.js +9 -16
- package/components/pager/pager.d.ts +83 -0
- package/components/pager/pager.js +184 -291
- package/components/pager-ng/pager-ng.examples.js +1 -1
- package/components/palette/palette.examples.js +1 -1
- package/components/panel/panel.d.ts +12 -0
- package/components/panel/panel.js +11 -19
- package/components/permissions/permissions.d.ts +111 -0
- package/components/permissions/permissions.js +144 -160
- package/components/permissions/permissions__cache.d.ts +93 -0
- package/components/permissions/permissions__cache.js +200 -231
- package/components/permissions-ng/permissions-ng.examples.js +2 -2
- package/components/place-under-ng/place-under-ng.examples.js +2 -2
- package/components/popup/popup.consts.d.ts +37 -0
- package/components/popup/popup.consts.js +36 -36
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.d.ts +141 -0
- package/components/popup/popup.js +262 -346
- package/components/popup/popup.target.d.ts +7 -0
- package/components/popup/popup.target.js +12 -24
- package/components/popup/position.d.ts +30 -0
- package/components/popup/position.js +172 -225
- package/components/popup-menu/popup-menu.d.ts +59 -0
- package/components/popup-menu/popup-menu.js +30 -47
- package/components/progress-bar/progress-bar.css +8 -12
- package/components/progress-bar/progress-bar.d.ts +58 -0
- package/components/progress-bar/progress-bar.js +60 -93
- package/components/progress-bar-ng/progress-bar-ng.examples.js +4 -3
- package/components/promised-click-ng/promised-click-ng.examples.js +2 -2
- package/components/query-assist/query-assist.css +48 -64
- package/components/query-assist/query-assist.d.ts +327 -0
- package/components/query-assist/query-assist.js +706 -905
- package/components/query-assist/query-assist__suggestions.d.ts +29 -0
- package/components/query-assist/query-assist__suggestions.js +51 -91
- package/components/query-assist-ng/query-assist-ng.examples.js +2 -2
- package/components/radio/radio.css +10 -4
- package/components/radio/radio.d.ts +18 -0
- package/components/radio/radio.js +19 -29
- package/components/radio/radio__item.d.ts +28 -0
- package/components/radio/radio__item.js +28 -56
- package/components/radio-ng/radio-ng.examples.js +1 -1
- package/components/save-field-ng/save-field-ng.examples.js +2 -2
- package/components/select/select-popup.css +5 -1
- package/components/select/select.css +19 -37
- package/components/select/select.d.ts +289 -0
- package/components/select/select.js +806 -1191
- package/components/select/select__filter.d.ts +20 -0
- package/components/select/select__filter.js +37 -59
- package/components/select/select__popup.d.ts +123 -0
- package/components/select/select__popup.js +324 -498
- package/components/select-ng/select-ng.examples.js +4 -3
- package/components/select-ng/select-ng.js +3 -1
- package/components/select-ng/select-ng.test.js +1 -1
- package/components/select-ng/select-ng__lazy.js +3 -3
- package/components/shortcuts/core.d.ts +74 -0
- package/components/shortcuts/core.js +185 -226
- package/components/shortcuts/shortcut-title.d.ts +1 -0
- package/components/shortcuts/shortcut-title.js +43 -49
- package/components/shortcuts/shortcuts-hoc.d.ts +69 -0
- package/components/shortcuts/shortcuts-hoc.js +12 -26
- package/components/shortcuts/shortcuts.d.ts +28 -0
- package/components/shortcuts/shortcuts.js +39 -48
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.examples.js +2 -2
- package/components/sidebar-ng/sidebar-ng.examples.js +3 -3
- package/components/storage/storage.d.ts +18 -0
- package/components/storage/storage.js +6 -9
- package/components/storage/storage__fallback.d.ts +79 -0
- package/components/storage/storage__fallback.js +160 -178
- package/components/storage/storage__local.d.ts +38 -0
- package/components/storage/storage__local.js +108 -104
- package/components/tab-trap/tab-trap.d.ts +43 -0
- package/components/tab-trap/tab-trap.js +113 -163
- package/components/table/cell.d.ts +13 -0
- package/components/table/cell.js +10 -20
- package/components/table/disable-hover-hoc.d.ts +68 -0
- package/components/table/disable-hover-hoc.js +29 -41
- package/components/table/header-cell.d.ts +43 -0
- package/components/table/header-cell.js +40 -61
- package/components/table/header.d.ts +60 -0
- package/components/table/header.js +89 -156
- package/components/table/multitable.d.ts +25 -0
- package/components/table/multitable.js +76 -94
- package/components/table/row-with-focus-sensor.d.ts +18 -0
- package/components/table/row-with-focus-sensor.js +21 -35
- package/components/table/row.d.ts +56 -0
- package/components/table/row.js +110 -199
- package/components/table/selection-adapter.d.ts +5 -0
- package/components/table/selection-adapter.js +8 -8
- package/components/table/selection-shortcuts-hoc.d.ts +17 -0
- package/components/table/selection-shortcuts-hoc.js +140 -171
- package/components/table/selection.d.ts +47 -0
- package/components/table/selection.js +148 -183
- package/components/table/smart-table.d.ts +60 -0
- package/components/table/smart-table.js +29 -48
- package/components/table/table.d.ts +160 -0
- package/components/table/table.js +170 -256
- package/components/table-legacy-ng/table-legacy-ng.examples.js +4 -4
- package/components/table-ng/table-ng.examples.js +4 -4
- package/components/tabs/collapsible-more.d.ts +29 -0
- package/components/tabs/collapsible-more.js +72 -158
- package/components/tabs/collapsible-tab.d.ts +16 -0
- package/components/tabs/collapsible-tab.js +24 -80
- package/components/tabs/collapsible-tabs.d.ts +43 -0
- package/components/tabs/collapsible-tabs.js +176 -294
- package/components/tabs/custom-item.d.ts +9 -0
- package/components/tabs/custom-item.js +2 -3
- package/components/tabs/dumb-tabs.d.ts +33 -0
- package/components/tabs/dumb-tabs.js +42 -94
- package/components/tabs/smart-tabs.d.ts +20 -0
- package/components/tabs/smart-tabs.js +14 -27
- package/components/tabs/tab-link.d.ts +18 -0
- package/components/tabs/tab-link.js +12 -22
- package/components/tabs/tab.d.ts +27 -0
- package/components/tabs/tab.js +13 -19
- package/components/tabs/tabs.css +17 -28
- package/components/tabs/tabs.d.ts +7 -0
- package/components/tabs/tabs.js +4 -5
- package/components/tabs-ng/tabs-ng.examples.js +12 -4
- package/components/tabs-ng/tabs-ng.js +1 -4
- package/components/tabs-ng/tabs-ng__template.js +1 -1
- package/components/tag/tag.css +31 -8
- package/components/tag/tag.d.ts +64 -0
- package/components/tag/tag.js +103 -155
- package/components/tags-input/tags-input.css +10 -4
- package/components/tags-input/tags-input.d.ts +154 -0
- package/components/tags-input/tags-input.js +233 -315
- package/components/tags-input-ng/tags-input-ng.examples.js +1 -1
- package/components/tags-list/tags-list.d.ts +46 -0
- package/components/tags-list/tags-list.js +35 -83
- package/components/template-ng/template-ng.examples.js +1 -1
- package/components/text/text.d.ts +17 -0
- package/components/text/text.js +13 -21
- package/components/title-ng/title-ng.examples.js +1 -1
- package/components/toggle/toggle.css +61 -35
- package/components/toggle/toggle.d.ts +39 -0
- package/components/toggle/toggle.js +31 -62
- package/components/toggle-ng/toggle-ng.examples.js +1 -1
- package/components/tooltip/tooltip.css +7 -0
- package/components/tooltip/tooltip.d.ts +65 -0
- package/components/tooltip/tooltip.js +109 -151
- package/components/tooltip-ng/tooltip-ng.examples.js +2 -2
- package/components/user-agreement/service.d.ts +161 -0
- package/components/user-agreement/service.js +216 -270
- package/components/user-agreement/toolbox.eula.d.ts +2 -0
- package/components/user-agreement/user-agreement.d.ts +69 -0
- package/components/user-agreement/user-agreement.js +55 -98
- package/components/user-card/card.d.ts +52 -0
- package/components/user-card/card.js +42 -78
- package/components/user-card/smart-user-card-tooltip.d.ts +20 -0
- package/components/user-card/smart-user-card-tooltip.js +39 -58
- package/components/user-card/tooltip.d.ts +31 -0
- package/components/user-card/tooltip.js +25 -46
- package/components/user-card/user-card.d.ts +11 -0
- package/components/user-card/user-card.js +3 -5
- package/components/user-card-ng/user-card-ng.examples.js +4 -4
- package/dist/_helpers/anchor.js +2 -2
- package/dist/_helpers/badge.js +1 -1
- package/dist/_helpers/button-group.js +1 -1
- package/dist/_helpers/button-set.js +1 -1
- package/dist/_helpers/button-toolbar.js +1 -1
- package/dist/_helpers/button__classes.js +5 -8
- package/dist/_helpers/card.js +1 -1
- package/dist/_helpers/checkbox.js +1 -1
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/_helpers/dialog__body-scroll-preventer.js +2 -2
- package/dist/_helpers/error-message.js +1 -1
- package/dist/_helpers/footer.js +3 -3
- package/dist/_helpers/grid.js +1 -1
- package/dist/_helpers/group.js +1 -1
- package/dist/_helpers/header.js +1 -1
- package/dist/_helpers/icon.js +1 -1
- package/dist/_helpers/input.js +1 -1
- package/dist/_helpers/island.js +1 -1
- package/dist/_helpers/link.js +1 -1
- package/dist/_helpers/list.js +1 -1
- package/dist/_helpers/loader-inline.js +3 -0
- package/dist/_helpers/loader-screen.js +1 -1
- package/dist/_helpers/panel.js +1 -1
- package/dist/_helpers/query-assist__suggestions.js +3 -3
- package/dist/_helpers/radio.js +1 -1
- package/dist/_helpers/select__filter.js +13 -9
- package/dist/_helpers/services-link.js +1 -1
- package/dist/_helpers/sidebar.js +7 -4
- package/dist/_helpers/table.js +1 -1
- package/dist/_helpers/tabs.js +1 -1
- package/dist/_helpers/theme.js +50 -0
- package/dist/_helpers/title.js +14 -14
- package/dist/alert/alert.d.ts +113 -0
- package/dist/alert/alert.js +56 -50
- package/dist/alert/container.d.ts +15 -0
- package/dist/alert/container.js +6 -8
- package/dist/alert-service/alert-service.d.ts +34 -0
- package/dist/alert-service/alert-service.js +9 -7
- package/dist/analytics/analytics.d.ts +24 -0
- package/dist/analytics/analytics.js +10 -15
- package/dist/analytics/analytics__custom-plugin.d.ts +39 -0
- package/dist/analytics/analytics__custom-plugin.js +30 -9
- package/dist/analytics/analytics__fus-plugin.d.ts +62 -0
- package/dist/analytics/analytics__fus-plugin.js +23 -6
- package/dist/analytics/analytics__ga-plugin.d.ts +17 -0
- package/dist/analytics/analytics__ga-plugin.js +12 -6
- package/dist/analytics/analytics__plugin-utils.d.ts +15 -0
- package/dist/analytics/analytics__plugin-utils.js +58 -59
- package/dist/analytics-ng/analytics-ng.js +1 -0
- package/dist/auth/auth.d.ts +3 -0
- package/dist/auth/auth.js +9 -9
- package/dist/auth/auth__core.d.ts +235 -0
- package/dist/auth/auth__core.js +219 -125
- package/dist/auth/background-flow.d.ts +31 -0
- package/dist/auth/background-flow.js +9 -1
- package/dist/auth/down-notification.d.ts +15 -0
- package/dist/auth/down-notification.js +8 -8
- package/dist/auth/iframe-flow.d.ts +20 -0
- package/dist/auth/iframe-flow.js +20 -6
- package/dist/auth/landing-entry.d.ts +3 -0
- package/dist/auth/landing.d.ts +2 -0
- package/dist/auth/landing.js +22 -16
- package/dist/auth/request-builder.d.ts +47 -0
- package/dist/auth/request-builder.js +7 -1
- package/dist/auth/response-parser.d.ts +70 -0
- package/dist/auth/response-parser.js +25 -13
- package/dist/auth/storage.d.ts +112 -0
- package/dist/auth/storage.js +50 -17
- package/dist/auth/token-validator.d.ts +93 -0
- package/dist/auth/token-validator.js +32 -12
- package/dist/auth/window-flow.d.ts +26 -0
- package/dist/auth/window-flow.js +24 -11
- package/dist/auth-dialog/auth-dialog.d.ts +60 -0
- package/dist/auth-dialog/auth-dialog.js +5 -8
- package/dist/auth-dialog-service/auth-dialog-service.d.ts +5 -0
- package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
- package/dist/auth-ng/auth-ng.js +9 -9
- package/dist/autofocus-ng/autofocus-ng.js +1 -1
- package/dist/avatar/avatar-example-datauri.d.ts +1 -0
- package/dist/avatar/avatar.d.ts +51 -0
- package/dist/avatar/avatar.js +14 -11
- package/dist/avatar/fallback-avatar.d.ts +17 -0
- package/dist/avatar-editor-ng/avatar-editor-ng.js +9 -7
- package/dist/badge/badge.d.ts +24 -0
- package/dist/breadcrumb-ng/breadcrumb-ng.js +1 -1
- package/dist/button/button.d.ts +67 -0
- package/dist/button/button.js +17 -18
- package/dist/button/button__classes.d.ts +2 -0
- package/dist/button/button__classes.js +0 -3
- package/dist/button-group/button-group.d.ts +17 -0
- package/dist/button-group/button-group.js +5 -3
- package/dist/button-group/caption.d.ts +8 -0
- package/dist/button-group-ng/button-group-ng.js +1 -1
- package/dist/button-ng/button-ng.js +6 -31
- package/dist/button-set/button-set.d.ts +12 -0
- package/dist/button-toolbar/button-toolbar.d.ts +12 -0
- package/dist/caret/caret.d.ts +66 -0
- package/dist/caret/caret.js +35 -19
- package/dist/checkbox/checkbox.d.ts +41 -0
- package/dist/checkbox/checkbox.js +6 -0
- package/dist/code/code.d.ts +43 -0
- package/dist/code/code.js +13 -9
- package/dist/confirm/confirm.d.ts +48 -0
- package/dist/confirm/confirm.js +4 -4
- package/dist/confirm-ng/confirm-ng.js +1 -1
- package/dist/confirm-service/confirm-service.d.ts +15 -0
- package/dist/confirm-service/confirm-service.js +1 -1
- package/dist/content-layout/content-layout.d.ts +26 -0
- package/dist/content-layout/content-layout.js +4 -2
- package/dist/content-layout/sidebar.d.ts +31 -0
- package/dist/contenteditable/contenteditable.d.ts +47 -0
- package/dist/contenteditable/contenteditable.js +6 -4
- package/dist/data-list/data-list.d.ts +89 -0
- package/dist/data-list/data-list.js +54 -30
- package/dist/data-list/data-list.mock.d.ts +16 -0
- package/dist/data-list/data-list.mock.js +2 -2
- package/dist/data-list/item.d.ts +50 -0
- package/dist/data-list/item.js +33 -32
- package/dist/data-list/selection.d.ts +16 -0
- package/dist/data-list/selection.js +13 -0
- package/dist/data-list/title.d.ts +26 -0
- package/dist/data-list/title.js +1 -0
- package/dist/data-list-ng/data-list-ng.js +6 -9
- package/dist/date-picker/consts.d.ts +99 -0
- package/dist/date-picker/consts.js +2 -21
- package/dist/date-picker/date-input.d.ts +57 -0
- package/dist/date-picker/date-input.js +8 -3
- package/dist/date-picker/date-picker.d.ts +70 -0
- package/dist/date-picker/date-picker.js +39 -39
- package/dist/date-picker/date-popup.d.ts +56 -0
- package/dist/date-picker/date-popup.js +44 -27
- package/dist/date-picker/day.d.ts +30 -0
- package/dist/date-picker/day.js +8 -4
- package/dist/date-picker/formats.d.ts +2 -0
- package/dist/date-picker/month-names.d.ts +13 -0
- package/dist/date-picker/month-names.js +6 -5
- package/dist/date-picker/month-slider.d.ts +29 -0
- package/dist/date-picker/month-slider.js +2 -2
- package/dist/date-picker/month.d.ts +14 -0
- package/dist/date-picker/months.d.ts +11 -0
- package/dist/date-picker/months.js +3 -3
- package/dist/date-picker/weekdays.d.ts +13 -0
- package/dist/date-picker/weekdays.js +1 -1
- package/dist/date-picker/years.d.ts +21 -0
- package/dist/date-picker/years.js +8 -6
- package/dist/dialog/dialog.d.ts +73 -0
- package/dist/dialog/dialog.js +4 -2
- package/dist/dialog/dialog__body-scroll-preventer.d.ts +9 -0
- package/dist/dialog-ng/dialog-ng.js +3 -3
- package/dist/dialog-ng/dialog-ng__template.js +1 -0
- package/dist/docked-panel-ng/docked-panel-ng.js +1 -1
- package/dist/dropdown/anchor.d.ts +11 -0
- package/dist/dropdown/anchor.js +1 -1
- package/dist/dropdown/dropdown.d.ts +77 -0
- package/dist/dropdown/dropdown.js +14 -7
- package/dist/dropdown-menu/dropdown-menu.d.ts +26 -0
- package/dist/dropdown-menu/dropdown-menu.js +9 -6
- package/dist/error-bubble/error-bubble.d.ts +18 -0
- package/dist/error-bubble/error-bubble.js +4 -2
- package/dist/error-message/error-message.d.ts +25 -0
- package/dist/footer/footer.d.ts +28 -0
- package/dist/global/compose.d.ts +7 -0
- package/dist/global/compose.js +2 -2
- package/dist/global/composeRefs.d.ts +3 -0
- package/dist/global/controls-height.d.ts +7 -0
- package/dist/global/controls-height.js +13 -0
- package/dist/global/create-stateful-context.d.ts +27 -0
- package/dist/global/data-tests.d.ts +3 -0
- package/dist/global/data-tests.js +5 -1
- package/dist/global/dom.d.ts +37 -0
- package/dist/global/dom.js +4 -4
- package/dist/global/focus-sensor-hoc.d.ts +18 -0
- package/dist/global/focus-sensor-hoc.js +58 -20
- package/dist/global/fuzzy-highlight.d.ts +5 -0
- package/dist/global/get-event-key.d.ts +2 -0
- package/dist/global/get-event-key.js +0 -1
- package/dist/global/get-uid.d.ts +1 -0
- package/dist/global/inject-styles.d.ts +3 -0
- package/dist/global/linear-function.d.ts +6 -0
- package/dist/global/listeners.d.ts +8 -0
- package/dist/global/listeners.js +10 -2
- package/dist/global/memoize.d.ts +1 -0
- package/dist/global/memoize.js +7 -6
- package/dist/global/normalize-indent.d.ts +1 -0
- package/dist/global/normalize-indent.js +5 -1
- package/dist/global/promise-with-timeout.d.ts +4 -0
- package/dist/global/prop-types.d.ts +4 -0
- package/dist/global/prop-types.js +7 -0
- package/dist/global/react-dom-renderer.d.ts +16 -0
- package/dist/global/react-dom-renderer.js +2 -0
- package/dist/global/rerender-hoc.d.ts +45 -0
- package/dist/global/rerender-hoc.js +5 -14
- package/dist/global/schedule-raf.d.ts +1 -0
- package/dist/global/schedule-raf.js +3 -1
- package/dist/global/sniffer.d.ts +3 -0
- package/dist/global/theme.d.ts +13 -0
- package/dist/global/theme.js +7 -54
- package/dist/global/trivial-template-tag.d.ts +1 -0
- package/dist/global/typescript-utils.d.ts +2 -0
- package/dist/global/typescript-utils.js +4 -0
- package/dist/global/url.d.ts +57 -0
- package/dist/global/url.js +1 -1
- package/dist/global/variables.d.ts +90 -0
- package/dist/global/variables.js +1 -0
- package/dist/grid/col.d.ts +31 -0
- package/dist/grid/col.js +7 -1
- package/dist/grid/grid.d.ts +14 -0
- package/dist/grid/row.d.ts +40 -0
- package/dist/grid/row.js +1 -4
- package/dist/group/group.d.ts +12 -0
- package/dist/header/header.d.ts +34 -0
- package/dist/header/header.js +14 -19
- package/dist/header/logo.d.ts +14 -0
- package/dist/header/profile.d.ts +73 -0
- package/dist/header/profile.js +4 -4
- package/dist/header/services-link.d.ts +25 -0
- package/dist/header/services.d.ts +33 -0
- package/dist/header/services.js +12 -3
- package/dist/header/smart-profile.d.ts +36 -0
- package/dist/header/smart-profile.js +11 -14
- package/dist/header/smart-services.d.ts +25 -0
- package/dist/header/smart-services.js +21 -16
- package/dist/header/tray-icon.d.ts +32 -0
- package/dist/header/tray-icon.js +2 -5
- package/dist/header/tray.d.ts +9 -0
- package/dist/heading/heading.d.ts +25 -0
- package/dist/heading/heading.js +15 -14
- package/dist/http/http.d.ts +49 -0
- package/dist/http/http.js +47 -12
- package/dist/http/http.mock.d.ts +20 -0
- package/dist/http/http.mock.js +12 -5
- package/dist/hub-source/hub-source.d.ts +42 -0
- package/dist/hub-source/hub-source.js +14 -1
- package/dist/hub-source/hub-source__user.d.ts +4 -0
- package/dist/hub-source/hub-source__user.js +4 -2
- package/dist/hub-source/hub-source__users-groups.d.ts +24 -0
- package/dist/hub-source/hub-source__users-groups.js +9 -1
- package/dist/icon/icon.d.ts +43 -0
- package/dist/icon/icon.js +2 -2
- package/dist/icon/icon__constants.d.ts +30 -0
- package/dist/icon/icon__constants.js +28 -23
- package/dist/icon/icon__svg.d.ts +15 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +1 -1
- package/dist/input/input.d.ts +69 -0
- package/dist/input/input.js +93 -87
- package/dist/input-ng/input-ng.js +46 -49
- package/dist/island/adaptive-island-hoc.d.ts +65 -0
- package/dist/island/adaptive-island-hoc.js +6 -4
- package/dist/island/content.d.ts +12 -0
- package/dist/island/content.js +8 -6
- package/dist/island/header.d.ts +8 -0
- package/dist/island/header.js +16 -8
- package/dist/island/island.d.ts +82 -0
- package/dist/island-legacy/content-legacy.d.ts +10 -0
- package/dist/island-legacy/header-legacy.d.ts +10 -0
- package/dist/island-legacy/island-legacy.d.ts +12 -0
- package/dist/link/clickableLink.d.ts +20 -0
- package/dist/link/link.d.ts +157 -0
- package/dist/link/link.js +9 -5
- package/dist/list/consts.d.ts +74 -0
- package/dist/list/consts.js +26 -20
- package/dist/list/list.d.ts +191 -0
- package/dist/list/list.js +32 -26
- package/dist/list/list__custom.d.ts +6 -0
- package/dist/list/list__custom.js +8 -13
- package/dist/list/list__hint.d.ts +15 -0
- package/dist/list/list__item.d.ts +8 -0
- package/dist/list/list__item.js +3 -4
- package/dist/list/list__link.d.ts +9 -0
- package/dist/list/list__link.js +5 -6
- package/dist/list/list__separator.d.ts +5 -0
- package/dist/list/list__separator.js +2 -4
- package/dist/list/list__title.d.ts +5 -0
- package/dist/list/list__title.js +2 -4
- package/dist/list/list__users-groups-source.d.ts +27 -0
- package/dist/list/list__users-groups-source.js +22 -12
- package/dist/loader/loader.d.ts +28 -0
- package/dist/loader/loader.js +5 -1
- package/dist/loader/loader__core.d.ts +75 -0
- package/dist/loader/loader__core.js +90 -48
- package/dist/loader-inline/loader-inline.d.ts +18 -0
- package/dist/loader-inline/loader-inline.js +3 -21
- package/dist/loader-inline-ng/loader-inline-ng.js +2 -30
- package/dist/loader-screen/loader-screen.d.ts +17 -0
- package/dist/login-dialog/login-dialog.d.ts +47 -0
- package/dist/login-dialog/login-dialog.js +5 -3
- package/dist/login-dialog/service.d.ts +2 -0
- package/dist/login-dialog/service.js +6 -2
- package/dist/markdown/code.d.ts +9 -0
- package/dist/markdown/code.js +3 -3
- package/dist/markdown/heading.d.ts +11 -0
- package/dist/markdown/heading.js +2 -2
- package/dist/markdown/link.d.ts +12 -0
- package/dist/markdown/link.js +3 -3
- package/dist/markdown/markdown.d.ts +14 -0
- package/dist/markdown/markdown.js +19 -21
- package/dist/message/message.d.ts +59 -0
- package/dist/message/message.js +36 -27
- package/dist/old-browsers-message/old-browsers-message.d.ts +2 -0
- package/dist/old-browsers-message/old-browsers-message.js +10 -6
- package/dist/old-browsers-message/old-browsers-message__stop.d.ts +1 -0
- package/dist/old-browsers-message/white-list.d.ts +2 -0
- package/dist/old-browsers-message/white-list.js +3 -3
- package/dist/pager/pager.d.ts +83 -0
- package/dist/pager/pager.js +44 -37
- package/dist/pager-ng/pager-ng.js +6 -7
- package/dist/panel/panel.d.ts +12 -0
- package/dist/permissions/permissions.d.ts +111 -0
- package/dist/permissions/permissions.js +23 -4
- package/dist/permissions/permissions__cache.d.ts +93 -0
- package/dist/permissions/permissions__cache.js +10 -3
- package/dist/permissions-ng/permissions-ng.js +9 -9
- package/dist/popup/popup.consts.d.ts +37 -0
- package/dist/popup/popup.consts.js +43 -29
- package/dist/popup/popup.d.ts +141 -0
- package/dist/popup/popup.js +84 -54
- package/dist/popup/popup.target.d.ts +7 -0
- package/dist/popup/popup.target.js +3 -4
- package/dist/popup/position.d.ts +30 -0
- package/dist/popup/position.js +11 -6
- package/dist/popup-menu/popup-menu.d.ts +59 -0
- package/dist/popup-menu/popup-menu.js +7 -6
- package/dist/progress-bar/progress-bar.d.ts +58 -0
- package/dist/progress-bar/progress-bar.js +6 -8
- package/dist/progress-bar-ng/progress-bar-ng.js +0 -1
- package/dist/promised-click-ng/promised-click-ng.js +2 -2
- package/dist/query-assist/query-assist.d.ts +327 -0
- package/dist/query-assist/query-assist.js +136 -88
- package/dist/query-assist/query-assist__suggestions.d.ts +29 -0
- package/dist/query-assist-ng/query-assist-ng.js +2 -7
- package/dist/radio/radio.d.ts +18 -0
- package/dist/radio/radio__item.d.ts +28 -0
- package/dist/radio/radio__item.js +5 -2
- package/dist/save-field-ng/save-field-ng.js +2 -9
- package/dist/select/select.d.ts +289 -0
- package/dist/select/select.js +191 -218
- package/dist/select/select__filter.d.ts +20 -0
- package/dist/select/select__filter.js +3 -1
- package/dist/select/select__popup.d.ts +123 -0
- package/dist/select/select__popup.js +96 -77
- package/dist/select-ng/select-ng.js +8 -9
- package/dist/select-ng/select-ng__lazy.js +11 -16
- package/dist/shortcuts/core.d.ts +74 -0
- package/dist/shortcuts/core.js +16 -10
- package/dist/shortcuts/shortcut-title.d.ts +1 -0
- package/dist/shortcuts/shortcuts-hoc.d.ts +69 -0
- package/dist/shortcuts/shortcuts.d.ts +28 -0
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +2 -2
- package/dist/sidebar-ng/sidebar-ng.js +2 -2
- package/dist/storage/storage.d.ts +18 -0
- package/dist/storage/storage.js +10 -8
- package/dist/storage/storage__fallback.d.ts +79 -0
- package/dist/storage/storage__fallback.js +31 -19
- package/dist/storage/storage__local.d.ts +38 -0
- package/dist/storage/storage__local.js +43 -26
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.d.ts +43 -0
- package/dist/tab-trap/tab-trap.js +17 -5
- package/dist/table/cell.d.ts +13 -0
- package/dist/table/disable-hover-hoc.d.ts +68 -0
- package/dist/table/disable-hover-hoc.js +1 -1
- package/dist/table/header-cell.d.ts +43 -0
- package/dist/table/header-cell.js +4 -0
- package/dist/table/header.d.ts +60 -0
- package/dist/table/header.js +9 -5
- package/dist/table/multitable.d.ts +25 -0
- package/dist/table/multitable.js +21 -7
- package/dist/table/row-with-focus-sensor.d.ts +18 -0
- package/dist/table/row-with-focus-sensor.js +8 -5
- package/dist/table/row.d.ts +56 -0
- package/dist/table/row.js +27 -25
- package/dist/table/selection-adapter.d.ts +5 -0
- package/dist/table/selection-shortcuts-hoc.d.ts +17 -0
- package/dist/table/selection-shortcuts-hoc.js +44 -19
- package/dist/table/selection.d.ts +47 -0
- package/dist/table/selection.js +18 -1
- package/dist/table/smart-table.d.ts +60 -0
- package/dist/table/smart-table.js +6 -4
- package/dist/table/table.d.ts +160 -0
- package/dist/table/table.js +59 -39
- package/dist/table-legacy-ng/table-legacy-ng.js +6 -7
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +6 -7
- package/dist/table-ng/smart-table-ng.js +2 -1
- package/dist/table-ng/table-ng.js +4 -3
- package/dist/tabs/collapsible-more.d.ts +29 -0
- package/dist/tabs/collapsible-more.js +2 -1
- package/dist/tabs/collapsible-tab.d.ts +16 -0
- package/dist/tabs/collapsible-tab.js +9 -10
- package/dist/tabs/collapsible-tabs.d.ts +43 -0
- package/dist/tabs/collapsible-tabs.js +58 -107
- package/dist/tabs/custom-item.d.ts +9 -0
- package/dist/tabs/dumb-tabs.d.ts +33 -0
- package/dist/tabs/dumb-tabs.js +7 -12
- package/dist/tabs/smart-tabs.d.ts +20 -0
- package/dist/tabs/smart-tabs.js +2 -1
- package/dist/tabs/tab-link.d.ts +18 -0
- package/dist/tabs/tab.d.ts +27 -0
- package/dist/tabs/tabs.d.ts +7 -0
- package/dist/tabs/tabs.js +2 -1
- package/dist/tabs-ng/tabs-ng.js +1 -6
- package/dist/tabs-ng/tabs-ng__template.js +1 -1
- package/dist/tag/tag.d.ts +64 -0
- package/dist/tag/tag.js +9 -4
- package/dist/tags-input/tags-input.d.ts +154 -0
- package/dist/tags-input/tags-input.js +68 -39
- package/dist/tags-input-ng/tags-input-ng.js +7 -8
- package/dist/tags-list/tags-list.d.ts +46 -0
- package/dist/tags-list/tags-list.js +2 -8
- package/dist/text/text.d.ts +17 -0
- package/dist/text/text.js +1 -1
- package/dist/toggle/toggle.d.ts +39 -0
- package/dist/toggle/toggle.js +7 -10
- package/dist/toggle-ng/toggle-ng.js +0 -1
- package/dist/tooltip/tooltip.d.ts +65 -0
- package/dist/tooltip/tooltip.js +19 -7
- package/dist/user-agreement/service.d.ts +161 -0
- package/dist/user-agreement/service.js +29 -26
- package/dist/user-agreement/toolbox.eula.d.ts +2 -0
- package/dist/user-agreement/user-agreement.d.ts +69 -0
- package/dist/user-agreement/user-agreement.js +4 -7
- package/dist/user-card/card.d.ts +52 -0
- package/dist/user-card/smart-user-card-tooltip.d.ts +20 -0
- package/dist/user-card/smart-user-card-tooltip.js +5 -9
- package/dist/user-card/tooltip.d.ts +31 -0
- package/dist/user-card/tooltip.js +6 -2
- package/dist/user-card/user-card.d.ts +11 -0
- package/dist/user-card/user-card.js +3 -7
- package/dist/user-card-ng/user-card-ng.js +5 -9
- package/package.json +77 -52
- package/typings.d.ts +97 -0
- package/webpack.config.js +4 -12
- package/components/alert/alert.examples.js +0 -143
- package/components/alert/alert.test.js +0 -61
- package/components/alert/container.test.js +0 -12
- package/components/alert-service/alert-service.examples.js +0 -91
- package/components/alert-service/alert-service.test.js +0 -88
- package/components/analytics/analytics.examples.js +0 -47
- package/components/analytics/analytics.test.js +0 -419
- package/components/auth/auth.examples.js +0 -122
- package/components/auth/auth.test.js +0 -772
- package/components/auth/request-builder.test.js +0 -64
- package/components/auth/response-parser.test.js +0 -89
- package/components/auth/storage.test.js +0 -178
- package/components/auth/token-validator.test.js +0 -199
- package/components/auth-dialog/auth-dialog.examples.js +0 -75
- package/components/auth-dialog/auth-dialog.test.js +0 -11
- package/components/auth-dialog-service/auth-dialog-service.examples.js +0 -66
- package/components/auth-dialog-service/auth-dialog-service.test.js +0 -75
- package/components/avatar/avatar.examples.js +0 -46
- package/components/avatar/avatar.test.js +0 -59
- package/components/badge/badge.examples.js +0 -26
- package/components/badge/badge.test.js +0 -34
- package/components/button/button.examples.js +0 -219
- package/components/button/button.test.js +0 -64
- package/components/button-group/button-group.examples.js +0 -58
- package/components/button-group/button-group.test.js +0 -10
- package/components/button-set/button-set.examples.js +0 -24
- package/components/button-set/button-set.test.js +0 -10
- package/components/button-toolbar/button-toolbar.examples.js +0 -31
- package/components/button-toolbar/button-toolbar.test.js +0 -21
- package/components/caret/caret.examples.js +0 -39
- package/components/caret/caret.test.js +0 -137
- package/components/checkbox/checkbox.examples.js +0 -67
- package/components/checkbox/checkbox.test.js +0 -78
- package/components/code/code.examples.js +0 -92
- package/components/code/code.test.js +0 -100
- package/components/confirm/confirm.examples.js +0 -93
- package/components/confirm/confirm.test.js +0 -28
- package/components/confirm-service/confirm-service.examples.js +0 -61
- package/components/confirm-service/confirm-service.test.js +0 -59
- package/components/content-layout/content-layout.examples.js +0 -188
- package/components/content-layout/content-layout.test.js +0 -41
- package/components/contenteditable/contenteditable.examples.js +0 -45
- package/components/contenteditable/contenteditable.test.js +0 -73
- package/components/data-list/data-list.examples.js +0 -116
- package/components/data-list/data-list.test.js +0 -40
- package/components/date-picker/date-picker.examples.js +0 -345
- package/components/date-picker/date-picker.test.js +0 -89
- package/components/dialog/dialog.examples.js +0 -209
- package/components/dialog/dialog.test.js +0 -62
- package/components/dropdown/dropdown.examples.js +0 -151
- package/components/dropdown/dropdown.test.js +0 -175
- package/components/dropdown-menu/dropdown-menu.examples.js +0 -47
- package/components/dropdown-menu/dropdown-menu.test.js +0 -76
- package/components/error-bubble/error-bubble.examples.js +0 -96
- package/components/error-bubble/error-bubble.test.js +0 -41
- package/components/error-message/error-message.examples.js +0 -33
- package/components/error-message/error-message.test.js +0 -21
- package/components/footer/footer.examples.js +0 -56
- package/components/footer/footer.test.js +0 -78
- package/components/global/conic-gradient.js +0 -31
- package/components/global/data-tests.test.js +0 -18
- package/components/global/dom.examples.js +0 -39
- package/components/global/dom.test.js +0 -99
- package/components/global/fuzzy-highlight.test.js +0 -52
- package/components/global/get-uid.test.js +0 -21
- package/components/global/listeners.test.js +0 -78
- package/components/global/radial-gradient-mask.js +0 -43
- package/components/global/supports-css.js +0 -17
- package/components/global/url.test.js +0 -138
- package/components/global/variables.examples.js +0 -160
- package/components/global/variables_dark.js +0 -55
- package/components/grid/grid.examples.js +0 -291
- package/components/grid/grid.test.js +0 -72
- package/components/group/group.examples.js +0 -27
- package/components/group/group.test.js +0 -21
- package/components/header/header.examples.js +0 -118
- package/components/header/header.test.js +0 -21
- package/components/heading/heading.examples.js +0 -64
- package/components/heading/heading.test.js +0 -29
- package/components/http/http.examples.js +0 -34
- package/components/http/http.test.js +0 -187
- package/components/hub-source/hub-source.test.js +0 -200
- package/components/hub-source/hub-source__users-groups.test.js +0 -91
- package/components/icon/icon.examples.js +0 -146
- package/components/icon/icon.test.js +0 -51
- package/components/input/input.examples.js +0 -140
- package/components/input/input.test.js +0 -40
- package/components/island/island.examples.js +0 -74
- package/components/island/island.test.js +0 -59
- package/components/island-legacy/island-legacy.examples.js +0 -33
- package/components/island-legacy/island-legacy.test.js +0 -21
- package/components/link/link.examples.js +0 -86
- package/components/link/link.test.js +0 -182
- package/components/list/list.examples.js +0 -271
- package/components/list/list.test.js +0 -428
- package/components/list/list__item.test.js +0 -60
- package/components/list/list__users-groups-source.test.js +0 -125
- package/components/loader/loader.examples.js +0 -22
- package/components/loader/loader__core.test.js +0 -232
- package/components/loader-inline/inject-styles.js +0 -28
- package/components/loader-inline/loader-inline.examples.js +0 -106
- package/components/loader-inline/loader-inline.test.js +0 -21
- package/components/loader-screen/loader-screen.examples.js +0 -40
- package/components/markdown/markdown.examples.js +0 -110
- package/components/markdown/markdown.test.js +0 -60
- package/components/message/message.examples.js +0 -78
- package/components/message/message.test.js +0 -26
- package/components/old-browsers-message/old-browsers-message.examples.js +0 -37
- package/components/pager/pager.examples.js +0 -291
- package/components/pager/pager.test.js +0 -56
- package/components/panel/panel.examples.js +0 -33
- package/components/panel/panel.test.js +0 -20
- package/components/permissions/permissions.test.js +0 -435
- package/components/permissions/permissions__cache.test.js +0 -75
- package/components/popup/popup.examples.js +0 -340
- package/components/popup/popup.test.js +0 -242
- package/components/popup/position.test.js +0 -192
- package/components/popup-menu/popup-menu.examples.js +0 -38
- package/components/popup-menu/popup-menu.test.js +0 -29
- package/components/progress-bar/progress-bar.examples.js +0 -56
- package/components/progress-bar/progress-bar.test.js +0 -114
- package/components/query-assist/query-assist.examples.js +0 -305
- package/components/query-assist/query-assist.test.js +0 -690
- package/components/radio/radio.examples.js +0 -58
- package/components/radio/radio.test.js +0 -90
- package/components/radio/radio__item.test.js +0 -98
- package/components/select/select.examples.js +0 -1023
- package/components/select/select.test.js +0 -1201
- package/components/select/select__popup.test.js +0 -156
- package/components/shortcuts/core.test.js +0 -282
- package/components/shortcuts/shortcuts-hoc.test.js +0 -53
- package/components/shortcuts/shortcuts.test.js +0 -45
- package/components/storage/storage.examples.js +0 -37
- package/components/storage/storage.test.js +0 -248
- package/components/tab-trap/tab-trap.examples.js +0 -49
- package/components/table/table.examples.js +0 -346
- package/components/tabs/tabs.examples.js +0 -275
- package/components/tabs/tabs.test.js +0 -26
- package/components/tag/tag.examples.js +0 -50
- package/components/tag/tag.test.js +0 -21
- package/components/tags-input/tag-input.examples.js +0 -133
- package/components/tags-input/tags-input.test.js +0 -234
- package/components/tags-list/tags-list.examples.js +0 -41
- package/components/tags-list/tags-list.test.js +0 -43
- package/components/text/text.examples.js +0 -25
- package/components/text/text.test.js +0 -25
- package/components/toggle/toggle.examples.js +0 -79
- package/components/toggle/toggle.test.js +0 -34
- package/components/tooltip/tooltip.examples.js +0 -118
- package/components/tooltip/tooltip.test.js +0 -128
- package/components/user-agreement/user-agreement.examples.js +0 -112
- package/components/user-card/user-card.examples.js +0 -88
- package/components/user-card/user-card.test.js +0 -102
- package/components/welcome.examples.js +0 -25
- package/dist/_helpers/inject-styles.js +0 -22
- package/dist/global/conic-gradient.js +0 -35
- package/dist/global/radial-gradient-mask.js +0 -49
- package/dist/global/supports-css.js +0 -20
- package/dist/global/variables_dark.js +0 -57
- package/dist/loader-inline/inject-styles.js +0 -11
package/dist/auth/auth__core.js
CHANGED
|
@@ -29,28 +29,30 @@ import '../_helpers/icon.js';
|
|
|
29
29
|
import '../icon/icon__svg.js';
|
|
30
30
|
import '../global/memoize.js';
|
|
31
31
|
import '../loader-inline/loader-inline.js';
|
|
32
|
-
import '../global/theme.js';
|
|
33
32
|
import '../global/data-tests.js';
|
|
34
|
-
import '../_helpers/
|
|
35
|
-
import '../global/conic-gradient.js';
|
|
36
|
-
import 'conic-gradient';
|
|
37
|
-
import '../global/supports-css.js';
|
|
38
|
-
import '../global/inject-styles.js';
|
|
39
|
-
import '../global/radial-gradient-mask.js';
|
|
33
|
+
import '../_helpers/loader-inline.js';
|
|
40
34
|
import '../global/dom.js';
|
|
35
|
+
import '../button/button.js';
|
|
36
|
+
import 'focus-visible';
|
|
37
|
+
import '@jetbrains/icons/chevron-10px';
|
|
38
|
+
import '../link/clickableLink.js';
|
|
39
|
+
import '../global/controls-height.js';
|
|
40
|
+
import '../_helpers/button__classes.js';
|
|
41
|
+
import '../_helpers/theme.js';
|
|
42
|
+
import '../popup/popup.target.js';
|
|
41
43
|
import '../alert/container.js';
|
|
42
44
|
import '../storage/storage__fallback.js';
|
|
43
45
|
import 'deep-equal';
|
|
44
46
|
import 'simply-uuid';
|
|
45
47
|
|
|
46
|
-
/* eslint-disable no-magic-numbers */
|
|
48
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
47
49
|
|
|
48
50
|
const DEFAULT_EXPIRES_TIMEOUT = 40 * 60;
|
|
49
51
|
const DEFAULT_BACKGROUND_TIMEOUT = 10 * 1000;
|
|
50
52
|
const DEFAULT_BACKEND_CHECK_TIMEOUT = 10 * 1000;
|
|
51
53
|
const BACKGROUND_REDIRECT_TIMEOUT = 20 * 1000;
|
|
52
54
|
const DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT = 5 * 1000;
|
|
53
|
-
/* eslint-enable no-magic-numbers */
|
|
55
|
+
/* eslint-enable @typescript-eslint/no-magic-numbers */
|
|
54
56
|
|
|
55
57
|
const USER_CHANGED_EVENT = 'userChange';
|
|
56
58
|
const DOMAIN_USER_CHANGED_EVENT = 'domainUser';
|
|
@@ -79,7 +81,7 @@ const DEFAULT_CONFIG = {
|
|
|
79
81
|
enableBackendStatusCheck: true,
|
|
80
82
|
backendCheckTimeout: DEFAULT_BACKEND_CHECK_TIMEOUT,
|
|
81
83
|
checkBackendIsUp: () => Promise.resolve(null),
|
|
82
|
-
onBackendDown: () => {},
|
|
84
|
+
onBackendDown: () => () => {},
|
|
83
85
|
defaultExpiresIn: DEFAULT_EXPIRES_TIMEOUT,
|
|
84
86
|
waitForRedirectTimeout: DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT,
|
|
85
87
|
translations: {
|
|
@@ -98,11 +100,11 @@ const DEFAULT_CONFIG = {
|
|
|
98
100
|
};
|
|
99
101
|
class Auth {
|
|
100
102
|
constructor(config) {
|
|
101
|
-
_defineProperty(this, "config",
|
|
103
|
+
_defineProperty(this, "config", void 0);
|
|
102
104
|
|
|
103
105
|
_defineProperty(this, "listeners", new Listeners());
|
|
104
106
|
|
|
105
|
-
_defineProperty(this, "http",
|
|
107
|
+
_defineProperty(this, "http", void 0);
|
|
106
108
|
|
|
107
109
|
_defineProperty(this, "_service", {});
|
|
108
110
|
|
|
@@ -112,7 +114,7 @@ class Auth {
|
|
|
112
114
|
|
|
113
115
|
_defineProperty(this, "_requestBuilder", null);
|
|
114
116
|
|
|
115
|
-
_defineProperty(this, "_backgroundFlow",
|
|
117
|
+
_defineProperty(this, "_backgroundFlow", void 0);
|
|
116
118
|
|
|
117
119
|
_defineProperty(this, "_embeddedFlow", null);
|
|
118
120
|
|
|
@@ -124,6 +126,14 @@ class Auth {
|
|
|
124
126
|
|
|
125
127
|
_defineProperty(this, "_authDialogService", undefined);
|
|
126
128
|
|
|
129
|
+
_defineProperty(this, "_domainStorage", void 0);
|
|
130
|
+
|
|
131
|
+
_defineProperty(this, "user", null);
|
|
132
|
+
|
|
133
|
+
_defineProperty(this, "_initDeferred", void 0);
|
|
134
|
+
|
|
135
|
+
_defineProperty(this, "_isLoginWindowOpen", void 0);
|
|
136
|
+
|
|
127
137
|
if (!config) {
|
|
128
138
|
throw new Error('Config is required');
|
|
129
139
|
}
|
|
@@ -214,18 +224,30 @@ class Auth {
|
|
|
214
224
|
this.addListener(LOGOUT_EVENT, this.config.onLogout);
|
|
215
225
|
}
|
|
216
226
|
|
|
217
|
-
if (this.config.reloadOnUserChange
|
|
227
|
+
if (this.config.reloadOnUserChange) {
|
|
218
228
|
this.addListener(USER_CHANGED_EVENT, () => this._reloadCurrentPage());
|
|
219
229
|
}
|
|
220
230
|
|
|
221
231
|
this.addListener(LOGOUT_POSTPONED_EVENT, () => this._setPostponed(true));
|
|
222
232
|
this.addListener(USER_CHANGE_POSTPONED_EVENT, () => this._setPostponed(true));
|
|
223
233
|
this.addListener(USER_CHANGED_EVENT, () => this._setPostponed(false));
|
|
224
|
-
this.addListener(USER_CHANGED_EVENT, user =>
|
|
234
|
+
this.addListener(USER_CHANGED_EVENT, user => {
|
|
235
|
+
if (user) {
|
|
236
|
+
this._updateDomainUser(user.id);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
225
239
|
|
|
226
240
|
if (this.config.cacheCurrentUser) {
|
|
227
|
-
this.addListener(LOGOUT_EVENT, () =>
|
|
228
|
-
|
|
241
|
+
this.addListener(LOGOUT_EVENT, () => {
|
|
242
|
+
var _this$_storage;
|
|
243
|
+
|
|
244
|
+
return (_this$_storage = this._storage) === null || _this$_storage === void 0 ? void 0 : _this$_storage.wipeCachedCurrentUser();
|
|
245
|
+
});
|
|
246
|
+
this.addListener(USER_CHANGED_EVENT, () => {
|
|
247
|
+
var _this$_storage2;
|
|
248
|
+
|
|
249
|
+
return (_this$_storage2 = this._storage) === null || _this$_storage2 === void 0 ? void 0 : _this$_storage2.onUserChanged();
|
|
250
|
+
});
|
|
229
251
|
}
|
|
230
252
|
|
|
231
253
|
this._createInitDeferred();
|
|
@@ -262,11 +284,12 @@ class Auth {
|
|
|
262
284
|
}
|
|
263
285
|
|
|
264
286
|
_createInitDeferred() {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
287
|
+
const deferred = {};
|
|
288
|
+
deferred.promise = new Promise((resolve, reject) => {
|
|
289
|
+
deferred.resolve = resolve;
|
|
290
|
+
deferred.reject = reject;
|
|
269
291
|
});
|
|
292
|
+
this._initDeferred = deferred;
|
|
270
293
|
}
|
|
271
294
|
/**
|
|
272
295
|
* @return {Promise.<string>} absolute URL promise that is resolved to a URL
|
|
@@ -275,7 +298,9 @@ class Auth {
|
|
|
275
298
|
|
|
276
299
|
|
|
277
300
|
async init() {
|
|
278
|
-
|
|
301
|
+
var _this$_storage3;
|
|
302
|
+
|
|
303
|
+
(_this$_storage3 = this._storage) === null || _this$_storage3 === void 0 ? void 0 : _this$_storage3.onTokenChange(async token => {
|
|
279
304
|
const isGuest = this.user ? this.user.guest : false;
|
|
280
305
|
|
|
281
306
|
if (isGuest && !token) {
|
|
@@ -288,6 +313,10 @@ class Auth {
|
|
|
288
313
|
try {
|
|
289
314
|
await this._detectUserChange(token.accessToken);
|
|
290
315
|
} catch (error) {
|
|
316
|
+
if (!(error instanceof Error)) {
|
|
317
|
+
throw error;
|
|
318
|
+
}
|
|
319
|
+
|
|
291
320
|
if (this._canShowDialogs()) {
|
|
292
321
|
this._showAuthDialog({
|
|
293
322
|
nonInteractive: true,
|
|
@@ -298,11 +327,11 @@ class Auth {
|
|
|
298
327
|
}
|
|
299
328
|
});
|
|
300
329
|
|
|
301
|
-
this._domainStorage.onMessage(DOMAIN_USER_CHANGED_EVENT,
|
|
302
|
-
|
|
330
|
+
this._domainStorage.onMessage(DOMAIN_USER_CHANGED_EVENT, message => {
|
|
331
|
+
const {
|
|
303
332
|
userID,
|
|
304
333
|
serviceID
|
|
305
|
-
} =
|
|
334
|
+
} = message || {};
|
|
306
335
|
|
|
307
336
|
if (serviceID === this.config.clientId) {
|
|
308
337
|
return;
|
|
@@ -321,7 +350,7 @@ class Auth {
|
|
|
321
350
|
// Look for token or error in hash
|
|
322
351
|
state = await this._checkForAuthResponse();
|
|
323
352
|
} catch (error) {
|
|
324
|
-
return this.handleInitError(error);
|
|
353
|
+
return error instanceof Error ? this.handleInitError(error) : undefined;
|
|
325
354
|
} // Return endless promise in the background to avoid service start
|
|
326
355
|
|
|
327
356
|
|
|
@@ -330,20 +359,22 @@ class Auth {
|
|
|
330
359
|
}
|
|
331
360
|
|
|
332
361
|
try {
|
|
333
|
-
var _state;
|
|
362
|
+
var _this$_tokenValidator, _this$_initDeferred, _this$_initDeferred$r, _state;
|
|
334
363
|
|
|
335
364
|
// Check if there is a valid token
|
|
336
|
-
await this._tokenValidator.validateToken(); // Checking if there is a message left by another app on this domain
|
|
365
|
+
await ((_this$_tokenValidator = this._tokenValidator) === null || _this$_tokenValidator === void 0 ? void 0 : _this$_tokenValidator.validateToken()); // Checking if there is a message left by another app on this domain
|
|
337
366
|
|
|
338
367
|
const message = await this._domainStorage._messagesStorage.get(`domain-message-${DOMAIN_USER_CHANGED_EVENT}`);
|
|
339
368
|
|
|
340
369
|
if (message) {
|
|
370
|
+
var _this$user;
|
|
371
|
+
|
|
341
372
|
const {
|
|
342
373
|
userID,
|
|
343
374
|
serviceID
|
|
344
375
|
} = message;
|
|
345
376
|
|
|
346
|
-
if (serviceID !== this.config.clientId && (!userID || this.user.id !== userID)) {
|
|
377
|
+
if (serviceID !== this.config.clientId && (!userID || ((_this$user = this.user) === null || _this$user === void 0 ? void 0 : _this$user.id) !== userID)) {
|
|
347
378
|
this.forceTokenUpdate();
|
|
348
379
|
}
|
|
349
380
|
} // Access token appears to be valid.
|
|
@@ -355,27 +386,31 @@ class Auth {
|
|
|
355
386
|
state = await this._checkForStateRestoration();
|
|
356
387
|
}
|
|
357
388
|
|
|
358
|
-
this._initDeferred.resolve(state && state.restoreLocation);
|
|
359
|
-
|
|
389
|
+
(_this$_initDeferred = this._initDeferred) === null || _this$_initDeferred === void 0 ? void 0 : (_this$_initDeferred$r = _this$_initDeferred.resolve) === null || _this$_initDeferred$r === void 0 ? void 0 : _this$_initDeferred$r.call(_this$_initDeferred, state && state.restoreLocation);
|
|
360
390
|
return (_state = state) === null || _state === void 0 ? void 0 : _state.restoreLocation;
|
|
361
391
|
} catch (error) {
|
|
362
392
|
if (Auth.storageIsUnavailable) {
|
|
363
|
-
|
|
393
|
+
var _this$_initDeferred2, _this$_initDeferred2$;
|
|
364
394
|
|
|
395
|
+
(_this$_initDeferred2 = this._initDeferred) === null || _this$_initDeferred2 === void 0 ? void 0 : (_this$_initDeferred2$ = _this$_initDeferred2.resolve) === null || _this$_initDeferred2$ === void 0 ? void 0 : _this$_initDeferred2$.call(_this$_initDeferred2); // No way to handle if cookies are disabled
|
|
365
396
|
|
|
366
397
|
await this.requestUser(); // Someone may expect user to be loaded as a part of token validation
|
|
367
398
|
|
|
368
399
|
return null;
|
|
369
400
|
}
|
|
370
401
|
|
|
371
|
-
return this.handleInitValidationError(error);
|
|
402
|
+
return error instanceof Error ? this.handleInitValidationError(error) : undefined;
|
|
372
403
|
}
|
|
373
404
|
}
|
|
374
405
|
|
|
375
406
|
async sendRedirect(error) {
|
|
376
|
-
|
|
407
|
+
var _this$_requestBuilder;
|
|
377
408
|
|
|
378
|
-
|
|
409
|
+
const authRequest = await ((_this$_requestBuilder = this._requestBuilder) === null || _this$_requestBuilder === void 0 ? void 0 : _this$_requestBuilder.prepareAuthRequest());
|
|
410
|
+
|
|
411
|
+
if (authRequest != null) {
|
|
412
|
+
this._redirectCurrentPage(authRequest.url);
|
|
413
|
+
} // HUB-10867 Since we already redirecting the page, there is no actual need to throw an error
|
|
379
414
|
// and scare user with flashing error
|
|
380
415
|
// But let's keep it just in case redirect was not successful
|
|
381
416
|
|
|
@@ -385,19 +420,21 @@ class Auth {
|
|
|
385
420
|
}
|
|
386
421
|
|
|
387
422
|
async handleInitError(error) {
|
|
388
|
-
if (error.stateId) {
|
|
423
|
+
if ('stateId' in error && error.stateId) {
|
|
389
424
|
try {
|
|
390
|
-
|
|
425
|
+
var _this$_storage4;
|
|
391
426
|
|
|
392
|
-
|
|
393
|
-
state.error = error;
|
|
427
|
+
const state = await ((_this$_storage4 = this._storage) === null || _this$_storage4 === void 0 ? void 0 : _this$_storage4.getState(error.stateId));
|
|
394
428
|
|
|
395
|
-
|
|
429
|
+
if (state && state.nonRedirect) {
|
|
430
|
+
var _this$_storage5;
|
|
396
431
|
|
|
432
|
+
state.error = error;
|
|
433
|
+
(_this$_storage5 = this._storage) === null || _this$_storage5 === void 0 ? void 0 : _this$_storage5.saveState(error.stateId, state); // Return endless promise in the background to avoid service start
|
|
397
434
|
|
|
398
435
|
return new Promise(noop);
|
|
399
436
|
}
|
|
400
|
-
} catch (e) {// Throw the
|
|
437
|
+
} catch (e) {// Throw the original error instead below
|
|
401
438
|
}
|
|
402
439
|
}
|
|
403
440
|
|
|
@@ -405,28 +442,29 @@ class Auth {
|
|
|
405
442
|
}
|
|
406
443
|
|
|
407
444
|
async handleInitValidationError(error) {
|
|
445
|
+
var _this$_initDeferred4, _this$_initDeferred4$;
|
|
446
|
+
|
|
408
447
|
// Redirect flow
|
|
409
|
-
if (error.authRedirect && this.config.redirect) {
|
|
448
|
+
if ('authRedirect' in error && error.authRedirect && this.config.redirect) {
|
|
410
449
|
return this.sendRedirect(error);
|
|
411
450
|
} // Background flow
|
|
412
451
|
|
|
413
452
|
|
|
414
|
-
if (error.authRedirect && !this.config.redirect) {
|
|
453
|
+
if ('authRedirect' in error && error.authRedirect && !this.config.redirect) {
|
|
415
454
|
try {
|
|
416
|
-
|
|
417
|
-
await this._tokenValidator.validateToken();
|
|
418
|
-
|
|
419
|
-
this._initDeferred.resolve();
|
|
455
|
+
var _this$_backgroundFlow, _this$_tokenValidator2, _this$_initDeferred3, _this$_initDeferred3$;
|
|
420
456
|
|
|
457
|
+
await ((_this$_backgroundFlow = this._backgroundFlow) === null || _this$_backgroundFlow === void 0 ? void 0 : _this$_backgroundFlow.authorize());
|
|
458
|
+
await ((_this$_tokenValidator2 = this._tokenValidator) === null || _this$_tokenValidator2 === void 0 ? void 0 : _this$_tokenValidator2.validateToken());
|
|
459
|
+
(_this$_initDeferred3 = this._initDeferred) === null || _this$_initDeferred3 === void 0 ? void 0 : (_this$_initDeferred3$ = _this$_initDeferred3.resolve) === null || _this$_initDeferred3$ === void 0 ? void 0 : _this$_initDeferred3$.call(_this$_initDeferred3);
|
|
421
460
|
return undefined;
|
|
422
461
|
} catch (validationError) {
|
|
423
462
|
// Fallback to redirect flow
|
|
424
|
-
return this.sendRedirect(validationError);
|
|
463
|
+
return validationError instanceof Error ? this.sendRedirect(validationError) : undefined;
|
|
425
464
|
}
|
|
426
465
|
}
|
|
427
466
|
|
|
428
|
-
this._initDeferred.reject(error);
|
|
429
|
-
|
|
467
|
+
(_this$_initDeferred4 = this._initDeferred) === null || _this$_initDeferred4 === void 0 ? void 0 : (_this$_initDeferred4$ = _this$_initDeferred4.reject) === null || _this$_initDeferred4$ === void 0 ? void 0 : _this$_initDeferred4$.call(_this$_initDeferred4, error);
|
|
430
468
|
throw error;
|
|
431
469
|
}
|
|
432
470
|
/**
|
|
@@ -442,13 +480,15 @@ class Auth {
|
|
|
442
480
|
}
|
|
443
481
|
|
|
444
482
|
try {
|
|
445
|
-
|
|
483
|
+
var _this$_initDeferred5, _await$this$_tokenVal, _this$_tokenValidator3;
|
|
484
|
+
|
|
485
|
+
await ((_this$_initDeferred5 = this._initDeferred) === null || _this$_initDeferred5 === void 0 ? void 0 : _this$_initDeferred5.promise);
|
|
446
486
|
|
|
447
487
|
if (Auth.storageIsUnavailable) {
|
|
448
488
|
return null; // Forever guest if storage is unavailable
|
|
449
489
|
}
|
|
450
490
|
|
|
451
|
-
return await this._tokenValidator.validateTokenLocally();
|
|
491
|
+
return (_await$this$_tokenVal = await ((_this$_tokenValidator3 = this._tokenValidator) === null || _this$_tokenValidator3 === void 0 ? void 0 : _this$_tokenValidator3.validateTokenLocally())) !== null && _await$this$_tokenVal !== void 0 ? _await$this$_tokenVal : null;
|
|
452
492
|
} catch (e) {
|
|
453
493
|
return this.forceTokenUpdate();
|
|
454
494
|
}
|
|
@@ -473,20 +513,30 @@ class Auth {
|
|
|
473
513
|
}
|
|
474
514
|
|
|
475
515
|
try {
|
|
476
|
-
|
|
516
|
+
var _await$this$_backgrou, _this$_backgroundFlow2;
|
|
517
|
+
|
|
518
|
+
return (_await$this$_backgrou = await ((_this$_backgroundFlow2 = this._backgroundFlow) === null || _this$_backgroundFlow2 === void 0 ? void 0 : _this$_backgroundFlow2.authorize())) !== null && _await$this$_backgrou !== void 0 ? _await$this$_backgrou : null;
|
|
477
519
|
} catch (error) {
|
|
520
|
+
if (!(error instanceof Error)) {
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
|
|
478
524
|
if (this._canShowDialogs()) {
|
|
479
525
|
return new Promise(resolve => {
|
|
480
526
|
const onTryAgain = async () => {
|
|
481
527
|
try {
|
|
482
|
-
|
|
483
|
-
|
|
528
|
+
var _this$_backgroundFlow3;
|
|
529
|
+
|
|
530
|
+
const result = await ((_this$_backgroundFlow3 = this._backgroundFlow) === null || _this$_backgroundFlow3 === void 0 ? void 0 : _this$_backgroundFlow3.authorize());
|
|
531
|
+
resolve(result !== null && result !== void 0 ? result : null);
|
|
484
532
|
} catch (retryError) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
533
|
+
if (retryError instanceof Error) {
|
|
534
|
+
this._showAuthDialog({
|
|
535
|
+
nonInteractive: true,
|
|
536
|
+
error: retryError,
|
|
537
|
+
onTryAgain
|
|
538
|
+
});
|
|
539
|
+
}
|
|
490
540
|
|
|
491
541
|
throw retryError;
|
|
492
542
|
}
|
|
@@ -494,14 +544,18 @@ class Auth {
|
|
|
494
544
|
|
|
495
545
|
this._showAuthDialog({
|
|
496
546
|
nonInteractive: true,
|
|
497
|
-
error,
|
|
547
|
+
error: error,
|
|
498
548
|
onTryAgain
|
|
499
549
|
});
|
|
500
550
|
});
|
|
501
551
|
} else {
|
|
502
|
-
|
|
552
|
+
var _this$_requestBuilder2;
|
|
503
553
|
|
|
504
|
-
this.
|
|
554
|
+
const authRequest = await ((_this$_requestBuilder2 = this._requestBuilder) === null || _this$_requestBuilder2 === void 0 ? void 0 : _this$_requestBuilder2.prepareAuthRequest());
|
|
555
|
+
|
|
556
|
+
if (authRequest != null) {
|
|
557
|
+
this._redirectCurrentPage(authRequest.url);
|
|
558
|
+
}
|
|
505
559
|
}
|
|
506
560
|
|
|
507
561
|
throw new TokenValidator.TokenValidationError(error.message);
|
|
@@ -536,7 +590,9 @@ class Auth {
|
|
|
536
590
|
|
|
537
591
|
getUser(accessToken) {
|
|
538
592
|
if (this.config.cacheCurrentUser) {
|
|
539
|
-
|
|
593
|
+
var _this$_storage6;
|
|
594
|
+
|
|
595
|
+
return (_this$_storage6 = this._storage) === null || _this$_storage6 === void 0 ? void 0 : _this$_storage6.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
|
|
540
596
|
} else {
|
|
541
597
|
return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
|
|
542
598
|
}
|
|
@@ -563,12 +619,12 @@ class Auth {
|
|
|
563
619
|
}
|
|
564
620
|
|
|
565
621
|
async updateUser() {
|
|
622
|
+
var _this$_storage7;
|
|
623
|
+
|
|
566
624
|
this._setPostponed(false);
|
|
567
625
|
|
|
568
626
|
const accessToken = await this.requestToken();
|
|
569
|
-
|
|
570
|
-
this._storage.wipeCachedCurrentUser();
|
|
571
|
-
|
|
627
|
+
(_this$_storage7 = this._storage) === null || _this$_storage7 === void 0 ? void 0 : _this$_storage7.wipeCachedCurrentUser();
|
|
572
628
|
const user = await this.getUser(accessToken);
|
|
573
629
|
this.user = user;
|
|
574
630
|
this.listeners.trigger(USER_CHANGED_EVENT, user);
|
|
@@ -619,6 +675,8 @@ class Auth {
|
|
|
619
675
|
}
|
|
620
676
|
|
|
621
677
|
_showAuthDialog() {
|
|
678
|
+
var _this$user2, _this$_authDialogServ, _this$_storage9, _this$_storage10;
|
|
679
|
+
|
|
622
680
|
let {
|
|
623
681
|
nonInteractive,
|
|
624
682
|
error,
|
|
@@ -630,20 +688,20 @@ class Auth {
|
|
|
630
688
|
onPostponeLogout,
|
|
631
689
|
translations
|
|
632
690
|
} = this.config;
|
|
633
|
-
const cancelable = this.user.guest || canCancel;
|
|
691
|
+
const cancelable = ((_this$user2 = this.user) === null || _this$user2 === void 0 ? void 0 : _this$user2.guest) || canCancel;
|
|
634
692
|
|
|
635
693
|
this._createInitDeferred();
|
|
636
694
|
|
|
637
695
|
const closeDialog = () => {
|
|
638
|
-
/* eslint-disable no-use-before-define */
|
|
639
|
-
stopTokenListening();
|
|
640
|
-
stopMessageListening();
|
|
641
|
-
hide();
|
|
642
|
-
/* eslint-enable no-use-before-define */
|
|
696
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
697
|
+
stopTokenListening === null || stopTokenListening === void 0 ? void 0 : stopTokenListening();
|
|
698
|
+
stopMessageListening === null || stopMessageListening === void 0 ? void 0 : stopMessageListening();
|
|
699
|
+
hide === null || hide === void 0 ? void 0 : hide();
|
|
700
|
+
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
643
701
|
};
|
|
644
702
|
|
|
645
703
|
const onConfirm = () => {
|
|
646
|
-
if (embeddedLogin
|
|
704
|
+
if (!embeddedLogin) {
|
|
647
705
|
closeDialog();
|
|
648
706
|
this.logout();
|
|
649
707
|
return;
|
|
@@ -653,33 +711,36 @@ class Auth {
|
|
|
653
711
|
};
|
|
654
712
|
|
|
655
713
|
const onCancel = () => {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
this._storage.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
714
|
+
var _this$_embeddedFlow, _this$_storage8, _this$user3;
|
|
659
715
|
|
|
716
|
+
(_this$_embeddedFlow = this._embeddedFlow) === null || _this$_embeddedFlow === void 0 ? void 0 : _this$_embeddedFlow.stop();
|
|
717
|
+
(_this$_storage8 = this._storage) === null || _this$_storage8 === void 0 ? void 0 : _this$_storage8.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
660
718
|
closeDialog();
|
|
661
719
|
|
|
662
720
|
if (!cancelable) {
|
|
663
|
-
|
|
721
|
+
var _this$_initDeferred6, _this$_initDeferred6$;
|
|
664
722
|
|
|
723
|
+
(_this$_initDeferred6 = this._initDeferred) === null || _this$_initDeferred6 === void 0 ? void 0 : (_this$_initDeferred6$ = _this$_initDeferred6.resolve) === null || _this$_initDeferred6$ === void 0 ? void 0 : _this$_initDeferred6$.call(_this$_initDeferred6);
|
|
665
724
|
this.listeners.trigger(LOGOUT_POSTPONED_EVENT);
|
|
666
725
|
onPostponeLogout();
|
|
667
726
|
return;
|
|
668
727
|
}
|
|
669
728
|
|
|
670
|
-
if (this.user.guest && nonInteractive) {
|
|
729
|
+
if ((_this$user3 = this.user) !== null && _this$user3 !== void 0 && _this$user3.guest && nonInteractive) {
|
|
671
730
|
this.forceTokenUpdate();
|
|
672
731
|
} else {
|
|
673
|
-
|
|
732
|
+
var _this$_initDeferred7, _this$_initDeferred7$;
|
|
733
|
+
|
|
734
|
+
(_this$_initDeferred7 = this._initDeferred) === null || _this$_initDeferred7 === void 0 ? void 0 : (_this$_initDeferred7$ = _this$_initDeferred7.resolve) === null || _this$_initDeferred7$ === void 0 ? void 0 : _this$_initDeferred7$.call(_this$_initDeferred7);
|
|
674
735
|
}
|
|
675
736
|
};
|
|
676
737
|
|
|
677
738
|
const onTryAgainClick = async () => {
|
|
678
|
-
await onTryAgain();
|
|
739
|
+
await (onTryAgain === null || onTryAgain === void 0 ? void 0 : onTryAgain());
|
|
679
740
|
closeDialog();
|
|
680
741
|
};
|
|
681
742
|
|
|
682
|
-
const hide = this._authDialogService({ ...this._service,
|
|
743
|
+
const hide = (_this$_authDialogServ = this._authDialogService) === null || _this$_authDialogServ === void 0 ? void 0 : _this$_authDialogServ.call(this, { ...this._service,
|
|
683
744
|
loginCaption: translations.login,
|
|
684
745
|
loginToCaption: translations.loginTo,
|
|
685
746
|
confirmLabel: translations.login,
|
|
@@ -688,26 +749,31 @@ class Auth {
|
|
|
688
749
|
errorMessage: this._extractErrorMessage(error, true),
|
|
689
750
|
onConfirm,
|
|
690
751
|
onCancel,
|
|
691
|
-
onTryAgain: onTryAgain ? onTryAgainClick :
|
|
752
|
+
onTryAgain: onTryAgain ? onTryAgainClick : undefined
|
|
692
753
|
});
|
|
693
|
-
|
|
694
|
-
const stopTokenListening = this._storage.onTokenChange(token => {
|
|
754
|
+
const stopTokenListening = (_this$_storage9 = this._storage) === null || _this$_storage9 === void 0 ? void 0 : _this$_storage9.onTokenChange(token => {
|
|
695
755
|
if (token) {
|
|
696
|
-
|
|
756
|
+
var _this$_initDeferred8, _this$_initDeferred8$;
|
|
697
757
|
|
|
698
|
-
|
|
758
|
+
closeDialog();
|
|
759
|
+
(_this$_initDeferred8 = this._initDeferred) === null || _this$_initDeferred8 === void 0 ? void 0 : (_this$_initDeferred8$ = _this$_initDeferred8.resolve) === null || _this$_initDeferred8$ === void 0 ? void 0 : _this$_initDeferred8$.call(_this$_initDeferred8);
|
|
699
760
|
}
|
|
700
761
|
});
|
|
762
|
+
const stopMessageListening = (_this$_storage10 = this._storage) === null || _this$_storage10 === void 0 ? void 0 : _this$_storage10.onMessage(Auth.CLOSE_WINDOW_MESSAGE, () => {
|
|
763
|
+
var _this$_embeddedFlow2;
|
|
701
764
|
|
|
702
|
-
|
|
765
|
+
return (_this$_embeddedFlow2 = this._embeddedFlow) === null || _this$_embeddedFlow2 === void 0 ? void 0 : _this$_embeddedFlow2.stop();
|
|
766
|
+
});
|
|
703
767
|
}
|
|
704
768
|
|
|
705
|
-
_showUserChangedDialog() {
|
|
769
|
+
_showUserChangedDialog(_ref) {
|
|
770
|
+
var _this$_authDialogServ2, _newUser$name;
|
|
771
|
+
|
|
706
772
|
let {
|
|
707
773
|
newUser,
|
|
708
774
|
onApply,
|
|
709
775
|
onPostpone
|
|
710
|
-
} =
|
|
776
|
+
} = _ref;
|
|
711
777
|
const {
|
|
712
778
|
translations
|
|
713
779
|
} = this.config;
|
|
@@ -715,17 +781,19 @@ class Auth {
|
|
|
715
781
|
this._createInitDeferred();
|
|
716
782
|
|
|
717
783
|
const done = () => {
|
|
718
|
-
|
|
784
|
+
var _this$_initDeferred9, _this$_initDeferred9$;
|
|
719
785
|
|
|
786
|
+
(_this$_initDeferred9 = this._initDeferred) === null || _this$_initDeferred9 === void 0 ? void 0 : (_this$_initDeferred9$ = _this$_initDeferred9.resolve) === null || _this$_initDeferred9$ === void 0 ? void 0 : _this$_initDeferred9$.call(_this$_initDeferred9); // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
720
787
|
|
|
721
|
-
hide();
|
|
788
|
+
hide === null || hide === void 0 ? void 0 : hide();
|
|
722
789
|
};
|
|
723
790
|
|
|
724
|
-
const hide = this._authDialogService({ ...this._service,
|
|
725
|
-
title: translations.youHaveLoggedInAs.replace('%userName%', newUser.name),
|
|
791
|
+
const hide = (_this$_authDialogServ2 = this._authDialogService) === null || _this$_authDialogServ2 === void 0 ? void 0 : _this$_authDialogServ2.call(this, { ...this._service,
|
|
792
|
+
title: translations.youHaveLoggedInAs.replace('%userName%', (_newUser$name = newUser.name) !== null && _newUser$name !== void 0 ? _newUser$name : ''),
|
|
726
793
|
loginCaption: translations.login,
|
|
727
794
|
loginToCaption: translations.loginTo,
|
|
728
795
|
confirmLabel: translations.applyChange,
|
|
796
|
+
tryAgainLabel: translations.tryAgainLabel,
|
|
729
797
|
cancelLabel: translations.postpone,
|
|
730
798
|
onConfirm: () => {
|
|
731
799
|
done();
|
|
@@ -753,7 +821,7 @@ class Auth {
|
|
|
753
821
|
try {
|
|
754
822
|
// We've got some error from this list
|
|
755
823
|
// https://www.jetbrains.com/help/youtrack/devportal/OAuth-2.0-Errors.html
|
|
756
|
-
if (error.code && typeof error.code.code === 'string') {
|
|
824
|
+
if ('code' in error && error.code && typeof error.code === 'object' && 'code' in error.code && typeof error.code.code === 'string') {
|
|
757
825
|
const readableCode = error.code.code.split('_').join(' ');
|
|
758
826
|
return `Authorization error: ${readableCode}`;
|
|
759
827
|
}
|
|
@@ -769,23 +837,25 @@ class Auth {
|
|
|
769
837
|
translations
|
|
770
838
|
} = this.config;
|
|
771
839
|
const REPEAT_TIMEOUT = 5000;
|
|
772
|
-
let timerId
|
|
840
|
+
let timerId;
|
|
773
841
|
return new Promise((resolve, reject) => {
|
|
842
|
+
var _this$_storage12;
|
|
843
|
+
|
|
774
844
|
const done = () => {
|
|
775
|
-
|
|
845
|
+
var _this$_storage11;
|
|
846
|
+
|
|
847
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
776
848
|
hide();
|
|
777
849
|
window.removeEventListener('online', onCheckAgain);
|
|
778
|
-
stopListeningCloseMessage();
|
|
779
|
-
/* eslint-enable no-use-before-define */
|
|
850
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 ? void 0 : stopListeningCloseMessage();
|
|
851
|
+
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
780
852
|
|
|
781
|
-
this._storage.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
|
|
782
|
-
|
|
783
|
-
this._awaitingForBackendPromise = null;
|
|
853
|
+
(_this$_storage11 = this._storage) === null || _this$_storage11 === void 0 ? void 0 : _this$_storage11.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
|
|
784
854
|
clearTimeout(timerId);
|
|
785
855
|
};
|
|
786
856
|
|
|
787
|
-
const stopListeningCloseMessage = this._storage.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, () => {
|
|
788
|
-
stopListeningCloseMessage();
|
|
857
|
+
const stopListeningCloseMessage = (_this$_storage12 = this._storage) === null || _this$_storage12 === void 0 ? void 0 : _this$_storage12.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, () => {
|
|
858
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 ? void 0 : stopListeningCloseMessage();
|
|
789
859
|
done();
|
|
790
860
|
resolve();
|
|
791
861
|
});
|
|
@@ -814,10 +884,10 @@ class Auth {
|
|
|
814
884
|
onCheckAgain();
|
|
815
885
|
}
|
|
816
886
|
|
|
817
|
-
timerId = setTimeout(networkWatchdog, REPEAT_TIMEOUT);
|
|
887
|
+
timerId = window.setTimeout(networkWatchdog, REPEAT_TIMEOUT);
|
|
818
888
|
}
|
|
819
889
|
|
|
820
|
-
timerId = setTimeout(networkWatchdog, REPEAT_TIMEOUT);
|
|
890
|
+
timerId = window.setTimeout(networkWatchdog, REPEAT_TIMEOUT);
|
|
821
891
|
});
|
|
822
892
|
}
|
|
823
893
|
/**
|
|
@@ -826,28 +896,36 @@ class Auth {
|
|
|
826
896
|
|
|
827
897
|
|
|
828
898
|
async logout(extraParams) {
|
|
899
|
+
var _this$_storage13, _this$_requestBuilder3;
|
|
900
|
+
|
|
829
901
|
const requestParams = {
|
|
830
902
|
// eslint-disable-next-line camelcase
|
|
831
903
|
request_credentials: 'required',
|
|
832
904
|
...extraParams
|
|
833
905
|
};
|
|
834
906
|
await this._checkBackendsStatusesIfEnabled();
|
|
835
|
-
await this.listeners.trigger(
|
|
907
|
+
await this.listeners.trigger('logout');
|
|
836
908
|
|
|
837
909
|
this._updateDomainUser(null);
|
|
838
910
|
|
|
839
|
-
await this._storage.wipeToken();
|
|
840
|
-
const authRequest = await this._requestBuilder.prepareAuthRequest(requestParams);
|
|
911
|
+
await ((_this$_storage13 = this._storage) === null || _this$_storage13 === void 0 ? void 0 : _this$_storage13.wipeToken());
|
|
912
|
+
const authRequest = await ((_this$_requestBuilder3 = this._requestBuilder) === null || _this$_requestBuilder3 === void 0 ? void 0 : _this$_requestBuilder3.prepareAuthRequest(requestParams));
|
|
841
913
|
|
|
842
|
-
|
|
914
|
+
if (authRequest != null) {
|
|
915
|
+
this._redirectCurrentPage(authRequest.url);
|
|
916
|
+
}
|
|
843
917
|
}
|
|
844
918
|
|
|
845
919
|
async _runEmbeddedLogin() {
|
|
846
|
-
|
|
920
|
+
var _this$_storage14;
|
|
921
|
+
|
|
922
|
+
(_this$_storage14 = this._storage) === null || _this$_storage14 === void 0 ? void 0 : _this$_storage14.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
847
923
|
|
|
848
924
|
try {
|
|
925
|
+
var _this$_embeddedFlow3;
|
|
926
|
+
|
|
849
927
|
this._isLoginWindowOpen = true;
|
|
850
|
-
return await this._embeddedFlow.authorize();
|
|
928
|
+
return await ((_this$_embeddedFlow3 = this._embeddedFlow) === null || _this$_embeddedFlow3 === void 0 ? void 0 : _this$_embeddedFlow3.authorize());
|
|
851
929
|
} catch (e) {
|
|
852
930
|
throw e;
|
|
853
931
|
} finally {
|
|
@@ -869,7 +947,9 @@ class Auth {
|
|
|
869
947
|
await this._checkBackendsStatusesIfEnabled();
|
|
870
948
|
|
|
871
949
|
try {
|
|
872
|
-
|
|
950
|
+
var _this$_backgroundFlow4;
|
|
951
|
+
|
|
952
|
+
const accessToken = await ((_this$_backgroundFlow4 = this._backgroundFlow) === null || _this$_backgroundFlow4 === void 0 ? void 0 : _this$_backgroundFlow4.authorize());
|
|
873
953
|
const user = await this.getUser(accessToken);
|
|
874
954
|
|
|
875
955
|
if (user.guest) {
|
|
@@ -901,6 +981,8 @@ class Auth {
|
|
|
901
981
|
|
|
902
982
|
|
|
903
983
|
async _checkForAuthResponse() {
|
|
984
|
+
var _this$_storage15;
|
|
985
|
+
|
|
904
986
|
// getAuthResponseURL may throw an exception
|
|
905
987
|
const authResponse = this._responseParser.getAuthResponseFromURL();
|
|
906
988
|
|
|
@@ -924,20 +1006,28 @@ class Auth {
|
|
|
924
1006
|
expiresIn,
|
|
925
1007
|
accessToken
|
|
926
1008
|
} = authResponse;
|
|
927
|
-
const newState = (await (stateId && this._storage.getState(stateId))) || {};
|
|
1009
|
+
const newState = (await (stateId && ((_this$_storage15 = this._storage) === null || _this$_storage15 === void 0 ? void 0 : _this$_storage15.getState(stateId)))) || {};
|
|
928
1010
|
const scopes = scope ? scope.split(' ') : newState.scopes || defaultScope || [];
|
|
929
1011
|
const effectiveExpiresIn = expiresIn ? parseInt(expiresIn, 10) : defaultExpiresIn;
|
|
930
1012
|
const expires = TokenValidator._epoch() + effectiveExpiresIn;
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1013
|
+
|
|
1014
|
+
if (accessToken != null) {
|
|
1015
|
+
var _this$_storage16;
|
|
1016
|
+
|
|
1017
|
+
await ((_this$_storage16 = this._storage) === null || _this$_storage16 === void 0 ? void 0 : _this$_storage16.saveToken({
|
|
1018
|
+
accessToken,
|
|
1019
|
+
scopes,
|
|
1020
|
+
expires,
|
|
1021
|
+
lifeTime: effectiveExpiresIn
|
|
1022
|
+
}));
|
|
1023
|
+
}
|
|
1024
|
+
|
|
937
1025
|
return newState;
|
|
938
1026
|
}
|
|
939
1027
|
|
|
940
1028
|
async _checkForStateRestoration() {
|
|
1029
|
+
var _this$_storage17;
|
|
1030
|
+
|
|
941
1031
|
const authResponse = this._responseParser._authResponse;
|
|
942
1032
|
|
|
943
1033
|
if (authResponse && this.config.cleanHash) {
|
|
@@ -945,7 +1035,7 @@ class Auth {
|
|
|
945
1035
|
}
|
|
946
1036
|
|
|
947
1037
|
const stateId = authResponse === null || authResponse === void 0 ? void 0 : authResponse.restoreAuthState;
|
|
948
|
-
return (await (stateId && this._storage.getState(stateId))) || {};
|
|
1038
|
+
return (await (stateId && ((_this$_storage17 = this._storage) === null || _this$_storage17 === void 0 ? void 0 : _this$_storage17.getState(stateId)))) || {};
|
|
949
1039
|
}
|
|
950
1040
|
|
|
951
1041
|
_checkBackendsAreUp() {
|
|
@@ -971,7 +1061,9 @@ class Auth {
|
|
|
971
1061
|
try {
|
|
972
1062
|
await this._checkBackendsAreUp();
|
|
973
1063
|
} catch (backendDownErr) {
|
|
974
|
-
|
|
1064
|
+
if (backendDownErr instanceof Error) {
|
|
1065
|
+
await this._showBackendDownDialog(backendDownErr);
|
|
1066
|
+
}
|
|
975
1067
|
}
|
|
976
1068
|
}
|
|
977
1069
|
/**
|
|
@@ -986,7 +1078,7 @@ class Auth {
|
|
|
986
1078
|
linkNode.rel = 'preconnect';
|
|
987
1079
|
linkNode.href = url;
|
|
988
1080
|
linkNode.pr = '1.0';
|
|
989
|
-
linkNode.
|
|
1081
|
+
linkNode.crossOrigin = 'use-credentials';
|
|
990
1082
|
document.head.appendChild(linkNode);
|
|
991
1083
|
}
|
|
992
1084
|
/**
|
|
@@ -997,7 +1089,9 @@ class Auth {
|
|
|
997
1089
|
|
|
998
1090
|
|
|
999
1091
|
_redirectCurrentPage(url) {
|
|
1000
|
-
|
|
1092
|
+
{
|
|
1093
|
+
window.location.href = fixUrl(url);
|
|
1094
|
+
}
|
|
1001
1095
|
}
|
|
1002
1096
|
/**
|
|
1003
1097
|
* Reloads current page
|
|
@@ -1025,7 +1119,7 @@ class Auth {
|
|
|
1025
1119
|
// in which case it's not obvious where redirect will lead.
|
|
1026
1120
|
const cleanedUrl = [window.location.pathname, window.location.search].join('');
|
|
1027
1121
|
const hashIfExist = hash ? `#${hash}` : '';
|
|
1028
|
-
history.replaceState(undefined,
|
|
1122
|
+
history.replaceState(undefined, '', `${cleanedUrl}${hashIfExist}`);
|
|
1029
1123
|
} else {
|
|
1030
1124
|
window.location.hash = hash;
|
|
1031
1125
|
}
|