akeyless-client-commons 1.0.203 → 1.0.204
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/dist/components/index.d.mts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +7 -2
- package/dist/components/index.mjs +7 -2
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/index.mjs +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ComponentProps, ReactNode, Dispatch, SetStateAction, MouseEvent, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import React__default, { ComponentProps, ReactNode, Dispatch, SetStateAction, MouseEvent as MouseEvent$1, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';
|
|
4
4
|
import { NxUser, TObject, Geo } from 'akeyless-types-commons';
|
|
5
5
|
import { Command as Command$1 } from 'cmdk';
|
|
6
6
|
import * as RPNInput from 'react-phone-number-input';
|
|
@@ -311,7 +311,7 @@ interface TextAreaContainerProps extends Partial<TextAreaElement> {
|
|
|
311
311
|
}
|
|
312
312
|
type FormElement = InputElement | SelectElement | MultiSelectProps | InternationalInputProps | CustomElementProps | TextAreaElement | SelectWithSearchProps | FormSeparatorProps | CheckboxContainerProps;
|
|
313
313
|
interface ModularFormProps {
|
|
314
|
-
submitFunction: (form: React.FormEvent<HTMLFormElement
|
|
314
|
+
submitFunction: (form: React.FormEvent<HTMLFormElement>, clickEvent?: MouseEvent) => Promise<void>;
|
|
315
315
|
elements: FormElement[];
|
|
316
316
|
buttonContent: React.ReactNode;
|
|
317
317
|
headerContent?: React.ReactNode;
|
|
@@ -364,7 +364,7 @@ interface GoogleSvgProps {
|
|
|
364
364
|
height?: string;
|
|
365
365
|
viewBox?: string;
|
|
366
366
|
}
|
|
367
|
-
type LoginWithGoogleCallback = (e: MouseEvent<HTMLButtonElement>, user: NxUser, token: string, userPermissions: TObject<TObject<boolean>>) => Promise<void>;
|
|
367
|
+
type LoginWithGoogleCallback = (e: MouseEvent$1<HTMLButtonElement>, user: NxUser, token: string, userPermissions: TObject<TObject<boolean>>) => Promise<void>;
|
|
368
368
|
interface LoginWithGoogleButtonProps {
|
|
369
369
|
label: string;
|
|
370
370
|
onClick: LoginWithGoogleCallback;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ComponentProps, ReactNode, Dispatch, SetStateAction, MouseEvent, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import React__default, { ComponentProps, ReactNode, Dispatch, SetStateAction, MouseEvent as MouseEvent$1, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';
|
|
4
4
|
import { NxUser, TObject, Geo } from 'akeyless-types-commons';
|
|
5
5
|
import { Command as Command$1 } from 'cmdk';
|
|
6
6
|
import * as RPNInput from 'react-phone-number-input';
|
|
@@ -311,7 +311,7 @@ interface TextAreaContainerProps extends Partial<TextAreaElement> {
|
|
|
311
311
|
}
|
|
312
312
|
type FormElement = InputElement | SelectElement | MultiSelectProps | InternationalInputProps | CustomElementProps | TextAreaElement | SelectWithSearchProps | FormSeparatorProps | CheckboxContainerProps;
|
|
313
313
|
interface ModularFormProps {
|
|
314
|
-
submitFunction: (form: React.FormEvent<HTMLFormElement
|
|
314
|
+
submitFunction: (form: React.FormEvent<HTMLFormElement>, clickEvent?: MouseEvent) => Promise<void>;
|
|
315
315
|
elements: FormElement[];
|
|
316
316
|
buttonContent: React.ReactNode;
|
|
317
317
|
headerContent?: React.ReactNode;
|
|
@@ -364,7 +364,7 @@ interface GoogleSvgProps {
|
|
|
364
364
|
height?: string;
|
|
365
365
|
viewBox?: string;
|
|
366
366
|
}
|
|
367
|
-
type LoginWithGoogleCallback = (e: MouseEvent<HTMLButtonElement>, user: NxUser, token: string, userPermissions: TObject<TObject<boolean>>) => Promise<void>;
|
|
367
|
+
type LoginWithGoogleCallback = (e: MouseEvent$1<HTMLButtonElement>, user: NxUser, token: string, userPermissions: TObject<TObject<boolean>>) => Promise<void>;
|
|
368
368
|
interface LoginWithGoogleButtonProps {
|
|
369
369
|
label: string;
|
|
370
370
|
onClick: LoginWithGoogleCallback;
|
package/dist/components/index.js
CHANGED
|
@@ -6211,6 +6211,7 @@ var ModularForm = function(param) {
|
|
|
6211
6211
|
var _ref = _sliced_to_array((0, import_react16.useState)(""), 2), errorMsg = _ref[0], setErrorMsg = _ref[1];
|
|
6212
6212
|
var _ref1 = _sliced_to_array((0, import_react16.useState)(false), 2), isLoading = _ref1[0], setIsLoading = _ref1[1];
|
|
6213
6213
|
var formRef = (0, import_react16.useRef)(null);
|
|
6214
|
+
var submitClickEventRef = (0, import_react16.useRef)(null);
|
|
6214
6215
|
useDeepCompareEffect(function() {
|
|
6215
6216
|
if (formRef.current && autoFixLabelsWidth) {
|
|
6216
6217
|
var labels = formRef.current.getElementsByClassName("form-label");
|
|
@@ -6233,7 +6234,7 @@ var ModularForm = function(param) {
|
|
|
6233
6234
|
}, []);
|
|
6234
6235
|
var onSubmit = /*#__PURE__*/ function() {
|
|
6235
6236
|
var _ref = _async_to_generator(function(e) {
|
|
6236
|
-
var form, err;
|
|
6237
|
+
var clickEvent, form, err;
|
|
6237
6238
|
return _ts_generator(this, function(_state) {
|
|
6238
6239
|
switch(_state.label){
|
|
6239
6240
|
case 0:
|
|
@@ -6248,6 +6249,7 @@ var ModularForm = function(param) {
|
|
|
6248
6249
|
,
|
|
6249
6250
|
4
|
|
6250
6251
|
]);
|
|
6252
|
+
clickEvent = submitClickEventRef.current;
|
|
6251
6253
|
form = e.currentTarget;
|
|
6252
6254
|
elements.forEach(function(element) {
|
|
6253
6255
|
var hasMinLengthType = function(element2) {
|
|
@@ -6266,7 +6268,7 @@ var ModularForm = function(param) {
|
|
|
6266
6268
|
});
|
|
6267
6269
|
return [
|
|
6268
6270
|
4,
|
|
6269
|
-
submitFunction(e)
|
|
6271
|
+
submitFunction(e, clickEvent)
|
|
6270
6272
|
];
|
|
6271
6273
|
case 2:
|
|
6272
6274
|
_state.sent();
|
|
@@ -6384,6 +6386,9 @@ var ModularForm = function(param) {
|
|
|
6384
6386
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", {
|
|
6385
6387
|
ref: submitRef,
|
|
6386
6388
|
disabled: isLoading,
|
|
6389
|
+
onClick: function(e) {
|
|
6390
|
+
submitClickEventRef.current = e.nativeEvent;
|
|
6391
|
+
},
|
|
6387
6392
|
className: cn("bg-[#547f22] px-3 py-1.5 rounded-lg text-white min-w-20", buttonClassName),
|
|
6388
6393
|
type: "submit",
|
|
6389
6394
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader, _object_spread({
|
|
@@ -5995,6 +5995,7 @@ var ModularForm = function(param) {
|
|
|
5995
5995
|
var _useState10 = _sliced_to_array(useState10(""), 2), errorMsg = _useState10[0], setErrorMsg = _useState10[1];
|
|
5996
5996
|
var _useState101 = _sliced_to_array(useState10(false), 2), isLoading = _useState101[0], setIsLoading = _useState101[1];
|
|
5997
5997
|
var formRef = useRef7(null);
|
|
5998
|
+
var submitClickEventRef = useRef7(null);
|
|
5998
5999
|
useDeepCompareEffect(function() {
|
|
5999
6000
|
if (formRef.current && autoFixLabelsWidth) {
|
|
6000
6001
|
var labels = formRef.current.getElementsByClassName("form-label");
|
|
@@ -6017,7 +6018,7 @@ var ModularForm = function(param) {
|
|
|
6017
6018
|
}, []);
|
|
6018
6019
|
var onSubmit = /*#__PURE__*/ function() {
|
|
6019
6020
|
var _ref = _async_to_generator(function(e) {
|
|
6020
|
-
var form, err;
|
|
6021
|
+
var clickEvent, form, err;
|
|
6021
6022
|
return _ts_generator(this, function(_state) {
|
|
6022
6023
|
switch(_state.label){
|
|
6023
6024
|
case 0:
|
|
@@ -6032,6 +6033,7 @@ var ModularForm = function(param) {
|
|
|
6032
6033
|
,
|
|
6033
6034
|
4
|
|
6034
6035
|
]);
|
|
6036
|
+
clickEvent = submitClickEventRef.current;
|
|
6035
6037
|
form = e.currentTarget;
|
|
6036
6038
|
elements.forEach(function(element) {
|
|
6037
6039
|
var hasMinLengthType = function(element2) {
|
|
@@ -6050,7 +6052,7 @@ var ModularForm = function(param) {
|
|
|
6050
6052
|
});
|
|
6051
6053
|
return [
|
|
6052
6054
|
4,
|
|
6053
|
-
submitFunction(e)
|
|
6055
|
+
submitFunction(e, clickEvent)
|
|
6054
6056
|
];
|
|
6055
6057
|
case 2:
|
|
6056
6058
|
_state.sent();
|
|
@@ -6168,6 +6170,9 @@ var ModularForm = function(param) {
|
|
|
6168
6170
|
/* @__PURE__ */ jsx20("button", {
|
|
6169
6171
|
ref: submitRef,
|
|
6170
6172
|
disabled: isLoading,
|
|
6173
|
+
onClick: function(e) {
|
|
6174
|
+
submitClickEventRef.current = e.nativeEvent;
|
|
6175
|
+
},
|
|
6171
6176
|
className: cn("bg-[#547f22] px-3 py-1.5 rounded-lg text-white min-w-20", buttonClassName),
|
|
6172
6177
|
type: "submit",
|
|
6173
6178
|
children: isLoading ? /* @__PURE__ */ jsx20(Loader, _object_spread({
|
package/dist/helpers/index.js
CHANGED
|
@@ -2186,7 +2186,7 @@ var nx_api_call = /*#__PURE__*/ function() {
|
|
|
2186
2186
|
response = _state.sent();
|
|
2187
2187
|
return [
|
|
2188
2188
|
2,
|
|
2189
|
-
response.data || null
|
|
2189
|
+
(response === null || response === void 0 ? void 0 : response.data) || null
|
|
2190
2190
|
];
|
|
2191
2191
|
case 3:
|
|
2192
2192
|
error = _state.sent();
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1843,7 +1843,7 @@ var nx_api_call = /*#__PURE__*/ function() {
|
|
|
1843
1843
|
response = _state.sent();
|
|
1844
1844
|
return [
|
|
1845
1845
|
2,
|
|
1846
|
-
response.data || null
|
|
1846
|
+
(response === null || response === void 0 ? void 0 : response.data) || null
|
|
1847
1847
|
];
|
|
1848
1848
|
case 3:
|
|
1849
1849
|
error = _state.sent();
|
package/dist/types/index.d.mts
CHANGED
|
@@ -276,7 +276,7 @@ interface TextAreaContainerProps extends Partial<TextAreaElement> {
|
|
|
276
276
|
}
|
|
277
277
|
type FormElement = InputElement | SelectElement | MultiSelectProps | InternationalInputProps | CustomElementProps | TextAreaElement | SelectWithSearchProps | FormSeparatorProps | CheckboxContainerProps;
|
|
278
278
|
interface ModularFormProps {
|
|
279
|
-
submitFunction: (form: React.FormEvent<HTMLFormElement
|
|
279
|
+
submitFunction: (form: React.FormEvent<HTMLFormElement>, clickEvent?: MouseEvent) => Promise<void>;
|
|
280
280
|
elements: FormElement[];
|
|
281
281
|
buttonContent: React.ReactNode;
|
|
282
282
|
headerContent?: React.ReactNode;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -276,7 +276,7 @@ interface TextAreaContainerProps extends Partial<TextAreaElement> {
|
|
|
276
276
|
}
|
|
277
277
|
type FormElement = InputElement | SelectElement | MultiSelectProps | InternationalInputProps | CustomElementProps | TextAreaElement | SelectWithSearchProps | FormSeparatorProps | CheckboxContainerProps;
|
|
278
278
|
interface ModularFormProps {
|
|
279
|
-
submitFunction: (form: React.FormEvent<HTMLFormElement
|
|
279
|
+
submitFunction: (form: React.FormEvent<HTMLFormElement>, clickEvent?: MouseEvent) => Promise<void>;
|
|
280
280
|
elements: FormElement[];
|
|
281
281
|
buttonContent: React.ReactNode;
|
|
282
282
|
headerContent?: React.ReactNode;
|