@activecollab/components 1.0.382 → 1.0.384
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/cjs/components/Input/Input.js +3 -2
- package/dist/cjs/components/Input/Input.js.map +1 -1
- package/dist/cjs/components/Input/InputHours.js.map +1 -1
- package/dist/cjs/components/Input/Styles.js +6 -2
- package/dist/cjs/components/Input/Styles.js.map +1 -1
- package/dist/cjs/components/Input/types.js.map +1 -1
- package/dist/cjs/components/Stopwatch/Stopwatch.js +61 -0
- package/dist/cjs/components/Stopwatch/Stopwatch.js.map +1 -0
- package/dist/cjs/components/Stopwatch/Stopwatch.style.js +25 -0
- package/dist/cjs/components/Stopwatch/Stopwatch.style.js.map +1 -0
- package/dist/cjs/components/Stopwatch/index.js +17 -0
- package/dist/cjs/components/Stopwatch/index.js.map +1 -0
- package/dist/cjs/utils/index.js +9 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/esm/components/Input/Input.d.ts +1 -0
- package/dist/esm/components/Input/Input.d.ts.map +1 -1
- package/dist/esm/components/Input/Input.js +3 -2
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Input/InputHours.d.ts +1 -1
- package/dist/esm/components/Input/InputHours.d.ts.map +1 -1
- package/dist/esm/components/Input/InputHours.js.map +1 -1
- package/dist/esm/components/Input/Styles.d.ts.map +1 -1
- package/dist/esm/components/Input/Styles.js +6 -2
- package/dist/esm/components/Input/Styles.js.map +1 -1
- package/dist/esm/components/Input/types.d.ts +1 -1
- package/dist/esm/components/Input/types.d.ts.map +1 -1
- package/dist/esm/components/Input/types.js.map +1 -1
- package/dist/esm/components/Stopwatch/Stopwatch.d.ts +6 -0
- package/dist/esm/components/Stopwatch/Stopwatch.d.ts.map +1 -0
- package/dist/esm/components/Stopwatch/Stopwatch.js +43 -0
- package/dist/esm/components/Stopwatch/Stopwatch.js.map +1 -0
- package/dist/esm/components/Stopwatch/Stopwatch.style.d.ts +5 -0
- package/dist/esm/components/Stopwatch/Stopwatch.style.d.ts.map +1 -0
- package/dist/esm/components/Stopwatch/Stopwatch.style.js +15 -0
- package/dist/esm/components/Stopwatch/Stopwatch.style.js.map +1 -0
- package/dist/esm/components/Stopwatch/index.d.ts +2 -0
- package/dist/esm/components/Stopwatch/index.d.ts.map +1 -0
- package/dist/esm/components/Stopwatch/index.js +2 -0
- package/dist/esm/components/Stopwatch/index.js.map +1 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/index.js +103 -97
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Stopwatch/index.ts"],"sourcesContent":["export * from \"./Stopwatch\";\n"],"mappings":"AAAA,cAAc,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","useForkRef","useResizeObserver"],"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from \"./layers\";\nexport * from \"./validation\";\nexport { default as useForkRef } from \"./useForkRef\";\nexport { default as useResizeObserver } from \"./useResizeObserver\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","useForkRef","useResizeObserver","decimalToHours"],"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from \"./layers\";\nexport * from \"./validation\";\nexport { default as useForkRef } from \"./useForkRef\";\nexport { default as useResizeObserver } from \"./useResizeObserver\";\nexport { decimalToHours } from \"./timeUtils\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qBAAqB;AAClE,SAASC,cAAc,QAAQ,aAAa"}
|
package/dist/index.js
CHANGED
|
@@ -478,6 +478,99 @@
|
|
|
478
478
|
};
|
|
479
479
|
var useResizeObserver$1 = useResizeObserver;
|
|
480
480
|
|
|
481
|
+
// export const decimalToHours = (decimal: string) => {
|
|
482
|
+
// // we round it on two decimals first, to eliminate quirks, eg, 5.99999999 will return 5:59 instead of 6:00
|
|
483
|
+
// decimal = parseFloat(decimal).toFixed(2);
|
|
484
|
+
// decimal = decimal + "";
|
|
485
|
+
// let hours;
|
|
486
|
+
// let minutes_decimal;
|
|
487
|
+
//
|
|
488
|
+
// if (decimal.indexOf(".") < 0) {
|
|
489
|
+
// hours = parseInt(decimal);
|
|
490
|
+
// minutes_decimal = 0;
|
|
491
|
+
// } else {
|
|
492
|
+
// hours = parseInt(decimal.substring(0, decimal.indexOf(".")));
|
|
493
|
+
// minutes_decimal = decimal.substring(decimal.indexOf(".") + 1);
|
|
494
|
+
// minutes_decimal = minutes_decimal.substring(0, 2);
|
|
495
|
+
// if (minutes_decimal.length === 1) {
|
|
496
|
+
// minutes_decimal += "0";
|
|
497
|
+
// } // if
|
|
498
|
+
// minutes_decimal = parseInt(minutes_decimal);
|
|
499
|
+
// } // if
|
|
500
|
+
//
|
|
501
|
+
// const minutes = Math.round((minutes_decimal / 100) * 60);
|
|
502
|
+
//
|
|
503
|
+
// if (hours < 10) {
|
|
504
|
+
// hours = `0${hours}`;
|
|
505
|
+
// }
|
|
506
|
+
// return {
|
|
507
|
+
// hours: hours,
|
|
508
|
+
// minutes: minutes,
|
|
509
|
+
// };
|
|
510
|
+
// };
|
|
511
|
+
|
|
512
|
+
var decimalToHours = function decimalToHours(num) {
|
|
513
|
+
var withLeadingZeroHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
514
|
+
if (!num) {
|
|
515
|
+
return "";
|
|
516
|
+
}
|
|
517
|
+
if (typeof num === "string" && !num) {
|
|
518
|
+
return withLeadingZeroHours ? "00:00" : "0:00";
|
|
519
|
+
}
|
|
520
|
+
if (typeof num === "string" && num.indexOf(":") >= 0) {
|
|
521
|
+
//eslint-disable-next-line
|
|
522
|
+
var _num$split = num.split(":"),
|
|
523
|
+
_num$split2 = _slicedToArray(_num$split, 2),
|
|
524
|
+
_hours = _num$split2[0],
|
|
525
|
+
_minutes = _num$split2[1];
|
|
526
|
+
if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {
|
|
527
|
+
_minutes = "".concat(Number(_minutes), "0");
|
|
528
|
+
}
|
|
529
|
+
if (_hours && _minutes) {
|
|
530
|
+
if (withLeadingZeroHours) {
|
|
531
|
+
return "".concat(withLeadingZero(_hours), ":").concat(_minutes);
|
|
532
|
+
}
|
|
533
|
+
return "".concat(_hours, ":").concat(_minutes);
|
|
534
|
+
} else if (!_hours && _minutes) {
|
|
535
|
+
return withLeadingZeroHours ? "00:".concat(_minutes) : "0:".concat(_minutes);
|
|
536
|
+
} else if (!_minutes && _hours) {
|
|
537
|
+
return withLeadingZeroHours ? "".concat(withLeadingZero(_hours), ":00") : "".concat(_hours, ":00");
|
|
538
|
+
} else {
|
|
539
|
+
return withLeadingZeroHours ? "00:00" : "0:00";
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
if (typeof num === "string" && num.indexOf(",") >= 0) {
|
|
543
|
+
num = num.replace(",", ".");
|
|
544
|
+
}
|
|
545
|
+
var input = typeof num === "string" ? parseFloat(num) : num;
|
|
546
|
+
if (!isDecimal(input)) {
|
|
547
|
+
if (withLeadingZeroHours) {
|
|
548
|
+
return "".concat(withLeadingZero(input), ":00");
|
|
549
|
+
}
|
|
550
|
+
return "".concat(input, ":00");
|
|
551
|
+
}
|
|
552
|
+
var decimal = input.toFixed(2);
|
|
553
|
+
var time = decimal.toString().split(".");
|
|
554
|
+
var hours = time[0];
|
|
555
|
+
if (withLeadingZeroHours) {
|
|
556
|
+
hours = withLeadingZero(hours);
|
|
557
|
+
}
|
|
558
|
+
var minutes = time[1];
|
|
559
|
+
var minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
|
|
560
|
+
return "".concat(hours, ":").concat(withLeadingZero(minutes_formatted));
|
|
561
|
+
};
|
|
562
|
+
var withLeadingZero = function withLeadingZero(num) {
|
|
563
|
+
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
564
|
+
var s = "".concat(num);
|
|
565
|
+
while (s.length < size) {
|
|
566
|
+
s = "0" + s;
|
|
567
|
+
}
|
|
568
|
+
return s;
|
|
569
|
+
};
|
|
570
|
+
var isDecimal = function isDecimal(num) {
|
|
571
|
+
return !Number.isInteger(num);
|
|
572
|
+
};
|
|
573
|
+
|
|
481
574
|
var MenuContext = /*#__PURE__*/React.createContext({});
|
|
482
575
|
var MenuContextProvider = MenuContext.Provider;
|
|
483
576
|
MenuContext.Consumer;
|
|
@@ -11306,10 +11399,12 @@
|
|
|
11306
11399
|
var StyledInputWrapper = styled__default["default"].div.withConfig({
|
|
11307
11400
|
displayName: "Styles__StyledInputWrapper",
|
|
11308
11401
|
componentId: "sc-ce8kcp-0"
|
|
11309
|
-
})(["align-items:center;background-color:var(--input-background-color);border-color:var(--color-theme-500);border-radius:8px;border-style:solid;border-width:1px;cursor:text;display:flex;height:32px;padding-block:4px;padding-inline:4px;transition:all 0.3s ease;width:360px;", " ", " ", " ", " ", " ", " ", ""], FontStyle, BoxSizingStyle, function (props) {
|
|
11402
|
+
})(["align-items:center;background-color:var(--input-background-color);border-color:var(--color-theme-500);border-radius:8px;border-style:solid;border-width:1px;cursor:text;display:flex;height:32px;padding-block:4px;padding-inline:4px;transition:all 0.3s ease;width:360px;", " ", " ", " ", " ", " ", " ", " ", ""], FontStyle, BoxSizingStyle, function (props) {
|
|
11310
11403
|
return props.$size === "small" && styled.css(["border-radius:6px;height:24px;"]);
|
|
11311
11404
|
}, function (props) {
|
|
11312
11405
|
return props.$size === "big" && styled.css(["height:40px;"]);
|
|
11406
|
+
}, function (props) {
|
|
11407
|
+
return props.$size === "biggest" && styled.css(["height:48px;"]);
|
|
11313
11408
|
}, function (props) {
|
|
11314
11409
|
return props.$disabled && styled.css(["cursor:default;opacity:50%;"]);
|
|
11315
11410
|
}, function (props) {
|
|
@@ -11321,8 +11416,10 @@
|
|
|
11321
11416
|
var StyledInput$2 = styled__default["default"].input.withConfig({
|
|
11322
11417
|
displayName: "Styles__StyledInput",
|
|
11323
11418
|
componentId: "sc-ce8kcp-1"
|
|
11324
|
-
})(["background-color:var(--input-background-color);border:none;color:var(--color-theme-900);font-size:0.875rem;font-weight:400;letter-spacing:0.02em;margin-block:0;margin-inline:4px;outline:none;padding:0;width:100%;&::placeholder{color:var(--color-theme-transparent-500);}", " ", " ", ""], function (props) {
|
|
11419
|
+
})(["background-color:var(--input-background-color);border:none;color:var(--color-theme-900);font-size:0.875rem;font-weight:400;letter-spacing:0.02em;margin-block:0;margin-inline:4px;outline:none;padding:0;width:100%;&::placeholder{color:var(--color-theme-transparent-500);}", " ", " ", " ", ""], function (props) {
|
|
11325
11420
|
return props.$size === "big" && styled.css(["font-size:1rem;"]);
|
|
11421
|
+
}, function (props) {
|
|
11422
|
+
return props.$size === "biggest" && styled.css(["font-size:1.25rem;font-weight:500;"]);
|
|
11326
11423
|
}, function (props) {
|
|
11327
11424
|
return props.disabled && styled.css(["cursor:default;"]);
|
|
11328
11425
|
}, function (props) {
|
|
@@ -11330,7 +11427,7 @@
|
|
|
11330
11427
|
});
|
|
11331
11428
|
StyledInput$2.displayName = "StyledInput";
|
|
11332
11429
|
|
|
11333
|
-
var _excluded$N = ["className", "style", "type", "disabled", "size", "invalid", "startAdornment", "endAdornment", "wrapRef", "wrapperClick"];
|
|
11430
|
+
var _excluded$N = ["className", "style", "type", "disabled", "size", "invalid", "startAdornment", "endAdornment", "wrapRef", "inputClassName", "wrapperClick"];
|
|
11334
11431
|
var Input = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
|
11335
11432
|
var _ref$className = _ref.className,
|
|
11336
11433
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
@@ -11346,6 +11443,7 @@
|
|
|
11346
11443
|
startAdornment = _ref.startAdornment,
|
|
11347
11444
|
endAdornment = _ref.endAdornment,
|
|
11348
11445
|
wrapRef = _ref.wrapRef,
|
|
11446
|
+
inputClassName = _ref.inputClassName,
|
|
11349
11447
|
wrapperClick = _ref.wrapperClick,
|
|
11350
11448
|
rest = _objectWithoutProperties(_ref, _excluded$N);
|
|
11351
11449
|
var intInputRef = React.useRef(null);
|
|
@@ -11368,7 +11466,7 @@
|
|
|
11368
11466
|
type: type,
|
|
11369
11467
|
$size: size,
|
|
11370
11468
|
disabled: disabled,
|
|
11371
|
-
className: "c-input",
|
|
11469
|
+
className: classNames__default["default"]("c-input", inputClassName),
|
|
11372
11470
|
"aria-invalid": invalid,
|
|
11373
11471
|
"data-form-type": "other"
|
|
11374
11472
|
}, rest)), endAdornment);
|
|
@@ -12276,99 +12374,6 @@
|
|
|
12276
12374
|
});
|
|
12277
12375
|
InputAdornment.displayName = "InputAdornment";
|
|
12278
12376
|
|
|
12279
|
-
// export const decimalToHours = (decimal: string) => {
|
|
12280
|
-
// // we round it on two decimals first, to eliminate quirks, eg, 5.99999999 will return 5:59 instead of 6:00
|
|
12281
|
-
// decimal = parseFloat(decimal).toFixed(2);
|
|
12282
|
-
// decimal = decimal + "";
|
|
12283
|
-
// let hours;
|
|
12284
|
-
// let minutes_decimal;
|
|
12285
|
-
//
|
|
12286
|
-
// if (decimal.indexOf(".") < 0) {
|
|
12287
|
-
// hours = parseInt(decimal);
|
|
12288
|
-
// minutes_decimal = 0;
|
|
12289
|
-
// } else {
|
|
12290
|
-
// hours = parseInt(decimal.substring(0, decimal.indexOf(".")));
|
|
12291
|
-
// minutes_decimal = decimal.substring(decimal.indexOf(".") + 1);
|
|
12292
|
-
// minutes_decimal = minutes_decimal.substring(0, 2);
|
|
12293
|
-
// if (minutes_decimal.length === 1) {
|
|
12294
|
-
// minutes_decimal += "0";
|
|
12295
|
-
// } // if
|
|
12296
|
-
// minutes_decimal = parseInt(minutes_decimal);
|
|
12297
|
-
// } // if
|
|
12298
|
-
//
|
|
12299
|
-
// const minutes = Math.round((minutes_decimal / 100) * 60);
|
|
12300
|
-
//
|
|
12301
|
-
// if (hours < 10) {
|
|
12302
|
-
// hours = `0${hours}`;
|
|
12303
|
-
// }
|
|
12304
|
-
// return {
|
|
12305
|
-
// hours: hours,
|
|
12306
|
-
// minutes: minutes,
|
|
12307
|
-
// };
|
|
12308
|
-
// };
|
|
12309
|
-
|
|
12310
|
-
var decimalToHours = function decimalToHours(num) {
|
|
12311
|
-
var withLeadingZeroHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
12312
|
-
if (!num) {
|
|
12313
|
-
return "";
|
|
12314
|
-
}
|
|
12315
|
-
if (typeof num === "string" && !num) {
|
|
12316
|
-
return withLeadingZeroHours ? "00:00" : "0:00";
|
|
12317
|
-
}
|
|
12318
|
-
if (typeof num === "string" && num.indexOf(":") >= 0) {
|
|
12319
|
-
//eslint-disable-next-line
|
|
12320
|
-
var _num$split = num.split(":"),
|
|
12321
|
-
_num$split2 = _slicedToArray(_num$split, 2),
|
|
12322
|
-
_hours = _num$split2[0],
|
|
12323
|
-
_minutes = _num$split2[1];
|
|
12324
|
-
if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {
|
|
12325
|
-
_minutes = "".concat(Number(_minutes), "0");
|
|
12326
|
-
}
|
|
12327
|
-
if (_hours && _minutes) {
|
|
12328
|
-
if (withLeadingZeroHours) {
|
|
12329
|
-
return "".concat(withLeadingZero(_hours), ":").concat(_minutes);
|
|
12330
|
-
}
|
|
12331
|
-
return "".concat(_hours, ":").concat(_minutes);
|
|
12332
|
-
} else if (!_hours && _minutes) {
|
|
12333
|
-
return withLeadingZeroHours ? "00:".concat(_minutes) : "0:".concat(_minutes);
|
|
12334
|
-
} else if (!_minutes && _hours) {
|
|
12335
|
-
return withLeadingZeroHours ? "".concat(withLeadingZero(_hours), ":00") : "".concat(_hours, ":00");
|
|
12336
|
-
} else {
|
|
12337
|
-
return withLeadingZeroHours ? "00:00" : "0:00";
|
|
12338
|
-
}
|
|
12339
|
-
}
|
|
12340
|
-
if (typeof num === "string" && num.indexOf(",") >= 0) {
|
|
12341
|
-
num = num.replace(",", ".");
|
|
12342
|
-
}
|
|
12343
|
-
var input = typeof num === "string" ? parseFloat(num) : num;
|
|
12344
|
-
if (!isDecimal(input)) {
|
|
12345
|
-
if (withLeadingZeroHours) {
|
|
12346
|
-
return "".concat(withLeadingZero(input), ":00");
|
|
12347
|
-
}
|
|
12348
|
-
return "".concat(input, ":00");
|
|
12349
|
-
}
|
|
12350
|
-
var decimal = input.toFixed(2);
|
|
12351
|
-
var time = decimal.toString().split(".");
|
|
12352
|
-
var hours = time[0];
|
|
12353
|
-
if (withLeadingZeroHours) {
|
|
12354
|
-
hours = withLeadingZero(hours);
|
|
12355
|
-
}
|
|
12356
|
-
var minutes = time[1];
|
|
12357
|
-
var minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
|
|
12358
|
-
return "".concat(hours, ":").concat(withLeadingZero(minutes_formatted));
|
|
12359
|
-
};
|
|
12360
|
-
var withLeadingZero = function withLeadingZero(num) {
|
|
12361
|
-
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
12362
|
-
var s = "".concat(num);
|
|
12363
|
-
while (s.length < size) {
|
|
12364
|
-
s = "0" + s;
|
|
12365
|
-
}
|
|
12366
|
-
return s;
|
|
12367
|
-
};
|
|
12368
|
-
var isDecimal = function isDecimal(num) {
|
|
12369
|
-
return !Number.isInteger(num);
|
|
12370
|
-
};
|
|
12371
|
-
|
|
12372
12377
|
var StyledDiv = styled__default["default"].div.withConfig({
|
|
12373
12378
|
displayName: "Styles__StyledDiv",
|
|
12374
12379
|
componentId: "sc-1wapx2a-0"
|
|
@@ -18065,6 +18070,7 @@
|
|
|
18065
18070
|
exports._CommandPalette = _CommandPalette;
|
|
18066
18071
|
exports._Dialog = _Dialog;
|
|
18067
18072
|
exports._List = _List;
|
|
18073
|
+
exports.decimalToHours = decimalToHours;
|
|
18068
18074
|
exports.isOptionGroup = isOptionGroup;
|
|
18069
18075
|
exports.layers = layers;
|
|
18070
18076
|
exports.signifierTypes = signifierTypes;
|