devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
79 lines (78 loc) • 2.54 kB
JavaScript
/**
* DevExtreme (esm/__internal/ui/form/form.load_panel.js)
* Version: 25.2.7
* Build date: Tue May 05 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import $ from "../../../core/renderer";
import {
FORM_LOAD_PANEL_CLASS,
FORM_LOAD_PANEL_WRAPPER_CLASS
} from "../../ui/form/constants";
import {
AnimationType
} from "../../ui/load_indicator";
export const FORM_LOAD_INDICATOR_SIZE = 120;
export class FormLoadPanel {
constructor(dependencies) {
this._dependencies = dependencies
}
show() {
var _this$_loadPanel;
this._ensureLoadPanel();
null === (_this$_loadPanel = this._loadPanel) || void 0 === _this$_loadPanel || _this$_loadPanel.show()
}
hide() {
var _this$_loadPanel2;
null === (_this$_loadPanel2 = this._loadPanel) || void 0 === _this$_loadPanel2 || _this$_loadPanel2.hide()
}
dispose() {
if (!this._loadPanel) {
return
}
this._loadPanel.dispose();
this._loadPanel.$element().remove();
this._loadPanel = void 0
}
get instance() {
return this._loadPanel
}
option(name) {
var _this$_loadPanel3;
return null === (_this$_loadPanel3 = this._loadPanel) || void 0 === _this$_loadPanel3 ? void 0 : _this$_loadPanel3.option(name)
}
_ensureLoadPanel() {
if (this._loadPanel) {
return
}
const $loadPanel = $("<div>").addClass(FORM_LOAD_PANEL_CLASS).appendTo(this._dependencies.$container);
this._loadPanel = this._dependencies.onLoadPanelCreate($loadPanel, {
width: 120,
height: 120,
maxHeight: void 0,
maxWidth: void 0,
position: {
of: this._dependencies.$container.get(0)
},
visible: false,
showIndicator: true,
indicatorOptions: {
animationType: AnimationType.Sparkle,
width: 120,
height: 120
},
showPane: false,
shading: false,
hideOnOutsideClick: false,
hideOnParentScroll: false,
deferRendering: false,
disabled: false,
message: "",
wrapperAttr: {
class: FORM_LOAD_PANEL_WRAPPER_CLASS
}
})
}
}