akeyless-client-commons 1.0.57 → 1.0.59
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.css.map +1 -1
- package/dist/components/index.d.mts +4 -4
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.js +169 -13
- package/dist/components/index.mjs +169 -13
- package/dist/helpers/index.d.mts +4 -1
- package/dist/helpers/index.d.ts +4 -1
- package/dist/helpers/index.js +126 -32
- package/dist/helpers/index.mjs +115 -33
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/index.mjs +3 -3
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -669,6 +669,12 @@ var import_auth = require("firebase/auth");
|
|
|
669
669
|
var import_app_check = require("firebase/app-check");
|
|
670
670
|
var import_firestore = require("firebase/firestore");
|
|
671
671
|
var import_react2 = require("react");
|
|
672
|
+
// src/helpers/phoneNumber.ts
|
|
673
|
+
var import_libphonenumber_js = require("libphonenumber-js");
|
|
674
|
+
var local_israel_phone_format = function(international_number) {
|
|
675
|
+
return international_number.replace("+972", "0");
|
|
676
|
+
};
|
|
677
|
+
// src/helpers/firebase.ts
|
|
672
678
|
var import_meta = {};
|
|
673
679
|
var initApp = function() {
|
|
674
680
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
@@ -761,12 +767,150 @@ var collections = {
|
|
|
761
767
|
charge_capacities: (0, import_firestore.collection)(db, "nx-charge-capacities")
|
|
762
768
|
};
|
|
763
769
|
var fire_base_TIME_TEMP = import_firestore.Timestamp.now;
|
|
770
|
+
var simpleExtractData = function(doc2) {
|
|
771
|
+
var docData = doc2.data();
|
|
772
|
+
return _object_spread_props(_object_spread({}, docData), {
|
|
773
|
+
id: doc2.id
|
|
774
|
+
});
|
|
775
|
+
};
|
|
776
|
+
var query_document = /*#__PURE__*/ function() {
|
|
777
|
+
var _ref = _async_to_generator(function(collection_path, field_name, operator, value) {
|
|
778
|
+
var ignore_log, q, query_snapshot, documents, error;
|
|
779
|
+
var _arguments = arguments;
|
|
780
|
+
return _ts_generator(this, function(_state) {
|
|
781
|
+
switch(_state.label){
|
|
782
|
+
case 0:
|
|
783
|
+
ignore_log = _arguments.length > 4 && _arguments[4] !== void 0 ? _arguments[4] : false;
|
|
784
|
+
_state.label = 1;
|
|
785
|
+
case 1:
|
|
786
|
+
_state.trys.push([
|
|
787
|
+
1,
|
|
788
|
+
3,
|
|
789
|
+
,
|
|
790
|
+
4
|
|
791
|
+
]);
|
|
792
|
+
q = (0, import_firestore.query)((0, import_firestore.collection)(db, collection_path), (0, import_firestore.where)(field_name, operator, value));
|
|
793
|
+
return [
|
|
794
|
+
4,
|
|
795
|
+
(0, import_firestore.getDocs)(q)
|
|
796
|
+
];
|
|
797
|
+
case 2:
|
|
798
|
+
query_snapshot = _state.sent();
|
|
799
|
+
documents = query_snapshot.docs.map(function(doc2) {
|
|
800
|
+
return simpleExtractData(doc2);
|
|
801
|
+
});
|
|
802
|
+
if (documents.length < 1) {
|
|
803
|
+
throw new Error("No data to return from: \ncollection: ".concat(collection_path, ", \nfield_name: ").concat(field_name, ", \noperator: ").concat(operator, ", \nvalue: ").concat(value));
|
|
804
|
+
}
|
|
805
|
+
return [
|
|
806
|
+
2,
|
|
807
|
+
documents[0]
|
|
808
|
+
];
|
|
809
|
+
case 3:
|
|
810
|
+
error = _state.sent();
|
|
811
|
+
if (!ignore_log) {
|
|
812
|
+
console.error("Error querying document:", error);
|
|
813
|
+
}
|
|
814
|
+
return [
|
|
815
|
+
2,
|
|
816
|
+
null
|
|
817
|
+
];
|
|
818
|
+
case 4:
|
|
819
|
+
return [
|
|
820
|
+
2
|
|
821
|
+
];
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
});
|
|
825
|
+
return function query_document(collection_path, field_name, operator, value) {
|
|
826
|
+
return _ref.apply(this, arguments);
|
|
827
|
+
};
|
|
828
|
+
}();
|
|
829
|
+
var getUserByPhone = /*#__PURE__*/ function() {
|
|
830
|
+
var _ref = _async_to_generator(function(phone) {
|
|
831
|
+
var phones;
|
|
832
|
+
return _ts_generator(this, function(_state) {
|
|
833
|
+
switch(_state.label){
|
|
834
|
+
case 0:
|
|
835
|
+
phones = [
|
|
836
|
+
phone,
|
|
837
|
+
local_israel_phone_format(phone)
|
|
838
|
+
];
|
|
839
|
+
return [
|
|
840
|
+
4,
|
|
841
|
+
query_document("nx-users", "phone_number", "in", phones, true)
|
|
842
|
+
];
|
|
843
|
+
case 1:
|
|
844
|
+
return [
|
|
845
|
+
2,
|
|
846
|
+
_state.sent()
|
|
847
|
+
];
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
});
|
|
851
|
+
return function getUserByPhone(phone) {
|
|
852
|
+
return _ref.apply(this, arguments);
|
|
853
|
+
};
|
|
854
|
+
}();
|
|
855
|
+
var getUserByEmail = /*#__PURE__*/ function() {
|
|
856
|
+
var _ref = _async_to_generator(function(email) {
|
|
857
|
+
return _ts_generator(this, function(_state) {
|
|
858
|
+
switch(_state.label){
|
|
859
|
+
case 0:
|
|
860
|
+
return [
|
|
861
|
+
4,
|
|
862
|
+
query_document("nx-users", "email", "==", email, true)
|
|
863
|
+
];
|
|
864
|
+
case 1:
|
|
865
|
+
return [
|
|
866
|
+
2,
|
|
867
|
+
_state.sent()
|
|
868
|
+
];
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
});
|
|
872
|
+
return function getUserByEmail(email) {
|
|
873
|
+
return _ref.apply(this, arguments);
|
|
874
|
+
};
|
|
875
|
+
}();
|
|
876
|
+
var getUserByIdentifier = /*#__PURE__*/ function() {
|
|
877
|
+
var _ref = _async_to_generator(function(identifier) {
|
|
878
|
+
var _tmp;
|
|
879
|
+
return _ts_generator(this, function(_state) {
|
|
880
|
+
switch(_state.label){
|
|
881
|
+
case 0:
|
|
882
|
+
return [
|
|
883
|
+
4,
|
|
884
|
+
getUserByPhone(identifier)
|
|
885
|
+
];
|
|
886
|
+
case 1:
|
|
887
|
+
_tmp = _state.sent();
|
|
888
|
+
if (_tmp) return [
|
|
889
|
+
3,
|
|
890
|
+
3
|
|
891
|
+
];
|
|
892
|
+
return [
|
|
893
|
+
4,
|
|
894
|
+
getUserByEmail(identifier)
|
|
895
|
+
];
|
|
896
|
+
case 2:
|
|
897
|
+
_tmp = _state.sent();
|
|
898
|
+
_state.label = 3;
|
|
899
|
+
case 3:
|
|
900
|
+
return [
|
|
901
|
+
2,
|
|
902
|
+
_tmp
|
|
903
|
+
];
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
return function getUserByIdentifier(identifier) {
|
|
908
|
+
return _ref.apply(this, arguments);
|
|
909
|
+
};
|
|
910
|
+
}();
|
|
764
911
|
// src/helpers/global.ts
|
|
765
912
|
var import_akeyless_types_commons = require("akeyless-types-commons");
|
|
766
913
|
var import_axios = __toESM(require("axios"));
|
|
767
|
-
// src/helpers/phoneNumber.ts
|
|
768
|
-
var import_libphonenumber_js = require("libphonenumber-js");
|
|
769
|
-
// src/helpers/global.ts
|
|
770
914
|
var import_lodash = require("lodash");
|
|
771
915
|
var import_meta2 = {};
|
|
772
916
|
var renderOnce = function() {
|
|
@@ -965,15 +1109,15 @@ var LoginWithGoogleButton = function(param) {
|
|
|
965
1109
|
var _ref = _sliced_to_array((0, import_react3.useState)(false), 2), isLoading = _ref[0], setIsLoading = _ref[1];
|
|
966
1110
|
var onLoginClick = /*#__PURE__*/ function() {
|
|
967
1111
|
var _ref = _async_to_generator(function(e) {
|
|
968
|
-
var user, error;
|
|
1112
|
+
var user, dbUser, error;
|
|
969
1113
|
return _ts_generator(this, function(_state) {
|
|
970
1114
|
switch(_state.label){
|
|
971
1115
|
case 0:
|
|
972
1116
|
_state.trys.push([
|
|
973
1117
|
0,
|
|
974
|
-
3,
|
|
975
1118
|
4,
|
|
976
|
-
5
|
|
1119
|
+
5,
|
|
1120
|
+
6
|
|
977
1121
|
]);
|
|
978
1122
|
setIsLoading(true);
|
|
979
1123
|
return [
|
|
@@ -984,28 +1128,37 @@ var LoginWithGoogleButton = function(param) {
|
|
|
984
1128
|
user = _state.sent();
|
|
985
1129
|
return [
|
|
986
1130
|
4,
|
|
987
|
-
|
|
1131
|
+
getUserByIdentifier(user.email)
|
|
988
1132
|
];
|
|
989
1133
|
case 2:
|
|
1134
|
+
dbUser = _state.sent();
|
|
1135
|
+
if (!dbUser) {
|
|
1136
|
+
throw "user_not_found";
|
|
1137
|
+
}
|
|
1138
|
+
return [
|
|
1139
|
+
4,
|
|
1140
|
+
onClick(e, dbUser)
|
|
1141
|
+
];
|
|
1142
|
+
case 3:
|
|
990
1143
|
_state.sent();
|
|
991
1144
|
return [
|
|
992
1145
|
3,
|
|
993
|
-
|
|
1146
|
+
6
|
|
994
1147
|
];
|
|
995
|
-
case
|
|
1148
|
+
case 4:
|
|
996
1149
|
error = _state.sent();
|
|
997
1150
|
console.error("error from login with google:", error);
|
|
998
1151
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
999
1152
|
return [
|
|
1000
1153
|
3,
|
|
1001
|
-
|
|
1154
|
+
6
|
|
1002
1155
|
];
|
|
1003
|
-
case
|
|
1156
|
+
case 5:
|
|
1004
1157
|
setIsLoading(false);
|
|
1005
1158
|
return [
|
|
1006
1159
|
7
|
|
1007
1160
|
];
|
|
1008
|
-
case
|
|
1161
|
+
case 6:
|
|
1009
1162
|
return [
|
|
1010
1163
|
2
|
|
1011
1164
|
];
|
|
@@ -5708,7 +5861,7 @@ var import_input_otp = require("input-otp");
|
|
|
5708
5861
|
var import_react15 = require("react");
|
|
5709
5862
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
5710
5863
|
function CodeInput(param) {
|
|
5711
|
-
var codeValue = param.codeValue, setCodeValue = param.setCodeValue, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_slotContainerClassName = param.slotContainerClassName, slotContainerClassName = _param_slotContainerClassName === void 0 ? "" : _param_slotContainerClassName;
|
|
5864
|
+
var codeValue = param.codeValue, setCodeValue = param.setCodeValue, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_slotContainerClassName = param.slotContainerClassName, slotContainerClassName = _param_slotContainerClassName === void 0 ? "" : _param_slotContainerClassName, _param_direction = param.direction, direction = _param_direction === void 0 ? "ltr" : _param_direction;
|
|
5712
5865
|
var firstInputRef = (0, import_react15.useRef)(null);
|
|
5713
5866
|
(0, import_react15.useEffect)(function() {
|
|
5714
5867
|
if (firstInputRef.current) {
|
|
@@ -5716,6 +5869,9 @@ function CodeInput(param) {
|
|
|
5716
5869
|
}
|
|
5717
5870
|
}, []);
|
|
5718
5871
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
5872
|
+
style: {
|
|
5873
|
+
direction: direction
|
|
5874
|
+
},
|
|
5719
5875
|
className: cn("space-y-2 flex justify-center items-center", className),
|
|
5720
5876
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_input_otp.OTPInput, {
|
|
5721
5877
|
ref: firstInputRef,
|
|
@@ -473,6 +473,12 @@ import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth";
|
|
|
473
473
|
import { initializeAppCheck, ReCaptchaEnterpriseProvider } from "firebase/app-check";
|
|
474
474
|
import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, setDoc, Timestamp, where, getFirestore, onSnapshot, orderBy } from "firebase/firestore";
|
|
475
475
|
import { useCallback } from "react";
|
|
476
|
+
// src/helpers/phoneNumber.ts
|
|
477
|
+
import { parsePhoneNumberFromString } from "libphonenumber-js";
|
|
478
|
+
var local_israel_phone_format = function(international_number) {
|
|
479
|
+
return international_number.replace("+972", "0");
|
|
480
|
+
};
|
|
481
|
+
// src/helpers/firebase.ts
|
|
476
482
|
var initApp = function() {
|
|
477
483
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
478
484
|
var firebaseConfig = {
|
|
@@ -564,12 +570,150 @@ var collections = {
|
|
|
564
570
|
charge_capacities: collection(db, "nx-charge-capacities")
|
|
565
571
|
};
|
|
566
572
|
var fire_base_TIME_TEMP = Timestamp.now;
|
|
573
|
+
var simpleExtractData = function(doc2) {
|
|
574
|
+
var docData = doc2.data();
|
|
575
|
+
return _object_spread_props(_object_spread({}, docData), {
|
|
576
|
+
id: doc2.id
|
|
577
|
+
});
|
|
578
|
+
};
|
|
579
|
+
var query_document = /*#__PURE__*/ function() {
|
|
580
|
+
var _ref = _async_to_generator(function(collection_path, field_name, operator, value) {
|
|
581
|
+
var ignore_log, q, query_snapshot, documents, error;
|
|
582
|
+
var _arguments = arguments;
|
|
583
|
+
return _ts_generator(this, function(_state) {
|
|
584
|
+
switch(_state.label){
|
|
585
|
+
case 0:
|
|
586
|
+
ignore_log = _arguments.length > 4 && _arguments[4] !== void 0 ? _arguments[4] : false;
|
|
587
|
+
_state.label = 1;
|
|
588
|
+
case 1:
|
|
589
|
+
_state.trys.push([
|
|
590
|
+
1,
|
|
591
|
+
3,
|
|
592
|
+
,
|
|
593
|
+
4
|
|
594
|
+
]);
|
|
595
|
+
q = query(collection(db, collection_path), where(field_name, operator, value));
|
|
596
|
+
return [
|
|
597
|
+
4,
|
|
598
|
+
getDocs(q)
|
|
599
|
+
];
|
|
600
|
+
case 2:
|
|
601
|
+
query_snapshot = _state.sent();
|
|
602
|
+
documents = query_snapshot.docs.map(function(doc2) {
|
|
603
|
+
return simpleExtractData(doc2);
|
|
604
|
+
});
|
|
605
|
+
if (documents.length < 1) {
|
|
606
|
+
throw new Error("No data to return from: \ncollection: ".concat(collection_path, ", \nfield_name: ").concat(field_name, ", \noperator: ").concat(operator, ", \nvalue: ").concat(value));
|
|
607
|
+
}
|
|
608
|
+
return [
|
|
609
|
+
2,
|
|
610
|
+
documents[0]
|
|
611
|
+
];
|
|
612
|
+
case 3:
|
|
613
|
+
error = _state.sent();
|
|
614
|
+
if (!ignore_log) {
|
|
615
|
+
console.error("Error querying document:", error);
|
|
616
|
+
}
|
|
617
|
+
return [
|
|
618
|
+
2,
|
|
619
|
+
null
|
|
620
|
+
];
|
|
621
|
+
case 4:
|
|
622
|
+
return [
|
|
623
|
+
2
|
|
624
|
+
];
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
return function query_document(collection_path, field_name, operator, value) {
|
|
629
|
+
return _ref.apply(this, arguments);
|
|
630
|
+
};
|
|
631
|
+
}();
|
|
632
|
+
var getUserByPhone = /*#__PURE__*/ function() {
|
|
633
|
+
var _ref = _async_to_generator(function(phone) {
|
|
634
|
+
var phones;
|
|
635
|
+
return _ts_generator(this, function(_state) {
|
|
636
|
+
switch(_state.label){
|
|
637
|
+
case 0:
|
|
638
|
+
phones = [
|
|
639
|
+
phone,
|
|
640
|
+
local_israel_phone_format(phone)
|
|
641
|
+
];
|
|
642
|
+
return [
|
|
643
|
+
4,
|
|
644
|
+
query_document("nx-users", "phone_number", "in", phones, true)
|
|
645
|
+
];
|
|
646
|
+
case 1:
|
|
647
|
+
return [
|
|
648
|
+
2,
|
|
649
|
+
_state.sent()
|
|
650
|
+
];
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
});
|
|
654
|
+
return function getUserByPhone(phone) {
|
|
655
|
+
return _ref.apply(this, arguments);
|
|
656
|
+
};
|
|
657
|
+
}();
|
|
658
|
+
var getUserByEmail = /*#__PURE__*/ function() {
|
|
659
|
+
var _ref = _async_to_generator(function(email) {
|
|
660
|
+
return _ts_generator(this, function(_state) {
|
|
661
|
+
switch(_state.label){
|
|
662
|
+
case 0:
|
|
663
|
+
return [
|
|
664
|
+
4,
|
|
665
|
+
query_document("nx-users", "email", "==", email, true)
|
|
666
|
+
];
|
|
667
|
+
case 1:
|
|
668
|
+
return [
|
|
669
|
+
2,
|
|
670
|
+
_state.sent()
|
|
671
|
+
];
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
});
|
|
675
|
+
return function getUserByEmail(email) {
|
|
676
|
+
return _ref.apply(this, arguments);
|
|
677
|
+
};
|
|
678
|
+
}();
|
|
679
|
+
var getUserByIdentifier = /*#__PURE__*/ function() {
|
|
680
|
+
var _ref = _async_to_generator(function(identifier) {
|
|
681
|
+
var _tmp;
|
|
682
|
+
return _ts_generator(this, function(_state) {
|
|
683
|
+
switch(_state.label){
|
|
684
|
+
case 0:
|
|
685
|
+
return [
|
|
686
|
+
4,
|
|
687
|
+
getUserByPhone(identifier)
|
|
688
|
+
];
|
|
689
|
+
case 1:
|
|
690
|
+
_tmp = _state.sent();
|
|
691
|
+
if (_tmp) return [
|
|
692
|
+
3,
|
|
693
|
+
3
|
|
694
|
+
];
|
|
695
|
+
return [
|
|
696
|
+
4,
|
|
697
|
+
getUserByEmail(identifier)
|
|
698
|
+
];
|
|
699
|
+
case 2:
|
|
700
|
+
_tmp = _state.sent();
|
|
701
|
+
_state.label = 3;
|
|
702
|
+
case 3:
|
|
703
|
+
return [
|
|
704
|
+
2,
|
|
705
|
+
_tmp
|
|
706
|
+
];
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
});
|
|
710
|
+
return function getUserByIdentifier(identifier) {
|
|
711
|
+
return _ref.apply(this, arguments);
|
|
712
|
+
};
|
|
713
|
+
}();
|
|
567
714
|
// src/helpers/global.ts
|
|
568
715
|
import { CountryOptions } from "akeyless-types-commons";
|
|
569
716
|
import axios from "axios";
|
|
570
|
-
// src/helpers/phoneNumber.ts
|
|
571
|
-
import { parsePhoneNumberFromString } from "libphonenumber-js";
|
|
572
|
-
// src/helpers/global.ts
|
|
573
717
|
import { isEqual } from "lodash";
|
|
574
718
|
var renderOnce = function() {
|
|
575
719
|
return true;
|
|
@@ -767,15 +911,15 @@ var LoginWithGoogleButton = function(param) {
|
|
|
767
911
|
var _useState = _sliced_to_array(useState(false), 2), isLoading = _useState[0], setIsLoading = _useState[1];
|
|
768
912
|
var onLoginClick = /*#__PURE__*/ function() {
|
|
769
913
|
var _ref = _async_to_generator(function(e) {
|
|
770
|
-
var user, error;
|
|
914
|
+
var user, dbUser, error;
|
|
771
915
|
return _ts_generator(this, function(_state) {
|
|
772
916
|
switch(_state.label){
|
|
773
917
|
case 0:
|
|
774
918
|
_state.trys.push([
|
|
775
919
|
0,
|
|
776
|
-
3,
|
|
777
920
|
4,
|
|
778
|
-
5
|
|
921
|
+
5,
|
|
922
|
+
6
|
|
779
923
|
]);
|
|
780
924
|
setIsLoading(true);
|
|
781
925
|
return [
|
|
@@ -786,28 +930,37 @@ var LoginWithGoogleButton = function(param) {
|
|
|
786
930
|
user = _state.sent();
|
|
787
931
|
return [
|
|
788
932
|
4,
|
|
789
|
-
|
|
933
|
+
getUserByIdentifier(user.email)
|
|
790
934
|
];
|
|
791
935
|
case 2:
|
|
936
|
+
dbUser = _state.sent();
|
|
937
|
+
if (!dbUser) {
|
|
938
|
+
throw "user_not_found";
|
|
939
|
+
}
|
|
940
|
+
return [
|
|
941
|
+
4,
|
|
942
|
+
onClick(e, dbUser)
|
|
943
|
+
];
|
|
944
|
+
case 3:
|
|
792
945
|
_state.sent();
|
|
793
946
|
return [
|
|
794
947
|
3,
|
|
795
|
-
|
|
948
|
+
6
|
|
796
949
|
];
|
|
797
|
-
case
|
|
950
|
+
case 4:
|
|
798
951
|
error = _state.sent();
|
|
799
952
|
console.error("error from login with google:", error);
|
|
800
953
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
801
954
|
return [
|
|
802
955
|
3,
|
|
803
|
-
|
|
956
|
+
6
|
|
804
957
|
];
|
|
805
|
-
case
|
|
958
|
+
case 5:
|
|
806
959
|
setIsLoading(false);
|
|
807
960
|
return [
|
|
808
961
|
7
|
|
809
962
|
];
|
|
810
|
-
case
|
|
963
|
+
case 6:
|
|
811
964
|
return [
|
|
812
965
|
2
|
|
813
966
|
];
|
|
@@ -5510,7 +5663,7 @@ import { OTPInput } from "input-otp";
|
|
|
5510
5663
|
import { useEffect as useEffect7, useRef as useRef5 } from "react";
|
|
5511
5664
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5512
5665
|
function CodeInput(param) {
|
|
5513
|
-
var codeValue = param.codeValue, setCodeValue = param.setCodeValue, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_slotContainerClassName = param.slotContainerClassName, slotContainerClassName = _param_slotContainerClassName === void 0 ? "" : _param_slotContainerClassName;
|
|
5666
|
+
var codeValue = param.codeValue, setCodeValue = param.setCodeValue, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_slotContainerClassName = param.slotContainerClassName, slotContainerClassName = _param_slotContainerClassName === void 0 ? "" : _param_slotContainerClassName, _param_direction = param.direction, direction = _param_direction === void 0 ? "ltr" : _param_direction;
|
|
5514
5667
|
var firstInputRef = useRef5(null);
|
|
5515
5668
|
useEffect7(function() {
|
|
5516
5669
|
if (firstInputRef.current) {
|
|
@@ -5518,6 +5671,9 @@ function CodeInput(param) {
|
|
|
5518
5671
|
}
|
|
5519
5672
|
}, []);
|
|
5520
5673
|
return /* @__PURE__ */ jsx22("div", {
|
|
5674
|
+
style: {
|
|
5675
|
+
direction: direction
|
|
5676
|
+
},
|
|
5521
5677
|
className: cn("space-y-2 flex justify-center items-center", className),
|
|
5522
5678
|
children: /* @__PURE__ */ jsx22(OTPInput, {
|
|
5523
5679
|
ref: firstInputRef,
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -128,6 +128,9 @@ declare const query_document_by_conditions: (collection_path: string, where_cond
|
|
|
128
128
|
declare const snapshot: Snapshot;
|
|
129
129
|
declare const snapshotDocument: SnapshotDocument;
|
|
130
130
|
declare const cleanNxSites: () => Promise<void>;
|
|
131
|
+
declare const getUserByPhone: (phone: string) => Promise<TObject<any>>;
|
|
132
|
+
declare const getUserByEmail: (email: string) => Promise<TObject<any>>;
|
|
133
|
+
declare const getUserByIdentifier: (identifier: string) => Promise<TObject<any>>;
|
|
131
134
|
|
|
132
135
|
declare const calculateBearing: (startLat: any, startLng: any, endLat: any, endLng: any) => number;
|
|
133
136
|
declare const renderOnce: () => boolean;
|
|
@@ -211,4 +214,4 @@ type Method = "GET" | "POST" | "PUT" | "DELETE";
|
|
|
211
214
|
type ServerName = "devices" | "bi" | "call-center";
|
|
212
215
|
declare const nx_api_call: (serverName: ServerName, method: Method, url: string, data?: TObject<any>) => Promise<any>;
|
|
213
216
|
|
|
214
|
-
export { type ValidationType, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterDomain, carsRegex, chartsRegex, cleanNxSites, cn, collections, colorRegex, createSelectors, db, delete_document, devicesDomain, displayFormatPhoneNumber, emailRegex, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getFormElementValue, getLocationUrl, getUserCountryByIp, get_all_documents, get_document_by_id, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_iccid, local_israel_phone_format, mode, multiStringFormat, numbersOnlyRegex, numbersRegex, nx_api_call, parseMultiSelectInput, parsePermissions, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, setState, set_document, simpleExtractData, snapshot, snapshotDocument, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat };
|
|
217
|
+
export { type ValidationType, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterDomain, carsRegex, chartsRegex, cleanNxSites, cn, collections, colorRegex, createSelectors, db, delete_document, devicesDomain, displayFormatPhoneNumber, emailRegex, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_iccid, local_israel_phone_format, mode, multiStringFormat, numbersOnlyRegex, numbersRegex, nx_api_call, parseMultiSelectInput, parsePermissions, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, setState, set_document, simpleExtractData, snapshot, snapshotDocument, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -128,6 +128,9 @@ declare const query_document_by_conditions: (collection_path: string, where_cond
|
|
|
128
128
|
declare const snapshot: Snapshot;
|
|
129
129
|
declare const snapshotDocument: SnapshotDocument;
|
|
130
130
|
declare const cleanNxSites: () => Promise<void>;
|
|
131
|
+
declare const getUserByPhone: (phone: string) => Promise<TObject<any>>;
|
|
132
|
+
declare const getUserByEmail: (email: string) => Promise<TObject<any>>;
|
|
133
|
+
declare const getUserByIdentifier: (identifier: string) => Promise<TObject<any>>;
|
|
131
134
|
|
|
132
135
|
declare const calculateBearing: (startLat: any, startLng: any, endLat: any, endLng: any) => number;
|
|
133
136
|
declare const renderOnce: () => boolean;
|
|
@@ -211,4 +214,4 @@ type Method = "GET" | "POST" | "PUT" | "DELETE";
|
|
|
211
214
|
type ServerName = "devices" | "bi" | "call-center";
|
|
212
215
|
declare const nx_api_call: (serverName: ServerName, method: Method, url: string, data?: TObject<any>) => Promise<any>;
|
|
213
216
|
|
|
214
|
-
export { type ValidationType, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterDomain, carsRegex, chartsRegex, cleanNxSites, cn, collections, colorRegex, createSelectors, db, delete_document, devicesDomain, displayFormatPhoneNumber, emailRegex, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getFormElementValue, getLocationUrl, getUserCountryByIp, get_all_documents, get_document_by_id, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_iccid, local_israel_phone_format, mode, multiStringFormat, numbersOnlyRegex, numbersRegex, nx_api_call, parseMultiSelectInput, parsePermissions, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, setState, set_document, simpleExtractData, snapshot, snapshotDocument, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat };
|
|
217
|
+
export { type ValidationType, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterDomain, carsRegex, chartsRegex, cleanNxSites, cn, collections, colorRegex, createSelectors, db, delete_document, devicesDomain, displayFormatPhoneNumber, emailRegex, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_iccid, local_israel_phone_format, mode, multiStringFormat, numbersOnlyRegex, numbersRegex, nx_api_call, parseMultiSelectInput, parsePermissions, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, setState, set_document, simpleExtractData, snapshot, snapshotDocument, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat };
|