react-dialogger 1.1.59 → 1.1.60

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.
@@ -20,6 +20,7 @@ var Actions = function (_a) {
20
20
  return (0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', display: 'flex', flexDirection: 'row', columnGap: 10, alignItems: 'center' }, children: actions.map(function (action, index) {
21
21
  console.log('Actions_action', __assign(__assign({}, action.options), action.getIntent()));
22
22
  var referencedAction = dialog.initializeActionRef(action.name);
23
+ action._actionComponent = referencedAction;
23
24
  return (0, jsx_runtime_1.jsx)(_components_1.DialogActionBase, { name: action.name, ref: referencedAction, dialogBaseComponent: dialog,
24
25
  //onClick={ action.onClickHandler() }
25
26
  onClick: action._onCLick,
@@ -245,7 +245,7 @@ var DialogActionBase = /** @class */ (function (_super) {
245
245
  configurable: true
246
246
  });
247
247
  DialogActionBase.prototype.updateOptions = function (options) {
248
- this.setState(function (prevState) { return (__assign(__assign({}, prevState), { options: options })); });
248
+ this.setState(function (prevState) { return (__assign(__assign({}, prevState), { options: __assign(__assign({}, prevState.options), options) })); });
249
249
  // this._options = {...this._options, ...options};
250
250
  // this.forceUpdate();
251
251
  return this;
@@ -1,4 +1,6 @@
1
1
  import type { TDialogStateListenerForActionCallbackType, DialogActionOptionsType, DialogActionType, ActionIntentType, ActionIntent } from "../types/index.js";
2
+ import { DialogActionBase } from "../components/index.js";
3
+ import { RefObject } from "react";
2
4
  declare const ActionProgress: () => import("react/jsx-runtime").JSX.Element;
3
5
  export { ActionProgress };
4
6
  export declare const ACTION_INTENTS: {
@@ -21,10 +23,13 @@ declare class DialogAction {
21
23
  private _intent;
22
24
  _onCLick: DialogActionType;
23
25
  _stateListener: TDialogStateListenerForActionCallbackType;
26
+ _actionComponent: RefObject<DialogActionBase>;
24
27
  constructor(name: string, options?: DialogActionOptionsType);
25
28
  get name(): string;
26
29
  setIntent(intent: ActionIntentType): this;
27
30
  getIntent(): ActionIntent;
31
+ setInProcess: (inProcess: boolean) => this;
32
+ setDisabled: (disabled: boolean) => this;
28
33
  setOptions: (options: DialogActionOptionsType) => this;
29
34
  get options(): DialogActionOptionsType;
30
35
  onClick: (callback: DialogActionType) => this;
@@ -36,6 +36,14 @@ exports.ACTION_INTENTS = {
36
36
  var DialogAction = /** @class */ (function () {
37
37
  function DialogAction(name, options) {
38
38
  var _this = this;
39
+ this.setInProcess = function (inProcess) {
40
+ _this._actionComponent.current.setInProcess(inProcess);
41
+ return _this;
42
+ };
43
+ this.setDisabled = function (disabled) {
44
+ _this._actionComponent.current.setDisabled(disabled);
45
+ return _this;
46
+ };
39
47
  this.setOptions = function (options) {
40
48
  _this._options = options;
41
49
  return _this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.59",
3
+ "version": "1.1.60",
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",