acsi-core 1.2.1 → 1.2.6

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare const historyCore: import("history").History<unknown>;
2
2
  import { setLoading, setAlert, setTenant, setAddTenant, setTeam, setUser, setMenuCollapse, setIsRefetchSidebar, setLoadingPage, setIsFirstCalendar } from "./redux/commons/action";
3
- import { BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, TIMEZONE_ID } from "./utils/constants";
3
+ import { BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT } from "./utils/constants";
4
4
  import Login from "./containers/Login/views/Login";
5
5
  import store from "./store";
6
6
  import getAccessToken from "./utils/getAccessToken";
@@ -28,6 +28,7 @@ import CustomAsyncSelect from "./components/Selects/CustomAsyncSelect";
28
28
  import CustomCreatable from "./components/Selects/CustomCreatable";
29
29
  import CustomSelectOption from "./components/Selects/CustomSelectOption";
30
30
  import utcToLocalTime from "./utils/utcToLocalTime";
31
+ import getTimeZoneId from "./utils/getTimeZoneId";
31
32
  import timeSpanToLocalMoment from "./utils/timeSpanToLocalMoment";
32
33
  import Cookies from "js-cookie";
33
- export { setLoading, setLoadingPage, setIsFirstCalendar, BASE_URL, OPENSALT_BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, ORGANIZATION_TEAM, ORGANIZATION_TENANT, TIMEZONE_ID, firstCheckToken, getImageUrl, Login, utcToLocalTime, timeSpanToLocalMoment, getAccessToken, store, historyCore, setAlert, setUser, setTenant, setAddTenant, setTeam, setMenuCollapse, setIsRefetchSidebar, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, ToastContainer, toast, Role, Cookies, CustomPagination, useGoogleSignOut, CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch, CoreSelectCompact, CoreInputCompact, CoreTitleInput, CoreTooltip, getErrorMessage, MarkdownLatexRender, CustomSelect, CustomAsyncSelect, CustomCreatable, CustomSelectOption, GoogleOAuthProvider, useAmplitude, AmplitudeEvent, initializeAmplitude, initSentry };
34
+ export { setLoading, setLoadingPage, setIsFirstCalendar, BASE_URL, OPENSALT_BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, ORGANIZATION_TEAM, ORGANIZATION_TENANT, firstCheckToken, getImageUrl, Login, utcToLocalTime, getTimeZoneId, timeSpanToLocalMoment, getAccessToken, store, historyCore, setAlert, setUser, setTenant, setAddTenant, setTeam, setMenuCollapse, setIsRefetchSidebar, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, ToastContainer, toast, Role, Cookies, CustomPagination, useGoogleSignOut, CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch, CoreSelectCompact, CoreInputCompact, CoreTitleInput, CoreTooltip, getErrorMessage, MarkdownLatexRender, CustomSelect, CustomAsyncSelect, CustomCreatable, CustomSelectOption, GoogleOAuthProvider, useAmplitude, AmplitudeEvent, initializeAmplitude, initSentry };
package/dist/index.js CHANGED
@@ -87,7 +87,6 @@ var COLORS = {
87
87
  };
88
88
  var ORGANIZATION_TENANT = "ORGANIZATION_TENANT";
89
89
  var ORGANIZATION_TEAM = "ORGANIZATION_TEAM";
90
- var TIMEZONE_ID = "TIMEZONE_ID";
91
90
 
92
91
  var styleGlobal = {"signup_wrap":"_1KLz9","box-signin":"_2Jo1o","signin_title":"_3egBO","signup_link":"_1DoIT","google_button":"_34hK_","microsoft_button":"_19ESb","box-field":"_2e9xO","box-input":"_3zXRp","box-text":"_8NJga","box-button-email":"_21FPk","box-signin-container":"_1QERu","box-signin-text":"_2-znH","box-signin-logo":"_1aB2m","box-right":"_3qndF","image-slideshow":"_1aM7m","active":"_Vx1zf","box-right-body":"_JzdCr","box-right-footer":"_19aCA","pr-30":"_2HB5r","width-400":"_4ehXP"};
93
92
 
@@ -1713,7 +1712,6 @@ var apiUpload = axios.create({
1713
1712
  var domain = parts.slice(-2).join('.');
1714
1713
  localStorage.removeItem(ACCESS_TOKEN);
1715
1714
  localStorage.removeItem(ORGANIZATION_TENANT);
1716
- localStorage.removeItem(TIMEZONE_ID);
1717
1715
  localStorage.removeItem(ORGANIZATION_TEAM);
1718
1716
  Cookies.remove('auth', {
1719
1717
  path: '/',
@@ -3466,52 +3464,25 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
3466
3464
 
3467
3465
  var utcToLocalTime = (function (time, FORMAT) {
3468
3466
  if (time === DATE_MIN_VALUE || time == null) return "";
3469
- var timezone = localStorage.getItem(TIMEZONE_ID) || "";
3470
3467
  try {
3471
- if (!timezone) {
3472
- return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
3473
- }
3474
- var isOffset = /^(UTC|GMT)?[+-]/.test(timezone);
3475
- if (isOffset) {
3476
- var cleanOffset = timezone.replace(/UTC|GMT/gi, "").trim();
3477
- var offsetMinutes;
3478
- if (/^[+-]?\d+$/.test(cleanOffset)) {
3479
- offsetMinutes = parseInt(cleanOffset, 10) * 60;
3480
- } else {
3481
- offsetMinutes = cleanOffset;
3482
- }
3483
- return moment.utc(time).utcOffset(offsetMinutes).format(FORMAT || "yyyy-MM-DD");
3484
- }
3485
- return moment.utc(time).tz(timezone).format(FORMAT || "yyyy-MM-DD");
3468
+ return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
3486
3469
  } catch (_unused) {
3487
3470
  return "";
3488
3471
  }
3489
3472
  });
3490
3473
 
3491
- var timeSpanToLocalMoment = (function (time, timezone) {
3474
+ var getTimeZoneId = (function () {
3475
+ return moment$1.tz.guess();
3476
+ });
3477
+
3478
+ var timeSpanToLocalMoment = (function (time) {
3492
3479
  if (!time) return null;
3493
- if (time.split(":").length !== 3) return null;
3494
- if (!timezone) {
3495
- var totalSeconds = +time.split(":")[0] * 60 * 60 + +time.split(":")[1] * 60 + +time.split(":")[2];
3496
- var startOfDay = moment$1.utc().startOf("day");
3497
- var _dateTime = startOfDay.add(totalSeconds, "seconds");
3498
- return _dateTime.local();
3499
- }
3500
- var dateTime;
3501
- var isOffset = /^(UTC|GMT)?[+-]/.test(timezone);
3502
- if (isOffset) {
3503
- var cleanOffset = timezone.replace(/UTC|GMT/gi, '').trim();
3504
- var offsetMinutes;
3505
- if (/^[+-]?\d+$/.test(cleanOffset)) {
3506
- offsetMinutes = parseInt(cleanOffset, 10) * 60;
3507
- } else {
3508
- offsetMinutes = cleanOffset;
3509
- }
3510
- dateTime = moment$1.utc(time, "HH:mm:ss").utcOffset(offsetMinutes);
3511
- } else {
3512
- dateTime = moment$1.utc(time, "HH:mm:ss").tz(timezone);
3513
- }
3514
- return dateTime;
3480
+ var times = time.split(":");
3481
+ if (times.length !== 3) return null;
3482
+ var totalSeconds = +times[0] * 60 * 60 + +times[1] * 60 + +times[2];
3483
+ var startOfDay = moment.utc().startOf("day");
3484
+ var dateTime = startOfDay.add(totalSeconds, "seconds");
3485
+ return dateTime.local();
3515
3486
  });
3516
3487
 
3517
3488
  var historyCore = history.createBrowserHistory();
@@ -3567,13 +3538,13 @@ exports.NotFound = NotFound;
3567
3538
  exports.OPENSALT_BASE_URL = OPENSALT_BASE_URL;
3568
3539
  exports.ORGANIZATION_TEAM = ORGANIZATION_TEAM;
3569
3540
  exports.ORGANIZATION_TENANT = ORGANIZATION_TENANT;
3570
- exports.TIMEZONE_ID = TIMEZONE_ID;
3571
3541
  exports.api = api;
3572
3542
  exports.apiUpload = apiUpload;
3573
3543
  exports.firstCheckToken = firstCheckToken;
3574
3544
  exports.getAccessToken = getAccessToken;
3575
3545
  exports.getErrorMessage = getErrorMessage;
3576
3546
  exports.getImageUrl = getImageUrl;
3547
+ exports.getTimeZoneId = getTimeZoneId;
3577
3548
  exports.historyCore = historyCore;
3578
3549
  exports.initSentry = initSentry;
3579
3550
  exports.initializeAmplitude = initializeAmplitude;