jsl-ui 9.0.2 → 9.3.2

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.
@@ -18,6 +18,7 @@ export interface IMoveableOptions {
18
18
  selector?: string;
19
19
  handleSelector?: string;
20
20
  direction?: "x" | "y" | "both";
21
+ containInParent?: boolean;
21
22
  }
22
23
  export declare class MoveableContainer {
23
24
  private container;
@@ -17,7 +17,8 @@ var defaultOptions = {
17
17
  onStop: new EventHandler(),
18
18
  onMove: new EventHandler(),
19
19
  direction: "both",
20
- moveDelta: 0
20
+ moveDelta: 0,
21
+ containInParent: true
21
22
  };
22
23
  var MoveableContainer = /** @class */ (function () {
23
24
  function MoveableContainer(container, options) {
@@ -79,12 +80,14 @@ var MoveableContainer = /** @class */ (function () {
79
80
  if (_this.options.gridX) {
80
81
  x = Math.round(x / _this.options.gridX) * _this.options.gridX;
81
82
  }
82
- if (x < 0) {
83
- x = 0;
84
- }
85
- var maxX = _this.container.clientWidth - _this.element.offsetWidth;
86
- if (x > maxX) {
87
- x = maxX;
83
+ if (_this.options.containInParent) {
84
+ if (x < 0) {
85
+ x = 0;
86
+ }
87
+ var maxX = _this.container.clientWidth - _this.element.offsetWidth;
88
+ if (x > maxX) {
89
+ x = maxX;
90
+ }
88
91
  }
89
92
  _this.element.style.left = x + "px";
90
93
  raiseEvt = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsl-ui",
3
- "version": "9.0.2",
3
+ "version": "9.3.2",
4
4
  "description": "javascript UI library",
5
5
  "main": "lib/index.js",
6
6
  "files": [