react-dialogger 1.1.65 → 1.1.67
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.
- package/components/DialogActionBase.js +0 -26
- package/components/DialogBase.d.ts +0 -1
- package/components/DialogBase.js +4 -14
- package/components/DialogContent.js +5 -6
- package/components/DialogContentBody.js +0 -4
- package/components/RippleButton.js +6 -8
- package/models/DialogAction.js +2 -3
- package/package.json +1 -1
- package/styles/dialog.action.css +1 -0
|
@@ -96,45 +96,34 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
96
96
|
return _this._initialClickHandler;
|
|
97
97
|
};
|
|
98
98
|
_this.updateLabel = function (label) {
|
|
99
|
-
// this._options.label = label;
|
|
100
|
-
// this.forceUpdate();
|
|
101
99
|
_this.setState(function (prevStae) { return (__assign(__assign({}, prevStae), { options: __assign(__assign({}, prevStae.options), { label: label }) })); });
|
|
102
100
|
return _this;
|
|
103
101
|
};
|
|
104
102
|
/**
|
|
105
103
|
* @deprecated use Options*/
|
|
106
104
|
_this.updateVariant = function (variant) {
|
|
107
|
-
// this._options.variant = variant;
|
|
108
|
-
// this.forceUpdate();
|
|
109
105
|
_this.setState(function (prevStae) { return (__assign(__assign({}, prevStae), { options: __assign(__assign({}, prevStae.options), { variant: variant }) })); });
|
|
110
106
|
return _this;
|
|
111
107
|
};
|
|
112
108
|
/**
|
|
113
109
|
* @deprecated use Options*/
|
|
114
110
|
_this.getVariant = function () {
|
|
115
|
-
// return this._options.variant;
|
|
116
111
|
return _this.state.options.variant;
|
|
117
112
|
};
|
|
118
113
|
/**
|
|
119
114
|
* @deprecated use Options*/
|
|
120
115
|
_this.updateColor = function (color) {
|
|
121
|
-
// this._color = color;
|
|
122
|
-
// this._options.color = color;
|
|
123
|
-
// this.forceUpdate();
|
|
124
116
|
_this.setState(function (prevState) { return (__assign(__assign({}, prevState), { options: __assign(__assign({}, prevState.options), { color: color }) })); });
|
|
125
117
|
return _this;
|
|
126
118
|
};
|
|
127
119
|
/**
|
|
128
120
|
* @deprecated use Options*/
|
|
129
121
|
_this.getColor = function () {
|
|
130
|
-
// return this._options.color;
|
|
131
122
|
return _this.state.options.color;
|
|
132
123
|
};
|
|
133
124
|
/**
|
|
134
125
|
* @deprecated use Options*/
|
|
135
126
|
_this.setDisabled = function (disabled) {
|
|
136
|
-
// this._options.disabled = disabled;
|
|
137
|
-
// this.forceUpdate();
|
|
138
127
|
_this.setState(function (prevStae) { return (__assign(__assign({}, prevStae), { options: __assign(__assign({}, prevStae.options), { disabled: disabled }) })); });
|
|
139
128
|
return _this;
|
|
140
129
|
};
|
|
@@ -155,9 +144,6 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
155
144
|
return _this;
|
|
156
145
|
};
|
|
157
146
|
_this.setInProcess = function (inProcess) {
|
|
158
|
-
// this._inProcess = inProcess;
|
|
159
|
-
// this._options.disabled = inProcess;
|
|
160
|
-
// this.forceUpdate();
|
|
161
147
|
_this.setState(function (prevState) { return (__assign(__assign({}, prevState), { options: __assign(__assign({}, prevState.options), { disabled: inProcess }), inProcess: inProcess })); });
|
|
162
148
|
return _this;
|
|
163
149
|
};
|
|
@@ -173,20 +159,12 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
173
159
|
_this._rippleButtonRef.current.rippleEffect(_this._buttonRef, 19, 8);
|
|
174
160
|
_this._buttonRef.current.click();
|
|
175
161
|
};
|
|
176
|
-
// public onClickHandler = () => {
|
|
177
|
-
// return this._onClick;
|
|
178
|
-
// }
|
|
179
162
|
_this.render = function () {
|
|
180
|
-
console.log('Dialog_Action_Base_render', _this.state.options, _this._intent);
|
|
181
|
-
// // Set as default converted from action name prop
|
|
182
|
-
// const converted = this.props.name?.replace(/action/i, '') ?? this.props.name;
|
|
183
|
-
// this._options.label = (this.props.dialogBaseComponent?.dialogOptions?.localText?.[converted] ?? converted) ?? 'Button';
|
|
184
163
|
return (0, jsx_runtime_1.jsx)(_components_1.RippleButton, { ref: _this._buttonRef, innerRef: _this._rippleButtonRef,
|
|
185
164
|
// Intent Based
|
|
186
165
|
variant: _this.state.options.variant,
|
|
187
166
|
// Intent Based
|
|
188
167
|
color: _this.state.options.color, disabled: _this.state.options.disabled, onClick: function (e) {
|
|
189
|
-
// if(this.state.options.disabled || this.isInProcess() ) return;
|
|
190
168
|
if (_this.state.options.disabled || _this.state.inProcess)
|
|
191
169
|
return;
|
|
192
170
|
// @ts-ignore
|
|
@@ -256,15 +234,12 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
256
234
|
Object.defineProperty(DialogActionBase.prototype, "baseDialogAction", {
|
|
257
235
|
get: function () {
|
|
258
236
|
return this._baseDialogAction;
|
|
259
|
-
// return this;
|
|
260
237
|
},
|
|
261
238
|
enumerable: false,
|
|
262
239
|
configurable: true
|
|
263
240
|
});
|
|
264
241
|
DialogActionBase.prototype.updateOptions = function (options) {
|
|
265
242
|
this.setState(function (prevState) { return (__assign(__assign({}, prevState), { options: __assign(__assign({}, prevState.options), options) })); });
|
|
266
|
-
// this._options = {...this._options, ...options};
|
|
267
|
-
// this.forceUpdate();
|
|
268
243
|
return this;
|
|
269
244
|
};
|
|
270
245
|
/**
|
|
@@ -277,7 +252,6 @@ var DialogActionBase = /** @class */ (function (_super) {
|
|
|
277
252
|
};
|
|
278
253
|
Object.defineProperty(DialogActionBase.prototype, "options", {
|
|
279
254
|
get: function () {
|
|
280
|
-
// return this._options;
|
|
281
255
|
return this.state.options;
|
|
282
256
|
},
|
|
283
257
|
enumerable: false,
|
package/components/DialogBase.js
CHANGED
|
@@ -61,7 +61,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
62
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
63
63
|
var react_1 = require("react");
|
|
64
|
-
var formik_1 = require("formik");
|
|
65
64
|
var React = __importStar(require("react"));
|
|
66
65
|
var lodash_1 = require("lodash");
|
|
67
66
|
var _components_1 = require("./index.js");
|
|
@@ -164,18 +163,6 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
164
163
|
_this.getDom = function () {
|
|
165
164
|
return _this.props.dom;
|
|
166
165
|
};
|
|
167
|
-
_this.Body = function (_a) {
|
|
168
|
-
var body = _a.body;
|
|
169
|
-
var formikProps = (0, formik_1.useFormik)({
|
|
170
|
-
initialValues: {},
|
|
171
|
-
onSubmit: function (values, formikHelpers) { }
|
|
172
|
-
});
|
|
173
|
-
console.log('Body_formikProps', formikProps);
|
|
174
|
-
if (body instanceof Function) {
|
|
175
|
-
return (0, jsx_runtime_1.jsxs)("div", { ref: _this._dialogBodyRef, className: 'dialog-body', style: { height: '100%' }, children: ["N", body(_this)] });
|
|
176
|
-
}
|
|
177
|
-
return (0, jsx_runtime_1.jsx)("div", { className: 'dialog-body', style: { height: '100%', padding: 10 }, children: body });
|
|
178
|
-
};
|
|
179
166
|
_this.render = function () {
|
|
180
167
|
console.log('this._prevDialogRect', _this.state.prevDialogRect);
|
|
181
168
|
return (0, jsx_runtime_1.jsx)(_context_1.DialogContentContextProvider
|
|
@@ -358,6 +345,7 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
358
345
|
};
|
|
359
346
|
// ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
|
|
360
347
|
DialogBase.prototype.componentDidMount = function () {
|
|
348
|
+
var _this = this;
|
|
361
349
|
var _a, _b, _c;
|
|
362
350
|
// First position take from Global
|
|
363
351
|
var _d = this._dialogOptions.snackbar.anchorOrigin, vertical = _d.vertical, horizontal = _d.horizontal;
|
|
@@ -365,7 +353,9 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
365
353
|
// Merge user defied positions with global positions!
|
|
366
354
|
this._snackbarAnchor = __assign(__assign(__assign({}, initialAnchor), (((_a = this.props.snackbarAnchor) === null || _a === void 0 ? void 0 : _a.vertical) ? { vertical: this.props.snackbarAnchor.vertical } : {})), (((_b = this.props.snackbarAnchor) === null || _b === void 0 ? void 0 : _b.horizontal) ? { horizontal: this.props.snackbarAnchor.horizontal } : {}));
|
|
367
355
|
if (typeof ((_c = this.props) === null || _c === void 0 ? void 0 : _c.didMountCallback) === "function") {
|
|
368
|
-
|
|
356
|
+
setTimeout(function () {
|
|
357
|
+
_this.props.didMountCallback(_this);
|
|
358
|
+
}, this.dialogOptions.animate === "jumper" ? 300 : 100);
|
|
369
359
|
}
|
|
370
360
|
// accessFrom Property of Parent object Internal->External
|
|
371
361
|
this.accessFrom = "internal";
|
|
@@ -62,13 +62,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
62
62
|
exports.DialogContent = void 0;
|
|
63
63
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
64
64
|
var react_draggable_1 = __importDefault(require("react-draggable"));
|
|
65
|
-
var
|
|
65
|
+
var _helpers_1 = require("../helpers/index.js");
|
|
66
66
|
var React = __importStar(require("react"));
|
|
67
67
|
var _icons_1 = require("../icons/index.js");
|
|
68
68
|
var notistack_1 = require("notistack");
|
|
69
69
|
var _1 = require("./");
|
|
70
70
|
var react_1 = require("react");
|
|
71
|
-
var _helpers_1 = require("../helpers/index.js");
|
|
72
71
|
var jumper_animate_1 = require("../utils/effects/jumper-animate");
|
|
73
72
|
var _context_1 = require("../context/index.js");
|
|
74
73
|
var DialogContent = function (props) {
|
|
@@ -79,7 +78,7 @@ var DialogContent = function (props) {
|
|
|
79
78
|
var baseOptions = dialogOptions.base;
|
|
80
79
|
var _g = React.useState(false), fullscreenMode = _g[0], setFullscreenMode = _g[1];
|
|
81
80
|
var _h = React.useState(null), rect = _h[0], setRect = _h[1];
|
|
82
|
-
var bounds = ((_a = dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.memoBounds) ? (0,
|
|
81
|
+
var bounds = ((_a = dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.memoBounds) ? (0, _helpers_1.getDialogBounds)(dialog.dialogOptions.base.id) : null;
|
|
83
82
|
var domZIndex = window.getComputedStyle(dialog.getDom()).zIndex;
|
|
84
83
|
var positionSelector = function () {
|
|
85
84
|
var _a;
|
|
@@ -130,13 +129,13 @@ var DialogContent = function (props) {
|
|
|
130
129
|
setTimeout(function () {
|
|
131
130
|
var _a, _b;
|
|
132
131
|
if ((_a = dialog.dialogOptions.base) === null || _a === void 0 ? void 0 : _a.memoBounds) {
|
|
133
|
-
if (!
|
|
132
|
+
if (!_helpers_1.InitDialogMemoizeBoundsDeclared) {
|
|
134
133
|
throw new Error('InitDialogMemoizeBounds is not defined. Please make sure to declare it only once, at the top‑level of your module—outside of App or its render logic.\n' +
|
|
135
134
|
'InitDialogMemoizeBounds()\n' +
|
|
136
135
|
'const App() => {...');
|
|
137
136
|
}
|
|
138
137
|
var _c = (_b = dialogRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect(), width = _c.width, height = _c.height, x = _c.x, y = _c.y;
|
|
139
|
-
(0,
|
|
138
|
+
(0, _helpers_1.dialogRegister)(dialog.dialogOptions.base.id, {
|
|
140
139
|
width: width,
|
|
141
140
|
height: height,
|
|
142
141
|
x: x,
|
|
@@ -155,7 +154,7 @@ var DialogContent = function (props) {
|
|
|
155
154
|
event.preventDefault();
|
|
156
155
|
var _c = (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(), width = _c.width, height = _c.height, x = _c.x, y = _c.y;
|
|
157
156
|
console.log('onDragStop', 'fired', (_b = dialogRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect());
|
|
158
|
-
(0,
|
|
157
|
+
(0, _helpers_1.setDialogBounds)(dialogOptions.base.id, {
|
|
159
158
|
width: width,
|
|
160
159
|
height: height,
|
|
161
160
|
x: x,
|
|
@@ -51,12 +51,8 @@ var Placeholder = function (_a) {
|
|
|
51
51
|
}, children: placeholder });
|
|
52
52
|
};
|
|
53
53
|
var DialogContentBody = React.forwardRef(function (_a, ref) {
|
|
54
|
-
// const [localBody, setLocalBody] = React.useState(null);
|
|
55
54
|
var body = _a.body;
|
|
56
55
|
var dialog = (0, react_1.useContext)(_context_1.DialogContentContext).dialog;
|
|
57
|
-
// useEffect(() => {
|
|
58
|
-
// setLocalBody(body(dialog));
|
|
59
|
-
// }, [body]);
|
|
60
56
|
if (body instanceof Function) {
|
|
61
57
|
return (0, jsx_runtime_1.jsxs)("div", { className: 'dialog-body', style: { height: '100%' }, children: [dialog.holder && (0, jsx_runtime_1.jsx)(Placeholder, { dialogOptions: dialog.dialogOptions, placeholder: dialog.holder }), body(dialog)] });
|
|
62
58
|
}
|
|
@@ -52,7 +52,6 @@ exports.default = React.forwardRef(function (_a, ref) {
|
|
|
52
52
|
var variant = _a.variant, color = _a.color, children = _a.children, disabled = _a.disabled, onClick = _a.onClick, style = _a.style, baseStyle = _a.baseStyle, innerRef = _a.innerRef, fontFamily = _a.fontFamily;
|
|
53
53
|
var _b = React.useState({ x: -1, y: -1 }), coords = _b[0], setCoords = _b[1];
|
|
54
54
|
var _c = React.useState(false), isRippling = _c[0], setIsRippling = _c[1];
|
|
55
|
-
// const buttonRef = React.useRef<HTMLButtonElement>(null)
|
|
56
55
|
React.useEffect(function () {
|
|
57
56
|
if (coords.x !== -1 && coords.y !== -1) {
|
|
58
57
|
setIsRippling(true);
|
|
@@ -88,12 +87,11 @@ exports.default = React.forwardRef(function (_a, ref) {
|
|
|
88
87
|
hexedColor = (0, Colorify_1.colorNameToHex)(hexedColor);
|
|
89
88
|
}
|
|
90
89
|
exclusive = (0, Colorify_1.getButtonColors)(hexedColor);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
console.log('Button_exclusive', exclusive, hexedColor);
|
|
90
|
+
console.log('Button_variant', variant);
|
|
91
|
+
if (variant === 'text') {
|
|
92
|
+
exclusive.backgroundColor = 'inherit';
|
|
93
|
+
exclusive.color = color; // exclusive.backgroundColor;
|
|
94
|
+
}
|
|
97
95
|
}
|
|
98
96
|
else {
|
|
99
97
|
exclusive = null;
|
|
@@ -105,5 +103,5 @@ exports.default = React.forwardRef(function (_a, ref) {
|
|
|
105
103
|
setTimeout(function () {
|
|
106
104
|
onClick && onClick(e);
|
|
107
105
|
}, 200);
|
|
108
|
-
}, style: __assign(__assign(__assign(__assign(__assign({}, baseStyle), style), { fontFamily: fontFamily }),
|
|
106
|
+
}, style: __assign(__assign(__assign(__assign(__assign({}, baseStyle), style), exclusive), { fontFamily: fontFamily }), variant === 'text' ? { border: "none" } : null), children: [isRippling && (0, jsx_runtime_1.jsx)("span", { className: "ripple", style: { left: coords.x, top: coords.y } }), (0, jsx_runtime_1.jsx)("span", { className: "content", children: children(ref.current) })] }));
|
|
109
107
|
});
|
package/models/DialogAction.js
CHANGED
|
@@ -18,7 +18,6 @@ var ActionProgress = function () {
|
|
|
18
18
|
return (0, jsx_runtime_1.jsx)(_components_1.CircularProgress, { size: 20, inProcess: { inProcess: true } });
|
|
19
19
|
};
|
|
20
20
|
exports.ActionProgress = ActionProgress;
|
|
21
|
-
// class DialogAction extends DialogActionBase {
|
|
22
21
|
var DialogAction = /** @class */ (function () {
|
|
23
22
|
function DialogAction(name, options) {
|
|
24
23
|
var _this = this;
|
|
@@ -49,7 +48,7 @@ var DialogAction = /** @class */ (function () {
|
|
|
49
48
|
this._name = name;
|
|
50
49
|
var defaultOptions = {
|
|
51
50
|
label: null,
|
|
52
|
-
variant: '
|
|
51
|
+
variant: 'text',
|
|
53
52
|
color: 'default',
|
|
54
53
|
disabled: false,
|
|
55
54
|
prevDisabled: false
|
|
@@ -65,7 +64,7 @@ var DialogAction = /** @class */ (function () {
|
|
|
65
64
|
configurable: true
|
|
66
65
|
});
|
|
67
66
|
DialogAction.prototype.setIntent = function (intent) {
|
|
68
|
-
this._intent = intent;
|
|
67
|
+
this._intent = intent;
|
|
69
68
|
return this;
|
|
70
69
|
};
|
|
71
70
|
DialogAction.prototype.intent = function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dialogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.67",
|
|
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",
|