akeyless-client-commons 1.0.102 → 1.0.104
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.
|
@@ -310,6 +310,7 @@ interface ModularFormProps {
|
|
|
310
310
|
footerClassName?: string;
|
|
311
311
|
labelsCommonClassName?: string;
|
|
312
312
|
errorClassName?: string;
|
|
313
|
+
onLoad?: (e: EventTarget & HTMLFormElement) => void;
|
|
313
314
|
}
|
|
314
315
|
interface ConfirmFormProps {
|
|
315
316
|
onV: () => Promise<void> | void;
|
|
@@ -533,7 +534,7 @@ declare const TableProvider: (props: TableProps & {
|
|
|
533
534
|
}) => react_jsx_runtime.JSX.Element;
|
|
534
535
|
declare const Table: React__default.MemoExoticComponent<(props: TableProps) => react_jsx_runtime.JSX.Element>;
|
|
535
536
|
|
|
536
|
-
declare const ModularForm: ({ submitFunction, elements, headerContent, buttonContent, formClassName, headerClassName, direction, buttonClassName, submitRef, footerClassName, errorClassName, labelsCommonClassName, }: ModularFormProps) => react_jsx_runtime.JSX.Element;
|
|
537
|
+
declare const ModularForm: ({ submitFunction, elements, headerContent, buttonContent, formClassName, headerClassName, direction, buttonClassName, submitRef, footerClassName, errorClassName, labelsCommonClassName: labelsCommonClassNameProps, onLoad, }: ModularFormProps) => react_jsx_runtime.JSX.Element;
|
|
537
538
|
|
|
538
539
|
declare function InternationalPhonePicker({ setPhoneValue, phoneValue, placeholder, className, containerClassName, defaultCountry, flagContainerClassName, inputClassName, defaultValue, name, style, onEnter, labelContent, labelClassName, required, direction, defaultFocus, }: InternationalInputProps): react_jsx_runtime.JSX.Element;
|
|
539
540
|
|
|
@@ -310,6 +310,7 @@ interface ModularFormProps {
|
|
|
310
310
|
footerClassName?: string;
|
|
311
311
|
labelsCommonClassName?: string;
|
|
312
312
|
errorClassName?: string;
|
|
313
|
+
onLoad?: (e: EventTarget & HTMLFormElement) => void;
|
|
313
314
|
}
|
|
314
315
|
interface ConfirmFormProps {
|
|
315
316
|
onV: () => Promise<void> | void;
|
|
@@ -533,7 +534,7 @@ declare const TableProvider: (props: TableProps & {
|
|
|
533
534
|
}) => react_jsx_runtime.JSX.Element;
|
|
534
535
|
declare const Table: React__default.MemoExoticComponent<(props: TableProps) => react_jsx_runtime.JSX.Element>;
|
|
535
536
|
|
|
536
|
-
declare const ModularForm: ({ submitFunction, elements, headerContent, buttonContent, formClassName, headerClassName, direction, buttonClassName, submitRef, footerClassName, errorClassName, labelsCommonClassName, }: ModularFormProps) => react_jsx_runtime.JSX.Element;
|
|
537
|
+
declare const ModularForm: ({ submitFunction, elements, headerContent, buttonContent, formClassName, headerClassName, direction, buttonClassName, submitRef, footerClassName, errorClassName, labelsCommonClassName: labelsCommonClassNameProps, onLoad, }: ModularFormProps) => react_jsx_runtime.JSX.Element;
|
|
537
538
|
|
|
538
539
|
declare function InternationalPhonePicker({ setPhoneValue, phoneValue, placeholder, className, containerClassName, defaultCountry, flagContainerClassName, inputClassName, defaultValue, name, style, onEnter, labelContent, labelClassName, required, direction, defaultFocus, }: InternationalInputProps): react_jsx_runtime.JSX.Element;
|
|
539
540
|
|
package/dist/components/index.js
CHANGED
|
@@ -5844,10 +5844,34 @@ var ModularForm = function(param) {
|
|
|
5844
5844
|
return function(form) {
|
|
5845
5845
|
return _ref.apply(this, arguments);
|
|
5846
5846
|
};
|
|
5847
|
-
}() : _param_submitFunction, _param_elements = param.elements, elements = _param_elements === void 0 ? [] : _param_elements, headerContent = param.headerContent, buttonContent = param.buttonContent, _param_formClassName = param.formClassName, formClassName = _param_formClassName === void 0 ? "" : _param_formClassName, _param_headerClassName = param.headerClassName, headerClassName = _param_headerClassName === void 0 ? "" : _param_headerClassName, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_buttonClassName = param.buttonClassName, buttonClassName = _param_buttonClassName === void 0 ? "" : _param_buttonClassName, submitRef = param.submitRef, _param_footerClassName = param.footerClassName, footerClassName = _param_footerClassName === void 0 ? "" : _param_footerClassName, _param_errorClassName = param.errorClassName, errorClassName = _param_errorClassName === void 0 ? "" : _param_errorClassName, labelsCommonClassName = param.
|
|
5847
|
+
}() : _param_submitFunction, _param_elements = param.elements, elements = _param_elements === void 0 ? [] : _param_elements, headerContent = param.headerContent, buttonContent = param.buttonContent, _param_formClassName = param.formClassName, formClassName = _param_formClassName === void 0 ? "" : _param_formClassName, _param_headerClassName = param.headerClassName, headerClassName = _param_headerClassName === void 0 ? "" : _param_headerClassName, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_buttonClassName = param.buttonClassName, buttonClassName = _param_buttonClassName === void 0 ? "" : _param_buttonClassName, submitRef = param.submitRef, _param_footerClassName = param.footerClassName, footerClassName = _param_footerClassName === void 0 ? "" : _param_footerClassName, _param_errorClassName = param.errorClassName, errorClassName = _param_errorClassName === void 0 ? "" : _param_errorClassName, labelsCommonClassNameProps = param.labelsCommonClassName, onLoad = param.onLoad;
|
|
5848
5848
|
var _ref = _sliced_to_array((0, import_react13.useState)(""), 2), errorMsg = _ref[0], setErrorMsg = _ref[1];
|
|
5849
5849
|
var _ref1 = _sliced_to_array((0, import_react13.useState)(false), 2), isLoading = _ref1[0], setIsLoading = _ref1[1];
|
|
5850
5850
|
var formRef = (0, import_react13.useRef)(null);
|
|
5851
|
+
var labelsCommonClassName = function() {
|
|
5852
|
+
console.log("labelsCommonClassName called", {
|
|
5853
|
+
labelsCommonClassNameProps: labelsCommonClassNameProps,
|
|
5854
|
+
ref: formRef.current
|
|
5855
|
+
});
|
|
5856
|
+
if (!formRef.current) {
|
|
5857
|
+
return labelsCommonClassNameProps;
|
|
5858
|
+
}
|
|
5859
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(formRef.current);
|
|
5860
|
+
var labels = formRef.current.getElementsByClassName("form-label");
|
|
5861
|
+
var max_width = 0;
|
|
5862
|
+
Array.from(labels).forEach(function(label) {
|
|
5863
|
+
var label_width = label.clientWidth;
|
|
5864
|
+
if (label_width > max_width) {
|
|
5865
|
+
max_width = label_width;
|
|
5866
|
+
}
|
|
5867
|
+
});
|
|
5868
|
+
return cn("min-w-[".concat(max_width, "px]"), labelsCommonClassNameProps);
|
|
5869
|
+
};
|
|
5870
|
+
(0, import_react13.useEffect)(function() {
|
|
5871
|
+
if (formRef.current) {
|
|
5872
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(formRef.current);
|
|
5873
|
+
}
|
|
5874
|
+
}, []);
|
|
5851
5875
|
var onSubmit = /*#__PURE__*/ function() {
|
|
5852
5876
|
var _ref = _async_to_generator(function(e) {
|
|
5853
5877
|
var form, err;
|
|
@@ -5915,20 +5939,6 @@ var ModularForm = function(param) {
|
|
|
5915
5939
|
return _ref.apply(this, arguments);
|
|
5916
5940
|
};
|
|
5917
5941
|
}();
|
|
5918
|
-
(0, import_react13.useEffect)(function() {
|
|
5919
|
-
if (formRef.current) {
|
|
5920
|
-
var labels = formRef.current.getElementsByClassName("form-label");
|
|
5921
|
-
console.log("labels:", labels.length);
|
|
5922
|
-
var max_width = 0;
|
|
5923
|
-
Array.from(labels).forEach(function(label) {
|
|
5924
|
-
var label_width = label.clientWidth;
|
|
5925
|
-
if (label_width > max_width) {
|
|
5926
|
-
max_width = label_width;
|
|
5927
|
-
}
|
|
5928
|
-
});
|
|
5929
|
-
console.log("max label width:", max_width);
|
|
5930
|
-
}
|
|
5931
|
-
}, []);
|
|
5932
5942
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", {
|
|
5933
5943
|
ref: formRef,
|
|
5934
5944
|
onSubmit: onSubmit,
|
|
@@ -5946,32 +5956,32 @@ var ModularForm = function(param) {
|
|
|
5946
5956
|
case "input":
|
|
5947
5957
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InputContainer, _object_spread_props(_object_spread({}, element), {
|
|
5948
5958
|
direction: direction,
|
|
5949
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5959
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5950
5960
|
}), index2);
|
|
5951
5961
|
case "textarea":
|
|
5952
5962
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextAreaContainer, _object_spread_props(_object_spread({}, element), {
|
|
5953
5963
|
direction: direction,
|
|
5954
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5964
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5955
5965
|
}), index2);
|
|
5956
5966
|
case "select":
|
|
5957
5967
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SelectContainer, _object_spread_props(_object_spread({}, element), {
|
|
5958
5968
|
direction: direction,
|
|
5959
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5969
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5960
5970
|
}), index2);
|
|
5961
5971
|
case "multiSelect":
|
|
5962
5972
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MultiSelect, _object_spread_props(_object_spread({}, element), {
|
|
5963
5973
|
direction: direction,
|
|
5964
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5974
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5965
5975
|
}), index2);
|
|
5966
5976
|
case "selectWithSearch":
|
|
5967
5977
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SelectWithSearch, _object_spread_props(_object_spread({}, element), {
|
|
5968
5978
|
direction: direction,
|
|
5969
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5979
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5970
5980
|
}), index2);
|
|
5971
5981
|
case "internationalPhoneInput":
|
|
5972
5982
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InternationalPhonePicker, _object_spread_props(_object_spread({}, element), {
|
|
5973
5983
|
direction: direction,
|
|
5974
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5984
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5975
5985
|
}), index2);
|
|
5976
5986
|
case "separator":
|
|
5977
5987
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormSeparator, _object_spread_props(_object_spread({}, element), {
|
|
@@ -5640,10 +5640,34 @@ var ModularForm = function(param) {
|
|
|
5640
5640
|
return function(form) {
|
|
5641
5641
|
return _ref.apply(this, arguments);
|
|
5642
5642
|
};
|
|
5643
|
-
}() : _param_submitFunction, _param_elements = param.elements, elements = _param_elements === void 0 ? [] : _param_elements, headerContent = param.headerContent, buttonContent = param.buttonContent, _param_formClassName = param.formClassName, formClassName = _param_formClassName === void 0 ? "" : _param_formClassName, _param_headerClassName = param.headerClassName, headerClassName = _param_headerClassName === void 0 ? "" : _param_headerClassName, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_buttonClassName = param.buttonClassName, buttonClassName = _param_buttonClassName === void 0 ? "" : _param_buttonClassName, submitRef = param.submitRef, _param_footerClassName = param.footerClassName, footerClassName = _param_footerClassName === void 0 ? "" : _param_footerClassName, _param_errorClassName = param.errorClassName, errorClassName = _param_errorClassName === void 0 ? "" : _param_errorClassName, labelsCommonClassName = param.
|
|
5643
|
+
}() : _param_submitFunction, _param_elements = param.elements, elements = _param_elements === void 0 ? [] : _param_elements, headerContent = param.headerContent, buttonContent = param.buttonContent, _param_formClassName = param.formClassName, formClassName = _param_formClassName === void 0 ? "" : _param_formClassName, _param_headerClassName = param.headerClassName, headerClassName = _param_headerClassName === void 0 ? "" : _param_headerClassName, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_buttonClassName = param.buttonClassName, buttonClassName = _param_buttonClassName === void 0 ? "" : _param_buttonClassName, submitRef = param.submitRef, _param_footerClassName = param.footerClassName, footerClassName = _param_footerClassName === void 0 ? "" : _param_footerClassName, _param_errorClassName = param.errorClassName, errorClassName = _param_errorClassName === void 0 ? "" : _param_errorClassName, labelsCommonClassNameProps = param.labelsCommonClassName, onLoad = param.onLoad;
|
|
5644
5644
|
var _useState8 = _sliced_to_array(useState8(""), 2), errorMsg = _useState8[0], setErrorMsg = _useState8[1];
|
|
5645
5645
|
var _useState81 = _sliced_to_array(useState8(false), 2), isLoading = _useState81[0], setIsLoading = _useState81[1];
|
|
5646
5646
|
var formRef = useRef5(null);
|
|
5647
|
+
var labelsCommonClassName = function() {
|
|
5648
|
+
console.log("labelsCommonClassName called", {
|
|
5649
|
+
labelsCommonClassNameProps: labelsCommonClassNameProps,
|
|
5650
|
+
ref: formRef.current
|
|
5651
|
+
});
|
|
5652
|
+
if (!formRef.current) {
|
|
5653
|
+
return labelsCommonClassNameProps;
|
|
5654
|
+
}
|
|
5655
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(formRef.current);
|
|
5656
|
+
var labels = formRef.current.getElementsByClassName("form-label");
|
|
5657
|
+
var max_width = 0;
|
|
5658
|
+
Array.from(labels).forEach(function(label) {
|
|
5659
|
+
var label_width = label.clientWidth;
|
|
5660
|
+
if (label_width > max_width) {
|
|
5661
|
+
max_width = label_width;
|
|
5662
|
+
}
|
|
5663
|
+
});
|
|
5664
|
+
return cn("min-w-[".concat(max_width, "px]"), labelsCommonClassNameProps);
|
|
5665
|
+
};
|
|
5666
|
+
useEffect7(function() {
|
|
5667
|
+
if (formRef.current) {
|
|
5668
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(formRef.current);
|
|
5669
|
+
}
|
|
5670
|
+
}, []);
|
|
5647
5671
|
var onSubmit = /*#__PURE__*/ function() {
|
|
5648
5672
|
var _ref = _async_to_generator(function(e) {
|
|
5649
5673
|
var form, err;
|
|
@@ -5711,20 +5735,6 @@ var ModularForm = function(param) {
|
|
|
5711
5735
|
return _ref.apply(this, arguments);
|
|
5712
5736
|
};
|
|
5713
5737
|
}();
|
|
5714
|
-
useEffect7(function() {
|
|
5715
|
-
if (formRef.current) {
|
|
5716
|
-
var labels = formRef.current.getElementsByClassName("form-label");
|
|
5717
|
-
console.log("labels:", labels.length);
|
|
5718
|
-
var max_width = 0;
|
|
5719
|
-
Array.from(labels).forEach(function(label) {
|
|
5720
|
-
var label_width = label.clientWidth;
|
|
5721
|
-
if (label_width > max_width) {
|
|
5722
|
-
max_width = label_width;
|
|
5723
|
-
}
|
|
5724
|
-
});
|
|
5725
|
-
console.log("max label width:", max_width);
|
|
5726
|
-
}
|
|
5727
|
-
}, []);
|
|
5728
5738
|
return /* @__PURE__ */ jsxs15("form", {
|
|
5729
5739
|
ref: formRef,
|
|
5730
5740
|
onSubmit: onSubmit,
|
|
@@ -5742,32 +5752,32 @@ var ModularForm = function(param) {
|
|
|
5742
5752
|
case "input":
|
|
5743
5753
|
return /* @__PURE__ */ jsx20(InputContainer, _object_spread_props(_object_spread({}, element), {
|
|
5744
5754
|
direction: direction,
|
|
5745
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5755
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5746
5756
|
}), index2);
|
|
5747
5757
|
case "textarea":
|
|
5748
5758
|
return /* @__PURE__ */ jsx20(TextAreaContainer, _object_spread_props(_object_spread({}, element), {
|
|
5749
5759
|
direction: direction,
|
|
5750
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5760
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5751
5761
|
}), index2);
|
|
5752
5762
|
case "select":
|
|
5753
5763
|
return /* @__PURE__ */ jsx20(SelectContainer, _object_spread_props(_object_spread({}, element), {
|
|
5754
5764
|
direction: direction,
|
|
5755
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5765
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5756
5766
|
}), index2);
|
|
5757
5767
|
case "multiSelect":
|
|
5758
5768
|
return /* @__PURE__ */ jsx20(MultiSelect, _object_spread_props(_object_spread({}, element), {
|
|
5759
5769
|
direction: direction,
|
|
5760
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5770
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5761
5771
|
}), index2);
|
|
5762
5772
|
case "selectWithSearch":
|
|
5763
5773
|
return /* @__PURE__ */ jsx20(SelectWithSearch, _object_spread_props(_object_spread({}, element), {
|
|
5764
5774
|
direction: direction,
|
|
5765
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5775
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5766
5776
|
}), index2);
|
|
5767
5777
|
case "internationalPhoneInput":
|
|
5768
5778
|
return /* @__PURE__ */ jsx20(InternationalPhonePicker, _object_spread_props(_object_spread({}, element), {
|
|
5769
5779
|
direction: direction,
|
|
5770
|
-
labelsCommonClassName: labelsCommonClassName
|
|
5780
|
+
labelsCommonClassName: labelsCommonClassName()
|
|
5771
5781
|
}), index2);
|
|
5772
5782
|
case "separator":
|
|
5773
5783
|
return /* @__PURE__ */ jsx20(FormSeparator, _object_spread_props(_object_spread({}, element), {
|
package/dist/types/index.d.mts
CHANGED
|
@@ -258,6 +258,7 @@ interface ModularFormProps {
|
|
|
258
258
|
footerClassName?: string;
|
|
259
259
|
labelsCommonClassName?: string;
|
|
260
260
|
errorClassName?: string;
|
|
261
|
+
onLoad?: (e: EventTarget & HTMLFormElement) => void;
|
|
261
262
|
}
|
|
262
263
|
interface ConfirmFormProps {
|
|
263
264
|
onV: () => Promise<void> | void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -258,6 +258,7 @@ interface ModularFormProps {
|
|
|
258
258
|
footerClassName?: string;
|
|
259
259
|
labelsCommonClassName?: string;
|
|
260
260
|
errorClassName?: string;
|
|
261
|
+
onLoad?: (e: EventTarget & HTMLFormElement) => void;
|
|
261
262
|
}
|
|
262
263
|
interface ConfirmFormProps {
|
|
263
264
|
onV: () => Promise<void> | void;
|