mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 08:50:24 +08:00
17c92b4b2a
This commit adds a new option `@modalForMobile` for `<DMenu />` which allows to display a `<DModal />` when expanding a menu on mobile. This commit also adds a `@views` options to toasts which is an array accepting `['mobile', 'desktop']` and will control if the toast is show on desktop and/or mobile. Finally this commit allows to hide the progressBar even if the toast is set to `@autoClose=true`. This is controlled through the `@showProgressBar` option.
87 lines
1.7 KiB
JavaScript
87 lines
1.7 KiB
JavaScript
export const FLOAT_UI_PLACEMENTS = [
|
|
"top",
|
|
"top-start",
|
|
"top-end",
|
|
"right",
|
|
"right-start",
|
|
"right-end",
|
|
"bottom",
|
|
"bottom-start",
|
|
"bottom-end",
|
|
"left",
|
|
"left-start",
|
|
"left-end",
|
|
];
|
|
|
|
export const TOOLTIP = {
|
|
options: {
|
|
animated: true,
|
|
arrow: true,
|
|
beforeTrigger: null,
|
|
closeOnClickOutside: true,
|
|
closeOnEscape: true,
|
|
closeOnScroll: true,
|
|
component: null,
|
|
content: null,
|
|
identifier: null,
|
|
interactive: false,
|
|
listeners: false,
|
|
maxWidth: 350,
|
|
data: null,
|
|
offset: 10,
|
|
triggers: ["hover", "click"],
|
|
untriggers: ["hover", "click"],
|
|
placement: "top",
|
|
fallbackPlacements: FLOAT_UI_PLACEMENTS,
|
|
autoUpdate: true,
|
|
trapTab: true,
|
|
onClose: null,
|
|
onShow: null,
|
|
onRegisterApi: null,
|
|
},
|
|
portalOutletId: "d-tooltip-portal-outlet",
|
|
};
|
|
|
|
export const MENU = {
|
|
options: {
|
|
animated: true,
|
|
arrow: false,
|
|
beforeTrigger: null,
|
|
closeOnEscape: true,
|
|
closeOnClickOutside: true,
|
|
closeOnScroll: false,
|
|
component: null,
|
|
content: null,
|
|
identifier: null,
|
|
interactive: true,
|
|
listeners: false,
|
|
maxWidth: 400,
|
|
data: null,
|
|
offset: 10,
|
|
triggers: ["click"],
|
|
untriggers: ["click"],
|
|
placement: "bottom",
|
|
fallbackPlacements: FLOAT_UI_PLACEMENTS,
|
|
autoUpdate: true,
|
|
trapTab: true,
|
|
extraClassName: null,
|
|
onClose: null,
|
|
onShow: null,
|
|
onRegisterApi: null,
|
|
modalForMobile: false,
|
|
},
|
|
portalOutletId: "d-menu-portal-outlet",
|
|
};
|
|
|
|
import DDefaultToast from "float-kit/components/d-default-toast";
|
|
|
|
export const TOAST = {
|
|
options: {
|
|
autoClose: true,
|
|
duration: 3000,
|
|
component: DDefaultToast,
|
|
showProgressBar: true,
|
|
views: ["desktop", "mobile"],
|
|
},
|
|
};
|