akeyless-client-commons 1.0.50 → 1.0.52
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 +10 -0
- package/dist/components/index.css.map +1 -1
- package/dist/components/index.d.mts +21 -5
- package/dist/components/index.d.ts +21 -5
- package/dist/components/index.js +752 -619
- package/dist/components/index.mjs +718 -589
- package/package.json +3 -2
package/dist/components/index.js
CHANGED
|
@@ -470,6 +470,9 @@ __export(components_exports, {
|
|
|
470
470
|
Loader: function() {
|
|
471
471
|
return Loader;
|
|
472
472
|
},
|
|
473
|
+
LoginWithGoogleButton: function() {
|
|
474
|
+
return LoginWithGoogleButton;
|
|
475
|
+
},
|
|
473
476
|
MaxRowsLabel: function() {
|
|
474
477
|
return MaxRowsLabel;
|
|
475
478
|
},
|
|
@@ -658,11 +661,250 @@ var ErrorBoundary = /*#__PURE__*/ function(_import_react_default_Component) {
|
|
|
658
661
|
}(import_react.default.Component);
|
|
659
662
|
// src/components/utils/loaders.tsx
|
|
660
663
|
var import_react_spinners = require("react-spinners");
|
|
664
|
+
// src/helpers/firebase.ts
|
|
665
|
+
var import_moment = __toESM(require("moment"));
|
|
666
|
+
var import_app = require("firebase/app");
|
|
667
|
+
var import_storage = require("firebase/storage");
|
|
668
|
+
var import_auth = require("firebase/auth");
|
|
669
|
+
var import_app_check = require("firebase/app-check");
|
|
670
|
+
var import_firestore = require("firebase/firestore");
|
|
671
|
+
var import_react2 = require("react");
|
|
672
|
+
var import_meta = {};
|
|
673
|
+
var initApp = function() {
|
|
674
|
+
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
675
|
+
var firebaseConfig = {
|
|
676
|
+
apiKey: isNodeEnv2 ? process.env.NEXT_PUBLIC_API_KEY : import_meta.env.VITE_API_KEY,
|
|
677
|
+
authDomain: isNodeEnv2 ? process.env.NEXT_PUBLIC_AUTH_DOMAIN : import_meta.env.VITE_AUTH_DOMAIN,
|
|
678
|
+
projectId: isNodeEnv2 ? process.env.NEXT_PUBLIC_PROJECT_ID : import_meta.env.VITE_PROJECT_ID,
|
|
679
|
+
storageBucket: isNodeEnv2 ? process.env.NEXT_PUBLIC_STORAGE_BUCKET : import_meta.env.VITE_STORAGE_BUCKET,
|
|
680
|
+
messagingSenderId: isNodeEnv2 ? process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID : import_meta.env.VITE_MESSAGING_SENDER_ID,
|
|
681
|
+
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import_meta.env.VITE_APP_ID
|
|
682
|
+
};
|
|
683
|
+
try {
|
|
684
|
+
var app2 = (0, import_app.initializeApp)(firebaseConfig);
|
|
685
|
+
var auth2 = (0, import_auth.getAuth)(app2);
|
|
686
|
+
auth2.settings.appVerificationDisabledForTesting = false;
|
|
687
|
+
var db2 = (0, import_firestore.getFirestore)(app2);
|
|
688
|
+
var storage2 = (0, import_storage.getStorage)(app2);
|
|
689
|
+
var googleLoginProvider2 = new import_auth.GoogleAuthProvider();
|
|
690
|
+
var recaptchaSiteKey = isNodeEnv2 ? process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY : import_meta.env.VITE_RECAPTCHA_SITE_KEY;
|
|
691
|
+
var result = {
|
|
692
|
+
db: db2,
|
|
693
|
+
auth: auth2,
|
|
694
|
+
storage: storage2,
|
|
695
|
+
app: app2,
|
|
696
|
+
googleLoginProvider: googleLoginProvider2
|
|
697
|
+
};
|
|
698
|
+
if (recaptchaSiteKey) {
|
|
699
|
+
result.appCheck = (0, import_app_check.initializeAppCheck)(app2, {
|
|
700
|
+
provider: new import_app_check.ReCaptchaEnterpriseProvider(recaptchaSiteKey),
|
|
701
|
+
isTokenAutoRefreshEnabled: true
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
return result;
|
|
705
|
+
} catch (error) {
|
|
706
|
+
console.error("Failed to initialize Firebase app:", error);
|
|
707
|
+
return {};
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
var _initApp = initApp(), db = _initApp.db, auth = _initApp.auth, storage = _initApp.storage, app = _initApp.app, appCheck = _initApp.appCheck, googleLoginProvider = _initApp.googleLoginProvider;
|
|
711
|
+
var useLoginWithGoogle = function() {
|
|
712
|
+
var signInWithGoogle = (0, import_react2.useCallback)(/*#__PURE__*/ _async_to_generator(function() {
|
|
713
|
+
var result, user;
|
|
714
|
+
return _ts_generator(this, function(_state) {
|
|
715
|
+
switch(_state.label){
|
|
716
|
+
case 0:
|
|
717
|
+
return [
|
|
718
|
+
4,
|
|
719
|
+
(0, import_auth.signInWithPopup)(auth, googleLoginProvider)
|
|
720
|
+
];
|
|
721
|
+
case 1:
|
|
722
|
+
result = _state.sent();
|
|
723
|
+
user = result.user;
|
|
724
|
+
return [
|
|
725
|
+
2,
|
|
726
|
+
user
|
|
727
|
+
];
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
}), [
|
|
731
|
+
auth,
|
|
732
|
+
googleLoginProvider
|
|
733
|
+
]);
|
|
734
|
+
return signInWithGoogle;
|
|
735
|
+
};
|
|
736
|
+
var collections = {
|
|
737
|
+
clients: (0, import_firestore.collection)(db, "nx-clients"),
|
|
738
|
+
sites: (0, import_firestore.collection)(db, "nx-sites"),
|
|
739
|
+
cars: (0, import_firestore.collection)(db, "units"),
|
|
740
|
+
users: (0, import_firestore.collection)(db, "nx-users"),
|
|
741
|
+
lastLocations: (0, import_firestore.collection)(db, "last_locations"),
|
|
742
|
+
ermEvents: (0, import_firestore.collection)(db, "erm_events_general"),
|
|
743
|
+
erm2Events: (0, import_firestore.collection)(db, "erm2_events_general"),
|
|
744
|
+
ruptelaEvents: (0, import_firestore.collection)(db, "ruptela_events_general"),
|
|
745
|
+
polygons: (0, import_firestore.collection)(db, "nx-polygons"),
|
|
746
|
+
polygonEvents: (0, import_firestore.collection)(db, "polygon_events"),
|
|
747
|
+
polygonCars: (0, import_firestore.collection)(db, "polygon_cars"),
|
|
748
|
+
canbus: (0, import_firestore.collection)(db, "erm_canbus_parameters"),
|
|
749
|
+
states: (0, import_firestore.collection)(db, "erm_states"),
|
|
750
|
+
app_pro_commands_queue: (0, import_firestore.collection)(db, "app_pro_commands_queue"),
|
|
751
|
+
trips: (0, import_firestore.collection)(db, "erm2_trip"),
|
|
752
|
+
tripsDetails: (0, import_firestore.collection)(db, "erm2_trip_details"),
|
|
753
|
+
audit: (0, import_firestore.collection)(db, "nx-audit"),
|
|
754
|
+
nx_settings: (0, import_firestore.collection)(db, "nx-settings"),
|
|
755
|
+
settings: (0, import_firestore.collection)(db, "settings"),
|
|
756
|
+
translations: (0, import_firestore.collection)(db, "nx-translations"),
|
|
757
|
+
nx_cars: (0, import_firestore.collection)(db, "nx-cars"),
|
|
758
|
+
boards: (0, import_firestore.collection)(db, "boards"),
|
|
759
|
+
protection_types: (0, import_firestore.collection)(db, "protectionTypes"),
|
|
760
|
+
board_types: (0, import_firestore.collection)(db, "boardTypes"),
|
|
761
|
+
charge_capacities: (0, import_firestore.collection)(db, "nx-charge-capacities")
|
|
762
|
+
};
|
|
763
|
+
var fire_base_TIME_TEMP = import_firestore.Timestamp.now;
|
|
764
|
+
// src/helpers/global.ts
|
|
765
|
+
var import_akeyless_types_commons = require("akeyless-types-commons");
|
|
766
|
+
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
|
+
var import_lodash = require("lodash");
|
|
771
|
+
var import_meta2 = {};
|
|
772
|
+
var renderOnce = function() {
|
|
773
|
+
return true;
|
|
774
|
+
};
|
|
775
|
+
var getLocationUrl = function(lng, lat) {
|
|
776
|
+
return "https://www.google.com/maps?q=".concat(lat, ",").concat(lng);
|
|
777
|
+
};
|
|
778
|
+
var isNodeEnv = typeof process !== "undefined" && process.env;
|
|
779
|
+
var _ref = {
|
|
780
|
+
mode: isNodeEnv ? process.env.NEXT_PUBLIC_MODE : import_meta2.env.VITE_MODE,
|
|
781
|
+
isLocal: (isNodeEnv ? process.env.NEXT_PUBLIC_IS_LOCAL : import_meta2.env.VITE_is_local) === "true"
|
|
782
|
+
}, mode = _ref.mode, isLocal = _ref.isLocal;
|
|
783
|
+
// src/helpers/forms.ts
|
|
784
|
+
var import_xregexp = __toESM(require("xregexp"));
|
|
785
|
+
var textRegex = (0, import_xregexp.default)("[^\\p{L}\\s-]", "gu");
|
|
786
|
+
var numbersRegex = (0, import_xregexp.default)("[^0-9\\s-+]", "g");
|
|
787
|
+
var numbersOnlyRegex = (0, import_xregexp.default)("[^0-9]", "g");
|
|
788
|
+
var priceRegex = (0, import_xregexp.default)("[^0-9.]", "g");
|
|
789
|
+
var emailRegex = (0, import_xregexp.default)("[^\\p{L}0-9.@\\s-]", "gu");
|
|
790
|
+
var colorRegex = (0, import_xregexp.default)("[^#0-9A-Fa-f]", "g");
|
|
791
|
+
var carsRegex = (0, import_xregexp.default)("[^\\p{L}0-9,_]", "gu");
|
|
792
|
+
var textNumbersRegex = (0, import_xregexp.default)("[^\\p{L}0-9\\s+\\-]", "gu");
|
|
793
|
+
var addressRegex = (0, import_xregexp.default)("[^\\p{L}0-9\\s.,+-\\-]", "gu");
|
|
794
|
+
var chartsRegex = (0, import_xregexp.default)("[^\\p{L}0-9\\s.,_@!+-\\-]", "gu");
|
|
795
|
+
var handleChange = function(e) {
|
|
796
|
+
e.target.setCustomValidity("");
|
|
797
|
+
var validation = e.target.getAttribute("data-validation");
|
|
798
|
+
if (validation === "text") {
|
|
799
|
+
e.target.value = import_xregexp.default.replace(e.target.value, textRegex, "");
|
|
800
|
+
} else if (validation === "numbers") {
|
|
801
|
+
e.target.value = import_xregexp.default.replace(e.target.value, numbersRegex, "");
|
|
802
|
+
} else if (validation === "numbersOnly") {
|
|
803
|
+
e.target.value = import_xregexp.default.replace(e.target.value, numbersOnlyRegex, "");
|
|
804
|
+
} else if (validation === "price") {
|
|
805
|
+
e.target.value = import_xregexp.default.replace(e.target.value, priceRegex, "");
|
|
806
|
+
} else if (validation === "textNumbers") {
|
|
807
|
+
e.target.value = import_xregexp.default.replace(e.target.value, textNumbersRegex, "");
|
|
808
|
+
} else if (validation === "email") {
|
|
809
|
+
e.target.value = import_xregexp.default.replace(e.target.value, emailRegex, "");
|
|
810
|
+
} else if (validation === "color") {
|
|
811
|
+
e.target.value = import_xregexp.default.replace(e.target.value, colorRegex, "");
|
|
812
|
+
} else if (validation === "address") {
|
|
813
|
+
e.target.value = import_xregexp.default.replace(e.target.value, addressRegex, "");
|
|
814
|
+
} else if (validation === "cars") {
|
|
815
|
+
e.target.value = import_xregexp.default.replace(e.target.value, carsRegex, "");
|
|
816
|
+
} else if (validation === "charts") {
|
|
817
|
+
e.target.value = import_xregexp.default.replace(e.target.value, chartsRegex, "");
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
var handlePaste = function(e) {
|
|
821
|
+
var validation = e.currentTarget.getAttribute("data-validation");
|
|
822
|
+
var pasteData = e.clipboardData.getData("text");
|
|
823
|
+
if (validation === "text") {
|
|
824
|
+
pasteData = import_xregexp.default.replace(pasteData, textRegex, "");
|
|
825
|
+
} else if (validation === "numbers") {
|
|
826
|
+
pasteData = import_xregexp.default.replace(pasteData, numbersRegex, "");
|
|
827
|
+
} else if (validation === "numbersOnly") {
|
|
828
|
+
pasteData = import_xregexp.default.replace(pasteData, numbersOnlyRegex, "");
|
|
829
|
+
} else if (validation === "price") {
|
|
830
|
+
pasteData = import_xregexp.default.replace(pasteData, priceRegex, "");
|
|
831
|
+
} else if (validation === "textNumbers") {
|
|
832
|
+
pasteData = import_xregexp.default.replace(pasteData, textNumbersRegex, "");
|
|
833
|
+
} else if (validation === "email") {
|
|
834
|
+
pasteData = import_xregexp.default.replace(pasteData, emailRegex, "");
|
|
835
|
+
} else if (validation === "color") {
|
|
836
|
+
pasteData = import_xregexp.default.replace(pasteData, colorRegex, "");
|
|
837
|
+
} else if (validation === "address") {
|
|
838
|
+
pasteData = import_xregexp.default.replace(pasteData, addressRegex, "");
|
|
839
|
+
} else if (validation === "cars") {
|
|
840
|
+
pasteData = import_xregexp.default.replace(pasteData, carsRegex, "");
|
|
841
|
+
} else if (validation === "charts") {
|
|
842
|
+
pasteData = import_xregexp.default.replace(pasteData, chartsRegex, "");
|
|
843
|
+
}
|
|
844
|
+
e.preventDefault();
|
|
845
|
+
document.execCommand("insertText", false, pasteData);
|
|
846
|
+
};
|
|
847
|
+
var handleInvalid = function(e, requireError) {
|
|
848
|
+
e.target.setCustomValidity(requireError || "This filed is required !");
|
|
849
|
+
};
|
|
850
|
+
var useValidation = function(validationType, requireError) {
|
|
851
|
+
return {
|
|
852
|
+
onChange: handleChange,
|
|
853
|
+
onPaste: handlePaste,
|
|
854
|
+
onInvalid: function(e) {
|
|
855
|
+
return handleInvalid(e, requireError);
|
|
856
|
+
},
|
|
857
|
+
"data-validation": validationType
|
|
858
|
+
};
|
|
859
|
+
};
|
|
860
|
+
var getFormElementValue = function(form, name) {
|
|
861
|
+
var _form_elements_namedItem;
|
|
862
|
+
return ((_form_elements_namedItem = form.elements.namedItem(name)) === null || _form_elements_namedItem === void 0 ? void 0 : _form_elements_namedItem.value) || "";
|
|
863
|
+
};
|
|
864
|
+
// src/lib/utils.ts
|
|
865
|
+
var import_clsx = require("clsx");
|
|
866
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
867
|
+
function cn() {
|
|
868
|
+
for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
869
|
+
inputs[_key] = arguments[_key];
|
|
870
|
+
}
|
|
871
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
872
|
+
}
|
|
873
|
+
// src/helpers/time_helpers.ts
|
|
874
|
+
var import_firestore2 = require("firebase/firestore");
|
|
875
|
+
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
876
|
+
function timestamp_to_string(firebaseTimestamp, options) {
|
|
877
|
+
var date;
|
|
878
|
+
if (_instanceof(firebaseTimestamp, import_firestore2.Timestamp)) {
|
|
879
|
+
date = firebaseTimestamp.toDate();
|
|
880
|
+
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
881
|
+
date = firebaseTimestamp;
|
|
882
|
+
} else if (typeof firebaseTimestamp === "string") {
|
|
883
|
+
date = import_moment_timezone.default.utc(firebaseTimestamp, (options === null || options === void 0 ? void 0 : options.fromFormat) || "DD/MM/YYYY HH:mm:ss").toDate();
|
|
884
|
+
if (isNaN(date.getTime())) {
|
|
885
|
+
throw new Error("Invalid date string format");
|
|
886
|
+
}
|
|
887
|
+
} else {
|
|
888
|
+
throw new Error("Invalid input: firebaseTimestamp must be a Timestamp, Date, or valid date string.");
|
|
889
|
+
}
|
|
890
|
+
if (options === null || options === void 0 ? void 0 : options.tz) {
|
|
891
|
+
var result = (0, import_moment_timezone.default)(date).tz(options === null || options === void 0 ? void 0 : options.tz).format((options === null || options === void 0 ? void 0 : options.format) || "DD/MM/YYYY HH:mm:ss");
|
|
892
|
+
return result;
|
|
893
|
+
}
|
|
894
|
+
return import_moment_timezone.default.utc(date).format((options === null || options === void 0 ? void 0 : options.format) || "DD/MM/YYYY HH:mm:ss");
|
|
895
|
+
}
|
|
896
|
+
// src/helpers/api.ts
|
|
897
|
+
var import_axios2 = __toESM(require("axios"));
|
|
898
|
+
var baseDomain = mode === "qa" ? "https://nx-api.xyz/api" : "https://nx-api.info/api";
|
|
899
|
+
var devicesDomain = isLocal ? "http://localhost:9001/api/devices" : baseDomain + "/devices";
|
|
900
|
+
var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
901
|
+
var callCenterDomain = isLocal ? "http://localhost:9003/api/call-center" : baseDomain + "/call-center";
|
|
902
|
+
// src/components/utils/loaders.tsx
|
|
661
903
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
662
904
|
var Loader = function(param) {
|
|
663
905
|
var color = param.color, size3 = param.size, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
|
|
664
906
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", {
|
|
665
|
-
className: "flex items-center justify-center
|
|
907
|
+
className: cn("flex items-center justify-center", className),
|
|
666
908
|
style: style,
|
|
667
909
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_spinners.ClipLoader, {
|
|
668
910
|
loading: true,
|
|
@@ -671,15 +913,6 @@ var Loader = function(param) {
|
|
|
671
913
|
})
|
|
672
914
|
});
|
|
673
915
|
};
|
|
674
|
-
// src/lib/utils.ts
|
|
675
|
-
var import_clsx = require("clsx");
|
|
676
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
677
|
-
function cn() {
|
|
678
|
-
for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
679
|
-
inputs[_key] = arguments[_key];
|
|
680
|
-
}
|
|
681
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
682
|
-
}
|
|
683
916
|
// src/components/utils/global.tsx
|
|
684
917
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
685
918
|
var Version = function(param) {
|
|
@@ -692,26 +925,130 @@ var Version = function(param) {
|
|
|
692
925
|
]
|
|
693
926
|
});
|
|
694
927
|
};
|
|
928
|
+
// src/components/utils/LoginWithGoogle.tsx
|
|
929
|
+
var import_react3 = require("react");
|
|
930
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
931
|
+
var GoogleSvg = function(param) {
|
|
932
|
+
var _param_width = param.width, width = _param_width === void 0 ? "20px" : _param_width, _param_height = param.height, height = _param_height === void 0 ? "20px" : _param_height, _param_viewBox = param.viewBox, viewBox = _param_viewBox === void 0 ? "0 0 256 266" : _param_viewBox;
|
|
933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", {
|
|
934
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
935
|
+
width: width,
|
|
936
|
+
height: height,
|
|
937
|
+
viewBox: viewBox,
|
|
938
|
+
preserveAspectRatio: "xMidYMid",
|
|
939
|
+
children: [
|
|
940
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", {
|
|
941
|
+
d: "M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",
|
|
942
|
+
fill: "#4285F4"
|
|
943
|
+
}),
|
|
944
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", {
|
|
945
|
+
d: "M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",
|
|
946
|
+
fill: "#34A853"
|
|
947
|
+
}),
|
|
948
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", {
|
|
949
|
+
d: "M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782",
|
|
950
|
+
fill: "#FBBC05"
|
|
951
|
+
}),
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", {
|
|
953
|
+
d: "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",
|
|
954
|
+
fill: "#EB4335"
|
|
955
|
+
})
|
|
956
|
+
]
|
|
957
|
+
});
|
|
958
|
+
};
|
|
959
|
+
var LoginWithGoogleButton = function(param) {
|
|
960
|
+
var label = param.label, className = param.className, containerClassName = param.containerClassName, onClick = param.onClick, _param_loaderProps = param.loaderProps, loaderProps = _param_loaderProps === void 0 ? {
|
|
961
|
+
color: "#000"
|
|
962
|
+
} : _param_loaderProps, googleSvgProps = param.googleSvgProps;
|
|
963
|
+
var signInWithGoogle = useLoginWithGoogle();
|
|
964
|
+
var _ref = _sliced_to_array((0, import_react3.useState)(false), 2), isLoading = _ref[0], setIsLoading = _ref[1];
|
|
965
|
+
var onLoginClick = /*#__PURE__*/ function() {
|
|
966
|
+
var _ref = _async_to_generator(function(e) {
|
|
967
|
+
var user, error;
|
|
968
|
+
return _ts_generator(this, function(_state) {
|
|
969
|
+
switch(_state.label){
|
|
970
|
+
case 0:
|
|
971
|
+
_state.trys.push([
|
|
972
|
+
0,
|
|
973
|
+
3,
|
|
974
|
+
4,
|
|
975
|
+
5
|
|
976
|
+
]);
|
|
977
|
+
setIsLoading(true);
|
|
978
|
+
return [
|
|
979
|
+
4,
|
|
980
|
+
signInWithGoogle()
|
|
981
|
+
];
|
|
982
|
+
case 1:
|
|
983
|
+
user = _state.sent();
|
|
984
|
+
return [
|
|
985
|
+
4,
|
|
986
|
+
onClick(e, user)
|
|
987
|
+
];
|
|
988
|
+
case 2:
|
|
989
|
+
_state.sent();
|
|
990
|
+
return [
|
|
991
|
+
3,
|
|
992
|
+
5
|
|
993
|
+
];
|
|
994
|
+
case 3:
|
|
995
|
+
error = _state.sent();
|
|
996
|
+
console.error("error from login with google:", error);
|
|
997
|
+
return [
|
|
998
|
+
3,
|
|
999
|
+
5
|
|
1000
|
+
];
|
|
1001
|
+
case 4:
|
|
1002
|
+
setIsLoading(false);
|
|
1003
|
+
return [
|
|
1004
|
+
7
|
|
1005
|
+
];
|
|
1006
|
+
case 5:
|
|
1007
|
+
return [
|
|
1008
|
+
2
|
|
1009
|
+
];
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
});
|
|
1013
|
+
return function onLoginClick(e) {
|
|
1014
|
+
return _ref.apply(this, arguments);
|
|
1015
|
+
};
|
|
1016
|
+
}();
|
|
1017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", {
|
|
1018
|
+
className: cn("flex justify-center", containerClassName),
|
|
1019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", {
|
|
1020
|
+
className: cn("center gap-2 py-2 w-11/12 max-w-80 ", "shadow-sm hover:border-[#303edb] border-[1px] rounded-lg text-lg", className),
|
|
1021
|
+
onClick: function(e) {
|
|
1022
|
+
return onLoginClick(e);
|
|
1023
|
+
},
|
|
1024
|
+
disabled: isLoading,
|
|
1025
|
+
children: [
|
|
1026
|
+
label,
|
|
1027
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Loader, _object_spread({}, loaderProps)) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GoogleSvg, _object_spread({}, googleSvgProps))
|
|
1028
|
+
]
|
|
1029
|
+
})
|
|
1030
|
+
});
|
|
1031
|
+
};
|
|
695
1032
|
// src/components/table/components.tsx
|
|
696
1033
|
var import_exceljs = __toESM(require("exceljs"));
|
|
697
1034
|
var import_file_saver = require("file-saver");
|
|
698
|
-
var
|
|
1035
|
+
var import_react10 = require("react");
|
|
699
1036
|
// src/assets/svg.tsx
|
|
700
|
-
var
|
|
1037
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
701
1038
|
var RedXSvg = function(param) {
|
|
702
1039
|
var height = param.height, width = param.width, viewBox = param.viewBox;
|
|
703
|
-
return /* @__PURE__ */ (0,
|
|
1040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", {
|
|
704
1041
|
xmlns: "http://www.w3.org/2000/svg",
|
|
705
1042
|
width: width || "32",
|
|
706
1043
|
height: height || "32",
|
|
707
1044
|
viewBox: viewBox || "0 0 32 32",
|
|
708
1045
|
fill: "none",
|
|
709
1046
|
children: [
|
|
710
|
-
/* @__PURE__ */ (0,
|
|
1047
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
711
1048
|
d: "M21.0801 10.3C20.6101 9.80996 19.8301 9.79996 19.3401 10.27L15.6101 13.89L11.8801 10.27C11.3901 9.79996 10.6101 9.80996 10.1401 10.3C9.67008 10.79 9.68008 11.57 10.1701 12.04L13.8501 15.61L10.1701 19.18C9.68008 19.65 9.67008 20.43 10.1401 20.92C10.6101 21.41 11.3901 21.42 11.8801 20.95L15.6101 17.33L19.3401 20.95C19.5701 21.17 19.8801 21.3 20.2001 21.3C20.8801 21.29 21.4301 20.73 21.4201 20.04C21.4201 19.72 21.2901 19.41 21.0601 19.19L17.3801 15.62L21.0601 12.05C21.5501 11.58 21.5601 10.8 21.0901 10.31L21.0801 10.3Z",
|
|
712
1049
|
fill: "#FF4C2B"
|
|
713
1050
|
}),
|
|
714
|
-
/* @__PURE__ */ (0,
|
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
715
1052
|
d: "M15.61 0C6.99 0 0 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z",
|
|
716
1053
|
fill: "#FF4C2B"
|
|
717
1054
|
})
|
|
@@ -720,20 +1057,20 @@ var RedXSvg = function(param) {
|
|
|
720
1057
|
};
|
|
721
1058
|
var RedXSvg2 = function(param) {
|
|
722
1059
|
var height = param.height, width = param.width, viewBox = param.viewBox;
|
|
723
|
-
return /* @__PURE__ */ (0,
|
|
1060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", {
|
|
724
1061
|
xmlns: "http://www.w3.org/2000/svg",
|
|
725
1062
|
width: width || "18px",
|
|
726
1063
|
height: height || "18px",
|
|
727
1064
|
viewBox: viewBox || "0,0,256,256",
|
|
728
1065
|
fillRule: "nonzero",
|
|
729
|
-
children: /* @__PURE__ */ (0,
|
|
1066
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("g", {
|
|
730
1067
|
fill: "#e90404",
|
|
731
1068
|
fillRule: "nonzero",
|
|
732
1069
|
stroke: "none",
|
|
733
1070
|
strokeWidth: "1",
|
|
734
|
-
children: /* @__PURE__ */ (0,
|
|
1071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("g", {
|
|
735
1072
|
transform: "scale(10.66667,10.66667)",
|
|
736
|
-
children: /* @__PURE__ */ (0,
|
|
1073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
737
1074
|
d: "M4.99023,3.99023c-0.40692,0.00011 -0.77321,0.24676 -0.92633,0.62377c-0.15312,0.37701 -0.06255,0.80921 0.22907,1.09303l6.29297,6.29297l-6.29297,6.29297c-0.26124,0.25082 -0.36647,0.62327 -0.27511,0.97371c0.09136,0.35044 0.36503,0.62411 0.71547,0.71547c0.35044,0.09136 0.72289,-0.01388 0.97371,-0.27511l6.29297,-6.29297l6.29297,6.29297c0.25082,0.26124 0.62327,0.36648 0.97371,0.27512c0.35044,-0.09136 0.62411,-0.36503 0.71547,-0.71547c0.09136,-0.35044 -0.01388,-0.72289 -0.27512,-0.97371l-6.29297,-6.29297l6.29297,-6.29297c0.29576,-0.28749 0.38469,-0.72707 0.22393,-1.10691c-0.16075,-0.37985 -0.53821,-0.62204 -0.9505,-0.60988c-0.2598,0.00774 -0.50638,0.11632 -0.6875,0.30273l-6.29297,6.29297l-6.29297,-6.29297c-0.18827,-0.19353 -0.4468,-0.30272 -0.7168,-0.30273z"
|
|
738
1075
|
})
|
|
739
1076
|
})
|
|
@@ -742,18 +1079,18 @@ var RedXSvg2 = function(param) {
|
|
|
742
1079
|
};
|
|
743
1080
|
var GreenVSvg = function(param) {
|
|
744
1081
|
var height = param.height, width = param.width, viewBox = param.viewBox;
|
|
745
|
-
return /* @__PURE__ */ (0,
|
|
1082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", {
|
|
746
1083
|
xmlns: "http://www.w3.org/2000/svg",
|
|
747
1084
|
width: width || "32",
|
|
748
1085
|
height: height || "32",
|
|
749
1086
|
viewBox: viewBox || "0 0 32 32",
|
|
750
1087
|
fill: "none",
|
|
751
1088
|
children: [
|
|
752
|
-
/* @__PURE__ */ (0,
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
753
1090
|
d: "M15.61 0C6.99 0 0.01 6.99 0 15.61C0.86 36.32 30.36 36.31 31.22 15.61C31.21 6.99 24.23 0 15.61 0ZM15.61 28.76C8.35 28.76 2.47 22.87 2.46 15.61C3.18 -1.84 28.04 -1.83 28.76 15.61C28.76 22.87 22.87 28.75 15.61 28.76Z",
|
|
754
1091
|
fill: "#3B8F08"
|
|
755
1092
|
}),
|
|
756
|
-
/* @__PURE__ */ (0,
|
|
1093
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
757
1094
|
d: "M21.66 10.15L13.37 18.44L9.58003 14.54C9.10003 14.06 8.32003 14.07 7.84003 14.54C7.38003 15.01 7.36003 15.76 7.82003 16.24L12.48 21.03C12.96 21.52 13.74 21.52 14.23 21.05L23.41 11.87C23.88 11.38 23.87 10.6 23.38 10.13C22.9 9.67003 22.15 9.67003 21.68 10.13L21.66 10.15Z",
|
|
758
1095
|
fill: "#3B8F08"
|
|
759
1096
|
})
|
|
@@ -761,9 +1098,9 @@ var GreenVSvg = function(param) {
|
|
|
761
1098
|
});
|
|
762
1099
|
};
|
|
763
1100
|
// src/assets/table.tsx
|
|
764
|
-
var
|
|
1101
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
765
1102
|
var sortSvg = function(upside_down) {
|
|
766
|
-
return /* @__PURE__ */ (0,
|
|
1103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", {
|
|
767
1104
|
style: upside_down ? {
|
|
768
1105
|
transform: "rotate(180deg)"
|
|
769
1106
|
} : {},
|
|
@@ -776,13 +1113,13 @@ var sortSvg = function(upside_down) {
|
|
|
776
1113
|
preserveAspectRatio: "xMidYMid meet",
|
|
777
1114
|
children: [
|
|
778
1115
|
" ",
|
|
779
|
-
/* @__PURE__ */ (0,
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", {
|
|
780
1117
|
transform: "translate(0.000000,1536.000000) scale(0.100000,-0.100000)",
|
|
781
1118
|
fill: "#fff",
|
|
782
1119
|
stroke: "none",
|
|
783
1120
|
children: [
|
|
784
1121
|
" ",
|
|
785
|
-
/* @__PURE__ */ (0,
|
|
1122
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
786
1123
|
d: "M6465 15350 c3 -5 -27 -25 -68 -44 -40 -19 -103 -57 -140 -86 -37 -28 -584 -569 -1215 -1203 -631 -633 -1699 -1705 -2374 -2382 -674 -676 -1237 -1243 -1249 -1260 -13 -16 -37 -46 -53 -65 -36 -41 -108 -185 -126 -250 -32 -119 -30 -352 3 -465 35 -120 102 -231 197 -325 132 -133 288 -208 479 -231 214 -26 418 31 596 166 39 29 703 685 1477 1458 774 772 1432 1421 1461 1441 105 73 239 71 347 -3 52 -36 70 -57 107 -131 17 -33 18 -252 24 -4710 6 -4979 3 -4715 49 -4855 118 -363 507 -605 876 -545 77 13 201 53 245 79 19 12 45 26 59 31 41 18 157 119 206 179 43 53 113 173 127 217 3 11 16 51 29 89 l22 70 6 4690 c5 4887 4 4736 43 4784 6 7 16 23 22 34 20 42 116 103 188 120 42 10 75 13 85 8 10 -5 34 -11 55 -15 20 -4 59 -21 85 -38 26 -17 686 -671 1467 -1453 781 -782 1443 -1439 1470 -1459 68 -49 178 -106 245 -128 30 -10 100 -24 155 -32 87 -12 114 -12 200 1 128 18 187 39 360 131 37 19 178 162 211 212 36 56 94 176 94 194 0 7 7 31 16 52 23 55 23 352 0 406 -9 21 -16 46 -16 56 0 30 -83 185 -130 242 -80 98 -4793 4810 -4865 4865 -66 50 -182 111 -250 132 -16 5 -29 15 -27 21 1 9 -62 12 -249 12 -157 0 -248 -4 -244 -10z"
|
|
787
1124
|
}),
|
|
788
1125
|
" "
|
|
@@ -793,8 +1130,8 @@ var sortSvg = function(upside_down) {
|
|
|
793
1130
|
});
|
|
794
1131
|
};
|
|
795
1132
|
var emptyFilterSvg = function(solid) {
|
|
796
|
-
return /* @__PURE__ */ (0,
|
|
797
|
-
children: solid ? /* @__PURE__ */ (0,
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {
|
|
1134
|
+
children: solid ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", {
|
|
798
1135
|
version: "1.0",
|
|
799
1136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
800
1137
|
width: "13",
|
|
@@ -803,13 +1140,13 @@ var emptyFilterSvg = function(solid) {
|
|
|
803
1140
|
preserveAspectRatio: "xMidYMid meet",
|
|
804
1141
|
children: [
|
|
805
1142
|
" ",
|
|
806
|
-
/* @__PURE__ */ (0,
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", {
|
|
807
1144
|
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
808
1145
|
fill: "#fff",
|
|
809
1146
|
stroke: "none",
|
|
810
1147
|
children: [
|
|
811
1148
|
" ",
|
|
812
|
-
/* @__PURE__ */ (0,
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
813
1150
|
d: "M382 8980 c-7 -11 -19 -20 -27 -20 -46 0 -166 -99 -196 -162 -46 -95 -51 -115 -47 -199 3 -70 9 -95 37 -149 42 -85 45 -90 118 -190 34 -47 72 -98 83 -115 12 -16 50 -70 85 -120 143 -200 188 -263 235 -330 27 -38 56 -79 64 -90 8 -11 46 -65 85 -120 38 -55 96 -136 128 -179 32 -44 60 -84 62 -90 2 -6 32 -48 65 -93 34 -45 99 -137 146 -203 47 -66 113 -159 148 -205 34 -46 62 -87 62 -90 0 -4 20 -33 45 -65 25 -32 45 -61 45 -64 0 -3 33 -50 73 -105 39 -54 106 -146 147 -205 41 -58 103 -144 138 -191 34 -46 62 -87 62 -90 0 -3 22 -36 50 -73 27 -37 61 -83 75 -102 14 -19 59 -82 100 -140 41 -58 95 -133 120 -167 25 -34 45 -66 45 -70 0 -4 13 -22 28 -40 15 -17 47 -61 72 -97 25 -37 74 -107 110 -156 36 -50 99 -138 140 -196 41 -58 108 -150 148 -205 39 -54 72 -102 72 -105 0 -3 20 -32 45 -64 25 -32 45 -62 45 -67 0 -5 14 -22 30 -38 17 -16 30 -33 30 -38 0 -5 19 -34 43 -65 90 -122 154 -259 178 -387 11 -56 14 -423 19 -1850 l5 -1780 29 -58 c36 -71 112 -148 168 -171 24 -10 51 -22 60 -27 24 -12 205 -11 213 1 3 6 15 10 25 10 11 0 34 6 52 14 18 8 52 21 76 30 64 24 118 44 165 62 23 8 55 22 70 30 16 8 36 14 46 14 9 0 26 7 37 15 10 8 27 15 37 15 11 0 31 6 45 14 15 8 47 22 72 31 25 9 60 23 78 31 18 8 39 14 47 14 7 0 26 6 42 14 15 8 48 22 73 31 25 10 57 23 72 31 14 8 35 14 45 14 11 0 28 7 39 15 10 8 26 15 35 15 14 0 62 19 197 76 18 8 40 14 48 14 9 0 28 6 42 14 28 15 36 18 235 92 23 9 56 22 72 29 17 7 50 21 75 31 84 34 127 77 181 182 9 18 20 56 24 85 4 28 10 714 14 1522 6 1402 7 1472 25 1520 41 109 110 235 188 344 46 62 88 121 93 130 6 9 30 45 55 80 72 101 159 222 250 351 47 67 113 159 148 205 34 46 62 87 62 90 0 4 27 42 60 85 33 43 60 81 60 84 0 3 22 36 50 73 27 37 60 83 72 101 13 18 30 41 38 52 8 10 35 49 60 85 25 37 73 104 108 150 34 46 62 87 62 90 0 3 33 50 73 103 40 53 81 111 91 127 11 17 45 65 78 107 32 43 58 80 58 83 0 4 20 33 45 65 25 32 45 63 45 70 0 6 7 13 15 16 8 4 15 10 15 16 0 5 26 44 58 86 32 42 70 95 85 117 64 95 144 206 208 292 38 51 69 95 69 99 0 3 13 23 29 43 26 33 92 126 193 271 21 30 48 68 60 85 85 112 108 144 108 150 0 3 27 42 60 85 33 43 60 81 60 85 0 3 28 44 63 90 34 47 82 114 107 151 25 36 50 71 56 77 5 7 32 44 58 82 27 39 62 86 77 106 16 20 29 42 29 48 0 6 4 11 8 11 5 0 25 32 45 71 36 68 37 75 37 175 0 118 -13 163 -69 234 -37 48 -127 112 -173 124 -16 3 -28 13 -28 21 0 13 -486 15 -4103 15 -4091 0 -4102 0 -4115 -20z"
|
|
814
1151
|
}),
|
|
815
1152
|
" "
|
|
@@ -817,7 +1154,7 @@ var emptyFilterSvg = function(solid) {
|
|
|
817
1154
|
}),
|
|
818
1155
|
" "
|
|
819
1156
|
]
|
|
820
|
-
}) : /* @__PURE__ */ (0,
|
|
1157
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", {
|
|
821
1158
|
version: "1.0",
|
|
822
1159
|
xmlns: "http://www.w3.org/2000/svg",
|
|
823
1160
|
width: "13",
|
|
@@ -826,13 +1163,13 @@ var emptyFilterSvg = function(solid) {
|
|
|
826
1163
|
preserveAspectRatio: "xMidYMid meet",
|
|
827
1164
|
children: [
|
|
828
1165
|
" ",
|
|
829
|
-
/* @__PURE__ */ (0,
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", {
|
|
830
1167
|
transform: "translate(0.000000,300.000000) scale(0.050000,-0.050000)",
|
|
831
1168
|
fill: "#fff",
|
|
832
1169
|
stroke: "none",
|
|
833
1170
|
children: [
|
|
834
1171
|
" ",
|
|
835
|
-
/* @__PURE__ */ (0,
|
|
1172
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
836
1173
|
d: "M58 5702 c-100 -101 -84 -148 136 -416 107 -130 242 -294 301 -366 58 -71 173 -211 254 -310 81 -99 441 -535 799 -969 l652 -789 0 -1201 c0 -1396 2 -1411 182 -1411 60 0 1302 604 1360 662 36 36 38 79 38 935 0 494 5 925 12 959 8 41 370 495 1110 1393 1202 1459 1158 1394 1040 1513 l-59 58 -2883 0 -2883 0 -59 -58z m5349 -327 c-16 -26 -150 -190 -683 -835 -169 -203 -381 -460 -472 -570 -90 -110 -290 -352 -443 -537 -154 -186 -301 -369 -329 -408 l-50 -70 -6 -913 -5 -913 -410 -205 c-225 -112 -413 -204 -418 -204 -6 0 -12 503 -15 1117 l-6 1118 -50 70 c-27 39 -175 222 -329 408 -153 185 -353 427 -443 537 -91 110 -303 367 -472 570 -533 645 -667 809 -683 835 -12 20 474 25 2407 25 1933 0 2419 -5 2407 -25z"
|
|
837
1174
|
}),
|
|
838
1175
|
" "
|
|
@@ -844,10 +1181,10 @@ var emptyFilterSvg = function(solid) {
|
|
|
844
1181
|
});
|
|
845
1182
|
};
|
|
846
1183
|
var slashFilterSvg = function(solid) {
|
|
847
|
-
return /* @__PURE__ */ (0,
|
|
848
|
-
children: solid ? /* @__PURE__ */ (0,
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {
|
|
1185
|
+
children: solid ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
849
1186
|
className: "mt-[-4px] mr-[-2px] ",
|
|
850
|
-
children: /* @__PURE__ */ (0,
|
|
1187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", {
|
|
851
1188
|
version: "1.0",
|
|
852
1189
|
xmlns: "http://www.w3.org/2000/svg",
|
|
853
1190
|
width: "18",
|
|
@@ -856,17 +1193,17 @@ var slashFilterSvg = function(solid) {
|
|
|
856
1193
|
preserveAspectRatio: "xMidYMid meet",
|
|
857
1194
|
children: [
|
|
858
1195
|
" ",
|
|
859
|
-
/* @__PURE__ */ (0,
|
|
1196
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", {
|
|
860
1197
|
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
861
1198
|
fill: "#fff",
|
|
862
1199
|
stroke: "none",
|
|
863
1200
|
children: [
|
|
864
1201
|
" ",
|
|
865
|
-
/* @__PURE__ */ (0,
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
866
1203
|
d: "M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z"
|
|
867
1204
|
}),
|
|
868
1205
|
" ",
|
|
869
|
-
/* @__PURE__ */ (0,
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
870
1207
|
d: "M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 186 0 14 -3600 3624 -3614 3624 -3 0 -6 -6 -6 -12z"
|
|
871
1208
|
}),
|
|
872
1209
|
" "
|
|
@@ -875,9 +1212,9 @@ var slashFilterSvg = function(solid) {
|
|
|
875
1212
|
" "
|
|
876
1213
|
]
|
|
877
1214
|
})
|
|
878
|
-
}) : /* @__PURE__ */ (0,
|
|
1215
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
879
1216
|
className: "mt-[-4px] mr-[-2px] ",
|
|
880
|
-
children: /* @__PURE__ */ (0,
|
|
1217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", {
|
|
881
1218
|
version: "1.0",
|
|
882
1219
|
xmlns: "http://www.w3.org/2000/svg",
|
|
883
1220
|
width: "18",
|
|
@@ -886,153 +1223,71 @@ var slashFilterSvg = function(solid) {
|
|
|
886
1223
|
preserveAspectRatio: "xMidYMid meet",
|
|
887
1224
|
children: [
|
|
888
1225
|
" ",
|
|
889
|
-
/* @__PURE__ */ (0,
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", {
|
|
890
1227
|
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
891
1228
|
fill: "#fff",
|
|
892
1229
|
stroke: "none",
|
|
893
1230
|
children: [
|
|
894
1231
|
" ",
|
|
895
|
-
/* @__PURE__ */ (0,
|
|
1232
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
896
1233
|
d: "M1000 8221 c-71 -27 -103 -47 -149 -92 -122 -123 -144 -294 -58 -456 22 -42 6838 -6858 6880 -6880 162 -86 333 -64 456 58 123 123 144 294 57 458 -10 19 -508 525 -1107 1124 l-1089 1089 1 256 1 257 676 1350 677 1350 115 6 c125 6 173 20 244 68 54 37 89 78 124 145 24 46 27 61 27 161 0 100 -3 115 -28 162 -52 100 -119 157 -225 194 -54 18 -131 19 -2817 19 l-2762 0 -341 340 c-188 186 -356 347 -374 357 -103 55 -220 68 -308 34z m5494 -1490 c6 -10 -1204 -2436 -1226 -2458 -13 -13 -168 139 -1247 1217 -677 677 -1231 1236 -1231 1241 0 12 3697 12 3704 0z"
|
|
897
1234
|
}),
|
|
898
1235
|
" ",
|
|
899
|
-
/* @__PURE__ */ (0,
|
|
1236
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
900
1237
|
d: "M2340 5338 c0 -7 146 -305 325 -662 l325 -649 0 -1112 c0 -1043 1 -1114 18 -1160 27 -76 47 -107 94 -154 48 -47 80 -67 153 -93 46 -17 120 -18 1231 -18 1085 0 1186 1 1235 17 30 9 66 24 81 33 68 40 158 146 158 185 0 18 -692 715 -709 715 -6 0 -11 -38 -13 -97 l-3 -98 -745 0 -745 0 -3 858 -2 859 -694 694 c-382 382 -697 694 -700 694 -3 0 -6 -6 -6 -12z"
|
|
901
|
-
}),
|
|
902
|
-
" "
|
|
903
|
-
]
|
|
904
|
-
}),
|
|
905
|
-
" "
|
|
906
|
-
]
|
|
907
|
-
})
|
|
908
|
-
})
|
|
909
|
-
});
|
|
910
|
-
};
|
|
911
|
-
var exportToExcelSvg = function(width, height, viewBox) {
|
|
912
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", {
|
|
913
|
-
version: "1.0",
|
|
914
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
915
|
-
width: width || "18",
|
|
916
|
-
height: height || "18",
|
|
917
|
-
viewBox: viewBox || "0 0 150.000000 150.000000",
|
|
918
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
919
|
-
children: [
|
|
920
|
-
" ",
|
|
921
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("g", {
|
|
922
|
-
transform: "translate(0.000000,150.000000) scale(0.100000,-0.100000)",
|
|
923
|
-
fill: "#ffffff",
|
|
924
|
-
stroke: "none",
|
|
925
|
-
children: [
|
|
926
|
-
" ",
|
|
927
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
928
|
-
d: "M205 1418 c-3 -7 -4 -317 -3 -688 l3 -675 435 -3 c239 -1 441 0 449 3 11 4 9 11 -9 30 l-23 25 -396 2 -396 3 0 625 0 625 280 0 280 0 5 -190 5 -190 190 -5 190 -5 5 -175 5 -175 25 0 25 0 3 200 2 199 -202 203 -203 203 -333 0 c-257 0 -334 -3 -337 -12z m828 -235 c70 -70 127 -131 127 -135 0 -5 -60 -7 -132 -6 l-133 3 -3 133 c-1 72 1 132 6 132 4 0 65 -57 135 -127z"
|
|
929
|
-
}),
|
|
930
|
-
" ",
|
|
931
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
932
|
-
d: "M518 915 c-6 -6 9 -37 42 -90 11 -16 23 -37 27 -45 4 -8 19 -36 35 -61 15 -25 28 -56 28 -68 0 -20 -29 -69 -121 -209 -16 -24 -29 -47 -29 -53 0 -5 31 -9 68 -9 l69 0 42 82 c60 116 66 118 107 35 56 -114 53 -112 127 -115 51 -2 67 0 67 11 0 7 -5 18 -11 24 -11 11 -26 36 -49 78 -6 11 -19 34 -30 50 -11 17 -24 40 -29 52 -5 11 -15 24 -20 28 -26 16 -18 33 97 212 25 39 39 70 34 75 -5 5 -36 8 -68 6 l-59 -3 -42 -84 c-24 -46 -45 -86 -48 -89 -6 -6 -44 40 -45 54 0 6 -13 35 -29 65 l-28 54 -65 3 c-35 2 -67 0 -70 -3z"
|
|
933
|
-
}),
|
|
934
|
-
" ",
|
|
935
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
936
|
-
d: "M1135 548 c-3 -7 -6 -67 -7 -133 l-3 -120 -55 -3 c-30 -1 -61 -5 -68 -7 -8 -3 28 -53 95 -132 122 -146 129 -153 140 -153 4 0 22 17 38 37 26 32 53 63 175 206 13 15 30 27 38 27 9 0 12 3 8 7 -3 4 -39 9 -79 12 l-72 6 -5 130 -5 130 -98 3 c-72 2 -99 -1 -102 -10z m145 -183 l5 -130 28 -3 c15 -2 27 -8 27 -14 0 -18 -92 -128 -107 -128 -11 1 -97 107 -101 125 -2 8 7 15 25 17 l28 3 3 120 c1 66 4 126 7 133 3 9 18 12 42 10 l38 -3 5 -130z"
|
|
937
|
-
}),
|
|
938
|
-
" "
|
|
939
|
-
]
|
|
940
|
-
}),
|
|
941
|
-
" "
|
|
942
|
-
]
|
|
943
|
-
});
|
|
944
|
-
};
|
|
945
|
-
// src/components/table/hooks.tsx
|
|
946
|
-
var import_react3 = require("react");
|
|
947
|
-
var import_zustand = require("zustand");
|
|
948
|
-
var import_lodash2 = require("lodash");
|
|
949
|
-
// src/components/table/Table.tsx
|
|
950
|
-
var import_react2 = __toESM(require("react"));
|
|
951
|
-
var import_lodash = require("lodash");
|
|
952
|
-
// src/helpers/forms.ts
|
|
953
|
-
var import_xregexp = __toESM(require("xregexp"));
|
|
954
|
-
var textRegex = (0, import_xregexp.default)("[^\\p{L}\\s-]", "gu");
|
|
955
|
-
var numbersRegex = (0, import_xregexp.default)("[^0-9\\s-+]", "g");
|
|
956
|
-
var numbersOnlyRegex = (0, import_xregexp.default)("[^0-9]", "g");
|
|
957
|
-
var priceRegex = (0, import_xregexp.default)("[^0-9.]", "g");
|
|
958
|
-
var emailRegex = (0, import_xregexp.default)("[^\\p{L}0-9.@\\s-]", "gu");
|
|
959
|
-
var colorRegex = (0, import_xregexp.default)("[^#0-9A-Fa-f]", "g");
|
|
960
|
-
var carsRegex = (0, import_xregexp.default)("[^\\p{L}0-9,_]", "gu");
|
|
961
|
-
var textNumbersRegex = (0, import_xregexp.default)("[^\\p{L}0-9\\s+\\-]", "gu");
|
|
962
|
-
var addressRegex = (0, import_xregexp.default)("[^\\p{L}0-9\\s.,+-\\-]", "gu");
|
|
963
|
-
var chartsRegex = (0, import_xregexp.default)("[^\\p{L}0-9\\s.,_@!+-\\-]", "gu");
|
|
964
|
-
var handleChange = function(e) {
|
|
965
|
-
e.target.setCustomValidity("");
|
|
966
|
-
var validation = e.target.getAttribute("data-validation");
|
|
967
|
-
if (validation === "text") {
|
|
968
|
-
e.target.value = import_xregexp.default.replace(e.target.value, textRegex, "");
|
|
969
|
-
} else if (validation === "numbers") {
|
|
970
|
-
e.target.value = import_xregexp.default.replace(e.target.value, numbersRegex, "");
|
|
971
|
-
} else if (validation === "numbersOnly") {
|
|
972
|
-
e.target.value = import_xregexp.default.replace(e.target.value, numbersOnlyRegex, "");
|
|
973
|
-
} else if (validation === "price") {
|
|
974
|
-
e.target.value = import_xregexp.default.replace(e.target.value, priceRegex, "");
|
|
975
|
-
} else if (validation === "textNumbers") {
|
|
976
|
-
e.target.value = import_xregexp.default.replace(e.target.value, textNumbersRegex, "");
|
|
977
|
-
} else if (validation === "email") {
|
|
978
|
-
e.target.value = import_xregexp.default.replace(e.target.value, emailRegex, "");
|
|
979
|
-
} else if (validation === "color") {
|
|
980
|
-
e.target.value = import_xregexp.default.replace(e.target.value, colorRegex, "");
|
|
981
|
-
} else if (validation === "address") {
|
|
982
|
-
e.target.value = import_xregexp.default.replace(e.target.value, addressRegex, "");
|
|
983
|
-
} else if (validation === "cars") {
|
|
984
|
-
e.target.value = import_xregexp.default.replace(e.target.value, carsRegex, "");
|
|
985
|
-
} else if (validation === "charts") {
|
|
986
|
-
e.target.value = import_xregexp.default.replace(e.target.value, chartsRegex, "");
|
|
987
|
-
}
|
|
988
|
-
};
|
|
989
|
-
var handlePaste = function(e) {
|
|
990
|
-
var validation = e.currentTarget.getAttribute("data-validation");
|
|
991
|
-
var pasteData = e.clipboardData.getData("text");
|
|
992
|
-
if (validation === "text") {
|
|
993
|
-
pasteData = import_xregexp.default.replace(pasteData, textRegex, "");
|
|
994
|
-
} else if (validation === "numbers") {
|
|
995
|
-
pasteData = import_xregexp.default.replace(pasteData, numbersRegex, "");
|
|
996
|
-
} else if (validation === "numbersOnly") {
|
|
997
|
-
pasteData = import_xregexp.default.replace(pasteData, numbersOnlyRegex, "");
|
|
998
|
-
} else if (validation === "price") {
|
|
999
|
-
pasteData = import_xregexp.default.replace(pasteData, priceRegex, "");
|
|
1000
|
-
} else if (validation === "textNumbers") {
|
|
1001
|
-
pasteData = import_xregexp.default.replace(pasteData, textNumbersRegex, "");
|
|
1002
|
-
} else if (validation === "email") {
|
|
1003
|
-
pasteData = import_xregexp.default.replace(pasteData, emailRegex, "");
|
|
1004
|
-
} else if (validation === "color") {
|
|
1005
|
-
pasteData = import_xregexp.default.replace(pasteData, colorRegex, "");
|
|
1006
|
-
} else if (validation === "address") {
|
|
1007
|
-
pasteData = import_xregexp.default.replace(pasteData, addressRegex, "");
|
|
1008
|
-
} else if (validation === "cars") {
|
|
1009
|
-
pasteData = import_xregexp.default.replace(pasteData, carsRegex, "");
|
|
1010
|
-
} else if (validation === "charts") {
|
|
1011
|
-
pasteData = import_xregexp.default.replace(pasteData, chartsRegex, "");
|
|
1012
|
-
}
|
|
1013
|
-
e.preventDefault();
|
|
1014
|
-
document.execCommand("insertText", false, pasteData);
|
|
1015
|
-
};
|
|
1016
|
-
var handleInvalid = function(e, requireError) {
|
|
1017
|
-
e.target.setCustomValidity(requireError || "This filed is required !");
|
|
1018
|
-
};
|
|
1019
|
-
var useValidation = function(validationType, requireError) {
|
|
1020
|
-
return {
|
|
1021
|
-
onChange: handleChange,
|
|
1022
|
-
onPaste: handlePaste,
|
|
1023
|
-
onInvalid: function(e) {
|
|
1024
|
-
return handleInvalid(e, requireError);
|
|
1025
|
-
},
|
|
1026
|
-
"data-validation": validationType
|
|
1027
|
-
};
|
|
1238
|
+
}),
|
|
1239
|
+
" "
|
|
1240
|
+
]
|
|
1241
|
+
}),
|
|
1242
|
+
" "
|
|
1243
|
+
]
|
|
1244
|
+
})
|
|
1245
|
+
})
|
|
1246
|
+
});
|
|
1028
1247
|
};
|
|
1029
|
-
var
|
|
1030
|
-
|
|
1031
|
-
|
|
1248
|
+
var exportToExcelSvg = function(width, height, viewBox) {
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", {
|
|
1250
|
+
version: "1.0",
|
|
1251
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1252
|
+
width: width || "18",
|
|
1253
|
+
height: height || "18",
|
|
1254
|
+
viewBox: viewBox || "0 0 150.000000 150.000000",
|
|
1255
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1256
|
+
children: [
|
|
1257
|
+
" ",
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", {
|
|
1259
|
+
transform: "translate(0.000000,150.000000) scale(0.100000,-0.100000)",
|
|
1260
|
+
fill: "#ffffff",
|
|
1261
|
+
stroke: "none",
|
|
1262
|
+
children: [
|
|
1263
|
+
" ",
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
1265
|
+
d: "M205 1418 c-3 -7 -4 -317 -3 -688 l3 -675 435 -3 c239 -1 441 0 449 3 11 4 9 11 -9 30 l-23 25 -396 2 -396 3 0 625 0 625 280 0 280 0 5 -190 5 -190 190 -5 190 -5 5 -175 5 -175 25 0 25 0 3 200 2 199 -202 203 -203 203 -333 0 c-257 0 -334 -3 -337 -12z m828 -235 c70 -70 127 -131 127 -135 0 -5 -60 -7 -132 -6 l-133 3 -3 133 c-1 72 1 132 6 132 4 0 65 -57 135 -127z"
|
|
1266
|
+
}),
|
|
1267
|
+
" ",
|
|
1268
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
1269
|
+
d: "M518 915 c-6 -6 9 -37 42 -90 11 -16 23 -37 27 -45 4 -8 19 -36 35 -61 15 -25 28 -56 28 -68 0 -20 -29 -69 -121 -209 -16 -24 -29 -47 -29 -53 0 -5 31 -9 68 -9 l69 0 42 82 c60 116 66 118 107 35 56 -114 53 -112 127 -115 51 -2 67 0 67 11 0 7 -5 18 -11 24 -11 11 -26 36 -49 78 -6 11 -19 34 -30 50 -11 17 -24 40 -29 52 -5 11 -15 24 -20 28 -26 16 -18 33 97 212 25 39 39 70 34 75 -5 5 -36 8 -68 6 l-59 -3 -42 -84 c-24 -46 -45 -86 -48 -89 -6 -6 -44 40 -45 54 0 6 -13 35 -29 65 l-28 54 -65 3 c-35 2 -67 0 -70 -3z"
|
|
1270
|
+
}),
|
|
1271
|
+
" ",
|
|
1272
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
1273
|
+
d: "M1135 548 c-3 -7 -6 -67 -7 -133 l-3 -120 -55 -3 c-30 -1 -61 -5 -68 -7 -8 -3 28 -53 95 -132 122 -146 129 -153 140 -153 4 0 22 17 38 37 26 32 53 63 175 206 13 15 30 27 38 27 9 0 12 3 8 7 -3 4 -39 9 -79 12 l-72 6 -5 130 -5 130 -98 3 c-72 2 -99 -1 -102 -10z m145 -183 l5 -130 28 -3 c15 -2 27 -8 27 -14 0 -18 -92 -128 -107 -128 -11 1 -97 107 -101 125 -2 8 7 15 25 17 l28 3 3 120 c1 66 4 126 7 133 3 9 18 12 42 10 l38 -3 5 -130z"
|
|
1274
|
+
}),
|
|
1275
|
+
" "
|
|
1276
|
+
]
|
|
1277
|
+
}),
|
|
1278
|
+
" "
|
|
1279
|
+
]
|
|
1280
|
+
});
|
|
1032
1281
|
};
|
|
1282
|
+
// src/components/table/hooks.tsx
|
|
1283
|
+
var import_react5 = require("react");
|
|
1284
|
+
var import_zustand = require("zustand");
|
|
1285
|
+
var import_lodash3 = require("lodash");
|
|
1033
1286
|
// src/components/table/Table.tsx
|
|
1034
|
-
var
|
|
1035
|
-
var
|
|
1287
|
+
var import_react4 = __toESM(require("react"));
|
|
1288
|
+
var import_lodash2 = require("lodash");
|
|
1289
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1290
|
+
var TableContext = (0, import_react4.createContext)(null);
|
|
1036
1291
|
var TableProvider = function(props) {
|
|
1037
1292
|
var // basic props
|
|
1038
1293
|
data = props.data, headers = props.headers, optionalElement = props.optionalElement, _props_keysToRender = props.keysToRender, keysToRender = _props_keysToRender === void 0 ? [] : _props_keysToRender, _props_direction = props.direction, direction = _props_direction === void 0 ? "ltr" : _props_direction, _props_onRowClick = props.onRowClick, onRowClick = _props_onRowClick === void 0 ? function(data2) {} : _props_onRowClick, // container styles props
|
|
@@ -1052,7 +1307,7 @@ var TableProvider = function(props) {
|
|
|
1052
1307
|
data: data,
|
|
1053
1308
|
filterableColumns: filterableColumns
|
|
1054
1309
|
}), filters = _useFilter.filters, filterPopupsDisplay = _useFilter.filterPopupsDisplay, filterOptions = _useFilter.filterOptions, handleFilterChange = _useFilter.handleFilterChange, handleFilterClick = _useFilter.handleFilterClick, closeFilterWindow = _useFilter.closeFilterWindow, clearFilter = _useFilter.clearFilter;
|
|
1055
|
-
var allKeys = (0,
|
|
1310
|
+
var allKeys = (0, import_react4.useMemo)(function() {
|
|
1056
1311
|
return Array.from(data.reduce(function(keys, obj) {
|
|
1057
1312
|
Object.keys(obj).forEach(function(key) {
|
|
1058
1313
|
return keys.add(key);
|
|
@@ -1062,7 +1317,7 @@ var TableProvider = function(props) {
|
|
|
1062
1317
|
}, [
|
|
1063
1318
|
data
|
|
1064
1319
|
]);
|
|
1065
|
-
var dataToRender = (0,
|
|
1320
|
+
var dataToRender = (0, import_react4.useMemo)(function() {
|
|
1066
1321
|
var filtered = data;
|
|
1067
1322
|
if (includeSearch && deferredSearchQuery.length > 0) {
|
|
1068
1323
|
var cleanString = function(str) {
|
|
@@ -1128,9 +1383,9 @@ var TableProvider = function(props) {
|
|
|
1128
1383
|
handleFilterClick: handleFilterClick,
|
|
1129
1384
|
closeFilterWindow: closeFilterWindow
|
|
1130
1385
|
});
|
|
1131
|
-
return /* @__PURE__ */ (0,
|
|
1386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableContext.Provider, {
|
|
1132
1387
|
value: providerValues,
|
|
1133
|
-
children: /* @__PURE__ */ (0,
|
|
1388
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", {
|
|
1134
1389
|
className: "flex flex-col gap-2 ".concat(containerClassName),
|
|
1135
1390
|
style: _object_spread_props(_object_spread({}, containerStyle), {
|
|
1136
1391
|
direction: direction
|
|
@@ -1141,51 +1396,51 @@ var TableProvider = function(props) {
|
|
|
1141
1396
|
};
|
|
1142
1397
|
var TableBase = function(props) {
|
|
1143
1398
|
var containerHeaderClassName = props.containerHeaderClassName, optionalElement = props.optionalElement, tableContainerClass = props.tableContainerClass, tableContainerStyle = props.tableContainerStyle, tableStyle = props.tableStyle, includeSearch = props.includeSearch, exportToExcelKeys = props.exportToExcelKeys, sumColumns = props.sumColumns, direction = props.direction, maxRowsLabel1 = props.maxRowsLabel1, maxRowsLabel2 = props.maxRowsLabel2, searchContainerClassName = props.searchContainerClassName;
|
|
1144
|
-
return /* @__PURE__ */ (0,
|
|
1399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(TableProvider, _object_spread_props(_object_spread({}, props), {
|
|
1145
1400
|
children: [
|
|
1146
|
-
/* @__PURE__ */ (0,
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", {
|
|
1147
1402
|
style: {
|
|
1148
1403
|
direction: direction
|
|
1149
1404
|
},
|
|
1150
1405
|
className: cn("flex justify-start items-center gap-2", containerHeaderClassName || ""),
|
|
1151
1406
|
children: [
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", {
|
|
1153
1408
|
className: cn("flex justify-start items-center gap-2", searchContainerClassName),
|
|
1154
1409
|
children: [
|
|
1155
|
-
includeSearch && /* @__PURE__ */ (0,
|
|
1156
|
-
exportToExcelKeys && /* @__PURE__ */ (0,
|
|
1410
|
+
includeSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Search, {}),
|
|
1411
|
+
exportToExcelKeys && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ExportToExcel, {})
|
|
1157
1412
|
]
|
|
1158
1413
|
}),
|
|
1159
|
-
maxRowsLabel1 && maxRowsLabel2 && /* @__PURE__ */ (0,
|
|
1414
|
+
maxRowsLabel1 && maxRowsLabel2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MaxRowsLabel, {}),
|
|
1160
1415
|
optionalElement && optionalElement
|
|
1161
1416
|
]
|
|
1162
1417
|
}),
|
|
1163
|
-
/* @__PURE__ */ (0,
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", {
|
|
1164
1419
|
style: _object_spread_props(_object_spread({}, tableContainerStyle || {}), {
|
|
1165
1420
|
direction: direction
|
|
1166
1421
|
}),
|
|
1167
1422
|
className: cn("animate-slide-in-up overflow-y-auto", tableContainerClass || ""),
|
|
1168
|
-
children: /* @__PURE__ */ (0,
|
|
1423
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("table", {
|
|
1169
1424
|
style: tableStyle,
|
|
1170
1425
|
className: "min-w-full text-sm font-light relative",
|
|
1171
1426
|
children: [
|
|
1172
|
-
/* @__PURE__ */ (0,
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableHead, {}),
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableBody, {})
|
|
1174
1429
|
]
|
|
1175
1430
|
})
|
|
1176
1431
|
}),
|
|
1177
|
-
sumColumns && /* @__PURE__ */ (0,
|
|
1432
|
+
sumColumns && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Summary, {})
|
|
1178
1433
|
]
|
|
1179
1434
|
}));
|
|
1180
1435
|
};
|
|
1181
1436
|
var areEqual = function(prevProps, nextProps) {
|
|
1182
|
-
return (0,
|
|
1437
|
+
return (0, import_lodash2.isEqual)(prevProps, nextProps);
|
|
1183
1438
|
};
|
|
1184
|
-
var Table =
|
|
1439
|
+
var Table = import_react4.default.memo(TableBase, areEqual);
|
|
1185
1440
|
Table.displayName = "Table";
|
|
1186
1441
|
// src/components/table/hooks.tsx
|
|
1187
1442
|
var useTableContext = function() {
|
|
1188
|
-
var context = (0,
|
|
1443
|
+
var context = (0, import_react5.useContext)(TableContext);
|
|
1189
1444
|
if (!context) {
|
|
1190
1445
|
throw new Error("useTableContext must be used within a Table component");
|
|
1191
1446
|
}
|
|
@@ -1196,8 +1451,8 @@ var useFilter = function(param) {
|
|
|
1196
1451
|
var initFilter = filterableColumns.reduce(function(acc, col) {
|
|
1197
1452
|
return _object_spread_props(_object_spread({}, acc), _define_property({}, col.dataKey, []));
|
|
1198
1453
|
}, {});
|
|
1199
|
-
var _ref = _sliced_to_array((0,
|
|
1200
|
-
var _ref1 = _sliced_to_array((0,
|
|
1454
|
+
var _ref = _sliced_to_array((0, import_react5.useState)(initFilter), 2), filters = _ref[0], setFilters = _ref[1];
|
|
1455
|
+
var _ref1 = _sliced_to_array((0, import_react5.useState)(""), 2), filterPopupsDisplay = _ref1[0], setFilterPopupsDisplay = _ref1[1];
|
|
1201
1456
|
var filterOptions = filterableColumns.reduce(function(acc, col) {
|
|
1202
1457
|
acc[col.dataKey] = Array.from(new Set(data.map(function(item) {
|
|
1203
1458
|
return item[col.dataKey];
|
|
@@ -1216,7 +1471,7 @@ var useFilter = function(param) {
|
|
|
1216
1471
|
setFilters(newFilters);
|
|
1217
1472
|
};
|
|
1218
1473
|
var clearFilter = function() {
|
|
1219
|
-
if (!(0,
|
|
1474
|
+
if (!(0, import_lodash3.isEqual)(filters, initFilter)) {
|
|
1220
1475
|
setFilters(initFilter);
|
|
1221
1476
|
}
|
|
1222
1477
|
};
|
|
@@ -1243,8 +1498,8 @@ var useFilter = function(param) {
|
|
|
1243
1498
|
};
|
|
1244
1499
|
};
|
|
1245
1500
|
var useSort = function() {
|
|
1246
|
-
var _ref = _sliced_to_array((0,
|
|
1247
|
-
var _ref1 = _sliced_to_array((0,
|
|
1501
|
+
var _ref = _sliced_to_array((0, import_react5.useState)(null), 2), sortColumn = _ref[0], setSortColumn = _ref[1];
|
|
1502
|
+
var _ref1 = _sliced_to_array((0, import_react5.useState)(null), 2), sortOrder = _ref1[0], setSortOrder = _ref1[1];
|
|
1248
1503
|
var handleSort = function(columnIndex) {
|
|
1249
1504
|
var newSortOrder = "asc";
|
|
1250
1505
|
if (sortColumn === columnIndex && sortOrder === "asc") {
|
|
@@ -1269,9 +1524,9 @@ var useSort = function() {
|
|
|
1269
1524
|
};
|
|
1270
1525
|
};
|
|
1271
1526
|
var useSearch = function() {
|
|
1272
|
-
var _ref = _sliced_to_array((0,
|
|
1273
|
-
var _ref1 = _sliced_to_array((0,
|
|
1274
|
-
var deferredSearchQuery = (0,
|
|
1527
|
+
var _ref = _sliced_to_array((0, import_react5.useState)(""), 2), searchQuery = _ref[0], setSearchQuery = _ref[1];
|
|
1528
|
+
var _ref1 = _sliced_to_array((0, import_react5.useTransition)(), 2), isPending = _ref1[0], startTransition = _ref1[1];
|
|
1529
|
+
var deferredSearchQuery = (0, import_react5.useDeferredValue)(searchQuery);
|
|
1275
1530
|
var handleSearch = function(e) {
|
|
1276
1531
|
var value = e.target.value;
|
|
1277
1532
|
startTransition(function() {
|
|
@@ -1293,132 +1548,9 @@ var useSearch = function() {
|
|
|
1293
1548
|
deferredSearchQuery: deferredSearchQuery
|
|
1294
1549
|
};
|
|
1295
1550
|
};
|
|
1296
|
-
// src/helpers/firebase.ts
|
|
1297
|
-
var import_moment = __toESM(require("moment"));
|
|
1298
|
-
var import_app = require("firebase/app");
|
|
1299
|
-
var import_storage = require("firebase/storage");
|
|
1300
|
-
var import_auth = require("firebase/auth");
|
|
1301
|
-
var import_app_check = require("firebase/app-check");
|
|
1302
|
-
var import_firestore = require("firebase/firestore");
|
|
1303
|
-
var import_react4 = require("react");
|
|
1304
|
-
var import_meta = {};
|
|
1305
|
-
var initApp = function() {
|
|
1306
|
-
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
1307
|
-
var firebaseConfig = {
|
|
1308
|
-
apiKey: isNodeEnv2 ? process.env.NEXT_PUBLIC_API_KEY : import_meta.env.VITE_API_KEY,
|
|
1309
|
-
authDomain: isNodeEnv2 ? process.env.NEXT_PUBLIC_AUTH_DOMAIN : import_meta.env.VITE_AUTH_DOMAIN,
|
|
1310
|
-
projectId: isNodeEnv2 ? process.env.NEXT_PUBLIC_PROJECT_ID : import_meta.env.VITE_PROJECT_ID,
|
|
1311
|
-
storageBucket: isNodeEnv2 ? process.env.NEXT_PUBLIC_STORAGE_BUCKET : import_meta.env.VITE_STORAGE_BUCKET,
|
|
1312
|
-
messagingSenderId: isNodeEnv2 ? process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID : import_meta.env.VITE_MESSAGING_SENDER_ID,
|
|
1313
|
-
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import_meta.env.VITE_APP_ID
|
|
1314
|
-
};
|
|
1315
|
-
try {
|
|
1316
|
-
var app2 = (0, import_app.initializeApp)(firebaseConfig);
|
|
1317
|
-
var auth2 = (0, import_auth.getAuth)(app2);
|
|
1318
|
-
auth2.settings.appVerificationDisabledForTesting = false;
|
|
1319
|
-
var db2 = (0, import_firestore.getFirestore)(app2);
|
|
1320
|
-
var storage2 = (0, import_storage.getStorage)(app2);
|
|
1321
|
-
var googleLoginProvider2 = new import_auth.GoogleAuthProvider();
|
|
1322
|
-
var recaptchaSiteKey = isNodeEnv2 ? process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY : import_meta.env.VITE_RECAPTCHA_SITE_KEY;
|
|
1323
|
-
var result = {
|
|
1324
|
-
db: db2,
|
|
1325
|
-
auth: auth2,
|
|
1326
|
-
storage: storage2,
|
|
1327
|
-
app: app2,
|
|
1328
|
-
googleLoginProvider: googleLoginProvider2
|
|
1329
|
-
};
|
|
1330
|
-
if (recaptchaSiteKey) {
|
|
1331
|
-
result.appCheck = (0, import_app_check.initializeAppCheck)(app2, {
|
|
1332
|
-
provider: new import_app_check.ReCaptchaEnterpriseProvider(recaptchaSiteKey),
|
|
1333
|
-
isTokenAutoRefreshEnabled: true
|
|
1334
|
-
});
|
|
1335
|
-
}
|
|
1336
|
-
return result;
|
|
1337
|
-
} catch (error) {
|
|
1338
|
-
console.error("Failed to initialize Firebase app:", error);
|
|
1339
|
-
return {};
|
|
1340
|
-
}
|
|
1341
|
-
};
|
|
1342
|
-
var _initApp = initApp(), db = _initApp.db, auth = _initApp.auth, storage = _initApp.storage, app = _initApp.app, appCheck = _initApp.appCheck, googleLoginProvider = _initApp.googleLoginProvider;
|
|
1343
|
-
var collections = {
|
|
1344
|
-
clients: (0, import_firestore.collection)(db, "nx-clients"),
|
|
1345
|
-
sites: (0, import_firestore.collection)(db, "nx-sites"),
|
|
1346
|
-
cars: (0, import_firestore.collection)(db, "units"),
|
|
1347
|
-
users: (0, import_firestore.collection)(db, "nx-users"),
|
|
1348
|
-
lastLocations: (0, import_firestore.collection)(db, "last_locations"),
|
|
1349
|
-
ermEvents: (0, import_firestore.collection)(db, "erm_events_general"),
|
|
1350
|
-
erm2Events: (0, import_firestore.collection)(db, "erm2_events_general"),
|
|
1351
|
-
ruptelaEvents: (0, import_firestore.collection)(db, "ruptela_events_general"),
|
|
1352
|
-
polygons: (0, import_firestore.collection)(db, "nx-polygons"),
|
|
1353
|
-
polygonEvents: (0, import_firestore.collection)(db, "polygon_events"),
|
|
1354
|
-
polygonCars: (0, import_firestore.collection)(db, "polygon_cars"),
|
|
1355
|
-
canbus: (0, import_firestore.collection)(db, "erm_canbus_parameters"),
|
|
1356
|
-
states: (0, import_firestore.collection)(db, "erm_states"),
|
|
1357
|
-
app_pro_commands_queue: (0, import_firestore.collection)(db, "app_pro_commands_queue"),
|
|
1358
|
-
trips: (0, import_firestore.collection)(db, "erm2_trip"),
|
|
1359
|
-
tripsDetails: (0, import_firestore.collection)(db, "erm2_trip_details"),
|
|
1360
|
-
audit: (0, import_firestore.collection)(db, "nx-audit"),
|
|
1361
|
-
nx_settings: (0, import_firestore.collection)(db, "nx-settings"),
|
|
1362
|
-
settings: (0, import_firestore.collection)(db, "settings"),
|
|
1363
|
-
translations: (0, import_firestore.collection)(db, "nx-translations"),
|
|
1364
|
-
nx_cars: (0, import_firestore.collection)(db, "nx-cars"),
|
|
1365
|
-
boards: (0, import_firestore.collection)(db, "boards"),
|
|
1366
|
-
protection_types: (0, import_firestore.collection)(db, "protectionTypes"),
|
|
1367
|
-
board_types: (0, import_firestore.collection)(db, "boardTypes"),
|
|
1368
|
-
charge_capacities: (0, import_firestore.collection)(db, "nx-charge-capacities")
|
|
1369
|
-
};
|
|
1370
|
-
var fire_base_TIME_TEMP = import_firestore.Timestamp.now;
|
|
1371
|
-
// src/helpers/global.ts
|
|
1372
|
-
var import_akeyless_types_commons = require("akeyless-types-commons");
|
|
1373
|
-
var import_axios = __toESM(require("axios"));
|
|
1374
|
-
// src/helpers/phoneNumber.ts
|
|
1375
|
-
var import_libphonenumber_js = require("libphonenumber-js");
|
|
1376
|
-
// src/helpers/global.ts
|
|
1377
|
-
var import_lodash3 = require("lodash");
|
|
1378
|
-
var import_meta2 = {};
|
|
1379
|
-
var renderOnce = function() {
|
|
1380
|
-
return true;
|
|
1381
|
-
};
|
|
1382
|
-
var getLocationUrl = function(lng, lat) {
|
|
1383
|
-
return "https://www.google.com/maps?q=".concat(lat, ",").concat(lng);
|
|
1384
|
-
};
|
|
1385
|
-
var isNodeEnv = typeof process !== "undefined" && process.env;
|
|
1386
|
-
var _ref = {
|
|
1387
|
-
mode: isNodeEnv ? process.env.NEXT_PUBLIC_MODE : import_meta2.env.VITE_MODE,
|
|
1388
|
-
isLocal: (isNodeEnv ? process.env.NEXT_PUBLIC_IS_LOCAL : import_meta2.env.VITE_is_local) === "true"
|
|
1389
|
-
}, mode = _ref.mode, isLocal = _ref.isLocal;
|
|
1390
|
-
// src/helpers/time_helpers.ts
|
|
1391
|
-
var import_firestore2 = require("firebase/firestore");
|
|
1392
|
-
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
1393
|
-
function timestamp_to_string(firebaseTimestamp, options) {
|
|
1394
|
-
var date;
|
|
1395
|
-
if (_instanceof(firebaseTimestamp, import_firestore2.Timestamp)) {
|
|
1396
|
-
date = firebaseTimestamp.toDate();
|
|
1397
|
-
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
1398
|
-
date = firebaseTimestamp;
|
|
1399
|
-
} else if (typeof firebaseTimestamp === "string") {
|
|
1400
|
-
date = import_moment_timezone.default.utc(firebaseTimestamp, (options === null || options === void 0 ? void 0 : options.fromFormat) || "DD/MM/YYYY HH:mm:ss").toDate();
|
|
1401
|
-
if (isNaN(date.getTime())) {
|
|
1402
|
-
throw new Error("Invalid date string format");
|
|
1403
|
-
}
|
|
1404
|
-
} else {
|
|
1405
|
-
throw new Error("Invalid input: firebaseTimestamp must be a Timestamp, Date, or valid date string.");
|
|
1406
|
-
}
|
|
1407
|
-
if (options === null || options === void 0 ? void 0 : options.tz) {
|
|
1408
|
-
var result = (0, import_moment_timezone.default)(date).tz(options === null || options === void 0 ? void 0 : options.tz).format((options === null || options === void 0 ? void 0 : options.format) || "DD/MM/YYYY HH:mm:ss");
|
|
1409
|
-
return result;
|
|
1410
|
-
}
|
|
1411
|
-
return import_moment_timezone.default.utc(date).format((options === null || options === void 0 ? void 0 : options.format) || "DD/MM/YYYY HH:mm:ss");
|
|
1412
|
-
}
|
|
1413
|
-
// src/helpers/api.ts
|
|
1414
|
-
var import_axios2 = __toESM(require("axios"));
|
|
1415
|
-
var baseDomain = mode === "qa" ? "https://nx-api.xyz/api" : "https://nx-api.info/api";
|
|
1416
|
-
var devicesDomain = isLocal ? "http://localhost:9001/api/devices" : baseDomain + "/devices";
|
|
1417
|
-
var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
1418
|
-
var callCenterDomain = isLocal ? "http://localhost:9003/api/call-center" : baseDomain + "/call-center";
|
|
1419
1551
|
// src/components/ui/badge.tsx
|
|
1420
1552
|
var import_class_variance_authority = require("class-variance-authority");
|
|
1421
|
-
var
|
|
1553
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1422
1554
|
var badgeVariants = (0, import_class_variance_authority.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
1423
1555
|
variants: {
|
|
1424
1556
|
variant: {
|
|
@@ -1437,7 +1569,7 @@ function Badge(_param) {
|
|
|
1437
1569
|
"className",
|
|
1438
1570
|
"variant"
|
|
1439
1571
|
]);
|
|
1440
|
-
return /* @__PURE__ */ (0,
|
|
1572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", _object_spread({
|
|
1441
1573
|
className: cn(badgeVariants({
|
|
1442
1574
|
variant: variant
|
|
1443
1575
|
}), className)
|
|
@@ -1447,7 +1579,7 @@ function Badge(_param) {
|
|
|
1447
1579
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
1448
1580
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
1449
1581
|
var React3 = __toESM(require("react"));
|
|
1450
|
-
var
|
|
1582
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1451
1583
|
var buttonVariants = (0, import_class_variance_authority2.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", {
|
|
1452
1584
|
variants: {
|
|
1453
1585
|
variant: {
|
|
@@ -1478,7 +1610,7 @@ var Button = React3.forwardRef(function(_param, ref) {
|
|
|
1478
1610
|
"asChild"
|
|
1479
1611
|
]);
|
|
1480
1612
|
var Comp = asChild ? import_react_slot.Slot : "button";
|
|
1481
|
-
return /* @__PURE__ */ (0,
|
|
1613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Comp, _object_spread({
|
|
1482
1614
|
ref: ref,
|
|
1483
1615
|
"data-slot": "button",
|
|
1484
1616
|
className: cn(buttonVariants({
|
|
@@ -1491,13 +1623,13 @@ var Button = React3.forwardRef(function(_param, ref) {
|
|
|
1491
1623
|
Button.displayName = "Button";
|
|
1492
1624
|
// src/components/ui/input.tsx
|
|
1493
1625
|
var React4 = __toESM(require("react"));
|
|
1494
|
-
var
|
|
1626
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1495
1627
|
var Input = React4.forwardRef(function(_param, ref) {
|
|
1496
1628
|
var className = _param.className, type = _param.type, props = _object_without_properties(_param, [
|
|
1497
1629
|
"className",
|
|
1498
1630
|
"type"
|
|
1499
1631
|
]);
|
|
1500
|
-
return /* @__PURE__ */ (0,
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", _object_spread({
|
|
1501
1633
|
type: type,
|
|
1502
1634
|
className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
1503
1635
|
ref: ref
|
|
@@ -1507,7 +1639,7 @@ Input.displayName = "Input";
|
|
|
1507
1639
|
// src/components/ui/progress.tsx
|
|
1508
1640
|
var React5 = __toESM(require("react"));
|
|
1509
1641
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
1510
|
-
var
|
|
1642
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1511
1643
|
var ProgressComponent = React5.forwardRef(function(_param, ref) {
|
|
1512
1644
|
var className = _param.className, value = _param.value, containerClassName = _param.containerClassName, indicatorClassName = _param.indicatorClassName, showValueClassName = _param.showValueClassName, _param_showValue = _param.showValue, showValue = _param_showValue === void 0 ? false : _param_showValue, props = _object_without_properties(_param, [
|
|
1513
1645
|
"className",
|
|
@@ -1517,18 +1649,18 @@ var ProgressComponent = React5.forwardRef(function(_param, ref) {
|
|
|
1517
1649
|
"showValueClassName",
|
|
1518
1650
|
"showValue"
|
|
1519
1651
|
]);
|
|
1520
|
-
return /* @__PURE__ */ (0,
|
|
1652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", {
|
|
1521
1653
|
className: cn("relative w-full", containerClassName),
|
|
1522
|
-
children: /* @__PURE__ */ (0,
|
|
1654
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProgressPrimitive.Root, _object_spread_props(_object_spread({
|
|
1523
1655
|
ref: ref,
|
|
1524
1656
|
className: cn("w-full h-5 bg-[#e5e7eb] relative overflow-hidden rounded-full", className)
|
|
1525
1657
|
}, props), {
|
|
1526
|
-
children: /* @__PURE__ */ (0,
|
|
1658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProgressPrimitive.Indicator, {
|
|
1527
1659
|
className: cn("h-full w-full flex-1 bg-[green] transition-all rounded-full", indicatorClassName),
|
|
1528
1660
|
style: {
|
|
1529
1661
|
transform: "translateX(-".concat(100 - (value || 0), "%)")
|
|
1530
1662
|
},
|
|
1531
|
-
children: showValue && /* @__PURE__ */ (0,
|
|
1663
|
+
children: showValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", {
|
|
1532
1664
|
className: cn("absolute right-1 top-[-2px] font-medium text-white", showValueClassName),
|
|
1533
1665
|
children: "".concat(value || 0, "%")
|
|
1534
1666
|
})
|
|
@@ -1541,8 +1673,8 @@ ProgressComponent.displayName = ProgressPrimitive.Root.displayName;
|
|
|
1541
1673
|
var import_react_dom = __toESM(require("react-dom"));
|
|
1542
1674
|
var import_cmdk2 = require("cmdk");
|
|
1543
1675
|
var import_lucide_react3 = require("lucide-react");
|
|
1544
|
-
var
|
|
1545
|
-
var
|
|
1676
|
+
var import_react7 = __toESM(require("react"));
|
|
1677
|
+
var import_react8 = require("react");
|
|
1546
1678
|
// src/components/ui/command.tsx
|
|
1547
1679
|
var import_cmdk = require("cmdk");
|
|
1548
1680
|
var import_lucide_react2 = require("lucide-react");
|
|
@@ -1551,13 +1683,13 @@ var React7 = __toESM(require("react"));
|
|
|
1551
1683
|
var React6 = __toESM(require("react"));
|
|
1552
1684
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
1553
1685
|
var import_lucide_react = require("lucide-react");
|
|
1554
|
-
var
|
|
1686
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1555
1687
|
var DialogPortal = DialogPrimitive.Portal;
|
|
1556
1688
|
var DialogOverlay = React6.forwardRef(function(_param, ref) {
|
|
1557
1689
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1558
1690
|
"className"
|
|
1559
1691
|
]);
|
|
1560
|
-
return /* @__PURE__ */ (0,
|
|
1692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Overlay, _object_spread({
|
|
1561
1693
|
ref: ref,
|
|
1562
1694
|
className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className)
|
|
1563
1695
|
}, props));
|
|
@@ -1568,22 +1700,22 @@ var DialogContent = React6.forwardRef(function(_param, ref) {
|
|
|
1568
1700
|
"className",
|
|
1569
1701
|
"children"
|
|
1570
1702
|
]);
|
|
1571
|
-
return /* @__PURE__ */ (0,
|
|
1703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPortal, {
|
|
1572
1704
|
children: [
|
|
1573
|
-
/* @__PURE__ */ (0,
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1705
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlay, {}),
|
|
1706
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPrimitive.Content, _object_spread_props(_object_spread({
|
|
1575
1707
|
ref: ref,
|
|
1576
1708
|
className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className)
|
|
1577
1709
|
}, props), {
|
|
1578
1710
|
children: [
|
|
1579
1711
|
children,
|
|
1580
|
-
/* @__PURE__ */ (0,
|
|
1712
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPrimitive.Close, {
|
|
1581
1713
|
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
1582
1714
|
children: [
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react.X, {
|
|
1584
1716
|
className: "h-4 w-4"
|
|
1585
1717
|
}),
|
|
1586
|
-
/* @__PURE__ */ (0,
|
|
1718
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {
|
|
1587
1719
|
className: "sr-only",
|
|
1588
1720
|
children: "Close"
|
|
1589
1721
|
})
|
|
@@ -1599,7 +1731,7 @@ var DialogHeader = function(_param) {
|
|
|
1599
1731
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1600
1732
|
"className"
|
|
1601
1733
|
]);
|
|
1602
|
-
return /* @__PURE__ */ (0,
|
|
1734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", _object_spread({
|
|
1603
1735
|
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className)
|
|
1604
1736
|
}, props));
|
|
1605
1737
|
};
|
|
@@ -1608,7 +1740,7 @@ var DialogFooter = function(_param) {
|
|
|
1608
1740
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1609
1741
|
"className"
|
|
1610
1742
|
]);
|
|
1611
|
-
return /* @__PURE__ */ (0,
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", _object_spread({
|
|
1612
1744
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
|
|
1613
1745
|
}, props));
|
|
1614
1746
|
};
|
|
@@ -1617,7 +1749,7 @@ var DialogTitle = React6.forwardRef(function(_param, ref) {
|
|
|
1617
1749
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1618
1750
|
"className"
|
|
1619
1751
|
]);
|
|
1620
|
-
return /* @__PURE__ */ (0,
|
|
1752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Title, _object_spread({
|
|
1621
1753
|
ref: ref,
|
|
1622
1754
|
className: cn("text-lg font-semibold leading-none tracking-tight", className)
|
|
1623
1755
|
}, props));
|
|
@@ -1627,19 +1759,19 @@ var DialogDescription = React6.forwardRef(function(_param, ref) {
|
|
|
1627
1759
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1628
1760
|
"className"
|
|
1629
1761
|
]);
|
|
1630
|
-
return /* @__PURE__ */ (0,
|
|
1762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Description, _object_spread({
|
|
1631
1763
|
ref: ref,
|
|
1632
1764
|
className: cn("text-sm text-muted-foreground", className)
|
|
1633
1765
|
}, props));
|
|
1634
1766
|
});
|
|
1635
1767
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1636
1768
|
// src/components/ui/command.tsx
|
|
1637
|
-
var
|
|
1769
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1638
1770
|
var Command = React7.forwardRef(function(_param, ref) {
|
|
1639
1771
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1640
1772
|
"className"
|
|
1641
1773
|
]);
|
|
1642
|
-
return /* @__PURE__ */ (0,
|
|
1774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command, _object_spread({
|
|
1643
1775
|
ref: ref,
|
|
1644
1776
|
className: cn("flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground", className)
|
|
1645
1777
|
}, props));
|
|
@@ -1650,16 +1782,16 @@ var CommandInput = React7.forwardRef(function(_param, ref) {
|
|
|
1650
1782
|
"className",
|
|
1651
1783
|
"withSearchIcon"
|
|
1652
1784
|
]);
|
|
1653
|
-
return /* @__PURE__ */ (0,
|
|
1785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", {
|
|
1654
1786
|
className: "flex items-center border-b border-input px-3",
|
|
1655
1787
|
"cmdk-input-wrapper": "",
|
|
1656
1788
|
children: [
|
|
1657
|
-
withSearchIcon && /* @__PURE__ */ (0,
|
|
1789
|
+
withSearchIcon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react2.Search, {
|
|
1658
1790
|
size: 20,
|
|
1659
1791
|
strokeWidth: 2,
|
|
1660
1792
|
className: "me-3 text-muted-foreground/80"
|
|
1661
1793
|
}),
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Input, _object_spread({
|
|
1663
1795
|
ref: ref,
|
|
1664
1796
|
className: cn("flex h-10 w-full rounded-lg bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
1665
1797
|
}, props))
|
|
@@ -1671,14 +1803,14 @@ var CommandList = React7.forwardRef(function(_param, ref) {
|
|
|
1671
1803
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1672
1804
|
"className"
|
|
1673
1805
|
]);
|
|
1674
|
-
return /* @__PURE__ */ (0,
|
|
1806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.List, _object_spread({
|
|
1675
1807
|
ref: ref,
|
|
1676
1808
|
className: cn("max-h-80 overflow-y-auto overflow-x-hidden", className)
|
|
1677
1809
|
}, props));
|
|
1678
1810
|
});
|
|
1679
1811
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
1680
1812
|
var CommandEmpty = React7.forwardRef(function(props, ref) {
|
|
1681
|
-
return /* @__PURE__ */ (0,
|
|
1813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Empty, _object_spread({
|
|
1682
1814
|
ref: ref,
|
|
1683
1815
|
className: "py-6 text-center text-sm"
|
|
1684
1816
|
}, props));
|
|
@@ -1688,7 +1820,7 @@ var CommandGroup = React7.forwardRef(function(_param, ref) {
|
|
|
1688
1820
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1689
1821
|
"className"
|
|
1690
1822
|
]);
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
1823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Group, _object_spread({
|
|
1692
1824
|
ref: ref,
|
|
1693
1825
|
className: cn("overflow-hidden p-2 text-foreground [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className)
|
|
1694
1826
|
}, props));
|
|
@@ -1698,7 +1830,7 @@ var CommandSeparator = React7.forwardRef(function(_param, ref) {
|
|
|
1698
1830
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1699
1831
|
"className"
|
|
1700
1832
|
]);
|
|
1701
|
-
return /* @__PURE__ */ (0,
|
|
1833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Separator, _object_spread({
|
|
1702
1834
|
ref: ref,
|
|
1703
1835
|
className: cn("-mx-1 h-px bg-border", className)
|
|
1704
1836
|
}, props));
|
|
@@ -1708,7 +1840,7 @@ var CommandItem = React7.forwardRef(function(_param, ref) {
|
|
|
1708
1840
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1709
1841
|
"className"
|
|
1710
1842
|
]);
|
|
1711
|
-
return /* @__PURE__ */ (0,
|
|
1843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Item, _object_spread({
|
|
1712
1844
|
ref: ref,
|
|
1713
1845
|
className: cn("relative flex cursor-default select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className)
|
|
1714
1846
|
}, props));
|
|
@@ -1718,7 +1850,7 @@ var CommandShortcut = function(_param) {
|
|
|
1718
1850
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1719
1851
|
"className"
|
|
1720
1852
|
]);
|
|
1721
|
-
return /* @__PURE__ */ (0,
|
|
1853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("kbd", _object_spread({
|
|
1722
1854
|
className: cn("-me-1 ms-auto inline-flex h-5 max-h-full items-center rounded border border-border bg-background px-1 font-[inherit] text-[0.625rem] font-medium text-muted-foreground/70", className)
|
|
1723
1855
|
}, props));
|
|
1724
1856
|
};
|
|
@@ -3289,9 +3421,9 @@ var computePosition2 = function(reference, floating, options) {
|
|
|
3289
3421
|
};
|
|
3290
3422
|
// node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
3291
3423
|
var React8 = __toESM(require("react"), 1);
|
|
3292
|
-
var
|
|
3424
|
+
var import_react6 = require("react");
|
|
3293
3425
|
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
3294
|
-
var index = typeof document !== "undefined" ?
|
|
3426
|
+
var index = typeof document !== "undefined" ? import_react6.useLayoutEffect : import_react6.useEffect;
|
|
3295
3427
|
function deepEqual(a, b) {
|
|
3296
3428
|
if (a === b) {
|
|
3297
3429
|
return true;
|
|
@@ -3556,7 +3688,7 @@ var flip3 = function(options, deps) {
|
|
|
3556
3688
|
});
|
|
3557
3689
|
};
|
|
3558
3690
|
// src/components/ui/multiselect.tsx
|
|
3559
|
-
var
|
|
3691
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3560
3692
|
var Portal2 = function(param) {
|
|
3561
3693
|
var children = param.children;
|
|
3562
3694
|
return import_react_dom.default.createPortal(children, document.body);
|
|
@@ -3633,7 +3765,7 @@ function isOptionsExist(groupOption, targetOption) {
|
|
|
3633
3765
|
}
|
|
3634
3766
|
return false;
|
|
3635
3767
|
}
|
|
3636
|
-
var CommandEmpty2 = (0,
|
|
3768
|
+
var CommandEmpty2 = (0, import_react8.forwardRef)(function(_param, forwardedRef) {
|
|
3637
3769
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
3638
3770
|
"className"
|
|
3639
3771
|
]);
|
|
@@ -3641,7 +3773,7 @@ var CommandEmpty2 = (0, import_react7.forwardRef)(function(_param, forwardedRef)
|
|
|
3641
3773
|
return state.filtered.count === 0;
|
|
3642
3774
|
});
|
|
3643
3775
|
if (!render) return null;
|
|
3644
|
-
return /* @__PURE__ */ (0,
|
|
3776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", _object_spread({
|
|
3645
3777
|
ref: forwardedRef,
|
|
3646
3778
|
className: cn("px-2 py-4 text-center text-sm", className),
|
|
3647
3779
|
"cmdk-empty": "",
|
|
@@ -3650,8 +3782,8 @@ var CommandEmpty2 = (0, import_react7.forwardRef)(function(_param, forwardedRef)
|
|
|
3650
3782
|
});
|
|
3651
3783
|
CommandEmpty2.displayName = "CommandEmpty";
|
|
3652
3784
|
function useDebounce(value, delay) {
|
|
3653
|
-
var
|
|
3654
|
-
(0,
|
|
3785
|
+
var _import_react7_default_useState = _sliced_to_array(import_react7.default.useState(value), 2), debouncedValue = _import_react7_default_useState[0], setDebouncedValue = _import_react7_default_useState[1];
|
|
3786
|
+
(0, import_react8.useEffect)(function() {
|
|
3655
3787
|
var timer = setTimeout(function() {
|
|
3656
3788
|
return setDebouncedValue(value);
|
|
3657
3789
|
}, delay || 500);
|
|
@@ -3664,10 +3796,10 @@ function useDebounce(value, delay) {
|
|
|
3664
3796
|
]);
|
|
3665
3797
|
return debouncedValue;
|
|
3666
3798
|
}
|
|
3667
|
-
var MultipleSelector = (0,
|
|
3799
|
+
var MultipleSelector = (0, import_react8.forwardRef)(function(param, ref) {
|
|
3668
3800
|
var value = param.value, onChange = param.onChange, placeholder = param.placeholder, tmp = param.defaultOptions, arrayDefaultOptions = tmp === void 0 ? [] : tmp, arrayOptions = param.options, delay = param.delay, onSearch = param.onSearch, onSearchSync = param.onSearchSync, loadingIndicator = param.loadingIndicator, emptyIndicator = param.emptyIndicator, _param_maxSelected = param.maxSelected, maxSelected = _param_maxSelected === void 0 ? Number.MAX_SAFE_INTEGER : _param_maxSelected, onMaxSelected = param.onMaxSelected, _param_hidePlaceholderWhenSelected = param.hidePlaceholderWhenSelected, hidePlaceholderWhenSelected = _param_hidePlaceholderWhenSelected === void 0 ? true : _param_hidePlaceholderWhenSelected, disabled = param.disabled, groupBy = param.groupBy, className = param.className, badgeClassName = param.badgeClassName, _param_selectFirstItem = param.selectFirstItem, selectFirstItem = _param_selectFirstItem === void 0 ? true : _param_selectFirstItem, createNewOptionLabel = param.createNewOptionLabel, _param_triggerSearchOnFocus = param.triggerSearchOnFocus, triggerSearchOnFocus = _param_triggerSearchOnFocus === void 0 ? true : _param_triggerSearchOnFocus, commandProps = param.commandProps, inputProps = param.inputProps, _param_hideClearAllButton = param.hideClearAllButton, hideClearAllButton = _param_hideClearAllButton === void 0 ? false : _param_hideClearAllButton, dropdownClassName = param.dropdownClassName, dropdownOptionClassName = param.dropdownOptionClassName, emptyIndicatorClassName = param.emptyIndicatorClassName, _param_unremovableOptions = param.unremovableOptions, unremovableOptions = _param_unremovableOptions === void 0 ? [] : _param_unremovableOptions, name = param.name, _param_dropdownContainerClassName = param.dropdownContainerClassName, dropdownContainerClassName = _param_dropdownContainerClassName === void 0 ? "" : _param_dropdownContainerClassName;
|
|
3669
3801
|
var _containerRef_current;
|
|
3670
|
-
var
|
|
3802
|
+
var _import_react7_default_useState = _sliced_to_array(import_react7.default.useState(false), 2), isLoading = _import_react7_default_useState[0], setIsLoading = _import_react7_default_useState[1];
|
|
3671
3803
|
var _useFloating = useFloating({
|
|
3672
3804
|
placement: "bottom-start",
|
|
3673
3805
|
middleware: [
|
|
@@ -3677,20 +3809,20 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3677
3809
|
],
|
|
3678
3810
|
whileElementsMounted: autoUpdate
|
|
3679
3811
|
}), x = _useFloating.x, y = _useFloating.y, strategy = _useFloating.strategy, refs = _useFloating.refs, update = _useFloating.update;
|
|
3680
|
-
var containerRef = (0,
|
|
3812
|
+
var containerRef = (0, import_react8.useRef)(null);
|
|
3681
3813
|
var setContainerRef = function(node) {
|
|
3682
3814
|
containerRef.current = node;
|
|
3683
3815
|
refs.setReference(node);
|
|
3684
3816
|
};
|
|
3685
|
-
var inputRef = (0,
|
|
3686
|
-
var
|
|
3687
|
-
var
|
|
3688
|
-
var dropdownRef = (0,
|
|
3689
|
-
var
|
|
3690
|
-
var
|
|
3691
|
-
var
|
|
3817
|
+
var inputRef = (0, import_react8.useRef)(null);
|
|
3818
|
+
var _import_react7_default_useState1 = _sliced_to_array(import_react7.default.useState(false), 2), open = _import_react7_default_useState1[0], setOpen = _import_react7_default_useState1[1];
|
|
3819
|
+
var _import_react7_default_useState2 = _sliced_to_array(import_react7.default.useState(false), 2), onScrollbar = _import_react7_default_useState2[0], setOnScrollbar = _import_react7_default_useState2[1];
|
|
3820
|
+
var dropdownRef = (0, import_react8.useRef)(null);
|
|
3821
|
+
var _import_react7_default_useState3 = _sliced_to_array(import_react7.default.useState(value || []), 2), selected = _import_react7_default_useState3[0], setSelected = _import_react7_default_useState3[1];
|
|
3822
|
+
var _import_react7_default_useState4 = _sliced_to_array(import_react7.default.useState(transToGroupOption(arrayDefaultOptions, groupBy)), 2), options = _import_react7_default_useState4[0], setOptions = _import_react7_default_useState4[1];
|
|
3823
|
+
var _import_react7_default_useState5 = _sliced_to_array(import_react7.default.useState(""), 2), inputValue = _import_react7_default_useState5[0], setInputValue = _import_react7_default_useState5[1];
|
|
3692
3824
|
var debouncedSearchTerm = useDebounce(inputValue, delay || 500);
|
|
3693
|
-
|
|
3825
|
+
import_react7.default.useImperativeHandle(ref, function() {
|
|
3694
3826
|
return {
|
|
3695
3827
|
selectedValue: _to_consumable_array(selected),
|
|
3696
3828
|
input: inputRef.current,
|
|
@@ -3705,7 +3837,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3705
3837
|
}, [
|
|
3706
3838
|
selected
|
|
3707
3839
|
]);
|
|
3708
|
-
(0,
|
|
3840
|
+
(0, import_react8.useEffect)(function() {
|
|
3709
3841
|
if (open) {
|
|
3710
3842
|
update();
|
|
3711
3843
|
}
|
|
@@ -3713,14 +3845,14 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3713
3845
|
open,
|
|
3714
3846
|
update
|
|
3715
3847
|
]);
|
|
3716
|
-
var handleClickOutside = (0,
|
|
3848
|
+
var handleClickOutside = (0, import_react8.useCallback)(function(event) {
|
|
3717
3849
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target) && containerRef.current && !containerRef.current.contains(event.target)) {
|
|
3718
3850
|
var _inputRef_current;
|
|
3719
3851
|
setOpen(false);
|
|
3720
3852
|
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.blur();
|
|
3721
3853
|
}
|
|
3722
3854
|
}, []);
|
|
3723
|
-
(0,
|
|
3855
|
+
(0, import_react8.useEffect)(function() {
|
|
3724
3856
|
if (open) {
|
|
3725
3857
|
document.addEventListener("mousedown", handleClickOutside);
|
|
3726
3858
|
document.addEventListener("touchend", handleClickOutside);
|
|
@@ -3736,14 +3868,14 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3736
3868
|
open,
|
|
3737
3869
|
handleClickOutside
|
|
3738
3870
|
]);
|
|
3739
|
-
(0,
|
|
3871
|
+
(0, import_react8.useEffect)(function() {
|
|
3740
3872
|
if (value) {
|
|
3741
3873
|
setSelected(value);
|
|
3742
3874
|
}
|
|
3743
3875
|
}, [
|
|
3744
3876
|
value
|
|
3745
3877
|
]);
|
|
3746
|
-
(0,
|
|
3878
|
+
(0, import_react8.useEffect)(function() {
|
|
3747
3879
|
if (!arrayOptions || onSearch) return;
|
|
3748
3880
|
var newOption = transToGroupOption(arrayOptions || [], groupBy);
|
|
3749
3881
|
if (JSON.stringify(newOption) !== JSON.stringify(options)) {
|
|
@@ -3756,7 +3888,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3756
3888
|
onSearch,
|
|
3757
3889
|
options
|
|
3758
3890
|
]);
|
|
3759
|
-
(0,
|
|
3891
|
+
(0, import_react8.useEffect)(function() {
|
|
3760
3892
|
var doSearchSync = function() {
|
|
3761
3893
|
var res = onSearchSync === null || onSearchSync === void 0 ? void 0 : onSearchSync(debouncedSearchTerm);
|
|
3762
3894
|
setOptions(transToGroupOption(res || [], groupBy));
|
|
@@ -3790,7 +3922,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3790
3922
|
triggerSearchOnFocus,
|
|
3791
3923
|
onSearchSync
|
|
3792
3924
|
]);
|
|
3793
|
-
(0,
|
|
3925
|
+
(0, import_react8.useEffect)(function() {
|
|
3794
3926
|
var doSearch = /*#__PURE__*/ function() {
|
|
3795
3927
|
var _ref = _async_to_generator(function() {
|
|
3796
3928
|
var res;
|
|
@@ -3866,7 +3998,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3866
3998
|
triggerSearchOnFocus,
|
|
3867
3999
|
onSearch
|
|
3868
4000
|
]);
|
|
3869
|
-
var handleUnselect = (0,
|
|
4001
|
+
var handleUnselect = (0, import_react8.useCallback)(function(option) {
|
|
3870
4002
|
if (unremovableOptions.find(function(v) {
|
|
3871
4003
|
return (0, import_lodash4.isEqual)(v.value, option.value);
|
|
3872
4004
|
})) {
|
|
@@ -3882,7 +4014,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3882
4014
|
selected,
|
|
3883
4015
|
unremovableOptions
|
|
3884
4016
|
]);
|
|
3885
|
-
var handleKeyDown = (0,
|
|
4017
|
+
var handleKeyDown = (0, import_react8.useCallback)(function(e) {
|
|
3886
4018
|
var input = inputRef.current;
|
|
3887
4019
|
if (input) {
|
|
3888
4020
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
@@ -3901,7 +4033,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3901
4033
|
handleUnselect,
|
|
3902
4034
|
selected
|
|
3903
4035
|
]);
|
|
3904
|
-
var combinedFloatingRef = (0,
|
|
4036
|
+
var combinedFloatingRef = (0, import_react8.useCallback)(function(node) {
|
|
3905
4037
|
if (!node) return;
|
|
3906
4038
|
refs.setFloating(node);
|
|
3907
4039
|
dropdownRef.current = node;
|
|
@@ -3920,7 +4052,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3920
4052
|
})) {
|
|
3921
4053
|
return void 0;
|
|
3922
4054
|
}
|
|
3923
|
-
var Item = /* @__PURE__ */ (0,
|
|
4055
|
+
var Item = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommandItem, {
|
|
3924
4056
|
value: inputValue,
|
|
3925
4057
|
className: "cursor-pointer",
|
|
3926
4058
|
onMouseDown: function(e) {
|
|
@@ -3952,17 +4084,17 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3952
4084
|
}
|
|
3953
4085
|
return void 0;
|
|
3954
4086
|
};
|
|
3955
|
-
var EmptyItem = (0,
|
|
4087
|
+
var EmptyItem = (0, import_react8.useCallback)(function() {
|
|
3956
4088
|
if (!emptyIndicator) return void 0;
|
|
3957
4089
|
if (onSearch && !createNewOptionLabel && Object.keys(options).length === 0) {
|
|
3958
|
-
return /* @__PURE__ */ (0,
|
|
4090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommandItem, {
|
|
3959
4091
|
className: "",
|
|
3960
4092
|
value: "-",
|
|
3961
4093
|
disabled: true,
|
|
3962
4094
|
children: emptyIndicator
|
|
3963
4095
|
});
|
|
3964
4096
|
}
|
|
3965
|
-
return /* @__PURE__ */ (0,
|
|
4097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommandEmpty2, {
|
|
3966
4098
|
className: emptyIndicatorClassName,
|
|
3967
4099
|
children: emptyIndicator
|
|
3968
4100
|
});
|
|
@@ -3973,13 +4105,13 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3973
4105
|
options,
|
|
3974
4106
|
emptyIndicatorClassName
|
|
3975
4107
|
]);
|
|
3976
|
-
var selectables = (0,
|
|
4108
|
+
var selectables = (0, import_react8.useMemo)(function() {
|
|
3977
4109
|
return removePickedOption(options, selected);
|
|
3978
4110
|
}, [
|
|
3979
4111
|
options,
|
|
3980
4112
|
selected
|
|
3981
4113
|
]);
|
|
3982
|
-
var commandFilter = (0,
|
|
4114
|
+
var commandFilter = (0, import_react8.useCallback)(function() {
|
|
3983
4115
|
if (commandProps === null || commandProps === void 0 ? void 0 : commandProps.filter) {
|
|
3984
4116
|
return commandProps.filter;
|
|
3985
4117
|
}
|
|
@@ -3993,7 +4125,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
3993
4125
|
createNewOptionLabel,
|
|
3994
4126
|
commandProps === null || commandProps === void 0 ? void 0 : commandProps.filter
|
|
3995
4127
|
]);
|
|
3996
|
-
return /* @__PURE__ */ (0,
|
|
4128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Command, _object_spread_props(_object_spread({}, commandProps), {
|
|
3997
4129
|
onKeyDown: function(e) {
|
|
3998
4130
|
var _commandProps_onKeyDown;
|
|
3999
4131
|
handleKeyDown(e);
|
|
@@ -4003,7 +4135,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4003
4135
|
shouldFilter: (commandProps === null || commandProps === void 0 ? void 0 : commandProps.shouldFilter) !== void 0 ? commandProps.shouldFilter : !onSearch,
|
|
4004
4136
|
filter: commandFilter(),
|
|
4005
4137
|
children: [
|
|
4006
|
-
/* @__PURE__ */ (0,
|
|
4138
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {
|
|
4007
4139
|
ref: setContainerRef,
|
|
4008
4140
|
className: cn("relative min-h-[38px] py-2 rounded-lg border border-input text-sm transition-shadow focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50", {
|
|
4009
4141
|
"p-1": selected.length !== 0,
|
|
@@ -4014,11 +4146,11 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4014
4146
|
if (disabled) return;
|
|
4015
4147
|
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
4016
4148
|
},
|
|
4017
|
-
children: /* @__PURE__ */ (0,
|
|
4149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", {
|
|
4018
4150
|
className: "flex flex-wrap gap-1",
|
|
4019
4151
|
children: [
|
|
4020
4152
|
selected.map(function(option) {
|
|
4021
|
-
return /* @__PURE__ */ (0,
|
|
4153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", {
|
|
4022
4154
|
className: cn("animate-fadeIn relative inline-flex h-7 cursor-default items-center rounded-md border border-solid bg-background pe-7 pl-2 ps-2 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50 data-[fixed]:pe-2 px-1", badgeClassName),
|
|
4023
4155
|
"data-fixed": option.fixed,
|
|
4024
4156
|
"data-disabled": disabled || void 0,
|
|
@@ -4026,7 +4158,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4026
4158
|
option.label,
|
|
4027
4159
|
!unremovableOptions.find(function(v) {
|
|
4028
4160
|
return (0, import_lodash4.isEqual)(v.value, option.value);
|
|
4029
|
-
}) && /* @__PURE__ */ (0,
|
|
4161
|
+
}) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", {
|
|
4030
4162
|
className: "absolute -inset-y-px -end-px flex size-7 items-center justify-center rounded-e-lg border border-transparent p-0 text-muted-foreground/80 outline-0 transition-colors hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70",
|
|
4031
4163
|
onKeyDown: function(e) {
|
|
4032
4164
|
if (e.key === "Enter") {
|
|
@@ -4041,7 +4173,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4041
4173
|
return handleUnselect(option);
|
|
4042
4174
|
},
|
|
4043
4175
|
"aria-label": "Remove",
|
|
4044
|
-
children: /* @__PURE__ */ (0,
|
|
4176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react3.X, {
|
|
4045
4177
|
size: 14,
|
|
4046
4178
|
strokeWidth: 2,
|
|
4047
4179
|
"aria-hidden": "true"
|
|
@@ -4050,7 +4182,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4050
4182
|
]
|
|
4051
4183
|
}, option.value);
|
|
4052
4184
|
}),
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_cmdk2.Command.Input, _object_spread_props(_object_spread({}, inputProps), {
|
|
4054
4186
|
ref: inputRef,
|
|
4055
4187
|
value: inputValue,
|
|
4056
4188
|
disabled: disabled,
|
|
@@ -4081,7 +4213,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4081
4213
|
"ml-1": selected.length !== 0
|
|
4082
4214
|
}, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className)
|
|
4083
4215
|
})),
|
|
4084
|
-
/* @__PURE__ */ (0,
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", {
|
|
4085
4217
|
type: "button",
|
|
4086
4218
|
onClick: function() {
|
|
4087
4219
|
setSelected(selected.filter(function(s) {
|
|
@@ -4095,7 +4227,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4095
4227
|
return s.fixed;
|
|
4096
4228
|
}).length === selected.length) && "hidden"),
|
|
4097
4229
|
"aria-label": "Clear all",
|
|
4098
|
-
children: /* @__PURE__ */ (0,
|
|
4230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react3.X, {
|
|
4099
4231
|
size: 16,
|
|
4100
4232
|
strokeWidth: 2,
|
|
4101
4233
|
"aria-hidden": "true"
|
|
@@ -4104,8 +4236,8 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4104
4236
|
]
|
|
4105
4237
|
})
|
|
4106
4238
|
}),
|
|
4107
|
-
open && /* @__PURE__ */ (0,
|
|
4108
|
-
children: /* @__PURE__ */ (0,
|
|
4239
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Portal2, {
|
|
4240
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", {
|
|
4109
4241
|
ref: combinedFloatingRef,
|
|
4110
4242
|
style: {
|
|
4111
4243
|
position: strategy,
|
|
@@ -4115,7 +4247,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4115
4247
|
},
|
|
4116
4248
|
className: cn("z-[9999] overflow-hidden rounded-lg border border-input", dropdownContainerClassName),
|
|
4117
4249
|
"data-state": open ? "open" : "closed",
|
|
4118
|
-
children: /* @__PURE__ */ (0,
|
|
4250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommandList, {
|
|
4119
4251
|
className: "bg-popover text-popover-foreground shadow-lg shadow-black/5 outline-none",
|
|
4120
4252
|
onMouseLeave: function() {
|
|
4121
4253
|
setOnScrollbar(false);
|
|
@@ -4127,23 +4259,23 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4127
4259
|
var _inputRef_current;
|
|
4128
4260
|
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
4129
4261
|
},
|
|
4130
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
4262
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {
|
|
4131
4263
|
children: loadingIndicator
|
|
4132
|
-
}) : /* @__PURE__ */ (0,
|
|
4264
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, {
|
|
4133
4265
|
children: [
|
|
4134
4266
|
EmptyItem(),
|
|
4135
4267
|
CreatableItem(),
|
|
4136
|
-
!selectFirstItem && /* @__PURE__ */ (0,
|
|
4268
|
+
!selectFirstItem && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommandItem, {
|
|
4137
4269
|
value: "-",
|
|
4138
4270
|
className: "hidden"
|
|
4139
4271
|
}),
|
|
4140
4272
|
Object.entries(selectables).map(function(param) {
|
|
4141
4273
|
var _param = _sliced_to_array(param, 2), key = _param[0], dropdowns = _param[1];
|
|
4142
|
-
return /* @__PURE__ */ (0,
|
|
4274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommandGroup, {
|
|
4143
4275
|
heading: key,
|
|
4144
4276
|
className: cn("h-full overflow-auto", dropdownClassName),
|
|
4145
4277
|
children: dropdowns.map(function(option) {
|
|
4146
|
-
return /* @__PURE__ */ (0,
|
|
4278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommandItem, {
|
|
4147
4279
|
value: option.value,
|
|
4148
4280
|
disabled: option.disable,
|
|
4149
4281
|
onMouseDown: function(e) {
|
|
@@ -4174,7 +4306,7 @@ var MultipleSelector = (0, import_react7.forwardRef)(function(param, ref) {
|
|
|
4174
4306
|
})
|
|
4175
4307
|
})
|
|
4176
4308
|
}),
|
|
4177
|
-
/* @__PURE__ */ (0,
|
|
4309
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", {
|
|
4178
4310
|
value: JSON.stringify(selected),
|
|
4179
4311
|
type: "hidden",
|
|
4180
4312
|
name: name
|
|
@@ -4186,16 +4318,16 @@ MultipleSelector.displayName = "MultipleSelector";
|
|
|
4186
4318
|
var multiselect_default = MultipleSelector;
|
|
4187
4319
|
// src/components/ui/popover.tsx
|
|
4188
4320
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
4189
|
-
var
|
|
4321
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
4190
4322
|
function Popover(_param) {
|
|
4191
4323
|
var props = _extends({}, _object_destructuring_empty(_param));
|
|
4192
|
-
return /* @__PURE__ */ (0,
|
|
4324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Root, _object_spread({
|
|
4193
4325
|
"data-slot": "popover"
|
|
4194
4326
|
}, props));
|
|
4195
4327
|
}
|
|
4196
4328
|
function PopoverTrigger(_param) {
|
|
4197
4329
|
var props = _extends({}, _object_destructuring_empty(_param));
|
|
4198
|
-
return /* @__PURE__ */ (0,
|
|
4330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Trigger, _object_spread({
|
|
4199
4331
|
"data-slot": "popover-trigger"
|
|
4200
4332
|
}, props));
|
|
4201
4333
|
}
|
|
@@ -4206,8 +4338,8 @@ function PopoverContent(_param) {
|
|
|
4206
4338
|
"sideOffset",
|
|
4207
4339
|
"showArrow"
|
|
4208
4340
|
]);
|
|
4209
|
-
return /* @__PURE__ */ (0,
|
|
4210
|
-
children: /* @__PURE__ */ (0,
|
|
4341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Portal, {
|
|
4342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(PopoverPrimitive.Content, _object_spread_props(_object_spread({
|
|
4211
4343
|
"data-slot": "popover-content",
|
|
4212
4344
|
align: align,
|
|
4213
4345
|
sideOffset: sideOffset,
|
|
@@ -4215,7 +4347,7 @@ function PopoverContent(_param) {
|
|
|
4215
4347
|
}, props), {
|
|
4216
4348
|
children: [
|
|
4217
4349
|
props.children,
|
|
4218
|
-
showArrow && /* @__PURE__ */ (0,
|
|
4350
|
+
showArrow && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Arrow, {
|
|
4219
4351
|
className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]"
|
|
4220
4352
|
})
|
|
4221
4353
|
]
|
|
@@ -4224,27 +4356,27 @@ function PopoverContent(_param) {
|
|
|
4224
4356
|
}
|
|
4225
4357
|
// src/components/ui/SearchSelect.tsx
|
|
4226
4358
|
var import_lucide_react4 = require("lucide-react");
|
|
4227
|
-
var
|
|
4228
|
-
var
|
|
4359
|
+
var import_react9 = require("react");
|
|
4360
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
4229
4361
|
function SearchSelect(param) {
|
|
4230
4362
|
var options = param.options, name = param.name, _param_selectPlaceholder = param.selectPlaceholder, selectPlaceholder = _param_selectPlaceholder === void 0 ? "Select" : _param_selectPlaceholder, defaultValue = param.defaultValue, _param_searchPlaceholder = param.searchPlaceholder, searchPlaceholder = _param_searchPlaceholder === void 0 ? "Search" : _param_searchPlaceholder, dropdownClassName = param.dropdownClassName, dropdownOptionClassName = param.dropdownOptionClassName, notFoundLabel = param.notFoundLabel, notFoundLabelClassName = param.notFoundLabelClassName, elementClassName = param.elementClassName, searchClassName = param.searchClassName, buttonClassName = param.buttonClassName, buttonFocusClassName = param.buttonFocusClassName, value = param.value, disabled = param.disabled, onChange = param.onChange, direction = param.direction, createNewOptionLabel = param.createNewOptionLabel, createNewOptionContainerClassName = param.createNewOptionContainerClassName;
|
|
4231
|
-
var id = (0,
|
|
4232
|
-
var _ref = _sliced_to_array((0,
|
|
4233
|
-
var _ref1 = _sliced_to_array((0,
|
|
4234
|
-
var _ref2 = _sliced_to_array((0,
|
|
4235
|
-
var _ref3 = _sliced_to_array((0,
|
|
4236
|
-
(0,
|
|
4363
|
+
var id = (0, import_react9.useId)();
|
|
4364
|
+
var _ref = _sliced_to_array((0, import_react9.useState)(false), 2), open = _ref[0], setOpen = _ref[1];
|
|
4365
|
+
var _ref1 = _sliced_to_array((0, import_react9.useState)(value || defaultValue || ""), 2), selectedValue = _ref1[0], setSelectedValue = _ref1[1];
|
|
4366
|
+
var _ref2 = _sliced_to_array((0, import_react9.useState)(""), 2), searchQuery = _ref2[0], setSearchQuery = _ref2[1];
|
|
4367
|
+
var _ref3 = _sliced_to_array((0, import_react9.useState)([]), 2), newOptions = _ref3[0], setNewOptions = _ref3[1];
|
|
4368
|
+
(0, import_react9.useEffect)(function() {
|
|
4237
4369
|
setSelectedValue(value);
|
|
4238
4370
|
}, [
|
|
4239
4371
|
value
|
|
4240
4372
|
]);
|
|
4241
|
-
var allOptions = (0,
|
|
4373
|
+
var allOptions = (0, import_react9.useMemo)(function() {
|
|
4242
4374
|
return _to_consumable_array(options).concat(_to_consumable_array(newOptions));
|
|
4243
4375
|
}, [
|
|
4244
4376
|
options,
|
|
4245
4377
|
newOptions
|
|
4246
4378
|
]);
|
|
4247
|
-
var filteredOptions = (0,
|
|
4379
|
+
var filteredOptions = (0, import_react9.useMemo)(function() {
|
|
4248
4380
|
if (!searchQuery) return allOptions;
|
|
4249
4381
|
var query2 = searchQuery.toLowerCase().trim();
|
|
4250
4382
|
return allOptions.filter(function(option) {
|
|
@@ -4256,7 +4388,7 @@ function SearchSelect(param) {
|
|
|
4256
4388
|
allOptions,
|
|
4257
4389
|
searchQuery
|
|
4258
4390
|
]);
|
|
4259
|
-
var selectLabel = (0,
|
|
4391
|
+
var selectLabel = (0, import_react9.useMemo)(function() {
|
|
4260
4392
|
var _allOptions_find;
|
|
4261
4393
|
return selectedValue ? ((_allOptions_find = allOptions.find(function(item) {
|
|
4262
4394
|
return item.value === selectedValue;
|
|
@@ -4266,7 +4398,7 @@ function SearchSelect(param) {
|
|
|
4266
4398
|
allOptions,
|
|
4267
4399
|
selectPlaceholder
|
|
4268
4400
|
]);
|
|
4269
|
-
var addNewOption = (0,
|
|
4401
|
+
var addNewOption = (0, import_react9.useCallback)(function() {
|
|
4270
4402
|
var newOption = {
|
|
4271
4403
|
value: searchQuery,
|
|
4272
4404
|
label: searchQuery
|
|
@@ -4283,22 +4415,22 @@ function SearchSelect(param) {
|
|
|
4283
4415
|
}, [
|
|
4284
4416
|
searchQuery
|
|
4285
4417
|
]);
|
|
4286
|
-
return /* @__PURE__ */ (0,
|
|
4418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", {
|
|
4287
4419
|
style: {
|
|
4288
4420
|
direction: direction
|
|
4289
4421
|
},
|
|
4290
4422
|
className: cn("w-full", elementClassName),
|
|
4291
4423
|
children: [
|
|
4292
|
-
/* @__PURE__ */ (0,
|
|
4424
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Popover, {
|
|
4293
4425
|
open: open,
|
|
4294
4426
|
onOpenChange: function(isOpen) {
|
|
4295
4427
|
setOpen(isOpen);
|
|
4296
4428
|
if (!isOpen) setSearchQuery("");
|
|
4297
4429
|
},
|
|
4298
4430
|
children: [
|
|
4299
|
-
/* @__PURE__ */ (0,
|
|
4431
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverTrigger, {
|
|
4300
4432
|
asChild: true,
|
|
4301
|
-
children: /* @__PURE__ */ (0,
|
|
4433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, {
|
|
4302
4434
|
id: id,
|
|
4303
4435
|
variant: "outline",
|
|
4304
4436
|
role: "combobox",
|
|
@@ -4306,11 +4438,11 @@ function SearchSelect(param) {
|
|
|
4306
4438
|
disabled: disabled,
|
|
4307
4439
|
className: cn("border-input w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px]", buttonClassName, open && buttonFocusClassName),
|
|
4308
4440
|
children: [
|
|
4309
|
-
/* @__PURE__ */ (0,
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", {
|
|
4310
4442
|
className: cn("truncate", !selectedValue && "text-muted-foreground"),
|
|
4311
4443
|
children: selectLabel
|
|
4312
4444
|
}),
|
|
4313
|
-
/* @__PURE__ */ (0,
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.ChevronDownIcon, {
|
|
4314
4446
|
size: 16,
|
|
4315
4447
|
className: "text-muted-foreground/80 shrink-0",
|
|
4316
4448
|
"aria-hidden": "true"
|
|
@@ -4318,12 +4450,12 @@ function SearchSelect(param) {
|
|
|
4318
4450
|
]
|
|
4319
4451
|
})
|
|
4320
4452
|
}),
|
|
4321
|
-
/* @__PURE__ */ (0,
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverContent, {
|
|
4322
4454
|
className: cn("border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 bg-[#fff]"),
|
|
4323
4455
|
align: "start",
|
|
4324
|
-
children: /* @__PURE__ */ (0,
|
|
4456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Command, {
|
|
4325
4457
|
children: [
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4458
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandInput, {
|
|
4327
4459
|
style: {
|
|
4328
4460
|
direction: direction
|
|
4329
4461
|
},
|
|
@@ -4339,24 +4471,24 @@ function SearchSelect(param) {
|
|
|
4339
4471
|
}
|
|
4340
4472
|
}
|
|
4341
4473
|
}),
|
|
4342
|
-
/* @__PURE__ */ (0,
|
|
4343
|
-
children: filteredOptions.length === 0 && searchQuery !== "" ? createNewOptionLabel ? /* @__PURE__ */ (0,
|
|
4474
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandList, {
|
|
4475
|
+
children: filteredOptions.length === 0 && searchQuery !== "" ? createNewOptionLabel ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandEmpty, {
|
|
4344
4476
|
style: {
|
|
4345
4477
|
direction: direction
|
|
4346
4478
|
},
|
|
4347
4479
|
onClick: addNewOption,
|
|
4348
4480
|
className: cn("hover:bg-[#cccbcb] cursor-pointer w-full", createNewOptionContainerClassName),
|
|
4349
|
-
children: /* @__PURE__ */ (0,
|
|
4481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", {
|
|
4350
4482
|
className: cn("w-full h-10 flex items-center px-2", notFoundLabelClassName),
|
|
4351
4483
|
children: "".concat(createNewOptionLabel, " : ").concat(searchQuery)
|
|
4352
4484
|
})
|
|
4353
|
-
}) : /* @__PURE__ */ (0,
|
|
4485
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandEmpty, {
|
|
4354
4486
|
className: cn("w-full py-2 text-center", notFoundLabelClassName),
|
|
4355
4487
|
children: notFoundLabel
|
|
4356
|
-
}) : /* @__PURE__ */ (0,
|
|
4488
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandGroup, {
|
|
4357
4489
|
className: cn("max-h-52 overflow-y-auto", dropdownClassName),
|
|
4358
4490
|
children: filteredOptions.map(function(option) {
|
|
4359
|
-
return /* @__PURE__ */ (0,
|
|
4491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(CommandItem, {
|
|
4360
4492
|
className: cn("hover:bg-[#cccbcb] cursor-pointer", dropdownOptionClassName, selectedValue === option.value && "bg-[#cccbcb]"),
|
|
4361
4493
|
value: JSON.stringify(option),
|
|
4362
4494
|
onSelect: function(currentValue) {
|
|
@@ -4368,7 +4500,7 @@ function SearchSelect(param) {
|
|
|
4368
4500
|
},
|
|
4369
4501
|
children: [
|
|
4370
4502
|
option.label,
|
|
4371
|
-
selectedValue === option.value && /* @__PURE__ */ (0,
|
|
4503
|
+
selectedValue === option.value && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.CheckIcon, {
|
|
4372
4504
|
size: 16,
|
|
4373
4505
|
className: "ml-auto"
|
|
4374
4506
|
})
|
|
@@ -4382,7 +4514,7 @@ function SearchSelect(param) {
|
|
|
4382
4514
|
})
|
|
4383
4515
|
]
|
|
4384
4516
|
}),
|
|
4385
|
-
/* @__PURE__ */ (0,
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", {
|
|
4386
4518
|
name: name,
|
|
4387
4519
|
type: "hidden",
|
|
4388
4520
|
value: selectedValue
|
|
@@ -4391,7 +4523,7 @@ function SearchSelect(param) {
|
|
|
4391
4523
|
});
|
|
4392
4524
|
}
|
|
4393
4525
|
// src/components/table/components.tsx
|
|
4394
|
-
var
|
|
4526
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
4395
4527
|
var getFixedNumber = function() {
|
|
4396
4528
|
var number = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, fix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 4;
|
|
4397
4529
|
var sum_value = number % 1 === 0 ? number : number.toFixed(fix).replace(/\.?0+$/, "");
|
|
@@ -4401,14 +4533,14 @@ var TableRow2 = function(param) {
|
|
|
4401
4533
|
var item = param.item, index2 = param.index;
|
|
4402
4534
|
var _useTableContext = useTableContext(), rowStyles = _useTableContext.rowStyles, rowClassName = _useTableContext.rowClassName, keysToRender = _useTableContext.keysToRender, onRowClick = _useTableContext.onRowClick, zebraStriping = _useTableContext.zebraStriping;
|
|
4403
4535
|
var zebraClassName = zebraStriping ? index2 % 2 === 0 ? zebraStriping.evenRowClassName || "" : zebraStriping.oddRowClassName || "bg-gray-300" : "";
|
|
4404
|
-
return /* @__PURE__ */ (0,
|
|
4536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tr", {
|
|
4405
4537
|
className: cn("hover:bg-[#808080] hover:text-[#fff]", zebraClassName, rowClassName || ""),
|
|
4406
4538
|
onClick: function() {
|
|
4407
4539
|
return onRowClick && onRowClick(item);
|
|
4408
4540
|
},
|
|
4409
4541
|
style: rowStyles,
|
|
4410
4542
|
children: keysToRender.map(function(key, index3) {
|
|
4411
|
-
return /* @__PURE__ */ (0,
|
|
4543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableCell, {
|
|
4412
4544
|
value: item[key]
|
|
4413
4545
|
}, index3);
|
|
4414
4546
|
})
|
|
@@ -4417,7 +4549,7 @@ var TableRow2 = function(param) {
|
|
|
4417
4549
|
var TableCell = function(param) {
|
|
4418
4550
|
var value = param.value;
|
|
4419
4551
|
var _useTableContext = useTableContext(), cellStyle = _useTableContext.cellStyle, cellClassName = _useTableContext.cellClassName;
|
|
4420
|
-
return /* @__PURE__ */ (0,
|
|
4552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("td", {
|
|
4421
4553
|
title: [
|
|
4422
4554
|
"string",
|
|
4423
4555
|
"number",
|
|
@@ -4428,60 +4560,60 @@ var TableCell = function(param) {
|
|
|
4428
4560
|
children: value
|
|
4429
4561
|
});
|
|
4430
4562
|
};
|
|
4431
|
-
var Filter = (0,
|
|
4563
|
+
var Filter = (0, import_react10.memo)(function(param) {
|
|
4432
4564
|
var filterableColumn = param.filterableColumn, index2 = param.index;
|
|
4433
4565
|
var _filters_filterableColumn_dataKey, _filters_filterableColumn_dataKey1, _filterOptions_filterableColumn_dataKey;
|
|
4434
4566
|
var _useTableContext = useTableContext(), direction = _useTableContext.direction, headers = _useTableContext.headers, filters = _useTableContext.filters, filterOptions = _useTableContext.filterOptions, filterPopupsDisplay = _useTableContext.filterPopupsDisplay, handleFilterChange = _useTableContext.handleFilterChange, handleFilterClick = _useTableContext.handleFilterClick, closeFilterWindow = _useTableContext.closeFilterWindow, filterLabel = _useTableContext.filterLabel;
|
|
4435
4567
|
var displayRight = direction === "rtl" && index2 === headers.length - 1 || direction === "ltr" && index2 !== headers.length - 1;
|
|
4436
|
-
return /* @__PURE__ */ (0,
|
|
4568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4437
4569
|
className: "absolute top-1 right-1 ",
|
|
4438
4570
|
children: [
|
|
4439
|
-
/* @__PURE__ */ (0,
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", {
|
|
4440
4572
|
title: filterLabel + " " + filterableColumn.header,
|
|
4441
4573
|
className: "text-[12px]",
|
|
4442
4574
|
onClick: function() {
|
|
4443
4575
|
return handleFilterClick(filterableColumn.dataKey);
|
|
4444
4576
|
},
|
|
4445
|
-
children: filterPopupsDisplay === filterableColumn.dataKey ? /* @__PURE__ */ (0,
|
|
4446
|
-
children: ((_filters_filterableColumn_dataKey = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey === void 0 ? void 0 : _filters_filterableColumn_dataKey.length) > 0 ? /* @__PURE__ */ (0,
|
|
4577
|
+
children: filterPopupsDisplay === filterableColumn.dataKey ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4578
|
+
children: ((_filters_filterableColumn_dataKey = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey === void 0 ? void 0 : _filters_filterableColumn_dataKey.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4447
4579
|
children: slashFilterSvg(true)
|
|
4448
|
-
}) : /* @__PURE__ */ (0,
|
|
4580
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4449
4581
|
children: emptyFilterSvg(true)
|
|
4450
4582
|
})
|
|
4451
|
-
}) : /* @__PURE__ */ (0,
|
|
4452
|
-
children: ((_filters_filterableColumn_dataKey1 = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey1 === void 0 ? void 0 : _filters_filterableColumn_dataKey1.length) > 0 ? /* @__PURE__ */ (0,
|
|
4583
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4584
|
+
children: ((_filters_filterableColumn_dataKey1 = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey1 === void 0 ? void 0 : _filters_filterableColumn_dataKey1.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4453
4585
|
children: slashFilterSvg()
|
|
4454
|
-
}) : /* @__PURE__ */ (0,
|
|
4586
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4455
4587
|
children: emptyFilterSvg()
|
|
4456
4588
|
})
|
|
4457
4589
|
})
|
|
4458
4590
|
}),
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4591
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4460
4592
|
className: "relative",
|
|
4461
|
-
children: filterPopupsDisplay === filterableColumn.dataKey && /* @__PURE__ */ (0,
|
|
4593
|
+
children: filterPopupsDisplay === filterableColumn.dataKey && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4462
4594
|
className: "absolute top-[-20px] z-20 ".concat(displayRight ? " left-[100%]" : "right-[100%]", " w-44 h-52 text-black bg-white p-1 flex flex-col items-center gap-2 shadow"),
|
|
4463
4595
|
children: [
|
|
4464
|
-
/* @__PURE__ */ (0,
|
|
4596
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4465
4597
|
className: "flex justify-between items-center border-black border-b-[1px] w-[90%]",
|
|
4466
4598
|
children: [
|
|
4467
|
-
/* @__PURE__ */ (0,
|
|
4599
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4468
4600
|
className: "text-start",
|
|
4469
4601
|
children: filterLabel + " " + filterableColumn.header
|
|
4470
4602
|
}),
|
|
4471
|
-
/* @__PURE__ */ (0,
|
|
4603
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", {
|
|
4472
4604
|
onClick: closeFilterWindow,
|
|
4473
|
-
children: /* @__PURE__ */ (0,
|
|
4605
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(RedXSvg2, {})
|
|
4474
4606
|
})
|
|
4475
4607
|
]
|
|
4476
4608
|
}),
|
|
4477
|
-
/* @__PURE__ */ (0,
|
|
4609
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4478
4610
|
className: "overflow-auto h-[80%] flex flex-col gap-1 w-full cursor-pointer ",
|
|
4479
4611
|
children: (_filterOptions_filterableColumn_dataKey = filterOptions[filterableColumn.dataKey]) === null || _filterOptions_filterableColumn_dataKey === void 0 ? void 0 : _filterOptions_filterableColumn_dataKey.map(function(option, i) {
|
|
4480
4612
|
var _filters_filterableColumn_dataKey;
|
|
4481
|
-
return /* @__PURE__ */ (0,
|
|
4613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4482
4614
|
className: "flex items-center px-2 justify-start hover:bg-[#547f22] hover:text-white",
|
|
4483
4615
|
children: [
|
|
4484
|
-
/* @__PURE__ */ (0,
|
|
4616
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", {
|
|
4485
4617
|
type: "checkbox",
|
|
4486
4618
|
className: "cursor-pointer",
|
|
4487
4619
|
checked: (_filters_filterableColumn_dataKey = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey === void 0 ? void 0 : _filters_filterableColumn_dataKey.includes(option),
|
|
@@ -4489,7 +4621,7 @@ var Filter = (0, import_react9.memo)(function(param) {
|
|
|
4489
4621
|
return handleFilterChange(filterableColumn.dataKey, option);
|
|
4490
4622
|
}
|
|
4491
4623
|
}),
|
|
4492
|
-
/* @__PURE__ */ (0,
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", {
|
|
4493
4625
|
className: "flex-1 text-start px-2",
|
|
4494
4626
|
onClick: function() {
|
|
4495
4627
|
return handleFilterChange(filterableColumn.dataKey, option);
|
|
@@ -4506,39 +4638,39 @@ var Filter = (0, import_react9.memo)(function(param) {
|
|
|
4506
4638
|
]
|
|
4507
4639
|
});
|
|
4508
4640
|
});
|
|
4509
|
-
var TableHead = (0,
|
|
4641
|
+
var TableHead = (0, import_react10.memo)(function() {
|
|
4510
4642
|
var _useTableContext = useTableContext(), headers = _useTableContext.headers, headerStyle = _useTableContext.headerStyle, headerCellStyle = _useTableContext.headerCellStyle, sortColumn = _useTableContext.sortColumn, handleSort = _useTableContext.handleSort, sortKeys = _useTableContext.sortKeys, sortOrder = _useTableContext.sortOrder, _useTableContext_filterableColumns = _useTableContext.filterableColumns, filterableColumns = _useTableContext_filterableColumns === void 0 ? [] : _useTableContext_filterableColumns, sortLabel = _useTableContext.sortLabel, headerClassName = _useTableContext.headerClassName, headerCellClassName = _useTableContext.headerCellClassName;
|
|
4511
|
-
var sortDisplay = (0,
|
|
4643
|
+
var sortDisplay = (0, import_react10.useMemo)(function() {
|
|
4512
4644
|
return Boolean(sortKeys === null || sortKeys === void 0 ? void 0 : sortKeys.length);
|
|
4513
4645
|
}, [
|
|
4514
4646
|
sortKeys
|
|
4515
4647
|
]);
|
|
4516
|
-
return /* @__PURE__ */ (0,
|
|
4648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("thead", {
|
|
4517
4649
|
className: cn("bg-[#282828] text-white sticky top-0", headerClassName),
|
|
4518
|
-
children: /* @__PURE__ */ (0,
|
|
4650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tr", {
|
|
4519
4651
|
style: headerStyle,
|
|
4520
4652
|
children: headers.map(function(header, index2) {
|
|
4521
4653
|
var filterableColumn = filterableColumns.find(function(col) {
|
|
4522
4654
|
return col.header === header;
|
|
4523
4655
|
});
|
|
4524
|
-
return /* @__PURE__ */ (0,
|
|
4656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("th", {
|
|
4525
4657
|
title: sortDisplay ? "".concat(sortLabel, " ").concat(header) : header,
|
|
4526
4658
|
style: headerCellStyle,
|
|
4527
4659
|
className: cn("border-black border-[1px] max-w-[130px] px-2 text-center relative", headerCellClassName),
|
|
4528
4660
|
children: [
|
|
4529
|
-
/* @__PURE__ */ (0,
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4530
4662
|
className: "px-2 ".concat(sortDisplay ? "cursor-pointer" : ""),
|
|
4531
4663
|
onClick: function() {
|
|
4532
4664
|
return sortDisplay && handleSort(index2);
|
|
4533
4665
|
},
|
|
4534
4666
|
children: header
|
|
4535
4667
|
}),
|
|
4536
|
-
sortDisplay && sortColumn === index2 && (sortOrder === "desc" ? /* @__PURE__ */ (0,
|
|
4668
|
+
sortDisplay && sortColumn === index2 && (sortOrder === "desc" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4537
4669
|
children: sortSvg()
|
|
4538
|
-
}) : /* @__PURE__ */ (0,
|
|
4670
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4539
4671
|
children: sortSvg(true)
|
|
4540
4672
|
})),
|
|
4541
|
-
filterableColumn && /* @__PURE__ */ (0,
|
|
4673
|
+
filterableColumn && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Filter, {
|
|
4542
4674
|
filterableColumn: filterableColumn,
|
|
4543
4675
|
index: index2
|
|
4544
4676
|
})
|
|
@@ -4548,39 +4680,39 @@ var TableHead = (0, import_react9.memo)(function() {
|
|
|
4548
4680
|
})
|
|
4549
4681
|
});
|
|
4550
4682
|
}, renderOnce);
|
|
4551
|
-
var TableBody = (0,
|
|
4683
|
+
var TableBody = (0, import_react10.memo)(function() {
|
|
4552
4684
|
var dataToRender = useTableContext().dataToRender;
|
|
4553
|
-
return /* @__PURE__ */ (0,
|
|
4685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tbody", {
|
|
4554
4686
|
className: "divide-y divide-gray-600",
|
|
4555
4687
|
children: dataToRender.renderedData.map(function(item, index2) {
|
|
4556
|
-
return /* @__PURE__ */ (0,
|
|
4688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableRow2, {
|
|
4557
4689
|
item: item,
|
|
4558
4690
|
index: index2
|
|
4559
4691
|
}, index2);
|
|
4560
4692
|
})
|
|
4561
4693
|
});
|
|
4562
4694
|
}, renderOnce);
|
|
4563
|
-
var MaxRowsLabel = (0,
|
|
4695
|
+
var MaxRowsLabel = (0, import_react10.memo)(function() {
|
|
4564
4696
|
var _useTableContext = useTableContext(), data = _useTableContext.data, dataToRender = _useTableContext.dataToRender, maxRowsLabel1 = _useTableContext.maxRowsLabel1, maxRowsLabel2 = _useTableContext.maxRowsLabel2, maxRows = _useTableContext.maxRows, maxRowsContainerClassName = _useTableContext.maxRowsContainerClassName;
|
|
4565
|
-
return /* @__PURE__ */ (0,
|
|
4697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4566
4698
|
className: cn("flex justify-start items-center text-lg gap-1", maxRowsContainerClassName || ""),
|
|
4567
4699
|
children: [
|
|
4568
|
-
/* @__PURE__ */ (0,
|
|
4700
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4569
4701
|
children: maxRowsLabel1
|
|
4570
4702
|
}),
|
|
4571
|
-
/* @__PURE__ */ (0,
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4572
4704
|
children: maxRows > dataToRender.renderedData.length ? dataToRender.renderedData.length : maxRows
|
|
4573
4705
|
}),
|
|
4574
|
-
/* @__PURE__ */ (0,
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4575
4707
|
children: maxRowsLabel2
|
|
4576
4708
|
}),
|
|
4577
|
-
/* @__PURE__ */ (0,
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4578
4710
|
children: dataToRender.filtered.length
|
|
4579
4711
|
})
|
|
4580
4712
|
]
|
|
4581
4713
|
});
|
|
4582
4714
|
}, renderOnce);
|
|
4583
|
-
var ExportToExcel = (0,
|
|
4715
|
+
var ExportToExcel = (0, import_react10.memo)(function() {
|
|
4584
4716
|
var _useTableContext = useTableContext(), exportToExcelKeys = _useTableContext.exportToExcelKeys, dataToAddToExcelTable = _useTableContext.dataToAddToExcelTable, excelFileName = _useTableContext.excelFileName, dataToRender = _useTableContext.dataToRender, headers = _useTableContext.headers, sumColumns = _useTableContext.sumColumns, exportExcelTitle = _useTableContext.exportExcelTitle, exportExcelContent = _useTableContext.exportExcelContent, exportToExcelClassName = _useTableContext.exportToExcelClassName;
|
|
4585
4717
|
var addPropertiesToExcel = function(properties) {
|
|
4586
4718
|
var newData = _to_consumable_array(dataToRender.renderedData);
|
|
@@ -4653,16 +4785,16 @@ var ExportToExcel = (0, import_react9.memo)(function() {
|
|
|
4653
4785
|
return _ref.apply(this, arguments);
|
|
4654
4786
|
};
|
|
4655
4787
|
}();
|
|
4656
|
-
return /* @__PURE__ */ (0,
|
|
4788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", {
|
|
4657
4789
|
onClick: onExportExcelClick,
|
|
4658
4790
|
title: exportExcelTitle,
|
|
4659
4791
|
className: cn("px-2 py-[2px] bg-[#547f22] text-white rounded-lg text-[16px]", exportToExcelClassName),
|
|
4660
4792
|
children: exportExcelContent || exportToExcelSvg()
|
|
4661
4793
|
});
|
|
4662
4794
|
}, renderOnce);
|
|
4663
|
-
var Search = (0,
|
|
4795
|
+
var Search = (0, import_react10.memo)(function() {
|
|
4664
4796
|
var _useTableContext = useTableContext(), searchQuery = _useTableContext.searchQuery, handleSearch = _useTableContext.handleSearch, searchPlaceHolder = _useTableContext.searchPlaceHolder, searchInputClassName = _useTableContext.searchInputClassName, searchInputStyle = _useTableContext.searchInputStyle;
|
|
4665
|
-
return /* @__PURE__ */ (0,
|
|
4797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", {
|
|
4666
4798
|
className: cn("w-40 border-black border-[1px] text-lg px-2 ", searchInputClassName),
|
|
4667
4799
|
type: "text",
|
|
4668
4800
|
placeholder: searchPlaceHolder,
|
|
@@ -4671,19 +4803,19 @@ var Search = (0, import_react9.memo)(function() {
|
|
|
4671
4803
|
style: searchInputStyle
|
|
4672
4804
|
});
|
|
4673
4805
|
}, renderOnce);
|
|
4674
|
-
var Summary = (0,
|
|
4806
|
+
var Summary = (0, import_react10.memo)(function() {
|
|
4675
4807
|
var _useTableContext = useTableContext(), summaryContainerStyle = _useTableContext.summaryContainerStyle, summaryLabelStyle = _useTableContext.summaryLabelStyle, summaryLabel = _useTableContext.summaryLabel, summaryRowStyle = _useTableContext.summaryRowStyle, sumColumns = _useTableContext.sumColumns, dataToRender = _useTableContext.dataToRender, direction = _useTableContext.direction;
|
|
4676
|
-
return /* @__PURE__ */ (0,
|
|
4808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4677
4809
|
style: _object_spread_props(_object_spread({}, summaryContainerStyle), {
|
|
4678
4810
|
direction: direction
|
|
4679
4811
|
}),
|
|
4680
4812
|
className: "w-full h-8 flex justify-between items-center px-3 text-[18px] font-bold",
|
|
4681
4813
|
children: [
|
|
4682
|
-
/* @__PURE__ */ (0,
|
|
4814
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4683
4815
|
style: summaryLabelStyle,
|
|
4684
4816
|
children: summaryLabel
|
|
4685
4817
|
}),
|
|
4686
|
-
/* @__PURE__ */ (0,
|
|
4818
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4687
4819
|
style: summaryRowStyle,
|
|
4688
4820
|
className: "flex gap-3",
|
|
4689
4821
|
children: sumColumns.map(function(val) {
|
|
@@ -4691,16 +4823,16 @@ var Summary = (0, import_react9.memo)(function() {
|
|
|
4691
4823
|
return acc + Number(v[val.dataKey]) || 0;
|
|
4692
4824
|
}, 0);
|
|
4693
4825
|
var sum_value = getFixedNumber(sum_res);
|
|
4694
|
-
return /* @__PURE__ */ (0,
|
|
4826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4695
4827
|
className: "flex gap-1 justify-start",
|
|
4696
4828
|
children: [
|
|
4697
|
-
/* @__PURE__ */ (0,
|
|
4829
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4698
4830
|
children: val.label
|
|
4699
4831
|
}),
|
|
4700
|
-
/* @__PURE__ */ (0,
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", {
|
|
4701
4833
|
children: ":"
|
|
4702
4834
|
}),
|
|
4703
|
-
/* @__PURE__ */ (0,
|
|
4835
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4704
4836
|
children: val.ui ? val.ui(sum_value) : sum_value
|
|
4705
4837
|
})
|
|
4706
4838
|
]
|
|
@@ -4717,7 +4849,7 @@ var TimesUI = function(param) {
|
|
|
4717
4849
|
fromFormat: fromFormat,
|
|
4718
4850
|
tz: tz
|
|
4719
4851
|
});
|
|
4720
|
-
return /* @__PURE__ */ (0,
|
|
4852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4721
4853
|
style: {
|
|
4722
4854
|
direction: "ltr"
|
|
4723
4855
|
},
|
|
@@ -4733,22 +4865,22 @@ var TableButton = function(param) {
|
|
|
4733
4865
|
edit: "fa-light fa-pen-to-square text-xl",
|
|
4734
4866
|
delete: "fa-light fa-trash text-xl"
|
|
4735
4867
|
};
|
|
4736
|
-
return /* @__PURE__ */ (0,
|
|
4737
|
-
children: type === "custom" ? /* @__PURE__ */ (0,
|
|
4868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {
|
|
4869
|
+
children: type === "custom" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", {
|
|
4738
4870
|
className: className,
|
|
4739
4871
|
title: title,
|
|
4740
4872
|
onClick: onClick,
|
|
4741
4873
|
children: children
|
|
4742
|
-
}) : type === "add" ? /* @__PURE__ */ (0,
|
|
4874
|
+
}) : type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, {
|
|
4743
4875
|
title: title,
|
|
4744
4876
|
onClick: onClick,
|
|
4745
|
-
children: /* @__PURE__ */ (0,
|
|
4877
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", {
|
|
4746
4878
|
className: cn("fa-regular fa-plus text-2xl", className)
|
|
4747
4879
|
})
|
|
4748
|
-
}) : /* @__PURE__ */ (0,
|
|
4880
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", {
|
|
4749
4881
|
title: title,
|
|
4750
4882
|
onClick: onClick,
|
|
4751
|
-
children: /* @__PURE__ */ (0,
|
|
4883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", {
|
|
4752
4884
|
className: cn(icon[type], className)
|
|
4753
4885
|
})
|
|
4754
4886
|
})
|
|
@@ -4756,7 +4888,7 @@ var TableButton = function(param) {
|
|
|
4756
4888
|
};
|
|
4757
4889
|
var DurationUI = function(param) {
|
|
4758
4890
|
var duration = param.duration, _param_daysLabel = param.daysLabel, daysLabel = _param_daysLabel === void 0 ? "d" : _param_daysLabel, _param_hoursLabel = param.hoursLabel, hoursLabel = _param_hoursLabel === void 0 ? "h" : _param_hoursLabel, _param_minutesLabel = param.minutesLabel, minutesLabel = _param_minutesLabel === void 0 ? "m" : _param_minutesLabel, _param_secondsLabel = param.secondsLabel, secondsLabel = _param_secondsLabel === void 0 ? "s" : _param_secondsLabel, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, direction = param.direction;
|
|
4759
|
-
var _ref = (0,
|
|
4891
|
+
var _ref = (0, import_react10.useMemo)(function() {
|
|
4760
4892
|
var secondsInDay = 86400;
|
|
4761
4893
|
var days = Math.floor(duration / secondsInDay);
|
|
4762
4894
|
var remainderAfterDays = duration % secondsInDay;
|
|
@@ -4777,14 +4909,14 @@ var DurationUI = function(param) {
|
|
|
4777
4909
|
}, [
|
|
4778
4910
|
duration
|
|
4779
4911
|
]), daysStr = _ref.daysStr, hoursStr = _ref.hoursStr, minutesStr = _ref.minutesStr, secondsStr = _ref.secondsStr;
|
|
4780
|
-
return /* @__PURE__ */ (0,
|
|
4912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", {
|
|
4781
4913
|
title: "".concat(daysStr, " ").concat(daysLabel, " ").concat(hoursStr, " ").concat(hoursLabel, " ").concat(minutesStr, " ").concat(minutesLabel, " ").concat(secondsStr, " ").concat(secondsLabel).trim(),
|
|
4782
4914
|
style: {
|
|
4783
4915
|
direction: "ltr"
|
|
4784
4916
|
},
|
|
4785
4917
|
className: cn("flex gap-1 ".concat(direction === "rtl" ? "justify-end" : "justify-start"), className),
|
|
4786
4918
|
children: [
|
|
4787
|
-
daysStr !== "00" && /* @__PURE__ */ (0,
|
|
4919
|
+
daysStr !== "00" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", {
|
|
4788
4920
|
style: {
|
|
4789
4921
|
display: "inline-block"
|
|
4790
4922
|
},
|
|
@@ -4794,7 +4926,7 @@ var DurationUI = function(param) {
|
|
|
4794
4926
|
daysLabel
|
|
4795
4927
|
]
|
|
4796
4928
|
}),
|
|
4797
|
-
hoursStr !== "00" && /* @__PURE__ */ (0,
|
|
4929
|
+
hoursStr !== "00" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", {
|
|
4798
4930
|
style: {
|
|
4799
4931
|
display: "inline-block"
|
|
4800
4932
|
},
|
|
@@ -4804,7 +4936,7 @@ var DurationUI = function(param) {
|
|
|
4804
4936
|
hoursLabel
|
|
4805
4937
|
]
|
|
4806
4938
|
}),
|
|
4807
|
-
minutesStr !== "00" && /* @__PURE__ */ (0,
|
|
4939
|
+
minutesStr !== "00" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", {
|
|
4808
4940
|
style: {
|
|
4809
4941
|
display: "inline-block"
|
|
4810
4942
|
},
|
|
@@ -4814,7 +4946,7 @@ var DurationUI = function(param) {
|
|
|
4814
4946
|
minutesLabel
|
|
4815
4947
|
]
|
|
4816
4948
|
}),
|
|
4817
|
-
secondsStr !== "00" && /* @__PURE__ */ (0,
|
|
4949
|
+
secondsStr !== "00" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", {
|
|
4818
4950
|
style: {
|
|
4819
4951
|
display: "inline-block"
|
|
4820
4952
|
},
|
|
@@ -4829,7 +4961,7 @@ var DurationUI = function(param) {
|
|
|
4829
4961
|
};
|
|
4830
4962
|
var PhoneUI = function(param) {
|
|
4831
4963
|
var phone = param.phone, direction = param.direction, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
|
|
4832
|
-
return /* @__PURE__ */ (0,
|
|
4964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4833
4965
|
style: {
|
|
4834
4966
|
direction: "ltr"
|
|
4835
4967
|
},
|
|
@@ -4840,9 +4972,9 @@ var PhoneUI = function(param) {
|
|
|
4840
4972
|
};
|
|
4841
4973
|
var BooleanUi = function(param) {
|
|
4842
4974
|
var value = param.value, size3 = param.size, className = param.className, falseUi = param.falseUi, trueUi = param.trueUi;
|
|
4843
|
-
return value ? trueUi !== null && trueUi !== void 0 ? trueUi : /* @__PURE__ */ (0,
|
|
4975
|
+
return value ? trueUi !== null && trueUi !== void 0 ? trueUi : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", {
|
|
4844
4976
|
className: cn("fa-light fa-check ".concat(size3 === "small" ? "text-lg" : "text-2xl"), className)
|
|
4845
|
-
}) : falseUi !== null && falseUi !== void 0 ? falseUi : /* @__PURE__ */ (0,
|
|
4977
|
+
}) : falseUi !== null && falseUi !== void 0 ? falseUi : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", {
|
|
4846
4978
|
className: cn("fa-light fa-xmark ".concat(size3 === "small" ? "text-lg" : "text-2xl"), className)
|
|
4847
4979
|
});
|
|
4848
4980
|
};
|
|
@@ -4852,7 +4984,7 @@ var GeoUi = function(param) {
|
|
|
4852
4984
|
var lat = value.lat || value.latitude;
|
|
4853
4985
|
var googleMapsLink = getLocationUrl(lang, lat);
|
|
4854
4986
|
var langLatUi = linkUi || " ".concat(lang, " ").concat(lat);
|
|
4855
|
-
return /* @__PURE__ */ (0,
|
|
4987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", {
|
|
4856
4988
|
href: googleMapsLink,
|
|
4857
4989
|
target: "_blank",
|
|
4858
4990
|
className: cn("_ellipsis text-blue-500 hover:text-blue-700 underline", className),
|
|
@@ -4862,7 +4994,7 @@ var GeoUi = function(param) {
|
|
|
4862
4994
|
};
|
|
4863
4995
|
var NumberUI = function(param) {
|
|
4864
4996
|
var number = param.number, direction = param.direction, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
|
|
4865
|
-
return /* @__PURE__ */ (0,
|
|
4997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", {
|
|
4866
4998
|
style: {
|
|
4867
4999
|
direction: "ltr"
|
|
4868
5000
|
},
|
|
@@ -4872,15 +5004,15 @@ var NumberUI = function(param) {
|
|
|
4872
5004
|
});
|
|
4873
5005
|
};
|
|
4874
5006
|
// src/components/forms/ModularForm/ModularForm.tsx
|
|
4875
|
-
var
|
|
5007
|
+
var import_react13 = require("react");
|
|
4876
5008
|
// src/components/forms/ModularForm/formElements.tsx
|
|
4877
|
-
var
|
|
5009
|
+
var import_react12 = require("react");
|
|
4878
5010
|
// src/components/forms/ModularForm/InternationalPhonePicker.tsx
|
|
4879
5011
|
var import_lucide_react5 = require("lucide-react");
|
|
4880
|
-
var
|
|
5012
|
+
var import_react11 = require("react");
|
|
4881
5013
|
var RPNInput = __toESM(require("react-phone-number-input"));
|
|
4882
5014
|
var import_flags = __toESM(require("react-phone-number-input/flags"));
|
|
4883
|
-
var
|
|
5015
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
4884
5016
|
function InternationalPhonePicker(param) {
|
|
4885
5017
|
var setPhoneValue = param.setPhoneValue, _param_phoneValue = param.phoneValue, phoneValue = _param_phoneValue === void 0 ? "" : _param_phoneValue, _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "" : _param_placeholder, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_defaultCountry = param.defaultCountry, defaultCountry = _param_defaultCountry === void 0 ? "IL" : _param_defaultCountry, _param_flagContainerClassName = param.flagContainerClassName, flagContainerClassName = _param_flagContainerClassName === void 0 ? "" : _param_flagContainerClassName, _param_inputClassName = param.inputClassName, inputClassName = _param_inputClassName === void 0 ? "" : _param_inputClassName, defaultValue = param.defaultValue, name = param.name, style = param.style, onEnter = param.onEnter, labelContent = param.labelContent, labelClassName = param.labelClassName, required = param.required, direction = param.direction;
|
|
4886
5018
|
var handleKeyDown = function(e) {
|
|
@@ -4890,8 +5022,8 @@ function InternationalPhonePicker(param) {
|
|
|
4890
5022
|
}
|
|
4891
5023
|
}
|
|
4892
5024
|
};
|
|
4893
|
-
var _ref = _sliced_to_array((0,
|
|
4894
|
-
(0,
|
|
5025
|
+
var _ref = _sliced_to_array((0, import_react11.useState)(""), 2), tempPhoneValue = _ref[0], setTempPhoneValue = _ref[1];
|
|
5026
|
+
(0, import_react11.useEffect)(function() {
|
|
4895
5027
|
if (defaultValue) {
|
|
4896
5028
|
if (setPhoneValue) {
|
|
4897
5029
|
setPhoneValue(defaultValue);
|
|
@@ -4903,19 +5035,19 @@ function InternationalPhonePicker(param) {
|
|
|
4903
5035
|
defaultValue,
|
|
4904
5036
|
setPhoneValue
|
|
4905
5037
|
]);
|
|
4906
|
-
return /* @__PURE__ */ (0,
|
|
5038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", {
|
|
4907
5039
|
style: {
|
|
4908
5040
|
direction: direction
|
|
4909
5041
|
},
|
|
4910
5042
|
className: cn("space-y-2", "".concat(labelContent ? "flex gap-1 items-center" : ""), containerClassName),
|
|
4911
5043
|
children: [
|
|
4912
|
-
labelContent && /* @__PURE__ */ (0,
|
|
5044
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ElementLabel, {
|
|
4913
5045
|
labelContent: labelContent,
|
|
4914
5046
|
labelClassName: labelClassName,
|
|
4915
5047
|
name: name,
|
|
4916
5048
|
required: required
|
|
4917
5049
|
}),
|
|
4918
|
-
/* @__PURE__ */ (0,
|
|
5050
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RPNInput.default, {
|
|
4919
5051
|
style: {
|
|
4920
5052
|
direction: "ltr"
|
|
4921
5053
|
},
|
|
@@ -4948,7 +5080,7 @@ function InternationalPhonePicker(param) {
|
|
|
4948
5080
|
setTempPhoneValue(newValue !== null && newValue !== void 0 ? newValue : "");
|
|
4949
5081
|
}
|
|
4950
5082
|
}),
|
|
4951
|
-
/* @__PURE__ */ (0,
|
|
5083
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", {
|
|
4952
5084
|
type: "hidden",
|
|
4953
5085
|
name: name,
|
|
4954
5086
|
value: tempPhoneValue
|
|
@@ -4956,20 +5088,20 @@ function InternationalPhonePicker(param) {
|
|
|
4956
5088
|
]
|
|
4957
5089
|
});
|
|
4958
5090
|
}
|
|
4959
|
-
var PhoneInput = (0,
|
|
5091
|
+
var PhoneInput = (0, import_react11.forwardRef)(function(_param, ref) {
|
|
4960
5092
|
var className = _param.className, onKeyDown = _param.onKeyDown, defaultValue = _param.defaultValue, style = _param.style, props = _object_without_properties(_param, [
|
|
4961
5093
|
"className",
|
|
4962
5094
|
"onKeyDown",
|
|
4963
5095
|
"defaultValue",
|
|
4964
5096
|
"style"
|
|
4965
5097
|
]);
|
|
4966
|
-
var inputRef = (0,
|
|
4967
|
-
(0,
|
|
5098
|
+
var inputRef = (0, import_react11.useRef)(null);
|
|
5099
|
+
(0, import_react11.useEffect)(function() {
|
|
4968
5100
|
if (inputRef.current) {
|
|
4969
5101
|
inputRef.current.focus();
|
|
4970
5102
|
}
|
|
4971
5103
|
}, []);
|
|
4972
|
-
return /* @__PURE__ */ (0,
|
|
5104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Input, _object_spread({
|
|
4973
5105
|
className: cn("-ms-px rounded-s-none shadow-none focus-visible:z-10 h-full", className),
|
|
4974
5106
|
onKeyDown: onKeyDown,
|
|
4975
5107
|
defaultValue: defaultValue,
|
|
@@ -4990,24 +5122,24 @@ var CountrySelect = function(param) {
|
|
|
4990
5122
|
var handleSelect = function(event) {
|
|
4991
5123
|
onChange(event.target.value);
|
|
4992
5124
|
};
|
|
4993
|
-
var originalClassName = (0,
|
|
5125
|
+
var originalClassName = (0, import_react11.useMemo)(function() {
|
|
4994
5126
|
return "relative inline-flex items-center self-stretch rounded-s-lg border border-input bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-[:disabled]:pointer-events-none has-[:disabled]:opacity-50";
|
|
4995
5127
|
}, []);
|
|
4996
|
-
return /* @__PURE__ */ (0,
|
|
5128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", {
|
|
4997
5129
|
className: cn(originalClassName, className),
|
|
4998
5130
|
children: [
|
|
4999
|
-
/* @__PURE__ */ (0,
|
|
5131
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", {
|
|
5000
5132
|
className: "inline-flex items-center gap-1",
|
|
5001
5133
|
"aria-hidden": "true",
|
|
5002
5134
|
children: [
|
|
5003
|
-
/* @__PURE__ */ (0,
|
|
5135
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FlagComponent, {
|
|
5004
5136
|
country: value,
|
|
5005
5137
|
countryName: value,
|
|
5006
5138
|
"aria-hidden": "true"
|
|
5007
5139
|
}),
|
|
5008
|
-
/* @__PURE__ */ (0,
|
|
5140
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", {
|
|
5009
5141
|
className: "text-muted-foreground/80",
|
|
5010
|
-
children: /* @__PURE__ */ (0,
|
|
5142
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react5.ChevronDown, {
|
|
5011
5143
|
size: 16,
|
|
5012
5144
|
strokeWidth: 2,
|
|
5013
5145
|
"aria-hidden": "true"
|
|
@@ -5015,7 +5147,7 @@ var CountrySelect = function(param) {
|
|
|
5015
5147
|
})
|
|
5016
5148
|
]
|
|
5017
5149
|
}),
|
|
5018
|
-
/* @__PURE__ */ (0,
|
|
5150
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("select", {
|
|
5019
5151
|
disabled: disabled,
|
|
5020
5152
|
value: value,
|
|
5021
5153
|
onChange: handleSelect,
|
|
@@ -5025,7 +5157,7 @@ var CountrySelect = function(param) {
|
|
|
5025
5157
|
return x.value;
|
|
5026
5158
|
}).map(function(option, i) {
|
|
5027
5159
|
var _option_value;
|
|
5028
|
-
return /* @__PURE__ */ (0,
|
|
5160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", {
|
|
5029
5161
|
className: "text-black",
|
|
5030
5162
|
value: option.value,
|
|
5031
5163
|
children: [
|
|
@@ -5042,20 +5174,20 @@ var CountrySelect = function(param) {
|
|
|
5042
5174
|
var FlagComponent = function(param) {
|
|
5043
5175
|
var country = param.country, countryName = param.countryName;
|
|
5044
5176
|
var Flag = import_flags.default[country];
|
|
5045
|
-
return /* @__PURE__ */ (0,
|
|
5177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", {
|
|
5046
5178
|
className: "w-5 overflow-hidden rounded-sm",
|
|
5047
|
-
children: Flag ? /* @__PURE__ */ (0,
|
|
5179
|
+
children: Flag ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Flag, {
|
|
5048
5180
|
title: countryName
|
|
5049
|
-
}) : /* @__PURE__ */ (0,
|
|
5181
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react5.Phone, {
|
|
5050
5182
|
size: 16,
|
|
5051
5183
|
"aria-hidden": "true"
|
|
5052
5184
|
})
|
|
5053
5185
|
});
|
|
5054
5186
|
};
|
|
5055
5187
|
// src/components/forms/ModularForm/formElements.tsx
|
|
5056
|
-
var
|
|
5188
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
5057
5189
|
var useSortValues = function(options, sortDirection, sortAsNumber) {
|
|
5058
|
-
var sortOptions = (0,
|
|
5190
|
+
var sortOptions = (0, import_react12.useMemo)(function() {
|
|
5059
5191
|
var sorted = sortAsNumber ? options.sort(function(a, b) {
|
|
5060
5192
|
return parseInt(b.label) - parseInt(a.label);
|
|
5061
5193
|
}) : options.sort(function(a, b) {
|
|
@@ -5071,30 +5203,30 @@ var useSortValues = function(options, sortDirection, sortAsNumber) {
|
|
|
5071
5203
|
};
|
|
5072
5204
|
var InputContainer = function(param) {
|
|
5073
5205
|
var validationError = param.validationError, _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_inputType = param.inputType, inputType = _param_inputType === void 0 ? "text" : _param_inputType, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_validationName = param.validationName, validationName = _param_validationName === void 0 ? "textNumbers" : _param_validationName, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, placeholder = param.placeholder, props = param.props, minLength = param.minLength, onKeyDown = param.onKeyDown, onChange = param.onChange, direction = param.direction, value = param.value;
|
|
5074
|
-
var handleChangeFunction = (0,
|
|
5206
|
+
var handleChangeFunction = (0, import_react12.useCallback)(function(e) {
|
|
5075
5207
|
handleChange(e);
|
|
5076
5208
|
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
5077
5209
|
}, [
|
|
5078
5210
|
onChange
|
|
5079
5211
|
]);
|
|
5080
|
-
var validationProps = (0,
|
|
5212
|
+
var validationProps = (0, import_react12.useMemo)(function() {
|
|
5081
5213
|
return _object_spread_props(_object_spread({}, useValidation(validationName, validationError)), {
|
|
5082
5214
|
onChange: handleChangeFunction
|
|
5083
5215
|
});
|
|
5084
5216
|
}, [
|
|
5085
5217
|
handleChangeFunction
|
|
5086
5218
|
]);
|
|
5087
|
-
return /* @__PURE__ */ (0,
|
|
5219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", {
|
|
5088
5220
|
className: cn("center", containerClassName),
|
|
5089
5221
|
children: [
|
|
5090
|
-
labelContent && /* @__PURE__ */ (0,
|
|
5222
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ElementLabel, {
|
|
5091
5223
|
direction: direction,
|
|
5092
5224
|
labelContent: labelContent,
|
|
5093
5225
|
labelClassName: labelClassName,
|
|
5094
5226
|
name: name,
|
|
5095
5227
|
required: required
|
|
5096
5228
|
}),
|
|
5097
|
-
/* @__PURE__ */ (0,
|
|
5229
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, props), {
|
|
5098
5230
|
minLength: minLength,
|
|
5099
5231
|
placeholder: placeholder,
|
|
5100
5232
|
className: cn("w-[70%] bg-inherit border-b-[1px] border-black px-2", elementClassName),
|
|
@@ -5116,44 +5248,44 @@ var SelectContainer = function(param) {
|
|
|
5116
5248
|
var _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_optionClassName = param.optionClassName, optionClassName = _param_optionClassName === void 0 ? "" : _param_optionClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, _param_options = param.options, options = _param_options === void 0 ? [] : _param_options, _param_optionsContainerClassName = param.optionsContainerClassName, optionsContainerClassName = _param_optionsContainerClassName === void 0 ? "" : _param_optionsContainerClassName, _param_sortDirection = param.sortDirection, sortDirection = _param_sortDirection === void 0 ? "abc" : _param_sortDirection, sortAsNumber = param.sortAsNumber, direction = param.direction, onChange = param.onChange;
|
|
5117
5249
|
var _sortOptions_, _options_find;
|
|
5118
5250
|
var sortOptions = useSortValues(options, sortDirection, sortAsNumber);
|
|
5119
|
-
var _ref = _sliced_to_array((0,
|
|
5120
|
-
var _ref1 = _sliced_to_array((0,
|
|
5251
|
+
var _ref = _sliced_to_array((0, import_react12.useState)(false), 2), isOpen = _ref[0], setIsOpen = _ref[1];
|
|
5252
|
+
var _ref1 = _sliced_to_array((0, import_react12.useState)(defaultValue || ((_sortOptions_ = sortOptions[0]) === null || _sortOptions_ === void 0 ? void 0 : _sortOptions_.value) || ""), 2), selectedValue = _ref1[0], setSelectedValue = _ref1[1];
|
|
5121
5253
|
var handleOptionClick = function(value) {
|
|
5122
5254
|
setSelectedValue(value);
|
|
5123
5255
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
5124
5256
|
setIsOpen(false);
|
|
5125
5257
|
};
|
|
5126
|
-
return /* @__PURE__ */ (0,
|
|
5258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", {
|
|
5127
5259
|
className: cn("center", containerClassName),
|
|
5128
5260
|
children: [
|
|
5129
|
-
labelContent && /* @__PURE__ */ (0,
|
|
5261
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ElementLabel, {
|
|
5130
5262
|
direction: direction,
|
|
5131
5263
|
labelContent: labelContent,
|
|
5132
5264
|
labelClassName: labelClassName,
|
|
5133
5265
|
name: name,
|
|
5134
5266
|
required: required
|
|
5135
5267
|
}),
|
|
5136
|
-
/* @__PURE__ */ (0,
|
|
5268
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", {
|
|
5137
5269
|
className: cn("w-[70%] relative", elementClassName),
|
|
5138
5270
|
onClick: function() {
|
|
5139
5271
|
return setIsOpen(!isOpen);
|
|
5140
5272
|
},
|
|
5141
5273
|
children: [
|
|
5142
|
-
/* @__PURE__ */ (0,
|
|
5274
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
|
|
5143
5275
|
className: "border-b-[1px] border-black max-h-6 cursor-pointer",
|
|
5144
5276
|
children: ((_options_find = options.find(function(opt) {
|
|
5145
5277
|
return opt.value === selectedValue;
|
|
5146
5278
|
})) === null || _options_find === void 0 ? void 0 : _options_find.label) || selectedValue
|
|
5147
5279
|
}),
|
|
5148
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
5280
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {
|
|
5149
5281
|
className: "fa-light fa-chevron-up absolute top-[1px] left-1 cursor-pointer"
|
|
5150
|
-
}) : /* @__PURE__ */ (0,
|
|
5282
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {
|
|
5151
5283
|
className: "fa-light fa-chevron-down absolute top-[1px] left-1 cursor-pointer"
|
|
5152
5284
|
}),
|
|
5153
|
-
isOpen && /* @__PURE__ */ (0,
|
|
5285
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
|
|
5154
5286
|
className: cn("absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10", optionsContainerClassName),
|
|
5155
5287
|
children: sortOptions.map(function(option) {
|
|
5156
|
-
return /* @__PURE__ */ (0,
|
|
5288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
|
|
5157
5289
|
className: "p-2 cursor-pointer hover:bg-gray-200 ".concat(optionClassName),
|
|
5158
5290
|
onClick: function() {
|
|
5159
5291
|
return handleOptionClick(option.value);
|
|
@@ -5162,7 +5294,7 @@ var SelectContainer = function(param) {
|
|
|
5162
5294
|
}, option.value);
|
|
5163
5295
|
})
|
|
5164
5296
|
}),
|
|
5165
|
-
/* @__PURE__ */ (0,
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", {
|
|
5166
5298
|
value: selectedValue,
|
|
5167
5299
|
type: "hidden",
|
|
5168
5300
|
name: name,
|
|
@@ -5176,17 +5308,17 @@ var SelectContainer = function(param) {
|
|
|
5176
5308
|
function MultiSelect(param) {
|
|
5177
5309
|
var onChange = param.onChange, selectedOptions = param.selectedOptions, emptyOptionsElement = param.emptyOptionsElement, unremovableOptions = param.unremovableOptions, _param_options = param.options, options = _param_options === void 0 ? [] : _param_options, _param_styles = param.styles, styles = _param_styles === void 0 ? {} : _param_styles, _param_name = param.name, name = _param_name === void 0 ? "multipleSelect" : _param_name, _param_placeholder = param.placeholder, placeholder = _param_placeholder === void 0 ? "Select items" : _param_placeholder, labelContent = param.labelContent, required = param.required, labelClassName = param.labelClassName, groupBy = param.groupBy, onSearch = param.onSearch, onSearchSync = param.onSearchSync, triggerSearchOnFocus = param.triggerSearchOnFocus, _param_sortDirection = param.sortDirection, sortDirection = _param_sortDirection === void 0 ? "abc" : _param_sortDirection, sortAsNumber = param.sortAsNumber, direction = param.direction, createNewOptionLabel = param.createNewOptionLabel, searchInputProps = param.searchInputProps;
|
|
5178
5310
|
var sortOptions = useSortValues(options, sortDirection, sortAsNumber);
|
|
5179
|
-
return /* @__PURE__ */ (0,
|
|
5311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", {
|
|
5180
5312
|
className: cn("".concat(labelContent ? "flex gap-1 items-center" : ""), styles.containerClassName),
|
|
5181
5313
|
children: [
|
|
5182
|
-
labelContent && /* @__PURE__ */ (0,
|
|
5314
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ElementLabel, {
|
|
5183
5315
|
direction: direction,
|
|
5184
5316
|
labelContent: labelContent,
|
|
5185
5317
|
labelClassName: labelClassName,
|
|
5186
5318
|
name: name,
|
|
5187
5319
|
required: required
|
|
5188
5320
|
}),
|
|
5189
|
-
/* @__PURE__ */ (0,
|
|
5321
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(multiselect_default, {
|
|
5190
5322
|
commandProps: {
|
|
5191
5323
|
label: placeholder
|
|
5192
5324
|
},
|
|
@@ -5207,7 +5339,7 @@ function MultiSelect(param) {
|
|
|
5207
5339
|
className: styles.className,
|
|
5208
5340
|
dropdownClassName: styles.dropdownClassName,
|
|
5209
5341
|
dropdownOptionClassName: styles.dropdownOptionClassName,
|
|
5210
|
-
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0,
|
|
5342
|
+
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", {
|
|
5211
5343
|
className: "text-center text-sm",
|
|
5212
5344
|
children: "all options selected."
|
|
5213
5345
|
}),
|
|
@@ -5221,17 +5353,17 @@ function MultiSelect(param) {
|
|
|
5221
5353
|
var SelectWithSearch = function(param) {
|
|
5222
5354
|
var options = param.options, labelClassName = param.labelClassName, labelContent = param.labelContent, name = param.name, onChange = param.onChange, value = param.value, placeholder = param.placeholder, required = param.required, defaultValue = param.defaultValue, notFoundLabel = param.notFoundLabel, searchPlaceholder = param.searchPlaceholder, containerClassName = param.containerClassName, dropdownClassName = param.dropdownClassName, dropdownOptionClassName = param.dropdownOptionClassName, elementClassName = param.elementClassName, notFoundLabelClassName = param.notFoundLabelClassName, searchClassName = param.searchClassName, buttonClassName = param.buttonClassName, buttonFocusClassName = param.buttonFocusClassName, _param_sortDirection = param.sortDirection, sortDirection = _param_sortDirection === void 0 ? "abc" : _param_sortDirection, sortAsNumber = param.sortAsNumber, disabled = param.disabled, direction = param.direction, createNewOptionLabel = param.createNewOptionLabel, createNewOptionContainerClassName = param.createNewOptionContainerClassName;
|
|
5223
5355
|
var sortOptions = useSortValues(options, sortDirection, sortAsNumber);
|
|
5224
|
-
return /* @__PURE__ */ (0,
|
|
5356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", {
|
|
5225
5357
|
className: cn("flex justify-between items-center w-full", containerClassName),
|
|
5226
5358
|
children: [
|
|
5227
|
-
labelContent && /* @__PURE__ */ (0,
|
|
5359
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ElementLabel, {
|
|
5228
5360
|
direction: direction,
|
|
5229
5361
|
labelContent: labelContent,
|
|
5230
5362
|
labelClassName: labelClassName,
|
|
5231
5363
|
name: name,
|
|
5232
5364
|
required: required
|
|
5233
5365
|
}),
|
|
5234
|
-
/* @__PURE__ */ (0,
|
|
5366
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SearchSelect, {
|
|
5235
5367
|
direction: direction,
|
|
5236
5368
|
createNewOptionLabel: createNewOptionLabel,
|
|
5237
5369
|
createNewOptionContainerClassName: createNewOptionContainerClassName,
|
|
@@ -5257,10 +5389,10 @@ var SelectWithSearch = function(param) {
|
|
|
5257
5389
|
};
|
|
5258
5390
|
var TextAreaContainer = function(param) {
|
|
5259
5391
|
var _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, placeholder = param.placeholder, props = param.props, minLength = param.minLength, onKeyDown = param.onKeyDown, onChange = param.onChange, direction = param.direction;
|
|
5260
|
-
return /* @__PURE__ */ (0,
|
|
5392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", {
|
|
5261
5393
|
className: cn("flex flex-col gap-2 items-center", containerClassName),
|
|
5262
5394
|
children: [
|
|
5263
|
-
labelContent && /* @__PURE__ */ (0,
|
|
5395
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ElementLabel, {
|
|
5264
5396
|
direction: direction,
|
|
5265
5397
|
labelContent: labelContent,
|
|
5266
5398
|
labelClassName: "w-fit text-xl px-2 border-b-2 border-[#000] text-center ".concat(labelClassName),
|
|
@@ -5268,7 +5400,7 @@ var TextAreaContainer = function(param) {
|
|
|
5268
5400
|
required: required,
|
|
5269
5401
|
withDots: false
|
|
5270
5402
|
}),
|
|
5271
|
-
/* @__PURE__ */ (0,
|
|
5403
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("textarea", _object_spread_props(_object_spread({}, props), {
|
|
5272
5404
|
onChange: onChange,
|
|
5273
5405
|
minLength: minLength,
|
|
5274
5406
|
placeholder: placeholder,
|
|
@@ -5283,28 +5415,28 @@ var TextAreaContainer = function(param) {
|
|
|
5283
5415
|
};
|
|
5284
5416
|
var ElementLabel = function(param) {
|
|
5285
5417
|
var labelContent = param.labelContent, labelClassName = param.labelClassName, name = param.name, required = param.required, _param_withDots = param.withDots, withDots = _param_withDots === void 0 ? true : _param_withDots, direction = param.direction;
|
|
5286
|
-
return /* @__PURE__ */ (0,
|
|
5418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", {
|
|
5287
5419
|
style: {
|
|
5288
5420
|
direction: direction
|
|
5289
5421
|
},
|
|
5290
5422
|
className: cn("text-start w-[30%] flex gap-0.5", labelClassName),
|
|
5291
5423
|
htmlFor: name,
|
|
5292
5424
|
children: [
|
|
5293
|
-
/* @__PURE__ */ (0,
|
|
5425
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
|
|
5294
5426
|
children: labelContent
|
|
5295
5427
|
}),
|
|
5296
|
-
required && /* @__PURE__ */ (0,
|
|
5428
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
|
|
5297
5429
|
className: "text-red-500",
|
|
5298
5430
|
children: "*"
|
|
5299
5431
|
}),
|
|
5300
|
-
withDots && /* @__PURE__ */ (0,
|
|
5432
|
+
withDots && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
|
|
5301
5433
|
children: ":"
|
|
5302
5434
|
})
|
|
5303
5435
|
]
|
|
5304
5436
|
});
|
|
5305
5437
|
};
|
|
5306
5438
|
// src/components/forms/ModularForm/ModularForm.tsx
|
|
5307
|
-
var
|
|
5439
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
5308
5440
|
var ModularForm = function(param) {
|
|
5309
5441
|
var _param_submitFunction = param.submitFunction, submitFunction = _param_submitFunction === void 0 ? /*#__PURE__*/ function() {
|
|
5310
5442
|
var _ref = _async_to_generator(function(form) {
|
|
@@ -5318,8 +5450,8 @@ var ModularForm = function(param) {
|
|
|
5318
5450
|
return _ref.apply(this, arguments);
|
|
5319
5451
|
};
|
|
5320
5452
|
}() : _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;
|
|
5321
|
-
var _ref = _sliced_to_array((0,
|
|
5322
|
-
var _ref1 = _sliced_to_array((0,
|
|
5453
|
+
var _ref = _sliced_to_array((0, import_react13.useState)(""), 2), errorMsg = _ref[0], setErrorMsg = _ref[1];
|
|
5454
|
+
var _ref1 = _sliced_to_array((0, import_react13.useState)(false), 2), isLoading = _ref1[0], setIsLoading = _ref1[1];
|
|
5323
5455
|
var onSubmit = /*#__PURE__*/ function() {
|
|
5324
5456
|
var _ref = _async_to_generator(function(e) {
|
|
5325
5457
|
var form, err;
|
|
@@ -5381,66 +5513,66 @@ var ModularForm = function(param) {
|
|
|
5381
5513
|
return _ref.apply(this, arguments);
|
|
5382
5514
|
};
|
|
5383
5515
|
}();
|
|
5384
|
-
return /* @__PURE__ */ (0,
|
|
5516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", {
|
|
5385
5517
|
onSubmit: onSubmit,
|
|
5386
5518
|
style: {
|
|
5387
5519
|
direction: direction
|
|
5388
5520
|
},
|
|
5389
5521
|
className: cn("w-[350px] px-5 py-5 flex flex-col gap-5", formClassName),
|
|
5390
5522
|
children: [
|
|
5391
|
-
headerContent && /* @__PURE__ */ (0,
|
|
5523
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
5392
5524
|
className: cn("border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]", headerClassName),
|
|
5393
5525
|
children: headerContent
|
|
5394
5526
|
}),
|
|
5395
5527
|
elements.map(function(element, index2) {
|
|
5396
5528
|
switch(element.type){
|
|
5397
5529
|
case "input":
|
|
5398
|
-
return /* @__PURE__ */ (0,
|
|
5530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InputContainer, _object_spread_props(_object_spread({}, element), {
|
|
5399
5531
|
direction: direction
|
|
5400
5532
|
}), index2);
|
|
5401
5533
|
case "textarea":
|
|
5402
|
-
return /* @__PURE__ */ (0,
|
|
5534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextAreaContainer, _object_spread_props(_object_spread({}, element), {
|
|
5403
5535
|
direction: direction
|
|
5404
5536
|
}), index2);
|
|
5405
5537
|
case "select":
|
|
5406
|
-
return /* @__PURE__ */ (0,
|
|
5538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SelectContainer, _object_spread_props(_object_spread({}, element), {
|
|
5407
5539
|
direction: direction
|
|
5408
5540
|
}), index2);
|
|
5409
5541
|
case "multiSelect":
|
|
5410
|
-
return /* @__PURE__ */ (0,
|
|
5542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MultiSelect, _object_spread_props(_object_spread({}, element), {
|
|
5411
5543
|
direction: direction
|
|
5412
5544
|
}), index2);
|
|
5413
5545
|
case "selectWithSearch":
|
|
5414
|
-
return /* @__PURE__ */ (0,
|
|
5546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SelectWithSearch, _object_spread_props(_object_spread({}, element), {
|
|
5415
5547
|
direction: direction
|
|
5416
5548
|
}), index2);
|
|
5417
5549
|
case "internationalPhoneInput":
|
|
5418
|
-
return /* @__PURE__ */ (0,
|
|
5550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InternationalPhonePicker, _object_spread_props(_object_spread({}, element), {
|
|
5419
5551
|
direction: direction
|
|
5420
5552
|
}), index2);
|
|
5421
5553
|
case "custom":
|
|
5422
5554
|
var _element_element;
|
|
5423
|
-
return typeof ((_element_element = element.element) === null || _element_element === void 0 ? void 0 : _element_element.type) !== "string" && (0,
|
|
5555
|
+
return typeof ((_element_element = element.element) === null || _element_element === void 0 ? void 0 : _element_element.type) !== "string" && (0, import_react13.cloneElement)(element.element, {
|
|
5424
5556
|
key: index2
|
|
5425
5557
|
});
|
|
5426
5558
|
default:
|
|
5427
5559
|
return null;
|
|
5428
5560
|
}
|
|
5429
5561
|
}),
|
|
5430
|
-
/* @__PURE__ */ (0,
|
|
5562
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
5431
5563
|
className: cn("flex justify-between w-full", footerClassName),
|
|
5432
5564
|
children: [
|
|
5433
|
-
/* @__PURE__ */ (0,
|
|
5565
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
5434
5566
|
title: errorMsg,
|
|
5435
5567
|
className: cn("text-[#f22] text-[18px] max-w-[80%] ellipsis", errorClassName),
|
|
5436
5568
|
children: errorMsg
|
|
5437
5569
|
}),
|
|
5438
|
-
/* @__PURE__ */ (0,
|
|
5570
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", {
|
|
5439
5571
|
ref: submitRef,
|
|
5440
5572
|
disabled: isLoading,
|
|
5441
5573
|
className: cn("bg-[#547f22] px-3 py-1 rounded-lg text-white min-w-20", buttonClassName),
|
|
5442
5574
|
type: "submit",
|
|
5443
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
5575
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader, {
|
|
5444
5576
|
size: 25,
|
|
5445
5577
|
color: "#fff"
|
|
5446
5578
|
}) : buttonContent
|
|
@@ -5452,32 +5584,32 @@ var ModularForm = function(param) {
|
|
|
5452
5584
|
};
|
|
5453
5585
|
var ModularForm_default = ModularForm;
|
|
5454
5586
|
// src/components/forms/index.tsx
|
|
5455
|
-
var
|
|
5587
|
+
var import_react14 = require("react");
|
|
5456
5588
|
var import_moment2 = __toESM(require("moment"));
|
|
5457
|
-
var
|
|
5589
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
5458
5590
|
var ConfirmForm = function(param) {
|
|
5459
5591
|
var onV = param.onV, onX = param.onX, _param_headline = param.headline, headline = _param_headline === void 0 ? "" : _param_headline, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_buttonsContainerClassName = param.buttonsContainerClassName, buttonsContainerClassName = _param_buttonsContainerClassName === void 0 ? "" : _param_buttonsContainerClassName, _param_headlineClassName = param.headlineClassName, headlineClassName = _param_headlineClassName === void 0 ? "" : _param_headlineClassName;
|
|
5460
|
-
return /* @__PURE__ */ (0,
|
|
5592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
5461
5593
|
style: {
|
|
5462
5594
|
direction: direction,
|
|
5463
5595
|
padding: "30px"
|
|
5464
5596
|
},
|
|
5465
5597
|
className: cn("w-full h-full flex flex-col gap-3", containerClassName),
|
|
5466
5598
|
children: [
|
|
5467
|
-
/* @__PURE__ */ (0,
|
|
5599
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
5468
5600
|
className: cn("text-lg font-bold", headlineClassName),
|
|
5469
5601
|
children: headline
|
|
5470
5602
|
}),
|
|
5471
|
-
/* @__PURE__ */ (0,
|
|
5603
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
5472
5604
|
className: cn("flex justify-center items-center gap-2 w-full", buttonsContainerClassName),
|
|
5473
5605
|
children: [
|
|
5474
|
-
/* @__PURE__ */ (0,
|
|
5606
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", {
|
|
5475
5607
|
onClick: onX,
|
|
5476
|
-
children: /* @__PURE__ */ (0,
|
|
5608
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(RedXSvg, {})
|
|
5477
5609
|
}),
|
|
5478
|
-
/* @__PURE__ */ (0,
|
|
5610
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", {
|
|
5479
5611
|
onClick: onV,
|
|
5480
|
-
children: /* @__PURE__ */ (0,
|
|
5612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GreenVSvg, {})
|
|
5481
5613
|
})
|
|
5482
5614
|
]
|
|
5483
5615
|
})
|
|
@@ -5497,7 +5629,7 @@ var DatePicker = function(param) {
|
|
|
5497
5629
|
return _ref.apply(this, arguments);
|
|
5498
5630
|
};
|
|
5499
5631
|
}() : _param_submit, _param_formClassName = param.formClassName, formClassName = _param_formClassName === void 0 ? "" : _param_formClassName, _param_labelsClassName = param.labelsClassName, labelsClassName = _param_labelsClassName === void 0 ? "" : _param_labelsClassName, _param_inputsClassName = param.inputsClassName, inputsClassName = _param_inputsClassName === void 0 ? "" : _param_inputsClassName, _param_buttonClassName = param.buttonClassName, buttonClassName = _param_buttonClassName === void 0 ? "" : _param_buttonClassName, _param_buttonStyle = param.buttonStyle, buttonStyle = _param_buttonStyle === void 0 ? {} : _param_buttonStyle, defaultFrom = param.defaultFrom, defaultTo = param.defaultTo, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_fromText = param.fromText, fromText = _param_fromText === void 0 ? "From date" : _param_fromText, _param_toText = param.toText, toText = _param_toText === void 0 ? "To date" : _param_toText, _param_buttonText = param.buttonText, buttonText = _param_buttonText === void 0 ? "Search" : _param_buttonText;
|
|
5500
|
-
var _ref = _sliced_to_array((0,
|
|
5632
|
+
var _ref = _sliced_to_array((0, import_react14.useState)(false), 2), isLoading = _ref[0], setIsLoading = _ref[1];
|
|
5501
5633
|
var onSubmit = /*#__PURE__*/ function() {
|
|
5502
5634
|
var _ref = _async_to_generator(function(e) {
|
|
5503
5635
|
return _ts_generator(this, function(_state) {
|
|
@@ -5522,19 +5654,19 @@ var DatePicker = function(param) {
|
|
|
5522
5654
|
return _ref.apply(this, arguments);
|
|
5523
5655
|
};
|
|
5524
5656
|
}();
|
|
5525
|
-
return /* @__PURE__ */ (0,
|
|
5657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("form", {
|
|
5526
5658
|
style: {
|
|
5527
5659
|
direction: direction
|
|
5528
5660
|
},
|
|
5529
5661
|
onSubmit: onSubmit,
|
|
5530
5662
|
className: cn("w-full h-10 flex justify-start gap-3 items-center ", formClassName),
|
|
5531
5663
|
children: [
|
|
5532
|
-
/* @__PURE__ */ (0,
|
|
5664
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", {
|
|
5533
5665
|
className: cn("center text-[14px] relative gap-2", labelsClassName),
|
|
5534
5666
|
htmlFor: "from",
|
|
5535
5667
|
children: [
|
|
5536
5668
|
fromText,
|
|
5537
|
-
/* @__PURE__ */ (0,
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", {
|
|
5538
5670
|
className: "w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ".concat(inputsClassName),
|
|
5539
5671
|
type: "date",
|
|
5540
5672
|
name: "from",
|
|
@@ -5542,12 +5674,12 @@ var DatePicker = function(param) {
|
|
|
5542
5674
|
})
|
|
5543
5675
|
]
|
|
5544
5676
|
}),
|
|
5545
|
-
/* @__PURE__ */ (0,
|
|
5677
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", {
|
|
5546
5678
|
className: cn("center text-[14px] relative gap-2 ", labelsClassName),
|
|
5547
5679
|
htmlFor: "to",
|
|
5548
5680
|
children: [
|
|
5549
5681
|
toText,
|
|
5550
|
-
/* @__PURE__ */ (0,
|
|
5682
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", {
|
|
5551
5683
|
className: "w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ".concat(inputsClassName),
|
|
5552
5684
|
type: "date",
|
|
5553
5685
|
name: "to",
|
|
@@ -5555,12 +5687,12 @@ var DatePicker = function(param) {
|
|
|
5555
5687
|
})
|
|
5556
5688
|
]
|
|
5557
5689
|
}),
|
|
5558
|
-
/* @__PURE__ */ (0,
|
|
5690
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", {
|
|
5559
5691
|
disabled: isLoading,
|
|
5560
5692
|
style: buttonStyle,
|
|
5561
5693
|
className: cn("bg-[#699a2c] text-[#fff] font-[500] w-[75px] h-[27px]", buttonClassName),
|
|
5562
5694
|
type: "submit",
|
|
5563
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
5695
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loader, {
|
|
5564
5696
|
className: "pt-[2px]",
|
|
5565
5697
|
size: 20,
|
|
5566
5698
|
color: "#fff"
|
|
@@ -5571,19 +5703,19 @@ var DatePicker = function(param) {
|
|
|
5571
5703
|
};
|
|
5572
5704
|
// src/components/CodeInput.tsx
|
|
5573
5705
|
var import_input_otp = require("input-otp");
|
|
5574
|
-
var
|
|
5575
|
-
var
|
|
5706
|
+
var import_react15 = require("react");
|
|
5707
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
5576
5708
|
function CodeInput(param) {
|
|
5577
5709
|
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;
|
|
5578
|
-
var firstInputRef = (0,
|
|
5579
|
-
(0,
|
|
5710
|
+
var firstInputRef = (0, import_react15.useRef)(null);
|
|
5711
|
+
(0, import_react15.useEffect)(function() {
|
|
5580
5712
|
if (firstInputRef.current) {
|
|
5581
5713
|
firstInputRef.current.focus();
|
|
5582
5714
|
}
|
|
5583
5715
|
}, []);
|
|
5584
|
-
return /* @__PURE__ */ (0,
|
|
5716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
5585
5717
|
className: cn("space-y-2 flex justify-center items-center", className),
|
|
5586
|
-
children: /* @__PURE__ */ (0,
|
|
5718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_input_otp.OTPInput, {
|
|
5587
5719
|
ref: firstInputRef,
|
|
5588
5720
|
value: codeValue,
|
|
5589
5721
|
onChange: function(newVal) {
|
|
@@ -5593,10 +5725,10 @@ function CodeInput(param) {
|
|
|
5593
5725
|
maxLength: 6,
|
|
5594
5726
|
render: function(param) {
|
|
5595
5727
|
var slots = param.slots;
|
|
5596
|
-
return /* @__PURE__ */ (0,
|
|
5728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
5597
5729
|
className: cn("flex gap-5", slotContainerClassName),
|
|
5598
5730
|
children: slots.map(function(slot, idx) {
|
|
5599
|
-
return /* @__PURE__ */ (0,
|
|
5731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Slot2, _object_spread({}, slot), idx);
|
|
5600
5732
|
})
|
|
5601
5733
|
});
|
|
5602
5734
|
}
|
|
@@ -5604,11 +5736,11 @@ function CodeInput(param) {
|
|
|
5604
5736
|
});
|
|
5605
5737
|
}
|
|
5606
5738
|
function Slot2(props) {
|
|
5607
|
-
return /* @__PURE__ */ (0,
|
|
5739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
5608
5740
|
className: cn("flex size-9 items-center justify-center rounded-lg border border-input bg-background font-medium text-foreground shadow-sm shadow-black/5 transition-shadow", {
|
|
5609
5741
|
"z-10 border border-ring ring-[3px] ring-ring/20": props.isActive
|
|
5610
5742
|
}),
|
|
5611
|
-
children: props.char !== null && /* @__PURE__ */ (0,
|
|
5743
|
+
children: props.char !== null && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", {
|
|
5612
5744
|
children: props.char
|
|
5613
5745
|
})
|
|
5614
5746
|
});
|
|
@@ -5632,6 +5764,7 @@ function Slot2(props) {
|
|
|
5632
5764
|
InputContainer: InputContainer,
|
|
5633
5765
|
InternationalPhonePicker: InternationalPhonePicker,
|
|
5634
5766
|
Loader: Loader,
|
|
5767
|
+
LoginWithGoogleButton: LoginWithGoogleButton,
|
|
5635
5768
|
MaxRowsLabel: MaxRowsLabel,
|
|
5636
5769
|
ModularForm: ModularForm,
|
|
5637
5770
|
MultiSelect: MultiSelect,
|