akeyless-client-commons 1.0.51 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.mts +22 -5
- package/dist/components/index.d.ts +22 -5
- package/dist/components/index.js +753 -619
- package/dist/components/index.mjs +719 -589
- package/package.json +1 -1
|
@@ -465,11 +465,248 @@ var ErrorBoundary = /*#__PURE__*/ function(_React_Component) {
|
|
|
465
465
|
}(React.Component);
|
|
466
466
|
// src/components/utils/loaders.tsx
|
|
467
467
|
import { ClipLoader } from "react-spinners";
|
|
468
|
+
// src/helpers/firebase.ts
|
|
469
|
+
import moment from "moment";
|
|
470
|
+
import { initializeApp } from "firebase/app";
|
|
471
|
+
import { getStorage } from "firebase/storage";
|
|
472
|
+
import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth";
|
|
473
|
+
import { initializeAppCheck, ReCaptchaEnterpriseProvider } from "firebase/app-check";
|
|
474
|
+
import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, setDoc, Timestamp, where, getFirestore, onSnapshot, orderBy } from "firebase/firestore";
|
|
475
|
+
import { useCallback } from "react";
|
|
476
|
+
var initApp = function() {
|
|
477
|
+
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
478
|
+
var firebaseConfig = {
|
|
479
|
+
apiKey: isNodeEnv2 ? process.env.NEXT_PUBLIC_API_KEY : import.meta.env.VITE_API_KEY,
|
|
480
|
+
authDomain: isNodeEnv2 ? process.env.NEXT_PUBLIC_AUTH_DOMAIN : import.meta.env.VITE_AUTH_DOMAIN,
|
|
481
|
+
projectId: isNodeEnv2 ? process.env.NEXT_PUBLIC_PROJECT_ID : import.meta.env.VITE_PROJECT_ID,
|
|
482
|
+
storageBucket: isNodeEnv2 ? process.env.NEXT_PUBLIC_STORAGE_BUCKET : import.meta.env.VITE_STORAGE_BUCKET,
|
|
483
|
+
messagingSenderId: isNodeEnv2 ? process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID : import.meta.env.VITE_MESSAGING_SENDER_ID,
|
|
484
|
+
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import.meta.env.VITE_APP_ID
|
|
485
|
+
};
|
|
486
|
+
try {
|
|
487
|
+
var app2 = initializeApp(firebaseConfig);
|
|
488
|
+
var auth2 = getAuth(app2);
|
|
489
|
+
auth2.settings.appVerificationDisabledForTesting = false;
|
|
490
|
+
var db2 = getFirestore(app2);
|
|
491
|
+
var storage2 = getStorage(app2);
|
|
492
|
+
var googleLoginProvider2 = new GoogleAuthProvider();
|
|
493
|
+
var recaptchaSiteKey = isNodeEnv2 ? process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY : import.meta.env.VITE_RECAPTCHA_SITE_KEY;
|
|
494
|
+
var result = {
|
|
495
|
+
db: db2,
|
|
496
|
+
auth: auth2,
|
|
497
|
+
storage: storage2,
|
|
498
|
+
app: app2,
|
|
499
|
+
googleLoginProvider: googleLoginProvider2
|
|
500
|
+
};
|
|
501
|
+
if (recaptchaSiteKey) {
|
|
502
|
+
result.appCheck = initializeAppCheck(app2, {
|
|
503
|
+
provider: new ReCaptchaEnterpriseProvider(recaptchaSiteKey),
|
|
504
|
+
isTokenAutoRefreshEnabled: true
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
return result;
|
|
508
|
+
} catch (error) {
|
|
509
|
+
console.error("Failed to initialize Firebase app:", error);
|
|
510
|
+
return {};
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
var _initApp = initApp(), db = _initApp.db, auth = _initApp.auth, storage = _initApp.storage, app = _initApp.app, appCheck = _initApp.appCheck, googleLoginProvider = _initApp.googleLoginProvider;
|
|
514
|
+
var useLoginWithGoogle = function() {
|
|
515
|
+
var signInWithGoogle = useCallback(/*#__PURE__*/ _async_to_generator(function() {
|
|
516
|
+
var result, user;
|
|
517
|
+
return _ts_generator(this, function(_state) {
|
|
518
|
+
switch(_state.label){
|
|
519
|
+
case 0:
|
|
520
|
+
return [
|
|
521
|
+
4,
|
|
522
|
+
signInWithPopup(auth, googleLoginProvider)
|
|
523
|
+
];
|
|
524
|
+
case 1:
|
|
525
|
+
result = _state.sent();
|
|
526
|
+
user = result.user;
|
|
527
|
+
return [
|
|
528
|
+
2,
|
|
529
|
+
user
|
|
530
|
+
];
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
}), [
|
|
534
|
+
auth,
|
|
535
|
+
googleLoginProvider
|
|
536
|
+
]);
|
|
537
|
+
return signInWithGoogle;
|
|
538
|
+
};
|
|
539
|
+
var collections = {
|
|
540
|
+
clients: collection(db, "nx-clients"),
|
|
541
|
+
sites: collection(db, "nx-sites"),
|
|
542
|
+
cars: collection(db, "units"),
|
|
543
|
+
users: collection(db, "nx-users"),
|
|
544
|
+
lastLocations: collection(db, "last_locations"),
|
|
545
|
+
ermEvents: collection(db, "erm_events_general"),
|
|
546
|
+
erm2Events: collection(db, "erm2_events_general"),
|
|
547
|
+
ruptelaEvents: collection(db, "ruptela_events_general"),
|
|
548
|
+
polygons: collection(db, "nx-polygons"),
|
|
549
|
+
polygonEvents: collection(db, "polygon_events"),
|
|
550
|
+
polygonCars: collection(db, "polygon_cars"),
|
|
551
|
+
canbus: collection(db, "erm_canbus_parameters"),
|
|
552
|
+
states: collection(db, "erm_states"),
|
|
553
|
+
app_pro_commands_queue: collection(db, "app_pro_commands_queue"),
|
|
554
|
+
trips: collection(db, "erm2_trip"),
|
|
555
|
+
tripsDetails: collection(db, "erm2_trip_details"),
|
|
556
|
+
audit: collection(db, "nx-audit"),
|
|
557
|
+
nx_settings: collection(db, "nx-settings"),
|
|
558
|
+
settings: collection(db, "settings"),
|
|
559
|
+
translations: collection(db, "nx-translations"),
|
|
560
|
+
nx_cars: collection(db, "nx-cars"),
|
|
561
|
+
boards: collection(db, "boards"),
|
|
562
|
+
protection_types: collection(db, "protectionTypes"),
|
|
563
|
+
board_types: collection(db, "boardTypes"),
|
|
564
|
+
charge_capacities: collection(db, "nx-charge-capacities")
|
|
565
|
+
};
|
|
566
|
+
var fire_base_TIME_TEMP = Timestamp.now;
|
|
567
|
+
// src/helpers/global.ts
|
|
568
|
+
import { CountryOptions } from "akeyless-types-commons";
|
|
569
|
+
import axios from "axios";
|
|
570
|
+
// src/helpers/phoneNumber.ts
|
|
571
|
+
import { parsePhoneNumberFromString } from "libphonenumber-js";
|
|
572
|
+
// src/helpers/global.ts
|
|
573
|
+
import { isEqual } from "lodash";
|
|
574
|
+
var renderOnce = function() {
|
|
575
|
+
return true;
|
|
576
|
+
};
|
|
577
|
+
var getLocationUrl = function(lng, lat) {
|
|
578
|
+
return "https://www.google.com/maps?q=".concat(lat, ",").concat(lng);
|
|
579
|
+
};
|
|
580
|
+
var isNodeEnv = typeof process !== "undefined" && process.env;
|
|
581
|
+
var _ref = {
|
|
582
|
+
mode: isNodeEnv ? process.env.NEXT_PUBLIC_MODE : import.meta.env.VITE_MODE,
|
|
583
|
+
isLocal: (isNodeEnv ? process.env.NEXT_PUBLIC_IS_LOCAL : import.meta.env.VITE_is_local) === "true"
|
|
584
|
+
}, mode = _ref.mode, isLocal = _ref.isLocal;
|
|
585
|
+
// src/helpers/forms.ts
|
|
586
|
+
import XRegExp from "xregexp";
|
|
587
|
+
var textRegex = XRegExp("[^\\p{L}\\s-]", "gu");
|
|
588
|
+
var numbersRegex = XRegExp("[^0-9\\s-+]", "g");
|
|
589
|
+
var numbersOnlyRegex = XRegExp("[^0-9]", "g");
|
|
590
|
+
var priceRegex = XRegExp("[^0-9.]", "g");
|
|
591
|
+
var emailRegex = XRegExp("[^\\p{L}0-9.@\\s-]", "gu");
|
|
592
|
+
var colorRegex = XRegExp("[^#0-9A-Fa-f]", "g");
|
|
593
|
+
var carsRegex = XRegExp("[^\\p{L}0-9,_]", "gu");
|
|
594
|
+
var textNumbersRegex = XRegExp("[^\\p{L}0-9\\s+\\-]", "gu");
|
|
595
|
+
var addressRegex = XRegExp("[^\\p{L}0-9\\s.,+-\\-]", "gu");
|
|
596
|
+
var chartsRegex = XRegExp("[^\\p{L}0-9\\s.,_@!+-\\-]", "gu");
|
|
597
|
+
var handleChange = function(e) {
|
|
598
|
+
e.target.setCustomValidity("");
|
|
599
|
+
var validation = e.target.getAttribute("data-validation");
|
|
600
|
+
if (validation === "text") {
|
|
601
|
+
e.target.value = XRegExp.replace(e.target.value, textRegex, "");
|
|
602
|
+
} else if (validation === "numbers") {
|
|
603
|
+
e.target.value = XRegExp.replace(e.target.value, numbersRegex, "");
|
|
604
|
+
} else if (validation === "numbersOnly") {
|
|
605
|
+
e.target.value = XRegExp.replace(e.target.value, numbersOnlyRegex, "");
|
|
606
|
+
} else if (validation === "price") {
|
|
607
|
+
e.target.value = XRegExp.replace(e.target.value, priceRegex, "");
|
|
608
|
+
} else if (validation === "textNumbers") {
|
|
609
|
+
e.target.value = XRegExp.replace(e.target.value, textNumbersRegex, "");
|
|
610
|
+
} else if (validation === "email") {
|
|
611
|
+
e.target.value = XRegExp.replace(e.target.value, emailRegex, "");
|
|
612
|
+
} else if (validation === "color") {
|
|
613
|
+
e.target.value = XRegExp.replace(e.target.value, colorRegex, "");
|
|
614
|
+
} else if (validation === "address") {
|
|
615
|
+
e.target.value = XRegExp.replace(e.target.value, addressRegex, "");
|
|
616
|
+
} else if (validation === "cars") {
|
|
617
|
+
e.target.value = XRegExp.replace(e.target.value, carsRegex, "");
|
|
618
|
+
} else if (validation === "charts") {
|
|
619
|
+
e.target.value = XRegExp.replace(e.target.value, chartsRegex, "");
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
var handlePaste = function(e) {
|
|
623
|
+
var validation = e.currentTarget.getAttribute("data-validation");
|
|
624
|
+
var pasteData = e.clipboardData.getData("text");
|
|
625
|
+
if (validation === "text") {
|
|
626
|
+
pasteData = XRegExp.replace(pasteData, textRegex, "");
|
|
627
|
+
} else if (validation === "numbers") {
|
|
628
|
+
pasteData = XRegExp.replace(pasteData, numbersRegex, "");
|
|
629
|
+
} else if (validation === "numbersOnly") {
|
|
630
|
+
pasteData = XRegExp.replace(pasteData, numbersOnlyRegex, "");
|
|
631
|
+
} else if (validation === "price") {
|
|
632
|
+
pasteData = XRegExp.replace(pasteData, priceRegex, "");
|
|
633
|
+
} else if (validation === "textNumbers") {
|
|
634
|
+
pasteData = XRegExp.replace(pasteData, textNumbersRegex, "");
|
|
635
|
+
} else if (validation === "email") {
|
|
636
|
+
pasteData = XRegExp.replace(pasteData, emailRegex, "");
|
|
637
|
+
} else if (validation === "color") {
|
|
638
|
+
pasteData = XRegExp.replace(pasteData, colorRegex, "");
|
|
639
|
+
} else if (validation === "address") {
|
|
640
|
+
pasteData = XRegExp.replace(pasteData, addressRegex, "");
|
|
641
|
+
} else if (validation === "cars") {
|
|
642
|
+
pasteData = XRegExp.replace(pasteData, carsRegex, "");
|
|
643
|
+
} else if (validation === "charts") {
|
|
644
|
+
pasteData = XRegExp.replace(pasteData, chartsRegex, "");
|
|
645
|
+
}
|
|
646
|
+
e.preventDefault();
|
|
647
|
+
document.execCommand("insertText", false, pasteData);
|
|
648
|
+
};
|
|
649
|
+
var handleInvalid = function(e, requireError) {
|
|
650
|
+
e.target.setCustomValidity(requireError || "This filed is required !");
|
|
651
|
+
};
|
|
652
|
+
var useValidation = function(validationType, requireError) {
|
|
653
|
+
return {
|
|
654
|
+
onChange: handleChange,
|
|
655
|
+
onPaste: handlePaste,
|
|
656
|
+
onInvalid: function(e) {
|
|
657
|
+
return handleInvalid(e, requireError);
|
|
658
|
+
},
|
|
659
|
+
"data-validation": validationType
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
var getFormElementValue = function(form, name) {
|
|
663
|
+
var _form_elements_namedItem;
|
|
664
|
+
return ((_form_elements_namedItem = form.elements.namedItem(name)) === null || _form_elements_namedItem === void 0 ? void 0 : _form_elements_namedItem.value) || "";
|
|
665
|
+
};
|
|
666
|
+
// src/lib/utils.ts
|
|
667
|
+
import { clsx } from "clsx";
|
|
668
|
+
import { twMerge } from "tailwind-merge";
|
|
669
|
+
function cn() {
|
|
670
|
+
for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
671
|
+
inputs[_key] = arguments[_key];
|
|
672
|
+
}
|
|
673
|
+
return twMerge(clsx(inputs));
|
|
674
|
+
}
|
|
675
|
+
// src/helpers/time_helpers.ts
|
|
676
|
+
import { Timestamp as Timestamp2 } from "firebase/firestore";
|
|
677
|
+
import moment2 from "moment-timezone";
|
|
678
|
+
function timestamp_to_string(firebaseTimestamp, options) {
|
|
679
|
+
var date;
|
|
680
|
+
if (_instanceof(firebaseTimestamp, Timestamp2)) {
|
|
681
|
+
date = firebaseTimestamp.toDate();
|
|
682
|
+
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
683
|
+
date = firebaseTimestamp;
|
|
684
|
+
} else if (typeof firebaseTimestamp === "string") {
|
|
685
|
+
date = moment2.utc(firebaseTimestamp, (options === null || options === void 0 ? void 0 : options.fromFormat) || "DD/MM/YYYY HH:mm:ss").toDate();
|
|
686
|
+
if (isNaN(date.getTime())) {
|
|
687
|
+
throw new Error("Invalid date string format");
|
|
688
|
+
}
|
|
689
|
+
} else {
|
|
690
|
+
throw new Error("Invalid input: firebaseTimestamp must be a Timestamp, Date, or valid date string.");
|
|
691
|
+
}
|
|
692
|
+
if (options === null || options === void 0 ? void 0 : options.tz) {
|
|
693
|
+
var result = moment2(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");
|
|
694
|
+
return result;
|
|
695
|
+
}
|
|
696
|
+
return moment2.utc(date).format((options === null || options === void 0 ? void 0 : options.format) || "DD/MM/YYYY HH:mm:ss");
|
|
697
|
+
}
|
|
698
|
+
// src/helpers/api.ts
|
|
699
|
+
import axios2 from "axios";
|
|
700
|
+
var baseDomain = mode === "qa" ? "https://nx-api.xyz/api" : "https://nx-api.info/api";
|
|
701
|
+
var devicesDomain = isLocal ? "http://localhost:9001/api/devices" : baseDomain + "/devices";
|
|
702
|
+
var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
703
|
+
var callCenterDomain = isLocal ? "http://localhost:9003/api/call-center" : baseDomain + "/call-center";
|
|
704
|
+
// src/components/utils/loaders.tsx
|
|
468
705
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
469
706
|
var Loader = function(param) {
|
|
470
707
|
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;
|
|
471
708
|
return /* @__PURE__ */ jsx3("div", {
|
|
472
|
-
className: "flex items-center justify-center
|
|
709
|
+
className: cn("flex items-center justify-center", className),
|
|
473
710
|
style: style,
|
|
474
711
|
children: /* @__PURE__ */ jsx3(ClipLoader, {
|
|
475
712
|
loading: true,
|
|
@@ -478,15 +715,6 @@ var Loader = function(param) {
|
|
|
478
715
|
})
|
|
479
716
|
});
|
|
480
717
|
};
|
|
481
|
-
// src/lib/utils.ts
|
|
482
|
-
import { clsx } from "clsx";
|
|
483
|
-
import { twMerge } from "tailwind-merge";
|
|
484
|
-
function cn() {
|
|
485
|
-
for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
|
|
486
|
-
inputs[_key] = arguments[_key];
|
|
487
|
-
}
|
|
488
|
-
return twMerge(clsx(inputs));
|
|
489
|
-
}
|
|
490
718
|
// src/components/utils/global.tsx
|
|
491
719
|
import { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
492
720
|
var Version = function(param) {
|
|
@@ -499,26 +727,131 @@ var Version = function(param) {
|
|
|
499
727
|
]
|
|
500
728
|
});
|
|
501
729
|
};
|
|
730
|
+
// src/components/utils/LoginWithGoogle.tsx
|
|
731
|
+
import { useState } from "react";
|
|
732
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
733
|
+
var GoogleSvg = function(param) {
|
|
734
|
+
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;
|
|
735
|
+
return /* @__PURE__ */ jsxs3("svg", {
|
|
736
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
737
|
+
width: width,
|
|
738
|
+
height: height,
|
|
739
|
+
viewBox: viewBox,
|
|
740
|
+
preserveAspectRatio: "xMidYMid",
|
|
741
|
+
children: [
|
|
742
|
+
/* @__PURE__ */ jsx4("path", {
|
|
743
|
+
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",
|
|
744
|
+
fill: "#4285F4"
|
|
745
|
+
}),
|
|
746
|
+
/* @__PURE__ */ jsx4("path", {
|
|
747
|
+
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",
|
|
748
|
+
fill: "#34A853"
|
|
749
|
+
}),
|
|
750
|
+
/* @__PURE__ */ jsx4("path", {
|
|
751
|
+
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",
|
|
752
|
+
fill: "#FBBC05"
|
|
753
|
+
}),
|
|
754
|
+
/* @__PURE__ */ jsx4("path", {
|
|
755
|
+
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",
|
|
756
|
+
fill: "#EB4335"
|
|
757
|
+
})
|
|
758
|
+
]
|
|
759
|
+
});
|
|
760
|
+
};
|
|
761
|
+
var LoginWithGoogleButton = function(param) {
|
|
762
|
+
var label = param.label, className = param.className, containerClassName = param.containerClassName, onClick = param.onClick, onError = param.onError, _param_loaderProps = param.loaderProps, loaderProps = _param_loaderProps === void 0 ? {
|
|
763
|
+
color: "#000"
|
|
764
|
+
} : _param_loaderProps, googleSvgProps = param.googleSvgProps;
|
|
765
|
+
var signInWithGoogle = useLoginWithGoogle();
|
|
766
|
+
var _useState = _sliced_to_array(useState(false), 2), isLoading = _useState[0], setIsLoading = _useState[1];
|
|
767
|
+
var onLoginClick = /*#__PURE__*/ function() {
|
|
768
|
+
var _ref = _async_to_generator(function(e) {
|
|
769
|
+
var user, error;
|
|
770
|
+
return _ts_generator(this, function(_state) {
|
|
771
|
+
switch(_state.label){
|
|
772
|
+
case 0:
|
|
773
|
+
_state.trys.push([
|
|
774
|
+
0,
|
|
775
|
+
3,
|
|
776
|
+
4,
|
|
777
|
+
5
|
|
778
|
+
]);
|
|
779
|
+
setIsLoading(true);
|
|
780
|
+
return [
|
|
781
|
+
4,
|
|
782
|
+
signInWithGoogle()
|
|
783
|
+
];
|
|
784
|
+
case 1:
|
|
785
|
+
user = _state.sent();
|
|
786
|
+
return [
|
|
787
|
+
4,
|
|
788
|
+
onClick(e, user)
|
|
789
|
+
];
|
|
790
|
+
case 2:
|
|
791
|
+
_state.sent();
|
|
792
|
+
return [
|
|
793
|
+
3,
|
|
794
|
+
5
|
|
795
|
+
];
|
|
796
|
+
case 3:
|
|
797
|
+
error = _state.sent();
|
|
798
|
+
console.error("error from login with google:", error);
|
|
799
|
+
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
800
|
+
return [
|
|
801
|
+
3,
|
|
802
|
+
5
|
|
803
|
+
];
|
|
804
|
+
case 4:
|
|
805
|
+
setIsLoading(false);
|
|
806
|
+
return [
|
|
807
|
+
7
|
|
808
|
+
];
|
|
809
|
+
case 5:
|
|
810
|
+
return [
|
|
811
|
+
2
|
|
812
|
+
];
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
});
|
|
816
|
+
return function onLoginClick(e) {
|
|
817
|
+
return _ref.apply(this, arguments);
|
|
818
|
+
};
|
|
819
|
+
}();
|
|
820
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
821
|
+
className: cn("flex justify-center", containerClassName),
|
|
822
|
+
children: /* @__PURE__ */ jsxs3("button", {
|
|
823
|
+
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),
|
|
824
|
+
onClick: function(e) {
|
|
825
|
+
return onLoginClick(e);
|
|
826
|
+
},
|
|
827
|
+
disabled: isLoading,
|
|
828
|
+
children: [
|
|
829
|
+
label,
|
|
830
|
+
isLoading ? /* @__PURE__ */ jsx4(Loader, _object_spread({}, loaderProps)) : /* @__PURE__ */ jsx4(GoogleSvg, _object_spread({}, googleSvgProps))
|
|
831
|
+
]
|
|
832
|
+
})
|
|
833
|
+
});
|
|
834
|
+
};
|
|
502
835
|
// src/components/table/components.tsx
|
|
503
836
|
import ExcelJS from "exceljs";
|
|
504
837
|
import { saveAs } from "file-saver";
|
|
505
838
|
import { memo, useMemo as useMemo6 } from "react";
|
|
506
839
|
// src/assets/svg.tsx
|
|
507
|
-
import { jsx as
|
|
840
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
508
841
|
var RedXSvg = function(param) {
|
|
509
842
|
var height = param.height, width = param.width, viewBox = param.viewBox;
|
|
510
|
-
return /* @__PURE__ */
|
|
843
|
+
return /* @__PURE__ */ jsxs4("svg", {
|
|
511
844
|
xmlns: "http://www.w3.org/2000/svg",
|
|
512
845
|
width: width || "32",
|
|
513
846
|
height: height || "32",
|
|
514
847
|
viewBox: viewBox || "0 0 32 32",
|
|
515
848
|
fill: "none",
|
|
516
849
|
children: [
|
|
517
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ jsx5("path", {
|
|
518
851
|
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",
|
|
519
852
|
fill: "#FF4C2B"
|
|
520
853
|
}),
|
|
521
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ jsx5("path", {
|
|
522
855
|
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",
|
|
523
856
|
fill: "#FF4C2B"
|
|
524
857
|
})
|
|
@@ -527,20 +860,20 @@ var RedXSvg = function(param) {
|
|
|
527
860
|
};
|
|
528
861
|
var RedXSvg2 = function(param) {
|
|
529
862
|
var height = param.height, width = param.width, viewBox = param.viewBox;
|
|
530
|
-
return /* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ jsx5("svg", {
|
|
531
864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
532
865
|
width: width || "18px",
|
|
533
866
|
height: height || "18px",
|
|
534
867
|
viewBox: viewBox || "0,0,256,256",
|
|
535
868
|
fillRule: "nonzero",
|
|
536
|
-
children: /* @__PURE__ */
|
|
869
|
+
children: /* @__PURE__ */ jsx5("g", {
|
|
537
870
|
fill: "#e90404",
|
|
538
871
|
fillRule: "nonzero",
|
|
539
872
|
stroke: "none",
|
|
540
873
|
strokeWidth: "1",
|
|
541
|
-
children: /* @__PURE__ */
|
|
874
|
+
children: /* @__PURE__ */ jsx5("g", {
|
|
542
875
|
transform: "scale(10.66667,10.66667)",
|
|
543
|
-
children: /* @__PURE__ */
|
|
876
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
544
877
|
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"
|
|
545
878
|
})
|
|
546
879
|
})
|
|
@@ -549,18 +882,18 @@ var RedXSvg2 = function(param) {
|
|
|
549
882
|
};
|
|
550
883
|
var GreenVSvg = function(param) {
|
|
551
884
|
var height = param.height, width = param.width, viewBox = param.viewBox;
|
|
552
|
-
return /* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ jsxs4("svg", {
|
|
553
886
|
xmlns: "http://www.w3.org/2000/svg",
|
|
554
887
|
width: width || "32",
|
|
555
888
|
height: height || "32",
|
|
556
889
|
viewBox: viewBox || "0 0 32 32",
|
|
557
890
|
fill: "none",
|
|
558
891
|
children: [
|
|
559
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ jsx5("path", {
|
|
560
893
|
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",
|
|
561
894
|
fill: "#3B8F08"
|
|
562
895
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ jsx5("path", {
|
|
564
897
|
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",
|
|
565
898
|
fill: "#3B8F08"
|
|
566
899
|
})
|
|
@@ -568,9 +901,9 @@ var GreenVSvg = function(param) {
|
|
|
568
901
|
});
|
|
569
902
|
};
|
|
570
903
|
// src/assets/table.tsx
|
|
571
|
-
import { Fragment, jsx as
|
|
904
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
572
905
|
var sortSvg = function(upside_down) {
|
|
573
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ jsxs5("svg", {
|
|
574
907
|
style: upside_down ? {
|
|
575
908
|
transform: "rotate(180deg)"
|
|
576
909
|
} : {},
|
|
@@ -583,13 +916,13 @@ var sortSvg = function(upside_down) {
|
|
|
583
916
|
preserveAspectRatio: "xMidYMid meet",
|
|
584
917
|
children: [
|
|
585
918
|
" ",
|
|
586
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ jsxs5("g", {
|
|
587
920
|
transform: "translate(0.000000,1536.000000) scale(0.100000,-0.100000)",
|
|
588
921
|
fill: "#fff",
|
|
589
922
|
stroke: "none",
|
|
590
923
|
children: [
|
|
591
924
|
" ",
|
|
592
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ jsx6("path", {
|
|
593
926
|
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"
|
|
594
927
|
}),
|
|
595
928
|
" "
|
|
@@ -600,8 +933,8 @@ var sortSvg = function(upside_down) {
|
|
|
600
933
|
});
|
|
601
934
|
};
|
|
602
935
|
var emptyFilterSvg = function(solid) {
|
|
603
|
-
return /* @__PURE__ */
|
|
604
|
-
children: solid ? /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ jsx6(Fragment, {
|
|
937
|
+
children: solid ? /* @__PURE__ */ jsxs5("svg", {
|
|
605
938
|
version: "1.0",
|
|
606
939
|
xmlns: "http://www.w3.org/2000/svg",
|
|
607
940
|
width: "13",
|
|
@@ -610,13 +943,13 @@ var emptyFilterSvg = function(solid) {
|
|
|
610
943
|
preserveAspectRatio: "xMidYMid meet",
|
|
611
944
|
children: [
|
|
612
945
|
" ",
|
|
613
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ jsxs5("g", {
|
|
614
947
|
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
615
948
|
fill: "#fff",
|
|
616
949
|
stroke: "none",
|
|
617
950
|
children: [
|
|
618
951
|
" ",
|
|
619
|
-
/* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ jsx6("path", {
|
|
620
953
|
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"
|
|
621
954
|
}),
|
|
622
955
|
" "
|
|
@@ -624,7 +957,7 @@ var emptyFilterSvg = function(solid) {
|
|
|
624
957
|
}),
|
|
625
958
|
" "
|
|
626
959
|
]
|
|
627
|
-
}) : /* @__PURE__ */
|
|
960
|
+
}) : /* @__PURE__ */ jsxs5("svg", {
|
|
628
961
|
version: "1.0",
|
|
629
962
|
xmlns: "http://www.w3.org/2000/svg",
|
|
630
963
|
width: "13",
|
|
@@ -633,13 +966,13 @@ var emptyFilterSvg = function(solid) {
|
|
|
633
966
|
preserveAspectRatio: "xMidYMid meet",
|
|
634
967
|
children: [
|
|
635
968
|
" ",
|
|
636
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ jsxs5("g", {
|
|
637
970
|
transform: "translate(0.000000,300.000000) scale(0.050000,-0.050000)",
|
|
638
971
|
fill: "#fff",
|
|
639
972
|
stroke: "none",
|
|
640
973
|
children: [
|
|
641
974
|
" ",
|
|
642
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ jsx6("path", {
|
|
643
976
|
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"
|
|
644
977
|
}),
|
|
645
978
|
" "
|
|
@@ -651,194 +984,112 @@ var emptyFilterSvg = function(solid) {
|
|
|
651
984
|
});
|
|
652
985
|
};
|
|
653
986
|
var slashFilterSvg = function(solid) {
|
|
654
|
-
return /* @__PURE__ */
|
|
655
|
-
children: solid ? /* @__PURE__ */
|
|
656
|
-
className: "mt-[-4px] mr-[-2px] ",
|
|
657
|
-
children: /* @__PURE__ */ jsxs4("svg", {
|
|
658
|
-
version: "1.0",
|
|
659
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
660
|
-
width: "18",
|
|
661
|
-
height: "20",
|
|
662
|
-
viewBox: "0 0 900.000000 900.000000",
|
|
663
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
664
|
-
children: [
|
|
665
|
-
" ",
|
|
666
|
-
/* @__PURE__ */ jsxs4("g", {
|
|
667
|
-
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
668
|
-
fill: "#fff",
|
|
669
|
-
stroke: "none",
|
|
670
|
-
children: [
|
|
671
|
-
" ",
|
|
672
|
-
/* @__PURE__ */ jsx5("path", {
|
|
673
|
-
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"
|
|
674
|
-
}),
|
|
675
|
-
" ",
|
|
676
|
-
/* @__PURE__ */ jsx5("path", {
|
|
677
|
-
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"
|
|
678
|
-
}),
|
|
679
|
-
" "
|
|
680
|
-
]
|
|
681
|
-
}),
|
|
682
|
-
" "
|
|
683
|
-
]
|
|
684
|
-
})
|
|
685
|
-
}) : /* @__PURE__ */ jsx5("div", {
|
|
987
|
+
return /* @__PURE__ */ jsx6(Fragment, {
|
|
988
|
+
children: solid ? /* @__PURE__ */ jsx6("div", {
|
|
686
989
|
className: "mt-[-4px] mr-[-2px] ",
|
|
687
|
-
children: /* @__PURE__ */
|
|
990
|
+
children: /* @__PURE__ */ jsxs5("svg", {
|
|
688
991
|
version: "1.0",
|
|
689
992
|
xmlns: "http://www.w3.org/2000/svg",
|
|
690
993
|
width: "18",
|
|
691
994
|
height: "20",
|
|
692
995
|
viewBox: "0 0 900.000000 900.000000",
|
|
693
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
694
|
-
children: [
|
|
695
|
-
" ",
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
698
|
-
fill: "#fff",
|
|
699
|
-
stroke: "none",
|
|
700
|
-
children: [
|
|
701
|
-
" ",
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
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
|
|
704
|
-
}),
|
|
705
|
-
" ",
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
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
|
|
708
|
-
}),
|
|
709
|
-
" "
|
|
710
|
-
]
|
|
711
|
-
}),
|
|
712
|
-
" "
|
|
713
|
-
]
|
|
714
|
-
})
|
|
715
|
-
})
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
}),
|
|
748
|
-
" "
|
|
749
|
-
]
|
|
750
|
-
});
|
|
751
|
-
};
|
|
752
|
-
// src/components/table/hooks.tsx
|
|
753
|
-
import { useContext as useContext2, useDeferredValue, useState as useState2, useTransition } from "react";
|
|
754
|
-
import { create } from "zustand";
|
|
755
|
-
import { isEqual as isEqual2 } from "lodash";
|
|
756
|
-
// src/components/table/Table.tsx
|
|
757
|
-
import React2, { createContext, useMemo } from "react";
|
|
758
|
-
import { isEqual } from "lodash";
|
|
759
|
-
// src/helpers/forms.ts
|
|
760
|
-
import XRegExp from "xregexp";
|
|
761
|
-
var textRegex = XRegExp("[^\\p{L}\\s-]", "gu");
|
|
762
|
-
var numbersRegex = XRegExp("[^0-9\\s-+]", "g");
|
|
763
|
-
var numbersOnlyRegex = XRegExp("[^0-9]", "g");
|
|
764
|
-
var priceRegex = XRegExp("[^0-9.]", "g");
|
|
765
|
-
var emailRegex = XRegExp("[^\\p{L}0-9.@\\s-]", "gu");
|
|
766
|
-
var colorRegex = XRegExp("[^#0-9A-Fa-f]", "g");
|
|
767
|
-
var carsRegex = XRegExp("[^\\p{L}0-9,_]", "gu");
|
|
768
|
-
var textNumbersRegex = XRegExp("[^\\p{L}0-9\\s+\\-]", "gu");
|
|
769
|
-
var addressRegex = XRegExp("[^\\p{L}0-9\\s.,+-\\-]", "gu");
|
|
770
|
-
var chartsRegex = XRegExp("[^\\p{L}0-9\\s.,_@!+-\\-]", "gu");
|
|
771
|
-
var handleChange = function(e) {
|
|
772
|
-
e.target.setCustomValidity("");
|
|
773
|
-
var validation = e.target.getAttribute("data-validation");
|
|
774
|
-
if (validation === "text") {
|
|
775
|
-
e.target.value = XRegExp.replace(e.target.value, textRegex, "");
|
|
776
|
-
} else if (validation === "numbers") {
|
|
777
|
-
e.target.value = XRegExp.replace(e.target.value, numbersRegex, "");
|
|
778
|
-
} else if (validation === "numbersOnly") {
|
|
779
|
-
e.target.value = XRegExp.replace(e.target.value, numbersOnlyRegex, "");
|
|
780
|
-
} else if (validation === "price") {
|
|
781
|
-
e.target.value = XRegExp.replace(e.target.value, priceRegex, "");
|
|
782
|
-
} else if (validation === "textNumbers") {
|
|
783
|
-
e.target.value = XRegExp.replace(e.target.value, textNumbersRegex, "");
|
|
784
|
-
} else if (validation === "email") {
|
|
785
|
-
e.target.value = XRegExp.replace(e.target.value, emailRegex, "");
|
|
786
|
-
} else if (validation === "color") {
|
|
787
|
-
e.target.value = XRegExp.replace(e.target.value, colorRegex, "");
|
|
788
|
-
} else if (validation === "address") {
|
|
789
|
-
e.target.value = XRegExp.replace(e.target.value, addressRegex, "");
|
|
790
|
-
} else if (validation === "cars") {
|
|
791
|
-
e.target.value = XRegExp.replace(e.target.value, carsRegex, "");
|
|
792
|
-
} else if (validation === "charts") {
|
|
793
|
-
e.target.value = XRegExp.replace(e.target.value, chartsRegex, "");
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
var handlePaste = function(e) {
|
|
797
|
-
var validation = e.currentTarget.getAttribute("data-validation");
|
|
798
|
-
var pasteData = e.clipboardData.getData("text");
|
|
799
|
-
if (validation === "text") {
|
|
800
|
-
pasteData = XRegExp.replace(pasteData, textRegex, "");
|
|
801
|
-
} else if (validation === "numbers") {
|
|
802
|
-
pasteData = XRegExp.replace(pasteData, numbersRegex, "");
|
|
803
|
-
} else if (validation === "numbersOnly") {
|
|
804
|
-
pasteData = XRegExp.replace(pasteData, numbersOnlyRegex, "");
|
|
805
|
-
} else if (validation === "price") {
|
|
806
|
-
pasteData = XRegExp.replace(pasteData, priceRegex, "");
|
|
807
|
-
} else if (validation === "textNumbers") {
|
|
808
|
-
pasteData = XRegExp.replace(pasteData, textNumbersRegex, "");
|
|
809
|
-
} else if (validation === "email") {
|
|
810
|
-
pasteData = XRegExp.replace(pasteData, emailRegex, "");
|
|
811
|
-
} else if (validation === "color") {
|
|
812
|
-
pasteData = XRegExp.replace(pasteData, colorRegex, "");
|
|
813
|
-
} else if (validation === "address") {
|
|
814
|
-
pasteData = XRegExp.replace(pasteData, addressRegex, "");
|
|
815
|
-
} else if (validation === "cars") {
|
|
816
|
-
pasteData = XRegExp.replace(pasteData, carsRegex, "");
|
|
817
|
-
} else if (validation === "charts") {
|
|
818
|
-
pasteData = XRegExp.replace(pasteData, chartsRegex, "");
|
|
819
|
-
}
|
|
820
|
-
e.preventDefault();
|
|
821
|
-
document.execCommand("insertText", false, pasteData);
|
|
822
|
-
};
|
|
823
|
-
var handleInvalid = function(e, requireError) {
|
|
824
|
-
e.target.setCustomValidity(requireError || "This filed is required !");
|
|
825
|
-
};
|
|
826
|
-
var useValidation = function(validationType, requireError) {
|
|
827
|
-
return {
|
|
828
|
-
onChange: handleChange,
|
|
829
|
-
onPaste: handlePaste,
|
|
830
|
-
onInvalid: function(e) {
|
|
831
|
-
return handleInvalid(e, requireError);
|
|
832
|
-
},
|
|
833
|
-
"data-validation": validationType
|
|
834
|
-
};
|
|
996
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
997
|
+
children: [
|
|
998
|
+
" ",
|
|
999
|
+
/* @__PURE__ */ jsxs5("g", {
|
|
1000
|
+
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
1001
|
+
fill: "#fff",
|
|
1002
|
+
stroke: "none",
|
|
1003
|
+
children: [
|
|
1004
|
+
" ",
|
|
1005
|
+
/* @__PURE__ */ jsx6("path", {
|
|
1006
|
+
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"
|
|
1007
|
+
}),
|
|
1008
|
+
" ",
|
|
1009
|
+
/* @__PURE__ */ jsx6("path", {
|
|
1010
|
+
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"
|
|
1011
|
+
}),
|
|
1012
|
+
" "
|
|
1013
|
+
]
|
|
1014
|
+
}),
|
|
1015
|
+
" "
|
|
1016
|
+
]
|
|
1017
|
+
})
|
|
1018
|
+
}) : /* @__PURE__ */ jsx6("div", {
|
|
1019
|
+
className: "mt-[-4px] mr-[-2px] ",
|
|
1020
|
+
children: /* @__PURE__ */ jsxs5("svg", {
|
|
1021
|
+
version: "1.0",
|
|
1022
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1023
|
+
width: "18",
|
|
1024
|
+
height: "20",
|
|
1025
|
+
viewBox: "0 0 900.000000 900.000000",
|
|
1026
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1027
|
+
children: [
|
|
1028
|
+
" ",
|
|
1029
|
+
/* @__PURE__ */ jsxs5("g", {
|
|
1030
|
+
transform: "translate(0.000000,900.000000) scale(0.100000,-0.100000)",
|
|
1031
|
+
fill: "#fff",
|
|
1032
|
+
stroke: "none",
|
|
1033
|
+
children: [
|
|
1034
|
+
" ",
|
|
1035
|
+
/* @__PURE__ */ jsx6("path", {
|
|
1036
|
+
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"
|
|
1037
|
+
}),
|
|
1038
|
+
" ",
|
|
1039
|
+
/* @__PURE__ */ jsx6("path", {
|
|
1040
|
+
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"
|
|
1041
|
+
}),
|
|
1042
|
+
" "
|
|
1043
|
+
]
|
|
1044
|
+
}),
|
|
1045
|
+
" "
|
|
1046
|
+
]
|
|
1047
|
+
})
|
|
1048
|
+
})
|
|
1049
|
+
});
|
|
835
1050
|
};
|
|
836
|
-
var
|
|
837
|
-
|
|
838
|
-
|
|
1051
|
+
var exportToExcelSvg = function(width, height, viewBox) {
|
|
1052
|
+
return /* @__PURE__ */ jsxs5("svg", {
|
|
1053
|
+
version: "1.0",
|
|
1054
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1055
|
+
width: width || "18",
|
|
1056
|
+
height: height || "18",
|
|
1057
|
+
viewBox: viewBox || "0 0 150.000000 150.000000",
|
|
1058
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1059
|
+
children: [
|
|
1060
|
+
" ",
|
|
1061
|
+
/* @__PURE__ */ jsxs5("g", {
|
|
1062
|
+
transform: "translate(0.000000,150.000000) scale(0.100000,-0.100000)",
|
|
1063
|
+
fill: "#ffffff",
|
|
1064
|
+
stroke: "none",
|
|
1065
|
+
children: [
|
|
1066
|
+
" ",
|
|
1067
|
+
/* @__PURE__ */ jsx6("path", {
|
|
1068
|
+
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"
|
|
1069
|
+
}),
|
|
1070
|
+
" ",
|
|
1071
|
+
/* @__PURE__ */ jsx6("path", {
|
|
1072
|
+
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"
|
|
1073
|
+
}),
|
|
1074
|
+
" ",
|
|
1075
|
+
/* @__PURE__ */ jsx6("path", {
|
|
1076
|
+
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"
|
|
1077
|
+
}),
|
|
1078
|
+
" "
|
|
1079
|
+
]
|
|
1080
|
+
}),
|
|
1081
|
+
" "
|
|
1082
|
+
]
|
|
1083
|
+
});
|
|
839
1084
|
};
|
|
1085
|
+
// src/components/table/hooks.tsx
|
|
1086
|
+
import { useContext as useContext2, useDeferredValue, useState as useState3, useTransition } from "react";
|
|
1087
|
+
import { create } from "zustand";
|
|
1088
|
+
import { isEqual as isEqual3 } from "lodash";
|
|
840
1089
|
// src/components/table/Table.tsx
|
|
841
|
-
import {
|
|
1090
|
+
import React2, { createContext, useMemo } from "react";
|
|
1091
|
+
import { isEqual as isEqual2 } from "lodash";
|
|
1092
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
842
1093
|
var TableContext = createContext(null);
|
|
843
1094
|
var TableProvider = function(props) {
|
|
844
1095
|
var // basic props
|
|
@@ -935,9 +1186,9 @@ var TableProvider = function(props) {
|
|
|
935
1186
|
handleFilterClick: handleFilterClick,
|
|
936
1187
|
closeFilterWindow: closeFilterWindow
|
|
937
1188
|
});
|
|
938
|
-
return /* @__PURE__ */
|
|
1189
|
+
return /* @__PURE__ */ jsx7(TableContext.Provider, {
|
|
939
1190
|
value: providerValues,
|
|
940
|
-
children: /* @__PURE__ */
|
|
1191
|
+
children: /* @__PURE__ */ jsx7("div", {
|
|
941
1192
|
className: "flex flex-col gap-2 ".concat(containerClassName),
|
|
942
1193
|
style: _object_spread_props(_object_spread({}, containerStyle), {
|
|
943
1194
|
direction: direction
|
|
@@ -948,45 +1199,45 @@ var TableProvider = function(props) {
|
|
|
948
1199
|
};
|
|
949
1200
|
var TableBase = function(props) {
|
|
950
1201
|
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;
|
|
951
|
-
return /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ jsxs6(TableProvider, _object_spread_props(_object_spread({}, props), {
|
|
952
1203
|
children: [
|
|
953
|
-
/* @__PURE__ */
|
|
1204
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
954
1205
|
style: {
|
|
955
1206
|
direction: direction
|
|
956
1207
|
},
|
|
957
1208
|
className: cn("flex justify-start items-center gap-2", containerHeaderClassName || ""),
|
|
958
1209
|
children: [
|
|
959
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
960
1211
|
className: cn("flex justify-start items-center gap-2", searchContainerClassName),
|
|
961
1212
|
children: [
|
|
962
|
-
includeSearch && /* @__PURE__ */
|
|
963
|
-
exportToExcelKeys && /* @__PURE__ */
|
|
1213
|
+
includeSearch && /* @__PURE__ */ jsx7(Search, {}),
|
|
1214
|
+
exportToExcelKeys && /* @__PURE__ */ jsx7(ExportToExcel, {})
|
|
964
1215
|
]
|
|
965
1216
|
}),
|
|
966
|
-
maxRowsLabel1 && maxRowsLabel2 && /* @__PURE__ */
|
|
1217
|
+
maxRowsLabel1 && maxRowsLabel2 && /* @__PURE__ */ jsx7(MaxRowsLabel, {}),
|
|
967
1218
|
optionalElement && optionalElement
|
|
968
1219
|
]
|
|
969
1220
|
}),
|
|
970
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ jsx7("div", {
|
|
971
1222
|
style: _object_spread_props(_object_spread({}, tableContainerStyle || {}), {
|
|
972
1223
|
direction: direction
|
|
973
1224
|
}),
|
|
974
1225
|
className: cn("animate-slide-in-up overflow-y-auto", tableContainerClass || ""),
|
|
975
|
-
children: /* @__PURE__ */
|
|
1226
|
+
children: /* @__PURE__ */ jsxs6("table", {
|
|
976
1227
|
style: tableStyle,
|
|
977
1228
|
className: "min-w-full text-sm font-light relative",
|
|
978
1229
|
children: [
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
1230
|
+
/* @__PURE__ */ jsx7(TableHead, {}),
|
|
1231
|
+
/* @__PURE__ */ jsx7(TableBody, {})
|
|
981
1232
|
]
|
|
982
1233
|
})
|
|
983
1234
|
}),
|
|
984
|
-
sumColumns && /* @__PURE__ */
|
|
1235
|
+
sumColumns && /* @__PURE__ */ jsx7(Summary, {})
|
|
985
1236
|
]
|
|
986
1237
|
}));
|
|
987
1238
|
};
|
|
988
1239
|
var areEqual = function(prevProps, nextProps) {
|
|
989
|
-
return
|
|
1240
|
+
return isEqual2(prevProps, nextProps);
|
|
990
1241
|
};
|
|
991
1242
|
var Table = React2.memo(TableBase, areEqual);
|
|
992
1243
|
Table.displayName = "Table";
|
|
@@ -1003,8 +1254,8 @@ var useFilter = function(param) {
|
|
|
1003
1254
|
var initFilter = filterableColumns.reduce(function(acc, col) {
|
|
1004
1255
|
return _object_spread_props(_object_spread({}, acc), _define_property({}, col.dataKey, []));
|
|
1005
1256
|
}, {});
|
|
1006
|
-
var
|
|
1007
|
-
var
|
|
1257
|
+
var _useState3 = _sliced_to_array(useState3(initFilter), 2), filters = _useState3[0], setFilters = _useState3[1];
|
|
1258
|
+
var _useState31 = _sliced_to_array(useState3(""), 2), filterPopupsDisplay = _useState31[0], setFilterPopupsDisplay = _useState31[1];
|
|
1008
1259
|
var filterOptions = filterableColumns.reduce(function(acc, col) {
|
|
1009
1260
|
acc[col.dataKey] = Array.from(new Set(data.map(function(item) {
|
|
1010
1261
|
return item[col.dataKey];
|
|
@@ -1023,7 +1274,7 @@ var useFilter = function(param) {
|
|
|
1023
1274
|
setFilters(newFilters);
|
|
1024
1275
|
};
|
|
1025
1276
|
var clearFilter = function() {
|
|
1026
|
-
if (!
|
|
1277
|
+
if (!isEqual3(filters, initFilter)) {
|
|
1027
1278
|
setFilters(initFilter);
|
|
1028
1279
|
}
|
|
1029
1280
|
};
|
|
@@ -1050,8 +1301,8 @@ var useFilter = function(param) {
|
|
|
1050
1301
|
};
|
|
1051
1302
|
};
|
|
1052
1303
|
var useSort = function() {
|
|
1053
|
-
var
|
|
1054
|
-
var
|
|
1304
|
+
var _useState3 = _sliced_to_array(useState3(null), 2), sortColumn = _useState3[0], setSortColumn = _useState3[1];
|
|
1305
|
+
var _useState31 = _sliced_to_array(useState3(null), 2), sortOrder = _useState31[0], setSortOrder = _useState31[1];
|
|
1055
1306
|
var handleSort = function(columnIndex) {
|
|
1056
1307
|
var newSortOrder = "asc";
|
|
1057
1308
|
if (sortColumn === columnIndex && sortOrder === "asc") {
|
|
@@ -1076,7 +1327,7 @@ var useSort = function() {
|
|
|
1076
1327
|
};
|
|
1077
1328
|
};
|
|
1078
1329
|
var useSearch = function() {
|
|
1079
|
-
var
|
|
1330
|
+
var _useState3 = _sliced_to_array(useState3(""), 2), searchQuery = _useState3[0], setSearchQuery = _useState3[1];
|
|
1080
1331
|
var _useTransition = _sliced_to_array(useTransition(), 2), isPending = _useTransition[0], startTransition = _useTransition[1];
|
|
1081
1332
|
var deferredSearchQuery = useDeferredValue(searchQuery);
|
|
1082
1333
|
var handleSearch = function(e) {
|
|
@@ -1100,130 +1351,9 @@ var useSearch = function() {
|
|
|
1100
1351
|
deferredSearchQuery: deferredSearchQuery
|
|
1101
1352
|
};
|
|
1102
1353
|
};
|
|
1103
|
-
// src/helpers/firebase.ts
|
|
1104
|
-
import moment from "moment";
|
|
1105
|
-
import { initializeApp } from "firebase/app";
|
|
1106
|
-
import { getStorage } from "firebase/storage";
|
|
1107
|
-
import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth";
|
|
1108
|
-
import { initializeAppCheck, ReCaptchaEnterpriseProvider } from "firebase/app-check";
|
|
1109
|
-
import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, setDoc, Timestamp, where, getFirestore, onSnapshot, orderBy } from "firebase/firestore";
|
|
1110
|
-
import { useCallback } from "react";
|
|
1111
|
-
var initApp = function() {
|
|
1112
|
-
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
1113
|
-
var firebaseConfig = {
|
|
1114
|
-
apiKey: isNodeEnv2 ? process.env.NEXT_PUBLIC_API_KEY : import.meta.env.VITE_API_KEY,
|
|
1115
|
-
authDomain: isNodeEnv2 ? process.env.NEXT_PUBLIC_AUTH_DOMAIN : import.meta.env.VITE_AUTH_DOMAIN,
|
|
1116
|
-
projectId: isNodeEnv2 ? process.env.NEXT_PUBLIC_PROJECT_ID : import.meta.env.VITE_PROJECT_ID,
|
|
1117
|
-
storageBucket: isNodeEnv2 ? process.env.NEXT_PUBLIC_STORAGE_BUCKET : import.meta.env.VITE_STORAGE_BUCKET,
|
|
1118
|
-
messagingSenderId: isNodeEnv2 ? process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID : import.meta.env.VITE_MESSAGING_SENDER_ID,
|
|
1119
|
-
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import.meta.env.VITE_APP_ID
|
|
1120
|
-
};
|
|
1121
|
-
try {
|
|
1122
|
-
var app2 = initializeApp(firebaseConfig);
|
|
1123
|
-
var auth2 = getAuth(app2);
|
|
1124
|
-
auth2.settings.appVerificationDisabledForTesting = false;
|
|
1125
|
-
var db2 = getFirestore(app2);
|
|
1126
|
-
var storage2 = getStorage(app2);
|
|
1127
|
-
var googleLoginProvider2 = new GoogleAuthProvider();
|
|
1128
|
-
var recaptchaSiteKey = isNodeEnv2 ? process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY : import.meta.env.VITE_RECAPTCHA_SITE_KEY;
|
|
1129
|
-
var result = {
|
|
1130
|
-
db: db2,
|
|
1131
|
-
auth: auth2,
|
|
1132
|
-
storage: storage2,
|
|
1133
|
-
app: app2,
|
|
1134
|
-
googleLoginProvider: googleLoginProvider2
|
|
1135
|
-
};
|
|
1136
|
-
if (recaptchaSiteKey) {
|
|
1137
|
-
result.appCheck = initializeAppCheck(app2, {
|
|
1138
|
-
provider: new ReCaptchaEnterpriseProvider(recaptchaSiteKey),
|
|
1139
|
-
isTokenAutoRefreshEnabled: true
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
return result;
|
|
1143
|
-
} catch (error) {
|
|
1144
|
-
console.error("Failed to initialize Firebase app:", error);
|
|
1145
|
-
return {};
|
|
1146
|
-
}
|
|
1147
|
-
};
|
|
1148
|
-
var _initApp = initApp(), db = _initApp.db, auth = _initApp.auth, storage = _initApp.storage, app = _initApp.app, appCheck = _initApp.appCheck, googleLoginProvider = _initApp.googleLoginProvider;
|
|
1149
|
-
var collections = {
|
|
1150
|
-
clients: collection(db, "nx-clients"),
|
|
1151
|
-
sites: collection(db, "nx-sites"),
|
|
1152
|
-
cars: collection(db, "units"),
|
|
1153
|
-
users: collection(db, "nx-users"),
|
|
1154
|
-
lastLocations: collection(db, "last_locations"),
|
|
1155
|
-
ermEvents: collection(db, "erm_events_general"),
|
|
1156
|
-
erm2Events: collection(db, "erm2_events_general"),
|
|
1157
|
-
ruptelaEvents: collection(db, "ruptela_events_general"),
|
|
1158
|
-
polygons: collection(db, "nx-polygons"),
|
|
1159
|
-
polygonEvents: collection(db, "polygon_events"),
|
|
1160
|
-
polygonCars: collection(db, "polygon_cars"),
|
|
1161
|
-
canbus: collection(db, "erm_canbus_parameters"),
|
|
1162
|
-
states: collection(db, "erm_states"),
|
|
1163
|
-
app_pro_commands_queue: collection(db, "app_pro_commands_queue"),
|
|
1164
|
-
trips: collection(db, "erm2_trip"),
|
|
1165
|
-
tripsDetails: collection(db, "erm2_trip_details"),
|
|
1166
|
-
audit: collection(db, "nx-audit"),
|
|
1167
|
-
nx_settings: collection(db, "nx-settings"),
|
|
1168
|
-
settings: collection(db, "settings"),
|
|
1169
|
-
translations: collection(db, "nx-translations"),
|
|
1170
|
-
nx_cars: collection(db, "nx-cars"),
|
|
1171
|
-
boards: collection(db, "boards"),
|
|
1172
|
-
protection_types: collection(db, "protectionTypes"),
|
|
1173
|
-
board_types: collection(db, "boardTypes"),
|
|
1174
|
-
charge_capacities: collection(db, "nx-charge-capacities")
|
|
1175
|
-
};
|
|
1176
|
-
var fire_base_TIME_TEMP = Timestamp.now;
|
|
1177
|
-
// src/helpers/global.ts
|
|
1178
|
-
import { CountryOptions } from "akeyless-types-commons";
|
|
1179
|
-
import axios from "axios";
|
|
1180
|
-
// src/helpers/phoneNumber.ts
|
|
1181
|
-
import { parsePhoneNumberFromString } from "libphonenumber-js";
|
|
1182
|
-
// src/helpers/global.ts
|
|
1183
|
-
import { isEqual as isEqual3 } from "lodash";
|
|
1184
|
-
var renderOnce = function() {
|
|
1185
|
-
return true;
|
|
1186
|
-
};
|
|
1187
|
-
var getLocationUrl = function(lng, lat) {
|
|
1188
|
-
return "https://www.google.com/maps?q=".concat(lat, ",").concat(lng);
|
|
1189
|
-
};
|
|
1190
|
-
var isNodeEnv = typeof process !== "undefined" && process.env;
|
|
1191
|
-
var _ref = {
|
|
1192
|
-
mode: isNodeEnv ? process.env.NEXT_PUBLIC_MODE : import.meta.env.VITE_MODE,
|
|
1193
|
-
isLocal: (isNodeEnv ? process.env.NEXT_PUBLIC_IS_LOCAL : import.meta.env.VITE_is_local) === "true"
|
|
1194
|
-
}, mode = _ref.mode, isLocal = _ref.isLocal;
|
|
1195
|
-
// src/helpers/time_helpers.ts
|
|
1196
|
-
import { Timestamp as Timestamp2 } from "firebase/firestore";
|
|
1197
|
-
import moment2 from "moment-timezone";
|
|
1198
|
-
function timestamp_to_string(firebaseTimestamp, options) {
|
|
1199
|
-
var date;
|
|
1200
|
-
if (_instanceof(firebaseTimestamp, Timestamp2)) {
|
|
1201
|
-
date = firebaseTimestamp.toDate();
|
|
1202
|
-
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
1203
|
-
date = firebaseTimestamp;
|
|
1204
|
-
} else if (typeof firebaseTimestamp === "string") {
|
|
1205
|
-
date = moment2.utc(firebaseTimestamp, (options === null || options === void 0 ? void 0 : options.fromFormat) || "DD/MM/YYYY HH:mm:ss").toDate();
|
|
1206
|
-
if (isNaN(date.getTime())) {
|
|
1207
|
-
throw new Error("Invalid date string format");
|
|
1208
|
-
}
|
|
1209
|
-
} else {
|
|
1210
|
-
throw new Error("Invalid input: firebaseTimestamp must be a Timestamp, Date, or valid date string.");
|
|
1211
|
-
}
|
|
1212
|
-
if (options === null || options === void 0 ? void 0 : options.tz) {
|
|
1213
|
-
var result = moment2(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");
|
|
1214
|
-
return result;
|
|
1215
|
-
}
|
|
1216
|
-
return moment2.utc(date).format((options === null || options === void 0 ? void 0 : options.format) || "DD/MM/YYYY HH:mm:ss");
|
|
1217
|
-
}
|
|
1218
|
-
// src/helpers/api.ts
|
|
1219
|
-
import axios2 from "axios";
|
|
1220
|
-
var baseDomain = mode === "qa" ? "https://nx-api.xyz/api" : "https://nx-api.info/api";
|
|
1221
|
-
var devicesDomain = isLocal ? "http://localhost:9001/api/devices" : baseDomain + "/devices";
|
|
1222
|
-
var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
1223
|
-
var callCenterDomain = isLocal ? "http://localhost:9003/api/call-center" : baseDomain + "/call-center";
|
|
1224
1354
|
// src/components/ui/badge.tsx
|
|
1225
1355
|
import { cva } from "class-variance-authority";
|
|
1226
|
-
import { jsx as
|
|
1356
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1227
1357
|
var badgeVariants = 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", {
|
|
1228
1358
|
variants: {
|
|
1229
1359
|
variant: {
|
|
@@ -1242,7 +1372,7 @@ function Badge(_param) {
|
|
|
1242
1372
|
"className",
|
|
1243
1373
|
"variant"
|
|
1244
1374
|
]);
|
|
1245
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ jsx8("div", _object_spread({
|
|
1246
1376
|
className: cn(badgeVariants({
|
|
1247
1377
|
variant: variant
|
|
1248
1378
|
}), className)
|
|
@@ -1252,7 +1382,7 @@ function Badge(_param) {
|
|
|
1252
1382
|
import { Slot } from "@radix-ui/react-slot";
|
|
1253
1383
|
import { cva as cva2 } from "class-variance-authority";
|
|
1254
1384
|
import * as React3 from "react";
|
|
1255
|
-
import { jsx as
|
|
1385
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1256
1386
|
var buttonVariants = cva2("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]", {
|
|
1257
1387
|
variants: {
|
|
1258
1388
|
variant: {
|
|
@@ -1283,7 +1413,7 @@ var Button = React3.forwardRef(function(_param, ref) {
|
|
|
1283
1413
|
"asChild"
|
|
1284
1414
|
]);
|
|
1285
1415
|
var Comp = asChild ? Slot : "button";
|
|
1286
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ jsx9(Comp, _object_spread({
|
|
1287
1417
|
ref: ref,
|
|
1288
1418
|
"data-slot": "button",
|
|
1289
1419
|
className: cn(buttonVariants({
|
|
@@ -1296,13 +1426,13 @@ var Button = React3.forwardRef(function(_param, ref) {
|
|
|
1296
1426
|
Button.displayName = "Button";
|
|
1297
1427
|
// src/components/ui/input.tsx
|
|
1298
1428
|
import * as React4 from "react";
|
|
1299
|
-
import { jsx as
|
|
1429
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1300
1430
|
var Input = React4.forwardRef(function(_param, ref) {
|
|
1301
1431
|
var className = _param.className, type = _param.type, props = _object_without_properties(_param, [
|
|
1302
1432
|
"className",
|
|
1303
1433
|
"type"
|
|
1304
1434
|
]);
|
|
1305
|
-
return /* @__PURE__ */
|
|
1435
|
+
return /* @__PURE__ */ jsx10("input", _object_spread({
|
|
1306
1436
|
type: type,
|
|
1307
1437
|
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),
|
|
1308
1438
|
ref: ref
|
|
@@ -1312,7 +1442,7 @@ Input.displayName = "Input";
|
|
|
1312
1442
|
// src/components/ui/progress.tsx
|
|
1313
1443
|
import * as React5 from "react";
|
|
1314
1444
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
1315
|
-
import { jsx as
|
|
1445
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1316
1446
|
var ProgressComponent = React5.forwardRef(function(_param, ref) {
|
|
1317
1447
|
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, [
|
|
1318
1448
|
"className",
|
|
@@ -1322,18 +1452,18 @@ var ProgressComponent = React5.forwardRef(function(_param, ref) {
|
|
|
1322
1452
|
"showValueClassName",
|
|
1323
1453
|
"showValue"
|
|
1324
1454
|
]);
|
|
1325
|
-
return /* @__PURE__ */
|
|
1455
|
+
return /* @__PURE__ */ jsx11("div", {
|
|
1326
1456
|
className: cn("relative w-full", containerClassName),
|
|
1327
|
-
children: /* @__PURE__ */
|
|
1457
|
+
children: /* @__PURE__ */ jsx11(ProgressPrimitive.Root, _object_spread_props(_object_spread({
|
|
1328
1458
|
ref: ref,
|
|
1329
1459
|
className: cn("w-full h-5 bg-[#e5e7eb] relative overflow-hidden rounded-full", className)
|
|
1330
1460
|
}, props), {
|
|
1331
|
-
children: /* @__PURE__ */
|
|
1461
|
+
children: /* @__PURE__ */ jsx11(ProgressPrimitive.Indicator, {
|
|
1332
1462
|
className: cn("h-full w-full flex-1 bg-[green] transition-all rounded-full", indicatorClassName),
|
|
1333
1463
|
style: {
|
|
1334
1464
|
transform: "translateX(-".concat(100 - (value || 0), "%)")
|
|
1335
1465
|
},
|
|
1336
|
-
children: showValue && /* @__PURE__ */
|
|
1466
|
+
children: showValue && /* @__PURE__ */ jsx11("div", {
|
|
1337
1467
|
className: cn("absolute right-1 top-[-2px] font-medium text-white", showValueClassName),
|
|
1338
1468
|
children: "".concat(value || 0, "%")
|
|
1339
1469
|
})
|
|
@@ -1356,13 +1486,13 @@ import * as React7 from "react";
|
|
|
1356
1486
|
import * as React6 from "react";
|
|
1357
1487
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1358
1488
|
import { X } from "lucide-react";
|
|
1359
|
-
import { jsx as
|
|
1489
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1360
1490
|
var DialogPortal = DialogPrimitive.Portal;
|
|
1361
1491
|
var DialogOverlay = React6.forwardRef(function(_param, ref) {
|
|
1362
1492
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1363
1493
|
"className"
|
|
1364
1494
|
]);
|
|
1365
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ jsx12(DialogPrimitive.Overlay, _object_spread({
|
|
1366
1496
|
ref: ref,
|
|
1367
1497
|
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)
|
|
1368
1498
|
}, props));
|
|
@@ -1373,22 +1503,22 @@ var DialogContent = React6.forwardRef(function(_param, ref) {
|
|
|
1373
1503
|
"className",
|
|
1374
1504
|
"children"
|
|
1375
1505
|
]);
|
|
1376
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ jsxs7(DialogPortal, {
|
|
1377
1507
|
children: [
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ jsx12(DialogOverlay, {}),
|
|
1509
|
+
/* @__PURE__ */ jsxs7(DialogPrimitive.Content, _object_spread_props(_object_spread({
|
|
1380
1510
|
ref: ref,
|
|
1381
1511
|
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)
|
|
1382
1512
|
}, props), {
|
|
1383
1513
|
children: [
|
|
1384
1514
|
children,
|
|
1385
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ jsxs7(DialogPrimitive.Close, {
|
|
1386
1516
|
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",
|
|
1387
1517
|
children: [
|
|
1388
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ jsx12(X, {
|
|
1389
1519
|
className: "h-4 w-4"
|
|
1390
1520
|
}),
|
|
1391
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsx12("span", {
|
|
1392
1522
|
className: "sr-only",
|
|
1393
1523
|
children: "Close"
|
|
1394
1524
|
})
|
|
@@ -1404,7 +1534,7 @@ var DialogHeader = function(_param) {
|
|
|
1404
1534
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1405
1535
|
"className"
|
|
1406
1536
|
]);
|
|
1407
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ jsx12("div", _object_spread({
|
|
1408
1538
|
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className)
|
|
1409
1539
|
}, props));
|
|
1410
1540
|
};
|
|
@@ -1413,7 +1543,7 @@ var DialogFooter = function(_param) {
|
|
|
1413
1543
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1414
1544
|
"className"
|
|
1415
1545
|
]);
|
|
1416
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ jsx12("div", _object_spread({
|
|
1417
1547
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
|
|
1418
1548
|
}, props));
|
|
1419
1549
|
};
|
|
@@ -1422,7 +1552,7 @@ var DialogTitle = React6.forwardRef(function(_param, ref) {
|
|
|
1422
1552
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1423
1553
|
"className"
|
|
1424
1554
|
]);
|
|
1425
|
-
return /* @__PURE__ */
|
|
1555
|
+
return /* @__PURE__ */ jsx12(DialogPrimitive.Title, _object_spread({
|
|
1426
1556
|
ref: ref,
|
|
1427
1557
|
className: cn("text-lg font-semibold leading-none tracking-tight", className)
|
|
1428
1558
|
}, props));
|
|
@@ -1432,19 +1562,19 @@ var DialogDescription = React6.forwardRef(function(_param, ref) {
|
|
|
1432
1562
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1433
1563
|
"className"
|
|
1434
1564
|
]);
|
|
1435
|
-
return /* @__PURE__ */
|
|
1565
|
+
return /* @__PURE__ */ jsx12(DialogPrimitive.Description, _object_spread({
|
|
1436
1566
|
ref: ref,
|
|
1437
1567
|
className: cn("text-sm text-muted-foreground", className)
|
|
1438
1568
|
}, props));
|
|
1439
1569
|
});
|
|
1440
1570
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1441
1571
|
// src/components/ui/command.tsx
|
|
1442
|
-
import { jsx as
|
|
1572
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1443
1573
|
var Command = React7.forwardRef(function(_param, ref) {
|
|
1444
1574
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1445
1575
|
"className"
|
|
1446
1576
|
]);
|
|
1447
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ jsx13(CommandPrimitive, _object_spread({
|
|
1448
1578
|
ref: ref,
|
|
1449
1579
|
className: cn("flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground", className)
|
|
1450
1580
|
}, props));
|
|
@@ -1455,16 +1585,16 @@ var CommandInput = React7.forwardRef(function(_param, ref) {
|
|
|
1455
1585
|
"className",
|
|
1456
1586
|
"withSearchIcon"
|
|
1457
1587
|
]);
|
|
1458
|
-
return /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ jsxs8("div", {
|
|
1459
1589
|
className: "flex items-center border-b border-input px-3",
|
|
1460
1590
|
"cmdk-input-wrapper": "",
|
|
1461
1591
|
children: [
|
|
1462
|
-
withSearchIcon && /* @__PURE__ */
|
|
1592
|
+
withSearchIcon && /* @__PURE__ */ jsx13(Search2, {
|
|
1463
1593
|
size: 20,
|
|
1464
1594
|
strokeWidth: 2,
|
|
1465
1595
|
className: "me-3 text-muted-foreground/80"
|
|
1466
1596
|
}),
|
|
1467
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ jsx13(CommandPrimitive.Input, _object_spread({
|
|
1468
1598
|
ref: ref,
|
|
1469
1599
|
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)
|
|
1470
1600
|
}, props))
|
|
@@ -1476,14 +1606,14 @@ var CommandList = React7.forwardRef(function(_param, ref) {
|
|
|
1476
1606
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1477
1607
|
"className"
|
|
1478
1608
|
]);
|
|
1479
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx13(CommandPrimitive.List, _object_spread({
|
|
1480
1610
|
ref: ref,
|
|
1481
1611
|
className: cn("max-h-80 overflow-y-auto overflow-x-hidden", className)
|
|
1482
1612
|
}, props));
|
|
1483
1613
|
});
|
|
1484
1614
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
1485
1615
|
var CommandEmpty = React7.forwardRef(function(props, ref) {
|
|
1486
|
-
return /* @__PURE__ */
|
|
1616
|
+
return /* @__PURE__ */ jsx13(CommandPrimitive.Empty, _object_spread({
|
|
1487
1617
|
ref: ref,
|
|
1488
1618
|
className: "py-6 text-center text-sm"
|
|
1489
1619
|
}, props));
|
|
@@ -1493,7 +1623,7 @@ var CommandGroup = React7.forwardRef(function(_param, ref) {
|
|
|
1493
1623
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1494
1624
|
"className"
|
|
1495
1625
|
]);
|
|
1496
|
-
return /* @__PURE__ */
|
|
1626
|
+
return /* @__PURE__ */ jsx13(CommandPrimitive.Group, _object_spread({
|
|
1497
1627
|
ref: ref,
|
|
1498
1628
|
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)
|
|
1499
1629
|
}, props));
|
|
@@ -1503,7 +1633,7 @@ var CommandSeparator = React7.forwardRef(function(_param, ref) {
|
|
|
1503
1633
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1504
1634
|
"className"
|
|
1505
1635
|
]);
|
|
1506
|
-
return /* @__PURE__ */
|
|
1636
|
+
return /* @__PURE__ */ jsx13(CommandPrimitive.Separator, _object_spread({
|
|
1507
1637
|
ref: ref,
|
|
1508
1638
|
className: cn("-mx-1 h-px bg-border", className)
|
|
1509
1639
|
}, props));
|
|
@@ -1513,7 +1643,7 @@ var CommandItem = React7.forwardRef(function(_param, ref) {
|
|
|
1513
1643
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1514
1644
|
"className"
|
|
1515
1645
|
]);
|
|
1516
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ jsx13(CommandPrimitive.Item, _object_spread({
|
|
1517
1647
|
ref: ref,
|
|
1518
1648
|
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)
|
|
1519
1649
|
}, props));
|
|
@@ -1523,7 +1653,7 @@ var CommandShortcut = function(_param) {
|
|
|
1523
1653
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1524
1654
|
"className"
|
|
1525
1655
|
]);
|
|
1526
|
-
return /* @__PURE__ */
|
|
1656
|
+
return /* @__PURE__ */ jsx13("kbd", _object_spread({
|
|
1527
1657
|
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)
|
|
1528
1658
|
}, props));
|
|
1529
1659
|
};
|
|
@@ -3361,7 +3491,7 @@ var flip3 = function(options, deps) {
|
|
|
3361
3491
|
});
|
|
3362
3492
|
};
|
|
3363
3493
|
// src/components/ui/multiselect.tsx
|
|
3364
|
-
import { Fragment as Fragment2, jsx as
|
|
3494
|
+
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3365
3495
|
var Portal2 = function(param) {
|
|
3366
3496
|
var children = param.children;
|
|
3367
3497
|
return ReactDOM2.createPortal(children, document.body);
|
|
@@ -3446,7 +3576,7 @@ var CommandEmpty2 = forwardRef6(function(_param, forwardedRef) {
|
|
|
3446
3576
|
return state.filtered.count === 0;
|
|
3447
3577
|
});
|
|
3448
3578
|
if (!render) return null;
|
|
3449
|
-
return /* @__PURE__ */
|
|
3579
|
+
return /* @__PURE__ */ jsx14("div", _object_spread({
|
|
3450
3580
|
ref: forwardedRef,
|
|
3451
3581
|
className: cn("px-2 py-4 text-center text-sm", className),
|
|
3452
3582
|
"cmdk-empty": "",
|
|
@@ -3725,7 +3855,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3725
3855
|
})) {
|
|
3726
3856
|
return void 0;
|
|
3727
3857
|
}
|
|
3728
|
-
var Item = /* @__PURE__ */
|
|
3858
|
+
var Item = /* @__PURE__ */ jsx14(CommandItem, {
|
|
3729
3859
|
value: inputValue,
|
|
3730
3860
|
className: "cursor-pointer",
|
|
3731
3861
|
onMouseDown: function(e) {
|
|
@@ -3760,14 +3890,14 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3760
3890
|
var EmptyItem = useCallback3(function() {
|
|
3761
3891
|
if (!emptyIndicator) return void 0;
|
|
3762
3892
|
if (onSearch && !createNewOptionLabel && Object.keys(options).length === 0) {
|
|
3763
|
-
return /* @__PURE__ */
|
|
3893
|
+
return /* @__PURE__ */ jsx14(CommandItem, {
|
|
3764
3894
|
className: "",
|
|
3765
3895
|
value: "-",
|
|
3766
3896
|
disabled: true,
|
|
3767
3897
|
children: emptyIndicator
|
|
3768
3898
|
});
|
|
3769
3899
|
}
|
|
3770
|
-
return /* @__PURE__ */
|
|
3900
|
+
return /* @__PURE__ */ jsx14(CommandEmpty2, {
|
|
3771
3901
|
className: emptyIndicatorClassName,
|
|
3772
3902
|
children: emptyIndicator
|
|
3773
3903
|
});
|
|
@@ -3798,7 +3928,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3798
3928
|
createNewOptionLabel,
|
|
3799
3929
|
commandProps === null || commandProps === void 0 ? void 0 : commandProps.filter
|
|
3800
3930
|
]);
|
|
3801
|
-
return /* @__PURE__ */
|
|
3931
|
+
return /* @__PURE__ */ jsxs9(Command, _object_spread_props(_object_spread({}, commandProps), {
|
|
3802
3932
|
onKeyDown: function(e) {
|
|
3803
3933
|
var _commandProps_onKeyDown;
|
|
3804
3934
|
handleKeyDown(e);
|
|
@@ -3808,7 +3938,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3808
3938
|
shouldFilter: (commandProps === null || commandProps === void 0 ? void 0 : commandProps.shouldFilter) !== void 0 ? commandProps.shouldFilter : !onSearch,
|
|
3809
3939
|
filter: commandFilter(),
|
|
3810
3940
|
children: [
|
|
3811
|
-
/* @__PURE__ */
|
|
3941
|
+
/* @__PURE__ */ jsx14("div", {
|
|
3812
3942
|
ref: setContainerRef,
|
|
3813
3943
|
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", {
|
|
3814
3944
|
"p-1": selected.length !== 0,
|
|
@@ -3819,11 +3949,11 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3819
3949
|
if (disabled) return;
|
|
3820
3950
|
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
3821
3951
|
},
|
|
3822
|
-
children: /* @__PURE__ */
|
|
3952
|
+
children: /* @__PURE__ */ jsxs9("div", {
|
|
3823
3953
|
className: "flex flex-wrap gap-1",
|
|
3824
3954
|
children: [
|
|
3825
3955
|
selected.map(function(option) {
|
|
3826
|
-
return /* @__PURE__ */
|
|
3956
|
+
return /* @__PURE__ */ jsxs9("div", {
|
|
3827
3957
|
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),
|
|
3828
3958
|
"data-fixed": option.fixed,
|
|
3829
3959
|
"data-disabled": disabled || void 0,
|
|
@@ -3831,7 +3961,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3831
3961
|
option.label,
|
|
3832
3962
|
!unremovableOptions.find(function(v) {
|
|
3833
3963
|
return isEqual4(v.value, option.value);
|
|
3834
|
-
}) && /* @__PURE__ */
|
|
3964
|
+
}) && /* @__PURE__ */ jsx14("button", {
|
|
3835
3965
|
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",
|
|
3836
3966
|
onKeyDown: function(e) {
|
|
3837
3967
|
if (e.key === "Enter") {
|
|
@@ -3846,7 +3976,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3846
3976
|
return handleUnselect(option);
|
|
3847
3977
|
},
|
|
3848
3978
|
"aria-label": "Remove",
|
|
3849
|
-
children: /* @__PURE__ */
|
|
3979
|
+
children: /* @__PURE__ */ jsx14(X2, {
|
|
3850
3980
|
size: 14,
|
|
3851
3981
|
strokeWidth: 2,
|
|
3852
3982
|
"aria-hidden": "true"
|
|
@@ -3855,7 +3985,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3855
3985
|
]
|
|
3856
3986
|
}, option.value);
|
|
3857
3987
|
}),
|
|
3858
|
-
/* @__PURE__ */
|
|
3988
|
+
/* @__PURE__ */ jsx14(CommandPrimitive2.Input, _object_spread_props(_object_spread({}, inputProps), {
|
|
3859
3989
|
ref: inputRef,
|
|
3860
3990
|
value: inputValue,
|
|
3861
3991
|
disabled: disabled,
|
|
@@ -3886,7 +4016,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3886
4016
|
"ml-1": selected.length !== 0
|
|
3887
4017
|
}, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className)
|
|
3888
4018
|
})),
|
|
3889
|
-
/* @__PURE__ */
|
|
4019
|
+
/* @__PURE__ */ jsx14("button", {
|
|
3890
4020
|
type: "button",
|
|
3891
4021
|
onClick: function() {
|
|
3892
4022
|
setSelected(selected.filter(function(s) {
|
|
@@ -3900,7 +4030,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3900
4030
|
return s.fixed;
|
|
3901
4031
|
}).length === selected.length) && "hidden"),
|
|
3902
4032
|
"aria-label": "Clear all",
|
|
3903
|
-
children: /* @__PURE__ */
|
|
4033
|
+
children: /* @__PURE__ */ jsx14(X2, {
|
|
3904
4034
|
size: 16,
|
|
3905
4035
|
strokeWidth: 2,
|
|
3906
4036
|
"aria-hidden": "true"
|
|
@@ -3909,8 +4039,8 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3909
4039
|
]
|
|
3910
4040
|
})
|
|
3911
4041
|
}),
|
|
3912
|
-
open && /* @__PURE__ */
|
|
3913
|
-
children: /* @__PURE__ */
|
|
4042
|
+
open && /* @__PURE__ */ jsx14(Portal2, {
|
|
4043
|
+
children: /* @__PURE__ */ jsx14("div", {
|
|
3914
4044
|
ref: combinedFloatingRef,
|
|
3915
4045
|
style: {
|
|
3916
4046
|
position: strategy,
|
|
@@ -3920,7 +4050,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3920
4050
|
},
|
|
3921
4051
|
className: cn("z-[9999] overflow-hidden rounded-lg border border-input", dropdownContainerClassName),
|
|
3922
4052
|
"data-state": open ? "open" : "closed",
|
|
3923
|
-
children: /* @__PURE__ */
|
|
4053
|
+
children: /* @__PURE__ */ jsx14(CommandList, {
|
|
3924
4054
|
className: "bg-popover text-popover-foreground shadow-lg shadow-black/5 outline-none",
|
|
3925
4055
|
onMouseLeave: function() {
|
|
3926
4056
|
setOnScrollbar(false);
|
|
@@ -3932,23 +4062,23 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3932
4062
|
var _inputRef_current;
|
|
3933
4063
|
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
3934
4064
|
},
|
|
3935
|
-
children: isLoading ? /* @__PURE__ */
|
|
4065
|
+
children: isLoading ? /* @__PURE__ */ jsx14(Fragment2, {
|
|
3936
4066
|
children: loadingIndicator
|
|
3937
|
-
}) : /* @__PURE__ */
|
|
4067
|
+
}) : /* @__PURE__ */ jsxs9(Fragment2, {
|
|
3938
4068
|
children: [
|
|
3939
4069
|
EmptyItem(),
|
|
3940
4070
|
CreatableItem(),
|
|
3941
|
-
!selectFirstItem && /* @__PURE__ */
|
|
4071
|
+
!selectFirstItem && /* @__PURE__ */ jsx14(CommandItem, {
|
|
3942
4072
|
value: "-",
|
|
3943
4073
|
className: "hidden"
|
|
3944
4074
|
}),
|
|
3945
4075
|
Object.entries(selectables).map(function(param) {
|
|
3946
4076
|
var _param = _sliced_to_array(param, 2), key = _param[0], dropdowns = _param[1];
|
|
3947
|
-
return /* @__PURE__ */
|
|
4077
|
+
return /* @__PURE__ */ jsx14(CommandGroup, {
|
|
3948
4078
|
heading: key,
|
|
3949
4079
|
className: cn("h-full overflow-auto", dropdownClassName),
|
|
3950
4080
|
children: dropdowns.map(function(option) {
|
|
3951
|
-
return /* @__PURE__ */
|
|
4081
|
+
return /* @__PURE__ */ jsx14(CommandItem, {
|
|
3952
4082
|
value: option.value,
|
|
3953
4083
|
disabled: option.disable,
|
|
3954
4084
|
onMouseDown: function(e) {
|
|
@@ -3979,7 +4109,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
3979
4109
|
})
|
|
3980
4110
|
})
|
|
3981
4111
|
}),
|
|
3982
|
-
/* @__PURE__ */
|
|
4112
|
+
/* @__PURE__ */ jsx14("input", {
|
|
3983
4113
|
value: JSON.stringify(selected),
|
|
3984
4114
|
type: "hidden",
|
|
3985
4115
|
name: name
|
|
@@ -3991,16 +4121,16 @@ MultipleSelector.displayName = "MultipleSelector";
|
|
|
3991
4121
|
var multiselect_default = MultipleSelector;
|
|
3992
4122
|
// src/components/ui/popover.tsx
|
|
3993
4123
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3994
|
-
import { jsx as
|
|
4124
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3995
4125
|
function Popover(_param) {
|
|
3996
4126
|
var props = _extends({}, _object_destructuring_empty(_param));
|
|
3997
|
-
return /* @__PURE__ */
|
|
4127
|
+
return /* @__PURE__ */ jsx15(PopoverPrimitive.Root, _object_spread({
|
|
3998
4128
|
"data-slot": "popover"
|
|
3999
4129
|
}, props));
|
|
4000
4130
|
}
|
|
4001
4131
|
function PopoverTrigger(_param) {
|
|
4002
4132
|
var props = _extends({}, _object_destructuring_empty(_param));
|
|
4003
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ jsx15(PopoverPrimitive.Trigger, _object_spread({
|
|
4004
4134
|
"data-slot": "popover-trigger"
|
|
4005
4135
|
}, props));
|
|
4006
4136
|
}
|
|
@@ -4011,8 +4141,8 @@ function PopoverContent(_param) {
|
|
|
4011
4141
|
"sideOffset",
|
|
4012
4142
|
"showArrow"
|
|
4013
4143
|
]);
|
|
4014
|
-
return /* @__PURE__ */
|
|
4015
|
-
children: /* @__PURE__ */
|
|
4144
|
+
return /* @__PURE__ */ jsx15(PopoverPrimitive.Portal, {
|
|
4145
|
+
children: /* @__PURE__ */ jsxs10(PopoverPrimitive.Content, _object_spread_props(_object_spread({
|
|
4016
4146
|
"data-slot": "popover-content",
|
|
4017
4147
|
align: align,
|
|
4018
4148
|
sideOffset: sideOffset,
|
|
@@ -4020,7 +4150,7 @@ function PopoverContent(_param) {
|
|
|
4020
4150
|
}, props), {
|
|
4021
4151
|
children: [
|
|
4022
4152
|
props.children,
|
|
4023
|
-
showArrow && /* @__PURE__ */
|
|
4153
|
+
showArrow && /* @__PURE__ */ jsx15(PopoverPrimitive.Arrow, {
|
|
4024
4154
|
className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]"
|
|
4025
4155
|
})
|
|
4026
4156
|
]
|
|
@@ -4029,15 +4159,15 @@ function PopoverContent(_param) {
|
|
|
4029
4159
|
}
|
|
4030
4160
|
// src/components/ui/SearchSelect.tsx
|
|
4031
4161
|
import { CheckIcon, ChevronDownIcon } from "lucide-react";
|
|
4032
|
-
import { useCallback as useCallback4, useEffect as useEffect5, useId, useMemo as useMemo5, useState as
|
|
4033
|
-
import { jsx as
|
|
4162
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useId, useMemo as useMemo5, useState as useState5 } from "react";
|
|
4163
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4034
4164
|
function SearchSelect(param) {
|
|
4035
4165
|
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;
|
|
4036
4166
|
var id = useId();
|
|
4037
|
-
var
|
|
4038
|
-
var
|
|
4039
|
-
var
|
|
4040
|
-
var
|
|
4167
|
+
var _useState5 = _sliced_to_array(useState5(false), 2), open = _useState5[0], setOpen = _useState5[1];
|
|
4168
|
+
var _useState51 = _sliced_to_array(useState5(value || defaultValue || ""), 2), selectedValue = _useState51[0], setSelectedValue = _useState51[1];
|
|
4169
|
+
var _useState52 = _sliced_to_array(useState5(""), 2), searchQuery = _useState52[0], setSearchQuery = _useState52[1];
|
|
4170
|
+
var _useState53 = _sliced_to_array(useState5([]), 2), newOptions = _useState53[0], setNewOptions = _useState53[1];
|
|
4041
4171
|
useEffect5(function() {
|
|
4042
4172
|
setSelectedValue(value);
|
|
4043
4173
|
}, [
|
|
@@ -4088,22 +4218,22 @@ function SearchSelect(param) {
|
|
|
4088
4218
|
}, [
|
|
4089
4219
|
searchQuery
|
|
4090
4220
|
]);
|
|
4091
|
-
return /* @__PURE__ */
|
|
4221
|
+
return /* @__PURE__ */ jsxs11("div", {
|
|
4092
4222
|
style: {
|
|
4093
4223
|
direction: direction
|
|
4094
4224
|
},
|
|
4095
4225
|
className: cn("w-full", elementClassName),
|
|
4096
4226
|
children: [
|
|
4097
|
-
/* @__PURE__ */
|
|
4227
|
+
/* @__PURE__ */ jsxs11(Popover, {
|
|
4098
4228
|
open: open,
|
|
4099
4229
|
onOpenChange: function(isOpen) {
|
|
4100
4230
|
setOpen(isOpen);
|
|
4101
4231
|
if (!isOpen) setSearchQuery("");
|
|
4102
4232
|
},
|
|
4103
4233
|
children: [
|
|
4104
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ jsx16(PopoverTrigger, {
|
|
4105
4235
|
asChild: true,
|
|
4106
|
-
children: /* @__PURE__ */
|
|
4236
|
+
children: /* @__PURE__ */ jsxs11(Button, {
|
|
4107
4237
|
id: id,
|
|
4108
4238
|
variant: "outline",
|
|
4109
4239
|
role: "combobox",
|
|
@@ -4111,11 +4241,11 @@ function SearchSelect(param) {
|
|
|
4111
4241
|
disabled: disabled,
|
|
4112
4242
|
className: cn("border-input w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px]", buttonClassName, open && buttonFocusClassName),
|
|
4113
4243
|
children: [
|
|
4114
|
-
/* @__PURE__ */
|
|
4244
|
+
/* @__PURE__ */ jsx16("span", {
|
|
4115
4245
|
className: cn("truncate", !selectedValue && "text-muted-foreground"),
|
|
4116
4246
|
children: selectLabel
|
|
4117
4247
|
}),
|
|
4118
|
-
/* @__PURE__ */
|
|
4248
|
+
/* @__PURE__ */ jsx16(ChevronDownIcon, {
|
|
4119
4249
|
size: 16,
|
|
4120
4250
|
className: "text-muted-foreground/80 shrink-0",
|
|
4121
4251
|
"aria-hidden": "true"
|
|
@@ -4123,12 +4253,12 @@ function SearchSelect(param) {
|
|
|
4123
4253
|
]
|
|
4124
4254
|
})
|
|
4125
4255
|
}),
|
|
4126
|
-
/* @__PURE__ */
|
|
4256
|
+
/* @__PURE__ */ jsx16(PopoverContent, {
|
|
4127
4257
|
className: cn("border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 bg-[#fff]"),
|
|
4128
4258
|
align: "start",
|
|
4129
|
-
children: /* @__PURE__ */
|
|
4259
|
+
children: /* @__PURE__ */ jsxs11(Command, {
|
|
4130
4260
|
children: [
|
|
4131
|
-
/* @__PURE__ */
|
|
4261
|
+
/* @__PURE__ */ jsx16(CommandInput, {
|
|
4132
4262
|
style: {
|
|
4133
4263
|
direction: direction
|
|
4134
4264
|
},
|
|
@@ -4144,24 +4274,24 @@ function SearchSelect(param) {
|
|
|
4144
4274
|
}
|
|
4145
4275
|
}
|
|
4146
4276
|
}),
|
|
4147
|
-
/* @__PURE__ */
|
|
4148
|
-
children: filteredOptions.length === 0 && searchQuery !== "" ? createNewOptionLabel ? /* @__PURE__ */
|
|
4277
|
+
/* @__PURE__ */ jsx16(CommandList, {
|
|
4278
|
+
children: filteredOptions.length === 0 && searchQuery !== "" ? createNewOptionLabel ? /* @__PURE__ */ jsx16(CommandEmpty, {
|
|
4149
4279
|
style: {
|
|
4150
4280
|
direction: direction
|
|
4151
4281
|
},
|
|
4152
4282
|
onClick: addNewOption,
|
|
4153
4283
|
className: cn("hover:bg-[#cccbcb] cursor-pointer w-full", createNewOptionContainerClassName),
|
|
4154
|
-
children: /* @__PURE__ */
|
|
4284
|
+
children: /* @__PURE__ */ jsx16("div", {
|
|
4155
4285
|
className: cn("w-full h-10 flex items-center px-2", notFoundLabelClassName),
|
|
4156
4286
|
children: "".concat(createNewOptionLabel, " : ").concat(searchQuery)
|
|
4157
4287
|
})
|
|
4158
|
-
}) : /* @__PURE__ */
|
|
4288
|
+
}) : /* @__PURE__ */ jsx16(CommandEmpty, {
|
|
4159
4289
|
className: cn("w-full py-2 text-center", notFoundLabelClassName),
|
|
4160
4290
|
children: notFoundLabel
|
|
4161
|
-
}) : /* @__PURE__ */
|
|
4291
|
+
}) : /* @__PURE__ */ jsx16(CommandGroup, {
|
|
4162
4292
|
className: cn("max-h-52 overflow-y-auto", dropdownClassName),
|
|
4163
4293
|
children: filteredOptions.map(function(option) {
|
|
4164
|
-
return /* @__PURE__ */
|
|
4294
|
+
return /* @__PURE__ */ jsxs11(CommandItem, {
|
|
4165
4295
|
className: cn("hover:bg-[#cccbcb] cursor-pointer", dropdownOptionClassName, selectedValue === option.value && "bg-[#cccbcb]"),
|
|
4166
4296
|
value: JSON.stringify(option),
|
|
4167
4297
|
onSelect: function(currentValue) {
|
|
@@ -4173,7 +4303,7 @@ function SearchSelect(param) {
|
|
|
4173
4303
|
},
|
|
4174
4304
|
children: [
|
|
4175
4305
|
option.label,
|
|
4176
|
-
selectedValue === option.value && /* @__PURE__ */
|
|
4306
|
+
selectedValue === option.value && /* @__PURE__ */ jsx16(CheckIcon, {
|
|
4177
4307
|
size: 16,
|
|
4178
4308
|
className: "ml-auto"
|
|
4179
4309
|
})
|
|
@@ -4187,7 +4317,7 @@ function SearchSelect(param) {
|
|
|
4187
4317
|
})
|
|
4188
4318
|
]
|
|
4189
4319
|
}),
|
|
4190
|
-
/* @__PURE__ */
|
|
4320
|
+
/* @__PURE__ */ jsx16("input", {
|
|
4191
4321
|
name: name,
|
|
4192
4322
|
type: "hidden",
|
|
4193
4323
|
value: selectedValue
|
|
@@ -4196,7 +4326,7 @@ function SearchSelect(param) {
|
|
|
4196
4326
|
});
|
|
4197
4327
|
}
|
|
4198
4328
|
// src/components/table/components.tsx
|
|
4199
|
-
import { Fragment as Fragment3, jsx as
|
|
4329
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4200
4330
|
var getFixedNumber = function() {
|
|
4201
4331
|
var number = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, fix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 4;
|
|
4202
4332
|
var sum_value = number % 1 === 0 ? number : number.toFixed(fix).replace(/\.?0+$/, "");
|
|
@@ -4206,14 +4336,14 @@ var TableRow2 = function(param) {
|
|
|
4206
4336
|
var item = param.item, index2 = param.index;
|
|
4207
4337
|
var _useTableContext = useTableContext(), rowStyles = _useTableContext.rowStyles, rowClassName = _useTableContext.rowClassName, keysToRender = _useTableContext.keysToRender, onRowClick = _useTableContext.onRowClick, zebraStriping = _useTableContext.zebraStriping;
|
|
4208
4338
|
var zebraClassName = zebraStriping ? index2 % 2 === 0 ? zebraStriping.evenRowClassName || "" : zebraStriping.oddRowClassName || "bg-gray-300" : "";
|
|
4209
|
-
return /* @__PURE__ */
|
|
4339
|
+
return /* @__PURE__ */ jsx17("tr", {
|
|
4210
4340
|
className: cn("hover:bg-[#808080] hover:text-[#fff]", zebraClassName, rowClassName || ""),
|
|
4211
4341
|
onClick: function() {
|
|
4212
4342
|
return onRowClick && onRowClick(item);
|
|
4213
4343
|
},
|
|
4214
4344
|
style: rowStyles,
|
|
4215
4345
|
children: keysToRender.map(function(key, index3) {
|
|
4216
|
-
return /* @__PURE__ */
|
|
4346
|
+
return /* @__PURE__ */ jsx17(TableCell, {
|
|
4217
4347
|
value: item[key]
|
|
4218
4348
|
}, index3);
|
|
4219
4349
|
})
|
|
@@ -4222,7 +4352,7 @@ var TableRow2 = function(param) {
|
|
|
4222
4352
|
var TableCell = function(param) {
|
|
4223
4353
|
var value = param.value;
|
|
4224
4354
|
var _useTableContext = useTableContext(), cellStyle = _useTableContext.cellStyle, cellClassName = _useTableContext.cellClassName;
|
|
4225
|
-
return /* @__PURE__ */
|
|
4355
|
+
return /* @__PURE__ */ jsx17("td", {
|
|
4226
4356
|
title: [
|
|
4227
4357
|
"string",
|
|
4228
4358
|
"number",
|
|
@@ -4238,55 +4368,55 @@ var Filter = memo(function(param) {
|
|
|
4238
4368
|
var _filters_filterableColumn_dataKey, _filters_filterableColumn_dataKey1, _filterOptions_filterableColumn_dataKey;
|
|
4239
4369
|
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;
|
|
4240
4370
|
var displayRight = direction === "rtl" && index2 === headers.length - 1 || direction === "ltr" && index2 !== headers.length - 1;
|
|
4241
|
-
return /* @__PURE__ */
|
|
4371
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
4242
4372
|
className: "absolute top-1 right-1 ",
|
|
4243
4373
|
children: [
|
|
4244
|
-
/* @__PURE__ */
|
|
4374
|
+
/* @__PURE__ */ jsx17("button", {
|
|
4245
4375
|
title: filterLabel + " " + filterableColumn.header,
|
|
4246
4376
|
className: "text-[12px]",
|
|
4247
4377
|
onClick: function() {
|
|
4248
4378
|
return handleFilterClick(filterableColumn.dataKey);
|
|
4249
4379
|
},
|
|
4250
|
-
children: filterPopupsDisplay === filterableColumn.dataKey ? /* @__PURE__ */
|
|
4251
|
-
children: ((_filters_filterableColumn_dataKey = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey === void 0 ? void 0 : _filters_filterableColumn_dataKey.length) > 0 ? /* @__PURE__ */
|
|
4380
|
+
children: filterPopupsDisplay === filterableColumn.dataKey ? /* @__PURE__ */ jsx17(Fragment3, {
|
|
4381
|
+
children: ((_filters_filterableColumn_dataKey = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey === void 0 ? void 0 : _filters_filterableColumn_dataKey.length) > 0 ? /* @__PURE__ */ jsx17(Fragment3, {
|
|
4252
4382
|
children: slashFilterSvg(true)
|
|
4253
|
-
}) : /* @__PURE__ */
|
|
4383
|
+
}) : /* @__PURE__ */ jsx17(Fragment3, {
|
|
4254
4384
|
children: emptyFilterSvg(true)
|
|
4255
4385
|
})
|
|
4256
|
-
}) : /* @__PURE__ */
|
|
4257
|
-
children: ((_filters_filterableColumn_dataKey1 = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey1 === void 0 ? void 0 : _filters_filterableColumn_dataKey1.length) > 0 ? /* @__PURE__ */
|
|
4386
|
+
}) : /* @__PURE__ */ jsx17(Fragment3, {
|
|
4387
|
+
children: ((_filters_filterableColumn_dataKey1 = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey1 === void 0 ? void 0 : _filters_filterableColumn_dataKey1.length) > 0 ? /* @__PURE__ */ jsx17(Fragment3, {
|
|
4258
4388
|
children: slashFilterSvg()
|
|
4259
|
-
}) : /* @__PURE__ */
|
|
4389
|
+
}) : /* @__PURE__ */ jsx17(Fragment3, {
|
|
4260
4390
|
children: emptyFilterSvg()
|
|
4261
4391
|
})
|
|
4262
4392
|
})
|
|
4263
4393
|
}),
|
|
4264
|
-
/* @__PURE__ */
|
|
4394
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4265
4395
|
className: "relative",
|
|
4266
|
-
children: filterPopupsDisplay === filterableColumn.dataKey && /* @__PURE__ */
|
|
4396
|
+
children: filterPopupsDisplay === filterableColumn.dataKey && /* @__PURE__ */ jsxs12("div", {
|
|
4267
4397
|
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"),
|
|
4268
4398
|
children: [
|
|
4269
|
-
/* @__PURE__ */
|
|
4399
|
+
/* @__PURE__ */ jsxs12("div", {
|
|
4270
4400
|
className: "flex justify-between items-center border-black border-b-[1px] w-[90%]",
|
|
4271
4401
|
children: [
|
|
4272
|
-
/* @__PURE__ */
|
|
4402
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4273
4403
|
className: "text-start",
|
|
4274
4404
|
children: filterLabel + " " + filterableColumn.header
|
|
4275
4405
|
}),
|
|
4276
|
-
/* @__PURE__ */
|
|
4406
|
+
/* @__PURE__ */ jsx17("button", {
|
|
4277
4407
|
onClick: closeFilterWindow,
|
|
4278
|
-
children: /* @__PURE__ */
|
|
4408
|
+
children: /* @__PURE__ */ jsx17(RedXSvg2, {})
|
|
4279
4409
|
})
|
|
4280
4410
|
]
|
|
4281
4411
|
}),
|
|
4282
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4283
4413
|
className: "overflow-auto h-[80%] flex flex-col gap-1 w-full cursor-pointer ",
|
|
4284
4414
|
children: (_filterOptions_filterableColumn_dataKey = filterOptions[filterableColumn.dataKey]) === null || _filterOptions_filterableColumn_dataKey === void 0 ? void 0 : _filterOptions_filterableColumn_dataKey.map(function(option, i) {
|
|
4285
4415
|
var _filters_filterableColumn_dataKey;
|
|
4286
|
-
return /* @__PURE__ */
|
|
4416
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
4287
4417
|
className: "flex items-center px-2 justify-start hover:bg-[#547f22] hover:text-white",
|
|
4288
4418
|
children: [
|
|
4289
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ jsx17("input", {
|
|
4290
4420
|
type: "checkbox",
|
|
4291
4421
|
className: "cursor-pointer",
|
|
4292
4422
|
checked: (_filters_filterableColumn_dataKey = filters[filterableColumn.dataKey]) === null || _filters_filterableColumn_dataKey === void 0 ? void 0 : _filters_filterableColumn_dataKey.includes(option),
|
|
@@ -4294,7 +4424,7 @@ var Filter = memo(function(param) {
|
|
|
4294
4424
|
return handleFilterChange(filterableColumn.dataKey, option);
|
|
4295
4425
|
}
|
|
4296
4426
|
}),
|
|
4297
|
-
/* @__PURE__ */
|
|
4427
|
+
/* @__PURE__ */ jsx17("button", {
|
|
4298
4428
|
className: "flex-1 text-start px-2",
|
|
4299
4429
|
onClick: function() {
|
|
4300
4430
|
return handleFilterChange(filterableColumn.dataKey, option);
|
|
@@ -4318,32 +4448,32 @@ var TableHead = memo(function() {
|
|
|
4318
4448
|
}, [
|
|
4319
4449
|
sortKeys
|
|
4320
4450
|
]);
|
|
4321
|
-
return /* @__PURE__ */
|
|
4451
|
+
return /* @__PURE__ */ jsx17("thead", {
|
|
4322
4452
|
className: cn("bg-[#282828] text-white sticky top-0", headerClassName),
|
|
4323
|
-
children: /* @__PURE__ */
|
|
4453
|
+
children: /* @__PURE__ */ jsx17("tr", {
|
|
4324
4454
|
style: headerStyle,
|
|
4325
4455
|
children: headers.map(function(header, index2) {
|
|
4326
4456
|
var filterableColumn = filterableColumns.find(function(col) {
|
|
4327
4457
|
return col.header === header;
|
|
4328
4458
|
});
|
|
4329
|
-
return /* @__PURE__ */
|
|
4459
|
+
return /* @__PURE__ */ jsxs12("th", {
|
|
4330
4460
|
title: sortDisplay ? "".concat(sortLabel, " ").concat(header) : header,
|
|
4331
4461
|
style: headerCellStyle,
|
|
4332
4462
|
className: cn("border-black border-[1px] max-w-[130px] px-2 text-center relative", headerCellClassName),
|
|
4333
4463
|
children: [
|
|
4334
|
-
/* @__PURE__ */
|
|
4464
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4335
4465
|
className: "px-2 ".concat(sortDisplay ? "cursor-pointer" : ""),
|
|
4336
4466
|
onClick: function() {
|
|
4337
4467
|
return sortDisplay && handleSort(index2);
|
|
4338
4468
|
},
|
|
4339
4469
|
children: header
|
|
4340
4470
|
}),
|
|
4341
|
-
sortDisplay && sortColumn === index2 && (sortOrder === "desc" ? /* @__PURE__ */
|
|
4471
|
+
sortDisplay && sortColumn === index2 && (sortOrder === "desc" ? /* @__PURE__ */ jsx17(Fragment3, {
|
|
4342
4472
|
children: sortSvg()
|
|
4343
|
-
}) : /* @__PURE__ */
|
|
4473
|
+
}) : /* @__PURE__ */ jsx17(Fragment3, {
|
|
4344
4474
|
children: sortSvg(true)
|
|
4345
4475
|
})),
|
|
4346
|
-
filterableColumn && /* @__PURE__ */
|
|
4476
|
+
filterableColumn && /* @__PURE__ */ jsx17(Filter, {
|
|
4347
4477
|
filterableColumn: filterableColumn,
|
|
4348
4478
|
index: index2
|
|
4349
4479
|
})
|
|
@@ -4355,10 +4485,10 @@ var TableHead = memo(function() {
|
|
|
4355
4485
|
}, renderOnce);
|
|
4356
4486
|
var TableBody = memo(function() {
|
|
4357
4487
|
var dataToRender = useTableContext().dataToRender;
|
|
4358
|
-
return /* @__PURE__ */
|
|
4488
|
+
return /* @__PURE__ */ jsx17("tbody", {
|
|
4359
4489
|
className: "divide-y divide-gray-600",
|
|
4360
4490
|
children: dataToRender.renderedData.map(function(item, index2) {
|
|
4361
|
-
return /* @__PURE__ */
|
|
4491
|
+
return /* @__PURE__ */ jsx17(TableRow2, {
|
|
4362
4492
|
item: item,
|
|
4363
4493
|
index: index2
|
|
4364
4494
|
}, index2);
|
|
@@ -4367,19 +4497,19 @@ var TableBody = memo(function() {
|
|
|
4367
4497
|
}, renderOnce);
|
|
4368
4498
|
var MaxRowsLabel = memo(function() {
|
|
4369
4499
|
var _useTableContext = useTableContext(), data = _useTableContext.data, dataToRender = _useTableContext.dataToRender, maxRowsLabel1 = _useTableContext.maxRowsLabel1, maxRowsLabel2 = _useTableContext.maxRowsLabel2, maxRows = _useTableContext.maxRows, maxRowsContainerClassName = _useTableContext.maxRowsContainerClassName;
|
|
4370
|
-
return /* @__PURE__ */
|
|
4500
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
4371
4501
|
className: cn("flex justify-start items-center text-lg gap-1", maxRowsContainerClassName || ""),
|
|
4372
4502
|
children: [
|
|
4373
|
-
/* @__PURE__ */
|
|
4503
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4374
4504
|
children: maxRowsLabel1
|
|
4375
4505
|
}),
|
|
4376
|
-
/* @__PURE__ */
|
|
4506
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4377
4507
|
children: maxRows > dataToRender.renderedData.length ? dataToRender.renderedData.length : maxRows
|
|
4378
4508
|
}),
|
|
4379
|
-
/* @__PURE__ */
|
|
4509
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4380
4510
|
children: maxRowsLabel2
|
|
4381
4511
|
}),
|
|
4382
|
-
/* @__PURE__ */
|
|
4512
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4383
4513
|
children: dataToRender.filtered.length
|
|
4384
4514
|
})
|
|
4385
4515
|
]
|
|
@@ -4458,7 +4588,7 @@ var ExportToExcel = memo(function() {
|
|
|
4458
4588
|
return _ref.apply(this, arguments);
|
|
4459
4589
|
};
|
|
4460
4590
|
}();
|
|
4461
|
-
return /* @__PURE__ */
|
|
4591
|
+
return /* @__PURE__ */ jsx17("button", {
|
|
4462
4592
|
onClick: onExportExcelClick,
|
|
4463
4593
|
title: exportExcelTitle,
|
|
4464
4594
|
className: cn("px-2 py-[2px] bg-[#547f22] text-white rounded-lg text-[16px]", exportToExcelClassName),
|
|
@@ -4467,7 +4597,7 @@ var ExportToExcel = memo(function() {
|
|
|
4467
4597
|
}, renderOnce);
|
|
4468
4598
|
var Search = memo(function() {
|
|
4469
4599
|
var _useTableContext = useTableContext(), searchQuery = _useTableContext.searchQuery, handleSearch = _useTableContext.handleSearch, searchPlaceHolder = _useTableContext.searchPlaceHolder, searchInputClassName = _useTableContext.searchInputClassName, searchInputStyle = _useTableContext.searchInputStyle;
|
|
4470
|
-
return /* @__PURE__ */
|
|
4600
|
+
return /* @__PURE__ */ jsx17("input", {
|
|
4471
4601
|
className: cn("w-40 border-black border-[1px] text-lg px-2 ", searchInputClassName),
|
|
4472
4602
|
type: "text",
|
|
4473
4603
|
placeholder: searchPlaceHolder,
|
|
@@ -4478,17 +4608,17 @@ var Search = memo(function() {
|
|
|
4478
4608
|
}, renderOnce);
|
|
4479
4609
|
var Summary = memo(function() {
|
|
4480
4610
|
var _useTableContext = useTableContext(), summaryContainerStyle = _useTableContext.summaryContainerStyle, summaryLabelStyle = _useTableContext.summaryLabelStyle, summaryLabel = _useTableContext.summaryLabel, summaryRowStyle = _useTableContext.summaryRowStyle, sumColumns = _useTableContext.sumColumns, dataToRender = _useTableContext.dataToRender, direction = _useTableContext.direction;
|
|
4481
|
-
return /* @__PURE__ */
|
|
4611
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
4482
4612
|
style: _object_spread_props(_object_spread({}, summaryContainerStyle), {
|
|
4483
4613
|
direction: direction
|
|
4484
4614
|
}),
|
|
4485
4615
|
className: "w-full h-8 flex justify-between items-center px-3 text-[18px] font-bold",
|
|
4486
4616
|
children: [
|
|
4487
|
-
/* @__PURE__ */
|
|
4617
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4488
4618
|
style: summaryLabelStyle,
|
|
4489
4619
|
children: summaryLabel
|
|
4490
4620
|
}),
|
|
4491
|
-
/* @__PURE__ */
|
|
4621
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4492
4622
|
style: summaryRowStyle,
|
|
4493
4623
|
className: "flex gap-3",
|
|
4494
4624
|
children: sumColumns.map(function(val) {
|
|
@@ -4496,16 +4626,16 @@ var Summary = memo(function() {
|
|
|
4496
4626
|
return acc + Number(v[val.dataKey]) || 0;
|
|
4497
4627
|
}, 0);
|
|
4498
4628
|
var sum_value = getFixedNumber(sum_res);
|
|
4499
|
-
return /* @__PURE__ */
|
|
4629
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
4500
4630
|
className: "flex gap-1 justify-start",
|
|
4501
4631
|
children: [
|
|
4502
|
-
/* @__PURE__ */
|
|
4632
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4503
4633
|
children: val.label
|
|
4504
4634
|
}),
|
|
4505
|
-
/* @__PURE__ */
|
|
4635
|
+
/* @__PURE__ */ jsx17("span", {
|
|
4506
4636
|
children: ":"
|
|
4507
4637
|
}),
|
|
4508
|
-
/* @__PURE__ */
|
|
4638
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4509
4639
|
children: val.ui ? val.ui(sum_value) : sum_value
|
|
4510
4640
|
})
|
|
4511
4641
|
]
|
|
@@ -4522,7 +4652,7 @@ var TimesUI = function(param) {
|
|
|
4522
4652
|
fromFormat: fromFormat,
|
|
4523
4653
|
tz: tz
|
|
4524
4654
|
});
|
|
4525
|
-
return /* @__PURE__ */
|
|
4655
|
+
return /* @__PURE__ */ jsx17("div", {
|
|
4526
4656
|
style: {
|
|
4527
4657
|
direction: "ltr"
|
|
4528
4658
|
},
|
|
@@ -4538,22 +4668,22 @@ var TableButton = function(param) {
|
|
|
4538
4668
|
edit: "fa-light fa-pen-to-square text-xl",
|
|
4539
4669
|
delete: "fa-light fa-trash text-xl"
|
|
4540
4670
|
};
|
|
4541
|
-
return /* @__PURE__ */
|
|
4542
|
-
children: type === "custom" ? /* @__PURE__ */
|
|
4671
|
+
return /* @__PURE__ */ jsx17(Fragment3, {
|
|
4672
|
+
children: type === "custom" ? /* @__PURE__ */ jsx17("button", {
|
|
4543
4673
|
className: className,
|
|
4544
4674
|
title: title,
|
|
4545
4675
|
onClick: onClick,
|
|
4546
4676
|
children: children
|
|
4547
|
-
}) : type === "add" ? /* @__PURE__ */
|
|
4677
|
+
}) : type === "add" ? /* @__PURE__ */ jsx17(Button, {
|
|
4548
4678
|
title: title,
|
|
4549
4679
|
onClick: onClick,
|
|
4550
|
-
children: /* @__PURE__ */
|
|
4680
|
+
children: /* @__PURE__ */ jsx17("i", {
|
|
4551
4681
|
className: cn("fa-regular fa-plus text-2xl", className)
|
|
4552
4682
|
})
|
|
4553
|
-
}) : /* @__PURE__ */
|
|
4683
|
+
}) : /* @__PURE__ */ jsx17("button", {
|
|
4554
4684
|
title: title,
|
|
4555
4685
|
onClick: onClick,
|
|
4556
|
-
children: /* @__PURE__ */
|
|
4686
|
+
children: /* @__PURE__ */ jsx17("i", {
|
|
4557
4687
|
className: cn(icon[type], className)
|
|
4558
4688
|
})
|
|
4559
4689
|
})
|
|
@@ -4582,14 +4712,14 @@ var DurationUI = function(param) {
|
|
|
4582
4712
|
}, [
|
|
4583
4713
|
duration
|
|
4584
4714
|
]), daysStr = _useMemo6.daysStr, hoursStr = _useMemo6.hoursStr, minutesStr = _useMemo6.minutesStr, secondsStr = _useMemo6.secondsStr;
|
|
4585
|
-
return /* @__PURE__ */
|
|
4715
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
4586
4716
|
title: "".concat(daysStr, " ").concat(daysLabel, " ").concat(hoursStr, " ").concat(hoursLabel, " ").concat(minutesStr, " ").concat(minutesLabel, " ").concat(secondsStr, " ").concat(secondsLabel).trim(),
|
|
4587
4717
|
style: {
|
|
4588
4718
|
direction: "ltr"
|
|
4589
4719
|
},
|
|
4590
4720
|
className: cn("flex gap-1 ".concat(direction === "rtl" ? "justify-end" : "justify-start"), className),
|
|
4591
4721
|
children: [
|
|
4592
|
-
daysStr !== "00" && /* @__PURE__ */
|
|
4722
|
+
daysStr !== "00" && /* @__PURE__ */ jsxs12("span", {
|
|
4593
4723
|
style: {
|
|
4594
4724
|
display: "inline-block"
|
|
4595
4725
|
},
|
|
@@ -4599,7 +4729,7 @@ var DurationUI = function(param) {
|
|
|
4599
4729
|
daysLabel
|
|
4600
4730
|
]
|
|
4601
4731
|
}),
|
|
4602
|
-
hoursStr !== "00" && /* @__PURE__ */
|
|
4732
|
+
hoursStr !== "00" && /* @__PURE__ */ jsxs12("span", {
|
|
4603
4733
|
style: {
|
|
4604
4734
|
display: "inline-block"
|
|
4605
4735
|
},
|
|
@@ -4609,7 +4739,7 @@ var DurationUI = function(param) {
|
|
|
4609
4739
|
hoursLabel
|
|
4610
4740
|
]
|
|
4611
4741
|
}),
|
|
4612
|
-
minutesStr !== "00" && /* @__PURE__ */
|
|
4742
|
+
minutesStr !== "00" && /* @__PURE__ */ jsxs12("span", {
|
|
4613
4743
|
style: {
|
|
4614
4744
|
display: "inline-block"
|
|
4615
4745
|
},
|
|
@@ -4619,7 +4749,7 @@ var DurationUI = function(param) {
|
|
|
4619
4749
|
minutesLabel
|
|
4620
4750
|
]
|
|
4621
4751
|
}),
|
|
4622
|
-
secondsStr !== "00" && /* @__PURE__ */
|
|
4752
|
+
secondsStr !== "00" && /* @__PURE__ */ jsxs12("span", {
|
|
4623
4753
|
style: {
|
|
4624
4754
|
display: "inline-block"
|
|
4625
4755
|
},
|
|
@@ -4634,7 +4764,7 @@ var DurationUI = function(param) {
|
|
|
4634
4764
|
};
|
|
4635
4765
|
var PhoneUI = function(param) {
|
|
4636
4766
|
var phone = param.phone, direction = param.direction, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
|
|
4637
|
-
return /* @__PURE__ */
|
|
4767
|
+
return /* @__PURE__ */ jsx17("div", {
|
|
4638
4768
|
style: {
|
|
4639
4769
|
direction: "ltr"
|
|
4640
4770
|
},
|
|
@@ -4645,9 +4775,9 @@ var PhoneUI = function(param) {
|
|
|
4645
4775
|
};
|
|
4646
4776
|
var BooleanUi = function(param) {
|
|
4647
4777
|
var value = param.value, size3 = param.size, className = param.className, falseUi = param.falseUi, trueUi = param.trueUi;
|
|
4648
|
-
return value ? trueUi !== null && trueUi !== void 0 ? trueUi : /* @__PURE__ */
|
|
4778
|
+
return value ? trueUi !== null && trueUi !== void 0 ? trueUi : /* @__PURE__ */ jsx17("i", {
|
|
4649
4779
|
className: cn("fa-light fa-check ".concat(size3 === "small" ? "text-lg" : "text-2xl"), className)
|
|
4650
|
-
}) : falseUi !== null && falseUi !== void 0 ? falseUi : /* @__PURE__ */
|
|
4780
|
+
}) : falseUi !== null && falseUi !== void 0 ? falseUi : /* @__PURE__ */ jsx17("i", {
|
|
4651
4781
|
className: cn("fa-light fa-xmark ".concat(size3 === "small" ? "text-lg" : "text-2xl"), className)
|
|
4652
4782
|
});
|
|
4653
4783
|
};
|
|
@@ -4657,7 +4787,7 @@ var GeoUi = function(param) {
|
|
|
4657
4787
|
var lat = value.lat || value.latitude;
|
|
4658
4788
|
var googleMapsLink = getLocationUrl(lang, lat);
|
|
4659
4789
|
var langLatUi = linkUi || " ".concat(lang, " ").concat(lat);
|
|
4660
|
-
return /* @__PURE__ */
|
|
4790
|
+
return /* @__PURE__ */ jsx17("a", {
|
|
4661
4791
|
href: googleMapsLink,
|
|
4662
4792
|
target: "_blank",
|
|
4663
4793
|
className: cn("_ellipsis text-blue-500 hover:text-blue-700 underline", className),
|
|
@@ -4667,7 +4797,7 @@ var GeoUi = function(param) {
|
|
|
4667
4797
|
};
|
|
4668
4798
|
var NumberUI = function(param) {
|
|
4669
4799
|
var number = param.number, direction = param.direction, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className;
|
|
4670
|
-
return /* @__PURE__ */
|
|
4800
|
+
return /* @__PURE__ */ jsx17("div", {
|
|
4671
4801
|
style: {
|
|
4672
4802
|
direction: "ltr"
|
|
4673
4803
|
},
|
|
@@ -4677,15 +4807,15 @@ var NumberUI = function(param) {
|
|
|
4677
4807
|
});
|
|
4678
4808
|
};
|
|
4679
4809
|
// src/components/forms/ModularForm/ModularForm.tsx
|
|
4680
|
-
import { cloneElement, useState as
|
|
4810
|
+
import { cloneElement, useState as useState8 } from "react";
|
|
4681
4811
|
// src/components/forms/ModularForm/formElements.tsx
|
|
4682
|
-
import { useCallback as useCallback5, useMemo as useMemo8, useState as
|
|
4812
|
+
import { useCallback as useCallback5, useMemo as useMemo8, useState as useState7 } from "react";
|
|
4683
4813
|
// src/components/forms/ModularForm/InternationalPhonePicker.tsx
|
|
4684
4814
|
import { ChevronDown, Phone } from "lucide-react";
|
|
4685
|
-
import { forwardRef as forwardRef7, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef4, useState as
|
|
4815
|
+
import { forwardRef as forwardRef7, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from "react";
|
|
4686
4816
|
import * as RPNInput from "react-phone-number-input";
|
|
4687
4817
|
import flags from "react-phone-number-input/flags";
|
|
4688
|
-
import { jsx as
|
|
4818
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4689
4819
|
function InternationalPhonePicker(param) {
|
|
4690
4820
|
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;
|
|
4691
4821
|
var handleKeyDown = function(e) {
|
|
@@ -4695,7 +4825,7 @@ function InternationalPhonePicker(param) {
|
|
|
4695
4825
|
}
|
|
4696
4826
|
}
|
|
4697
4827
|
};
|
|
4698
|
-
var
|
|
4828
|
+
var _useState6 = _sliced_to_array(useState6(""), 2), tempPhoneValue = _useState6[0], setTempPhoneValue = _useState6[1];
|
|
4699
4829
|
useEffect6(function() {
|
|
4700
4830
|
if (defaultValue) {
|
|
4701
4831
|
if (setPhoneValue) {
|
|
@@ -4708,19 +4838,19 @@ function InternationalPhonePicker(param) {
|
|
|
4708
4838
|
defaultValue,
|
|
4709
4839
|
setPhoneValue
|
|
4710
4840
|
]);
|
|
4711
|
-
return /* @__PURE__ */
|
|
4841
|
+
return /* @__PURE__ */ jsxs13("div", {
|
|
4712
4842
|
style: {
|
|
4713
4843
|
direction: direction
|
|
4714
4844
|
},
|
|
4715
4845
|
className: cn("space-y-2", "".concat(labelContent ? "flex gap-1 items-center" : ""), containerClassName),
|
|
4716
4846
|
children: [
|
|
4717
|
-
labelContent && /* @__PURE__ */
|
|
4847
|
+
labelContent && /* @__PURE__ */ jsx18(ElementLabel, {
|
|
4718
4848
|
labelContent: labelContent,
|
|
4719
4849
|
labelClassName: labelClassName,
|
|
4720
4850
|
name: name,
|
|
4721
4851
|
required: required
|
|
4722
4852
|
}),
|
|
4723
|
-
/* @__PURE__ */
|
|
4853
|
+
/* @__PURE__ */ jsx18(RPNInput.default, {
|
|
4724
4854
|
style: {
|
|
4725
4855
|
direction: "ltr"
|
|
4726
4856
|
},
|
|
@@ -4753,7 +4883,7 @@ function InternationalPhonePicker(param) {
|
|
|
4753
4883
|
setTempPhoneValue(newValue !== null && newValue !== void 0 ? newValue : "");
|
|
4754
4884
|
}
|
|
4755
4885
|
}),
|
|
4756
|
-
/* @__PURE__ */
|
|
4886
|
+
/* @__PURE__ */ jsx18("input", {
|
|
4757
4887
|
type: "hidden",
|
|
4758
4888
|
name: name,
|
|
4759
4889
|
value: tempPhoneValue
|
|
@@ -4774,7 +4904,7 @@ var PhoneInput = forwardRef7(function(_param, ref) {
|
|
|
4774
4904
|
inputRef.current.focus();
|
|
4775
4905
|
}
|
|
4776
4906
|
}, []);
|
|
4777
|
-
return /* @__PURE__ */
|
|
4907
|
+
return /* @__PURE__ */ jsx18(Input, _object_spread({
|
|
4778
4908
|
className: cn("-ms-px rounded-s-none shadow-none focus-visible:z-10 h-full", className),
|
|
4779
4909
|
onKeyDown: onKeyDown,
|
|
4780
4910
|
defaultValue: defaultValue,
|
|
@@ -4798,21 +4928,21 @@ var CountrySelect = function(param) {
|
|
|
4798
4928
|
var originalClassName = useMemo7(function() {
|
|
4799
4929
|
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";
|
|
4800
4930
|
}, []);
|
|
4801
|
-
return /* @__PURE__ */
|
|
4931
|
+
return /* @__PURE__ */ jsxs13("div", {
|
|
4802
4932
|
className: cn(originalClassName, className),
|
|
4803
4933
|
children: [
|
|
4804
|
-
/* @__PURE__ */
|
|
4934
|
+
/* @__PURE__ */ jsxs13("div", {
|
|
4805
4935
|
className: "inline-flex items-center gap-1",
|
|
4806
4936
|
"aria-hidden": "true",
|
|
4807
4937
|
children: [
|
|
4808
|
-
/* @__PURE__ */
|
|
4938
|
+
/* @__PURE__ */ jsx18(FlagComponent, {
|
|
4809
4939
|
country: value,
|
|
4810
4940
|
countryName: value,
|
|
4811
4941
|
"aria-hidden": "true"
|
|
4812
4942
|
}),
|
|
4813
|
-
/* @__PURE__ */
|
|
4943
|
+
/* @__PURE__ */ jsx18("span", {
|
|
4814
4944
|
className: "text-muted-foreground/80",
|
|
4815
|
-
children: /* @__PURE__ */
|
|
4945
|
+
children: /* @__PURE__ */ jsx18(ChevronDown, {
|
|
4816
4946
|
size: 16,
|
|
4817
4947
|
strokeWidth: 2,
|
|
4818
4948
|
"aria-hidden": "true"
|
|
@@ -4820,7 +4950,7 @@ var CountrySelect = function(param) {
|
|
|
4820
4950
|
})
|
|
4821
4951
|
]
|
|
4822
4952
|
}),
|
|
4823
|
-
/* @__PURE__ */
|
|
4953
|
+
/* @__PURE__ */ jsx18("select", {
|
|
4824
4954
|
disabled: disabled,
|
|
4825
4955
|
value: value,
|
|
4826
4956
|
onChange: handleSelect,
|
|
@@ -4830,7 +4960,7 @@ var CountrySelect = function(param) {
|
|
|
4830
4960
|
return x.value;
|
|
4831
4961
|
}).map(function(option, i) {
|
|
4832
4962
|
var _option_value;
|
|
4833
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ jsxs13("option", {
|
|
4834
4964
|
className: "text-black",
|
|
4835
4965
|
value: option.value,
|
|
4836
4966
|
children: [
|
|
@@ -4847,18 +4977,18 @@ var CountrySelect = function(param) {
|
|
|
4847
4977
|
var FlagComponent = function(param) {
|
|
4848
4978
|
var country = param.country, countryName = param.countryName;
|
|
4849
4979
|
var Flag = flags[country];
|
|
4850
|
-
return /* @__PURE__ */
|
|
4980
|
+
return /* @__PURE__ */ jsx18("span", {
|
|
4851
4981
|
className: "w-5 overflow-hidden rounded-sm",
|
|
4852
|
-
children: Flag ? /* @__PURE__ */
|
|
4982
|
+
children: Flag ? /* @__PURE__ */ jsx18(Flag, {
|
|
4853
4983
|
title: countryName
|
|
4854
|
-
}) : /* @__PURE__ */
|
|
4984
|
+
}) : /* @__PURE__ */ jsx18(Phone, {
|
|
4855
4985
|
size: 16,
|
|
4856
4986
|
"aria-hidden": "true"
|
|
4857
4987
|
})
|
|
4858
4988
|
});
|
|
4859
4989
|
};
|
|
4860
4990
|
// src/components/forms/ModularForm/formElements.tsx
|
|
4861
|
-
import { jsx as
|
|
4991
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4862
4992
|
var useSortValues = function(options, sortDirection, sortAsNumber) {
|
|
4863
4993
|
var sortOptions = useMemo8(function() {
|
|
4864
4994
|
var sorted = sortAsNumber ? options.sort(function(a, b) {
|
|
@@ -4889,17 +5019,17 @@ var InputContainer = function(param) {
|
|
|
4889
5019
|
}, [
|
|
4890
5020
|
handleChangeFunction
|
|
4891
5021
|
]);
|
|
4892
|
-
return /* @__PURE__ */
|
|
5022
|
+
return /* @__PURE__ */ jsxs14("div", {
|
|
4893
5023
|
className: cn("center", containerClassName),
|
|
4894
5024
|
children: [
|
|
4895
|
-
labelContent && /* @__PURE__ */
|
|
5025
|
+
labelContent && /* @__PURE__ */ jsx19(ElementLabel, {
|
|
4896
5026
|
direction: direction,
|
|
4897
5027
|
labelContent: labelContent,
|
|
4898
5028
|
labelClassName: labelClassName,
|
|
4899
5029
|
name: name,
|
|
4900
5030
|
required: required
|
|
4901
5031
|
}),
|
|
4902
|
-
/* @__PURE__ */
|
|
5032
|
+
/* @__PURE__ */ jsx19("input", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, props), {
|
|
4903
5033
|
minLength: minLength,
|
|
4904
5034
|
placeholder: placeholder,
|
|
4905
5035
|
className: cn("w-[70%] bg-inherit border-b-[1px] border-black px-2", elementClassName),
|
|
@@ -4921,44 +5051,44 @@ var SelectContainer = function(param) {
|
|
|
4921
5051
|
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;
|
|
4922
5052
|
var _sortOptions_, _options_find;
|
|
4923
5053
|
var sortOptions = useSortValues(options, sortDirection, sortAsNumber);
|
|
4924
|
-
var
|
|
4925
|
-
var
|
|
5054
|
+
var _useState7 = _sliced_to_array(useState7(false), 2), isOpen = _useState7[0], setIsOpen = _useState7[1];
|
|
5055
|
+
var _useState71 = _sliced_to_array(useState7(defaultValue || ((_sortOptions_ = sortOptions[0]) === null || _sortOptions_ === void 0 ? void 0 : _sortOptions_.value) || ""), 2), selectedValue = _useState71[0], setSelectedValue = _useState71[1];
|
|
4926
5056
|
var handleOptionClick = function(value) {
|
|
4927
5057
|
setSelectedValue(value);
|
|
4928
5058
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
4929
5059
|
setIsOpen(false);
|
|
4930
5060
|
};
|
|
4931
|
-
return /* @__PURE__ */
|
|
5061
|
+
return /* @__PURE__ */ jsxs14("div", {
|
|
4932
5062
|
className: cn("center", containerClassName),
|
|
4933
5063
|
children: [
|
|
4934
|
-
labelContent && /* @__PURE__ */
|
|
5064
|
+
labelContent && /* @__PURE__ */ jsx19(ElementLabel, {
|
|
4935
5065
|
direction: direction,
|
|
4936
5066
|
labelContent: labelContent,
|
|
4937
5067
|
labelClassName: labelClassName,
|
|
4938
5068
|
name: name,
|
|
4939
5069
|
required: required
|
|
4940
5070
|
}),
|
|
4941
|
-
/* @__PURE__ */
|
|
5071
|
+
/* @__PURE__ */ jsxs14("div", {
|
|
4942
5072
|
className: cn("w-[70%] relative", elementClassName),
|
|
4943
5073
|
onClick: function() {
|
|
4944
5074
|
return setIsOpen(!isOpen);
|
|
4945
5075
|
},
|
|
4946
5076
|
children: [
|
|
4947
|
-
/* @__PURE__ */
|
|
5077
|
+
/* @__PURE__ */ jsx19("div", {
|
|
4948
5078
|
className: "border-b-[1px] border-black max-h-6 cursor-pointer",
|
|
4949
5079
|
children: ((_options_find = options.find(function(opt) {
|
|
4950
5080
|
return opt.value === selectedValue;
|
|
4951
5081
|
})) === null || _options_find === void 0 ? void 0 : _options_find.label) || selectedValue
|
|
4952
5082
|
}),
|
|
4953
|
-
isOpen ? /* @__PURE__ */
|
|
5083
|
+
isOpen ? /* @__PURE__ */ jsx19("i", {
|
|
4954
5084
|
className: "fa-light fa-chevron-up absolute top-[1px] left-1 cursor-pointer"
|
|
4955
|
-
}) : /* @__PURE__ */
|
|
5085
|
+
}) : /* @__PURE__ */ jsx19("i", {
|
|
4956
5086
|
className: "fa-light fa-chevron-down absolute top-[1px] left-1 cursor-pointer"
|
|
4957
5087
|
}),
|
|
4958
|
-
isOpen && /* @__PURE__ */
|
|
5088
|
+
isOpen && /* @__PURE__ */ jsx19("div", {
|
|
4959
5089
|
className: cn("absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10", optionsContainerClassName),
|
|
4960
5090
|
children: sortOptions.map(function(option) {
|
|
4961
|
-
return /* @__PURE__ */
|
|
5091
|
+
return /* @__PURE__ */ jsx19("div", {
|
|
4962
5092
|
className: "p-2 cursor-pointer hover:bg-gray-200 ".concat(optionClassName),
|
|
4963
5093
|
onClick: function() {
|
|
4964
5094
|
return handleOptionClick(option.value);
|
|
@@ -4967,7 +5097,7 @@ var SelectContainer = function(param) {
|
|
|
4967
5097
|
}, option.value);
|
|
4968
5098
|
})
|
|
4969
5099
|
}),
|
|
4970
|
-
/* @__PURE__ */
|
|
5100
|
+
/* @__PURE__ */ jsx19("input", {
|
|
4971
5101
|
value: selectedValue,
|
|
4972
5102
|
type: "hidden",
|
|
4973
5103
|
name: name,
|
|
@@ -4981,17 +5111,17 @@ var SelectContainer = function(param) {
|
|
|
4981
5111
|
function MultiSelect(param) {
|
|
4982
5112
|
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;
|
|
4983
5113
|
var sortOptions = useSortValues(options, sortDirection, sortAsNumber);
|
|
4984
|
-
return /* @__PURE__ */
|
|
5114
|
+
return /* @__PURE__ */ jsxs14("div", {
|
|
4985
5115
|
className: cn("".concat(labelContent ? "flex gap-1 items-center" : ""), styles.containerClassName),
|
|
4986
5116
|
children: [
|
|
4987
|
-
labelContent && /* @__PURE__ */
|
|
5117
|
+
labelContent && /* @__PURE__ */ jsx19(ElementLabel, {
|
|
4988
5118
|
direction: direction,
|
|
4989
5119
|
labelContent: labelContent,
|
|
4990
5120
|
labelClassName: labelClassName,
|
|
4991
5121
|
name: name,
|
|
4992
5122
|
required: required
|
|
4993
5123
|
}),
|
|
4994
|
-
/* @__PURE__ */
|
|
5124
|
+
/* @__PURE__ */ jsx19(multiselect_default, {
|
|
4995
5125
|
commandProps: {
|
|
4996
5126
|
label: placeholder
|
|
4997
5127
|
},
|
|
@@ -5012,7 +5142,7 @@ function MultiSelect(param) {
|
|
|
5012
5142
|
className: styles.className,
|
|
5013
5143
|
dropdownClassName: styles.dropdownClassName,
|
|
5014
5144
|
dropdownOptionClassName: styles.dropdownOptionClassName,
|
|
5015
|
-
emptyIndicator: emptyOptionsElement || /* @__PURE__ */
|
|
5145
|
+
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ jsx19("p", {
|
|
5016
5146
|
className: "text-center text-sm",
|
|
5017
5147
|
children: "all options selected."
|
|
5018
5148
|
}),
|
|
@@ -5026,17 +5156,17 @@ function MultiSelect(param) {
|
|
|
5026
5156
|
var SelectWithSearch = function(param) {
|
|
5027
5157
|
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;
|
|
5028
5158
|
var sortOptions = useSortValues(options, sortDirection, sortAsNumber);
|
|
5029
|
-
return /* @__PURE__ */
|
|
5159
|
+
return /* @__PURE__ */ jsxs14("div", {
|
|
5030
5160
|
className: cn("flex justify-between items-center w-full", containerClassName),
|
|
5031
5161
|
children: [
|
|
5032
|
-
labelContent && /* @__PURE__ */
|
|
5162
|
+
labelContent && /* @__PURE__ */ jsx19(ElementLabel, {
|
|
5033
5163
|
direction: direction,
|
|
5034
5164
|
labelContent: labelContent,
|
|
5035
5165
|
labelClassName: labelClassName,
|
|
5036
5166
|
name: name,
|
|
5037
5167
|
required: required
|
|
5038
5168
|
}),
|
|
5039
|
-
/* @__PURE__ */
|
|
5169
|
+
/* @__PURE__ */ jsx19(SearchSelect, {
|
|
5040
5170
|
direction: direction,
|
|
5041
5171
|
createNewOptionLabel: createNewOptionLabel,
|
|
5042
5172
|
createNewOptionContainerClassName: createNewOptionContainerClassName,
|
|
@@ -5062,10 +5192,10 @@ var SelectWithSearch = function(param) {
|
|
|
5062
5192
|
};
|
|
5063
5193
|
var TextAreaContainer = function(param) {
|
|
5064
5194
|
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;
|
|
5065
|
-
return /* @__PURE__ */
|
|
5195
|
+
return /* @__PURE__ */ jsxs14("div", {
|
|
5066
5196
|
className: cn("flex flex-col gap-2 items-center", containerClassName),
|
|
5067
5197
|
children: [
|
|
5068
|
-
labelContent && /* @__PURE__ */
|
|
5198
|
+
labelContent && /* @__PURE__ */ jsx19(ElementLabel, {
|
|
5069
5199
|
direction: direction,
|
|
5070
5200
|
labelContent: labelContent,
|
|
5071
5201
|
labelClassName: "w-fit text-xl px-2 border-b-2 border-[#000] text-center ".concat(labelClassName),
|
|
@@ -5073,7 +5203,7 @@ var TextAreaContainer = function(param) {
|
|
|
5073
5203
|
required: required,
|
|
5074
5204
|
withDots: false
|
|
5075
5205
|
}),
|
|
5076
|
-
/* @__PURE__ */
|
|
5206
|
+
/* @__PURE__ */ jsx19("textarea", _object_spread_props(_object_spread({}, props), {
|
|
5077
5207
|
onChange: onChange,
|
|
5078
5208
|
minLength: minLength,
|
|
5079
5209
|
placeholder: placeholder,
|
|
@@ -5088,28 +5218,28 @@ var TextAreaContainer = function(param) {
|
|
|
5088
5218
|
};
|
|
5089
5219
|
var ElementLabel = function(param) {
|
|
5090
5220
|
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;
|
|
5091
|
-
return /* @__PURE__ */
|
|
5221
|
+
return /* @__PURE__ */ jsxs14("label", {
|
|
5092
5222
|
style: {
|
|
5093
5223
|
direction: direction
|
|
5094
5224
|
},
|
|
5095
5225
|
className: cn("text-start w-[30%] flex gap-0.5", labelClassName),
|
|
5096
5226
|
htmlFor: name,
|
|
5097
5227
|
children: [
|
|
5098
|
-
/* @__PURE__ */
|
|
5228
|
+
/* @__PURE__ */ jsx19("div", {
|
|
5099
5229
|
children: labelContent
|
|
5100
5230
|
}),
|
|
5101
|
-
required && /* @__PURE__ */
|
|
5231
|
+
required && /* @__PURE__ */ jsx19("div", {
|
|
5102
5232
|
className: "text-red-500",
|
|
5103
5233
|
children: "*"
|
|
5104
5234
|
}),
|
|
5105
|
-
withDots && /* @__PURE__ */
|
|
5235
|
+
withDots && /* @__PURE__ */ jsx19("div", {
|
|
5106
5236
|
children: ":"
|
|
5107
5237
|
})
|
|
5108
5238
|
]
|
|
5109
5239
|
});
|
|
5110
5240
|
};
|
|
5111
5241
|
// src/components/forms/ModularForm/ModularForm.tsx
|
|
5112
|
-
import { jsx as
|
|
5242
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5113
5243
|
var ModularForm = function(param) {
|
|
5114
5244
|
var _param_submitFunction = param.submitFunction, submitFunction = _param_submitFunction === void 0 ? /*#__PURE__*/ function() {
|
|
5115
5245
|
var _ref = _async_to_generator(function(form) {
|
|
@@ -5123,8 +5253,8 @@ var ModularForm = function(param) {
|
|
|
5123
5253
|
return _ref.apply(this, arguments);
|
|
5124
5254
|
};
|
|
5125
5255
|
}() : _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;
|
|
5126
|
-
var
|
|
5127
|
-
var
|
|
5256
|
+
var _useState8 = _sliced_to_array(useState8(""), 2), errorMsg = _useState8[0], setErrorMsg = _useState8[1];
|
|
5257
|
+
var _useState81 = _sliced_to_array(useState8(false), 2), isLoading = _useState81[0], setIsLoading = _useState81[1];
|
|
5128
5258
|
var onSubmit = /*#__PURE__*/ function() {
|
|
5129
5259
|
var _ref = _async_to_generator(function(e) {
|
|
5130
5260
|
var form, err;
|
|
@@ -5186,41 +5316,41 @@ var ModularForm = function(param) {
|
|
|
5186
5316
|
return _ref.apply(this, arguments);
|
|
5187
5317
|
};
|
|
5188
5318
|
}();
|
|
5189
|
-
return /* @__PURE__ */
|
|
5319
|
+
return /* @__PURE__ */ jsxs15("form", {
|
|
5190
5320
|
onSubmit: onSubmit,
|
|
5191
5321
|
style: {
|
|
5192
5322
|
direction: direction
|
|
5193
5323
|
},
|
|
5194
5324
|
className: cn("w-[350px] px-5 py-5 flex flex-col gap-5", formClassName),
|
|
5195
5325
|
children: [
|
|
5196
|
-
headerContent && /* @__PURE__ */
|
|
5326
|
+
headerContent && /* @__PURE__ */ jsx20("div", {
|
|
5197
5327
|
className: cn("border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]", headerClassName),
|
|
5198
5328
|
children: headerContent
|
|
5199
5329
|
}),
|
|
5200
5330
|
elements.map(function(element, index2) {
|
|
5201
5331
|
switch(element.type){
|
|
5202
5332
|
case "input":
|
|
5203
|
-
return /* @__PURE__ */
|
|
5333
|
+
return /* @__PURE__ */ jsx20(InputContainer, _object_spread_props(_object_spread({}, element), {
|
|
5204
5334
|
direction: direction
|
|
5205
5335
|
}), index2);
|
|
5206
5336
|
case "textarea":
|
|
5207
|
-
return /* @__PURE__ */
|
|
5337
|
+
return /* @__PURE__ */ jsx20(TextAreaContainer, _object_spread_props(_object_spread({}, element), {
|
|
5208
5338
|
direction: direction
|
|
5209
5339
|
}), index2);
|
|
5210
5340
|
case "select":
|
|
5211
|
-
return /* @__PURE__ */
|
|
5341
|
+
return /* @__PURE__ */ jsx20(SelectContainer, _object_spread_props(_object_spread({}, element), {
|
|
5212
5342
|
direction: direction
|
|
5213
5343
|
}), index2);
|
|
5214
5344
|
case "multiSelect":
|
|
5215
|
-
return /* @__PURE__ */
|
|
5345
|
+
return /* @__PURE__ */ jsx20(MultiSelect, _object_spread_props(_object_spread({}, element), {
|
|
5216
5346
|
direction: direction
|
|
5217
5347
|
}), index2);
|
|
5218
5348
|
case "selectWithSearch":
|
|
5219
|
-
return /* @__PURE__ */
|
|
5349
|
+
return /* @__PURE__ */ jsx20(SelectWithSearch, _object_spread_props(_object_spread({}, element), {
|
|
5220
5350
|
direction: direction
|
|
5221
5351
|
}), index2);
|
|
5222
5352
|
case "internationalPhoneInput":
|
|
5223
|
-
return /* @__PURE__ */
|
|
5353
|
+
return /* @__PURE__ */ jsx20(InternationalPhonePicker, _object_spread_props(_object_spread({}, element), {
|
|
5224
5354
|
direction: direction
|
|
5225
5355
|
}), index2);
|
|
5226
5356
|
case "custom":
|
|
@@ -5232,20 +5362,20 @@ var ModularForm = function(param) {
|
|
|
5232
5362
|
return null;
|
|
5233
5363
|
}
|
|
5234
5364
|
}),
|
|
5235
|
-
/* @__PURE__ */
|
|
5365
|
+
/* @__PURE__ */ jsxs15("div", {
|
|
5236
5366
|
className: cn("flex justify-between w-full", footerClassName),
|
|
5237
5367
|
children: [
|
|
5238
|
-
/* @__PURE__ */
|
|
5368
|
+
/* @__PURE__ */ jsx20("div", {
|
|
5239
5369
|
title: errorMsg,
|
|
5240
5370
|
className: cn("text-[#f22] text-[18px] max-w-[80%] ellipsis", errorClassName),
|
|
5241
5371
|
children: errorMsg
|
|
5242
5372
|
}),
|
|
5243
|
-
/* @__PURE__ */
|
|
5373
|
+
/* @__PURE__ */ jsx20("button", {
|
|
5244
5374
|
ref: submitRef,
|
|
5245
5375
|
disabled: isLoading,
|
|
5246
5376
|
className: cn("bg-[#547f22] px-3 py-1 rounded-lg text-white min-w-20", buttonClassName),
|
|
5247
5377
|
type: "submit",
|
|
5248
|
-
children: isLoading ? /* @__PURE__ */
|
|
5378
|
+
children: isLoading ? /* @__PURE__ */ jsx20(Loader, {
|
|
5249
5379
|
size: 25,
|
|
5250
5380
|
color: "#fff"
|
|
5251
5381
|
}) : buttonContent
|
|
@@ -5257,32 +5387,32 @@ var ModularForm = function(param) {
|
|
|
5257
5387
|
};
|
|
5258
5388
|
var ModularForm_default = ModularForm;
|
|
5259
5389
|
// src/components/forms/index.tsx
|
|
5260
|
-
import { useState as
|
|
5390
|
+
import { useState as useState9 } from "react";
|
|
5261
5391
|
import moment3 from "moment";
|
|
5262
|
-
import { jsx as
|
|
5392
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5263
5393
|
var ConfirmForm = function(param) {
|
|
5264
5394
|
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;
|
|
5265
|
-
return /* @__PURE__ */
|
|
5395
|
+
return /* @__PURE__ */ jsxs16("div", {
|
|
5266
5396
|
style: {
|
|
5267
5397
|
direction: direction,
|
|
5268
5398
|
padding: "30px"
|
|
5269
5399
|
},
|
|
5270
5400
|
className: cn("w-full h-full flex flex-col gap-3", containerClassName),
|
|
5271
5401
|
children: [
|
|
5272
|
-
/* @__PURE__ */
|
|
5402
|
+
/* @__PURE__ */ jsx21("div", {
|
|
5273
5403
|
className: cn("text-lg font-bold", headlineClassName),
|
|
5274
5404
|
children: headline
|
|
5275
5405
|
}),
|
|
5276
|
-
/* @__PURE__ */
|
|
5406
|
+
/* @__PURE__ */ jsxs16("div", {
|
|
5277
5407
|
className: cn("flex justify-center items-center gap-2 w-full", buttonsContainerClassName),
|
|
5278
5408
|
children: [
|
|
5279
|
-
/* @__PURE__ */
|
|
5409
|
+
/* @__PURE__ */ jsx21("button", {
|
|
5280
5410
|
onClick: onX,
|
|
5281
|
-
children: /* @__PURE__ */
|
|
5411
|
+
children: /* @__PURE__ */ jsx21(RedXSvg, {})
|
|
5282
5412
|
}),
|
|
5283
|
-
/* @__PURE__ */
|
|
5413
|
+
/* @__PURE__ */ jsx21("button", {
|
|
5284
5414
|
onClick: onV,
|
|
5285
|
-
children: /* @__PURE__ */
|
|
5415
|
+
children: /* @__PURE__ */ jsx21(GreenVSvg, {})
|
|
5286
5416
|
})
|
|
5287
5417
|
]
|
|
5288
5418
|
})
|
|
@@ -5302,7 +5432,7 @@ var DatePicker = function(param) {
|
|
|
5302
5432
|
return _ref.apply(this, arguments);
|
|
5303
5433
|
};
|
|
5304
5434
|
}() : _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;
|
|
5305
|
-
var
|
|
5435
|
+
var _useState9 = _sliced_to_array(useState9(false), 2), isLoading = _useState9[0], setIsLoading = _useState9[1];
|
|
5306
5436
|
var onSubmit = /*#__PURE__*/ function() {
|
|
5307
5437
|
var _ref = _async_to_generator(function(e) {
|
|
5308
5438
|
return _ts_generator(this, function(_state) {
|
|
@@ -5327,19 +5457,19 @@ var DatePicker = function(param) {
|
|
|
5327
5457
|
return _ref.apply(this, arguments);
|
|
5328
5458
|
};
|
|
5329
5459
|
}();
|
|
5330
|
-
return /* @__PURE__ */
|
|
5460
|
+
return /* @__PURE__ */ jsxs16("form", {
|
|
5331
5461
|
style: {
|
|
5332
5462
|
direction: direction
|
|
5333
5463
|
},
|
|
5334
5464
|
onSubmit: onSubmit,
|
|
5335
5465
|
className: cn("w-full h-10 flex justify-start gap-3 items-center ", formClassName),
|
|
5336
5466
|
children: [
|
|
5337
|
-
/* @__PURE__ */
|
|
5467
|
+
/* @__PURE__ */ jsxs16("label", {
|
|
5338
5468
|
className: cn("center text-[14px] relative gap-2", labelsClassName),
|
|
5339
5469
|
htmlFor: "from",
|
|
5340
5470
|
children: [
|
|
5341
5471
|
fromText,
|
|
5342
|
-
/* @__PURE__ */
|
|
5472
|
+
/* @__PURE__ */ jsx21("input", {
|
|
5343
5473
|
className: "w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ".concat(inputsClassName),
|
|
5344
5474
|
type: "date",
|
|
5345
5475
|
name: "from",
|
|
@@ -5347,12 +5477,12 @@ var DatePicker = function(param) {
|
|
|
5347
5477
|
})
|
|
5348
5478
|
]
|
|
5349
5479
|
}),
|
|
5350
|
-
/* @__PURE__ */
|
|
5480
|
+
/* @__PURE__ */ jsxs16("label", {
|
|
5351
5481
|
className: cn("center text-[14px] relative gap-2 ", labelsClassName),
|
|
5352
5482
|
htmlFor: "to",
|
|
5353
5483
|
children: [
|
|
5354
5484
|
toText,
|
|
5355
|
-
/* @__PURE__ */
|
|
5485
|
+
/* @__PURE__ */ jsx21("input", {
|
|
5356
5486
|
className: "w-[125px] text-[14px] py-[2px] px-1 rounded-[2px] border-black border-[1px] text-end ".concat(inputsClassName),
|
|
5357
5487
|
type: "date",
|
|
5358
5488
|
name: "to",
|
|
@@ -5360,12 +5490,12 @@ var DatePicker = function(param) {
|
|
|
5360
5490
|
})
|
|
5361
5491
|
]
|
|
5362
5492
|
}),
|
|
5363
|
-
/* @__PURE__ */
|
|
5493
|
+
/* @__PURE__ */ jsx21("button", {
|
|
5364
5494
|
disabled: isLoading,
|
|
5365
5495
|
style: buttonStyle,
|
|
5366
5496
|
className: cn("bg-[#699a2c] text-[#fff] font-[500] w-[75px] h-[27px]", buttonClassName),
|
|
5367
5497
|
type: "submit",
|
|
5368
|
-
children: isLoading ? /* @__PURE__ */
|
|
5498
|
+
children: isLoading ? /* @__PURE__ */ jsx21(Loader, {
|
|
5369
5499
|
className: "pt-[2px]",
|
|
5370
5500
|
size: 20,
|
|
5371
5501
|
color: "#fff"
|
|
@@ -5377,7 +5507,7 @@ var DatePicker = function(param) {
|
|
|
5377
5507
|
// src/components/CodeInput.tsx
|
|
5378
5508
|
import { OTPInput } from "input-otp";
|
|
5379
5509
|
import { useEffect as useEffect7, useRef as useRef5 } from "react";
|
|
5380
|
-
import { jsx as
|
|
5510
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5381
5511
|
function CodeInput(param) {
|
|
5382
5512
|
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;
|
|
5383
5513
|
var firstInputRef = useRef5(null);
|
|
@@ -5386,9 +5516,9 @@ function CodeInput(param) {
|
|
|
5386
5516
|
firstInputRef.current.focus();
|
|
5387
5517
|
}
|
|
5388
5518
|
}, []);
|
|
5389
|
-
return /* @__PURE__ */
|
|
5519
|
+
return /* @__PURE__ */ jsx22("div", {
|
|
5390
5520
|
className: cn("space-y-2 flex justify-center items-center", className),
|
|
5391
|
-
children: /* @__PURE__ */
|
|
5521
|
+
children: /* @__PURE__ */ jsx22(OTPInput, {
|
|
5392
5522
|
ref: firstInputRef,
|
|
5393
5523
|
value: codeValue,
|
|
5394
5524
|
onChange: function(newVal) {
|
|
@@ -5398,10 +5528,10 @@ function CodeInput(param) {
|
|
|
5398
5528
|
maxLength: 6,
|
|
5399
5529
|
render: function(param) {
|
|
5400
5530
|
var slots = param.slots;
|
|
5401
|
-
return /* @__PURE__ */
|
|
5531
|
+
return /* @__PURE__ */ jsx22("div", {
|
|
5402
5532
|
className: cn("flex gap-5", slotContainerClassName),
|
|
5403
5533
|
children: slots.map(function(slot, idx) {
|
|
5404
|
-
return /* @__PURE__ */
|
|
5534
|
+
return /* @__PURE__ */ jsx22(Slot2, _object_spread({}, slot), idx);
|
|
5405
5535
|
})
|
|
5406
5536
|
});
|
|
5407
5537
|
}
|
|
@@ -5409,14 +5539,14 @@ function CodeInput(param) {
|
|
|
5409
5539
|
});
|
|
5410
5540
|
}
|
|
5411
5541
|
function Slot2(props) {
|
|
5412
|
-
return /* @__PURE__ */
|
|
5542
|
+
return /* @__PURE__ */ jsx22("div", {
|
|
5413
5543
|
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", {
|
|
5414
5544
|
"z-10 border border-ring ring-[3px] ring-ring/20": props.isActive
|
|
5415
5545
|
}),
|
|
5416
|
-
children: props.char !== null && /* @__PURE__ */
|
|
5546
|
+
children: props.char !== null && /* @__PURE__ */ jsx22("div", {
|
|
5417
5547
|
children: props.char
|
|
5418
5548
|
})
|
|
5419
5549
|
});
|
|
5420
5550
|
}
|
|
5421
|
-
export { Badge, BooleanUi, Button, Checkbox, CodeInput, ConfirmForm, DatePicker, DurationUI, ElementLabel, ErrorBoundary, ExportToExcel, Filter, GeoUi, Input, InputContainer, InternationalPhonePicker, Loader, MaxRowsLabel, ModularForm_default as ModularForm, MultiSelect, NumberUI, PhoneUI, ProgressComponent, Search, SelectContainer, SelectWithSearch, Summary, Table, TableBody, TableButton, TableCell, TableContext, TableHead, TableProvider, TableRow2 as TableRow, TextAreaContainer, TimesUI, Version, badgeVariants, buttonVariants, getFixedNumber, useDebounce, useSortValues };
|
|
5551
|
+
export { Badge, BooleanUi, Button, Checkbox, CodeInput, ConfirmForm, DatePicker, DurationUI, ElementLabel, ErrorBoundary, ExportToExcel, Filter, GeoUi, Input, InputContainer, InternationalPhonePicker, Loader, LoginWithGoogleButton, MaxRowsLabel, ModularForm_default as ModularForm, MultiSelect, NumberUI, PhoneUI, ProgressComponent, Search, SelectContainer, SelectWithSearch, Summary, Table, TableBody, TableButton, TableCell, TableContext, TableHead, TableProvider, TableRow2 as TableRow, TextAreaContainer, TimesUI, Version, badgeVariants, buttonVariants, getFixedNumber, useDebounce, useSortValues };
|
|
5422
5552
|
//# sourceMappingURL=index.mjs.map
|