react-dialogger 1.1.137 → 1.1.139

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.
@@ -187,12 +187,12 @@ var DialogContent = function (props) {
187
187
  }, id: "dialog-main", ref: dialogRef, onClick: function (e) {
188
188
  e.stopPropagation();
189
189
  if (dialog.dialogOptions.backdrop.throughable) {
190
- var toppest = dialog.props.zFinder();
190
+ var toppest = dialog.props.zFinder(true);
191
191
  var dom = dialog.getDom();
192
192
  console.log('toppest', parseInt(dom.style.zIndex), toppest);
193
193
  if (dom) {
194
194
  if (parseInt(dom.style.zIndex) < toppest) {
195
- dom.style.zIndex = String(dialog.props.zFinder() + 1);
195
+ dom.style.zIndex = String(dialog.props.zFinder(true) + 1);
196
196
  }
197
197
  }
198
198
  }
package/models/Dialog.js CHANGED
@@ -68,14 +68,48 @@ var Dialog = /** @class */ (function () {
68
68
  * UI / Dialog / Form bağlamında alışıldık
69
69
  * */
70
70
  this._headerRef = React.createRef();
71
- this.highestZ = function () {
72
- var _a, _b;
71
+ // private highestZ = (throughableOnly: boolean = false): number => {
72
+ //
73
+ // if(this._dialogOptions?.zIndex) {
74
+ // return this._dialogOptions?.zIndex;
75
+ // }
76
+ // // const presentationElements = document.querySelectorAll(`div[data-family="presentation"]${throughableOnly ? ' > div.dialogger-throughable' : ''}`)
77
+ // const presentationElements = document.querySelectorAll(`div[data-family="presentation"]`)
78
+ // let highest = 1201;
79
+ // presentationElements.forEach(element => {
80
+ // if(throughableOnly){
81
+ // const firstDiv = element.querySelector('div:first-child');
82
+ // if (firstDiv?.classList.contains('dialogger-throughable')) {
83
+ // // ✅ İlk div dialogger-throughable class'ına sahip
84
+ // const z = parseInt(window.getComputedStyle(element).zIndex, 10);
85
+ // if (!isNaN(z) && z > highest) {
86
+ // highest = z;
87
+ // }
88
+ // }
89
+ // } else {
90
+ // const z = parseInt(window.getComputedStyle(element).zIndex, 10);
91
+ // if (!isNaN(z) && z > highest) {
92
+ // highest = z;
93
+ // }
94
+ // }
95
+ // });
96
+ // return highest;
97
+ // }
98
+ this.highestZ = function (throughableOnly) {
99
+ var _a;
100
+ if (throughableOnly === void 0) { throughableOnly = false; }
73
101
  if ((_a = _this._dialogOptions) === null || _a === void 0 ? void 0 : _a.zIndex) {
74
- return (_b = _this._dialogOptions) === null || _b === void 0 ? void 0 : _b.zIndex;
102
+ return _this._dialogOptions.zIndex;
75
103
  }
76
104
  var presentationElements = document.querySelectorAll('div[data-family="presentation"]');
77
105
  var highest = 1201;
78
106
  presentationElements.forEach(function (element) {
107
+ // throughableOnly → sadece ilk child'ı dialogger-throughable olan presentation'lar
108
+ if (throughableOnly) {
109
+ var firstDiv = element.querySelector('div:first-child');
110
+ if (!(firstDiv === null || firstDiv === void 0 ? void 0 : firstDiv.classList.contains('dialogger-throughable')))
111
+ return;
112
+ }
79
113
  var z = parseInt(window.getComputedStyle(element).zIndex, 10);
80
114
  if (!isNaN(z) && z > highest) {
81
115
  highest = z;
@@ -90,6 +124,10 @@ var Dialog = /** @class */ (function () {
90
124
  dom.setAttribute('data-type', 'dialog');
91
125
  dom.setAttribute('data-family', 'presentation');
92
126
  dom.classList.add('react-guzzle-root');
127
+ // if(Boolean(this._dialogOptions?.backdrop?.throughable) && this._dialogOptions?.backdrop?.throughable){
128
+ // dom.classList.add('throughable');
129
+ // }
130
+ dom.classList.add('react-guzzle-root');
93
131
  dom.style.setProperty('z-index', String(_this.highestZ() + 1));
94
132
  // Find root element
95
133
  var rootElement = document.getElementById('root');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.137",
3
+ "version": "1.1.139",
4
4
  "description": "This package is a continuation of the react-araci package. Due to an error, react-araci was removed, and it has been decided to continue under the new package name react-dialogger",
5
5
  "main": "index.js",
6
6
  "author": "Sueleyman Topaloglu",
@@ -52,7 +52,7 @@ export interface BaseDialogProps<V extends Record<string, any>, I> {
52
52
  resizeListener?: (size: IDialogSize, dialog: IDialogApiDef<V, I>) => void;
53
53
  processingListeners?: Array<(inProcess: boolean, message: string) => void>;
54
54
  abortedListeners?: Array<(dialog: IDialogApiDef<V, I>) => void>;
55
- zFinder: () => number;
55
+ zFinder: (throughableOnly: boolean) => number;
56
56
  }
57
57
  export interface DialogContentBodyReturnType {
58
58
  setProcessing: React.Dispatch<React.SetStateAction<InProcessType>>;