loon-bulma-react 2023.0.12 → 2023.0.13

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.js CHANGED
@@ -2930,6 +2930,28 @@ var JSDateTime = /*#__PURE__*/function () {
2930
2930
  return rslt;
2931
2931
  };
2932
2932
  _createClass(JSDateTime, [{
2933
+ key: "info",
2934
+ get:
2935
+ function get() {
2936
+ return {
2937
+ year: {
2938
+ isLeapYear: this.isLeapYear,
2939
+ days: this.daysInYear,
2940
+ hours: this.daysInYear * 24,
2941
+ minutes: this.daysInYear * 24 * 60,
2942
+ seconds: this.daysInYear * 24 * 60 * 60,
2943
+ milliseconds: this.daysInYear * 24 * 60 * 60 * 1000
2944
+ },
2945
+ month: {
2946
+ days: this.daysInMonth,
2947
+ hours: this.daysInMonth * 24,
2948
+ minutes: this.daysInMonth * 24 * 60,
2949
+ seconds: this.daysInMonth * 24 * 60 * 60,
2950
+ milliseconds: this.daysInMonth * 24 * 60 * 60 * 1000
2951
+ }
2952
+ };
2953
+ }
2954
+ }, {
2933
2955
  key: "isLeapYear",
2934
2956
  get:
2935
2957
  function get() {
@@ -3253,6 +3275,101 @@ JSDateTime.defaultFormatOptions = {
3253
3275
  second: '2-digit'
3254
3276
  };
3255
3277
 
3278
+ var JSDuration = /*#__PURE__*/function () {
3279
+ function JSDuration(jsd1, jsd2) {
3280
+ if (jsd2 === void 0) {
3281
+ jsd2 = JSDateTime.now();
3282
+ }
3283
+ this.jsdate1 = jsd1 instanceof Date ? JSDateTime.fromDate(jsd1) : jsd1.clone();
3284
+ this.jsdate2 = jsd2 instanceof Date ? JSDateTime.fromDate(jsd2) : jsd2.clone();
3285
+ }
3286
+ var _proto = JSDuration.prototype;
3287
+ _proto.differenceIn =
3288
+ function differenceIn(types) {
3289
+ var millis = this.ms;
3290
+ var rslt = {};
3291
+ var subtractVal = 1000 * 60 * 60 * 24 * 7;
3292
+ var order = [['weeks', 7], ['days', 24], ['hours', 60], ['minutes', 60], ['seconds', 1000], ['milliseconds', 0]];
3293
+ order.forEach(function (_ref) {
3294
+ var type = _ref[0],
3295
+ factor = _ref[1];
3296
+ if (types.includes(type)) {
3297
+ var _Object$assign;
3298
+ var value = 0;
3299
+ while (millis >= subtractVal) {
3300
+ value++;
3301
+ millis -= subtractVal;
3302
+ }
3303
+ Object.assign(rslt, (_Object$assign = {}, _Object$assign[type] = value, _Object$assign));
3304
+ }
3305
+ subtractVal /= factor;
3306
+ });
3307
+
3308
+ if (millis !== 0)
3309
+ Object.assign(rslt, {
3310
+ rest: millis
3311
+ });
3312
+ return rslt;
3313
+ };
3314
+ _createClass(JSDuration, [{
3315
+ key: "ms",
3316
+ get:
3317
+ function get() {
3318
+ return Math.abs(this.jsdate2.valueOf() - this.jsdate1.valueOf());
3319
+ }
3320
+ }, {
3321
+ key: "inMillis",
3322
+ get:
3323
+ function get() {
3324
+ return this.ms;
3325
+ }
3326
+ }, {
3327
+ key: "inSeconds",
3328
+ get:
3329
+ function get() {
3330
+ return Math.floor(this.ms / 1000);
3331
+ }
3332
+ }, {
3333
+ key: "inMinutes",
3334
+ get:
3335
+ function get() {
3336
+ return Math.floor(this.ms / (1000 * 60));
3337
+ }
3338
+ }, {
3339
+ key: "inHours",
3340
+ get:
3341
+ function get() {
3342
+ return Math.floor(this.ms / (1000 * 60 * 60));
3343
+ }
3344
+ }, {
3345
+ key: "inDays",
3346
+ get:
3347
+ function get() {
3348
+ return Math.floor(this.ms / (1000 * 60 * 60 * 24));
3349
+ }
3350
+ }, {
3351
+ key: "inWeeks",
3352
+ get:
3353
+ function get() {
3354
+ return Math.floor(this.ms / (1000 * 60 * 60 * 24 * 7));
3355
+ }
3356
+ }, {
3357
+ key: "inAllTypes",
3358
+ get:
3359
+ function get() {
3360
+ return {
3361
+ milliseconds: this.inMillis,
3362
+ seconds: this.inSeconds,
3363
+ minutes: this.inMinutes,
3364
+ hours: this.inHours,
3365
+ days: this.inDays,
3366
+ weeks: this.inWeeks
3367
+ };
3368
+ }
3369
+ }]);
3370
+ return JSDuration;
3371
+ }();
3372
+
3256
3373
  function hasBSN(txt) {
3257
3374
  txt = txt.replaceAll(/[^0-9a-zA-Z]/g, '');
3258
3375
  var possibleBSNs = txt.match(/[0-9]{9}/g);
@@ -3583,8 +3700,8 @@ function DayContainer(_ref) {
3583
3700
  fontSize: '0.66em'
3584
3701
  }
3585
3702
  }, " ", date.monthLong)), React__default.createElement("div", null, events.map(function (evt, index) {
3586
- var _options$event, _options$event2, _options$event3, _options$event4;
3587
- var key = "" + (typeof evt.id === 'function' ? evt.id() : evt.id);
3703
+ var _ref2, _options$event, _options$event2, _options$event3, _options$event4;
3704
+ var key = (_ref2 = "" + (typeof evt.id === 'function' ? evt.id() : evt.id)) != null ? _ref2 : index;
3588
3705
  if (evt.allDay && index < 4) return React__default.createElement(CalendarColoredItem, {
3589
3706
  desc: function desc(evt) {
3590
3707
  return React__default.createElement("span", null, typeof evt.title === 'string' ? evt.title : evt.title());
@@ -7229,6 +7346,7 @@ exports.Image = Image;
7229
7346
  exports.Indicator = Indicator;
7230
7347
  exports.Input = Input;
7231
7348
  exports.JSDateTime = JSDateTime;
7349
+ exports.JSDuration = JSDuration;
7232
7350
  exports.Kbd = Kbd;
7233
7351
  exports.Kbds = Kbds;
7234
7352
  exports.Link = Link;