z_index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * DevExtreme (ui/overlay/z_index.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", {
  11. value: true
  12. });
  13. exports.clearStack = exports.remove = exports.create = exports.base = void 0;
  14. var _common = require("../../core/utils/common");
  15. var baseZIndex = 1500;
  16. var zIndexStack = [];
  17. var base = exports.base = function(ZIndex) {
  18. baseZIndex = (0, _common.ensureDefined)(ZIndex, baseZIndex);
  19. return baseZIndex
  20. };
  21. var create = exports.create = function() {
  22. var baseIndex = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : baseZIndex;
  23. var length = zIndexStack.length;
  24. var index = (length ? zIndexStack[length - 1] : baseIndex) + 1;
  25. zIndexStack.push(index);
  26. return index
  27. };
  28. var remove = exports.remove = function(zIndex) {
  29. var position = zIndexStack.indexOf(zIndex);
  30. if (position >= 0) {
  31. zIndexStack.splice(position, 1)
  32. }
  33. };
  34. var clearStack = exports.clearStack = function() {
  35. zIndexStack = []
  36. };