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 +120 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +120 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/JSDateTime.class.d.ts +16 -0
- package/dist/utils/JSDuration.class.d.ts +82 -0
- package/dist/utils/JSDuration.d.ts +2 -5
- package/dist/utils/index.d.ts +1 -0
- package/package.json +7 -7
package/dist/index.modern.js
CHANGED
|
@@ -2927,6 +2927,28 @@ var JSDateTime = /*#__PURE__*/function () {
|
|
|
2927
2927
|
return rslt;
|
|
2928
2928
|
};
|
|
2929
2929
|
_createClass(JSDateTime, [{
|
|
2930
|
+
key: "info",
|
|
2931
|
+
get:
|
|
2932
|
+
function get() {
|
|
2933
|
+
return {
|
|
2934
|
+
year: {
|
|
2935
|
+
isLeapYear: this.isLeapYear,
|
|
2936
|
+
days: this.daysInYear,
|
|
2937
|
+
hours: this.daysInYear * 24,
|
|
2938
|
+
minutes: this.daysInYear * 24 * 60,
|
|
2939
|
+
seconds: this.daysInYear * 24 * 60 * 60,
|
|
2940
|
+
milliseconds: this.daysInYear * 24 * 60 * 60 * 1000
|
|
2941
|
+
},
|
|
2942
|
+
month: {
|
|
2943
|
+
days: this.daysInMonth,
|
|
2944
|
+
hours: this.daysInMonth * 24,
|
|
2945
|
+
minutes: this.daysInMonth * 24 * 60,
|
|
2946
|
+
seconds: this.daysInMonth * 24 * 60 * 60,
|
|
2947
|
+
milliseconds: this.daysInMonth * 24 * 60 * 60 * 1000
|
|
2948
|
+
}
|
|
2949
|
+
};
|
|
2950
|
+
}
|
|
2951
|
+
}, {
|
|
2930
2952
|
key: "isLeapYear",
|
|
2931
2953
|
get:
|
|
2932
2954
|
function get() {
|
|
@@ -3250,6 +3272,101 @@ JSDateTime.defaultFormatOptions = {
|
|
|
3250
3272
|
second: '2-digit'
|
|
3251
3273
|
};
|
|
3252
3274
|
|
|
3275
|
+
var JSDuration = /*#__PURE__*/function () {
|
|
3276
|
+
function JSDuration(jsd1, jsd2) {
|
|
3277
|
+
if (jsd2 === void 0) {
|
|
3278
|
+
jsd2 = JSDateTime.now();
|
|
3279
|
+
}
|
|
3280
|
+
this.jsdate1 = jsd1 instanceof Date ? JSDateTime.fromDate(jsd1) : jsd1.clone();
|
|
3281
|
+
this.jsdate2 = jsd2 instanceof Date ? JSDateTime.fromDate(jsd2) : jsd2.clone();
|
|
3282
|
+
}
|
|
3283
|
+
var _proto = JSDuration.prototype;
|
|
3284
|
+
_proto.differenceIn =
|
|
3285
|
+
function differenceIn(types) {
|
|
3286
|
+
var millis = this.ms;
|
|
3287
|
+
var rslt = {};
|
|
3288
|
+
var subtractVal = 1000 * 60 * 60 * 24 * 7;
|
|
3289
|
+
var order = [['weeks', 7], ['days', 24], ['hours', 60], ['minutes', 60], ['seconds', 1000], ['milliseconds', 0]];
|
|
3290
|
+
order.forEach(function (_ref) {
|
|
3291
|
+
var type = _ref[0],
|
|
3292
|
+
factor = _ref[1];
|
|
3293
|
+
if (types.includes(type)) {
|
|
3294
|
+
var _Object$assign;
|
|
3295
|
+
var value = 0;
|
|
3296
|
+
while (millis >= subtractVal) {
|
|
3297
|
+
value++;
|
|
3298
|
+
millis -= subtractVal;
|
|
3299
|
+
}
|
|
3300
|
+
Object.assign(rslt, (_Object$assign = {}, _Object$assign[type] = value, _Object$assign));
|
|
3301
|
+
}
|
|
3302
|
+
subtractVal /= factor;
|
|
3303
|
+
});
|
|
3304
|
+
|
|
3305
|
+
if (millis !== 0)
|
|
3306
|
+
Object.assign(rslt, {
|
|
3307
|
+
rest: millis
|
|
3308
|
+
});
|
|
3309
|
+
return rslt;
|
|
3310
|
+
};
|
|
3311
|
+
_createClass(JSDuration, [{
|
|
3312
|
+
key: "ms",
|
|
3313
|
+
get:
|
|
3314
|
+
function get() {
|
|
3315
|
+
return Math.abs(this.jsdate2.valueOf() - this.jsdate1.valueOf());
|
|
3316
|
+
}
|
|
3317
|
+
}, {
|
|
3318
|
+
key: "inMillis",
|
|
3319
|
+
get:
|
|
3320
|
+
function get() {
|
|
3321
|
+
return this.ms;
|
|
3322
|
+
}
|
|
3323
|
+
}, {
|
|
3324
|
+
key: "inSeconds",
|
|
3325
|
+
get:
|
|
3326
|
+
function get() {
|
|
3327
|
+
return Math.floor(this.ms / 1000);
|
|
3328
|
+
}
|
|
3329
|
+
}, {
|
|
3330
|
+
key: "inMinutes",
|
|
3331
|
+
get:
|
|
3332
|
+
function get() {
|
|
3333
|
+
return Math.floor(this.ms / (1000 * 60));
|
|
3334
|
+
}
|
|
3335
|
+
}, {
|
|
3336
|
+
key: "inHours",
|
|
3337
|
+
get:
|
|
3338
|
+
function get() {
|
|
3339
|
+
return Math.floor(this.ms / (1000 * 60 * 60));
|
|
3340
|
+
}
|
|
3341
|
+
}, {
|
|
3342
|
+
key: "inDays",
|
|
3343
|
+
get:
|
|
3344
|
+
function get() {
|
|
3345
|
+
return Math.floor(this.ms / (1000 * 60 * 60 * 24));
|
|
3346
|
+
}
|
|
3347
|
+
}, {
|
|
3348
|
+
key: "inWeeks",
|
|
3349
|
+
get:
|
|
3350
|
+
function get() {
|
|
3351
|
+
return Math.floor(this.ms / (1000 * 60 * 60 * 24 * 7));
|
|
3352
|
+
}
|
|
3353
|
+
}, {
|
|
3354
|
+
key: "inAllTypes",
|
|
3355
|
+
get:
|
|
3356
|
+
function get() {
|
|
3357
|
+
return {
|
|
3358
|
+
milliseconds: this.inMillis,
|
|
3359
|
+
seconds: this.inSeconds,
|
|
3360
|
+
minutes: this.inMinutes,
|
|
3361
|
+
hours: this.inHours,
|
|
3362
|
+
days: this.inDays,
|
|
3363
|
+
weeks: this.inWeeks
|
|
3364
|
+
};
|
|
3365
|
+
}
|
|
3366
|
+
}]);
|
|
3367
|
+
return JSDuration;
|
|
3368
|
+
}();
|
|
3369
|
+
|
|
3253
3370
|
function hasBSN(txt) {
|
|
3254
3371
|
txt = txt.replaceAll(/[^0-9a-zA-Z]/g, '');
|
|
3255
3372
|
var possibleBSNs = txt.match(/[0-9]{9}/g);
|
|
@@ -3580,8 +3697,8 @@ function DayContainer(_ref) {
|
|
|
3580
3697
|
fontSize: '0.66em'
|
|
3581
3698
|
}
|
|
3582
3699
|
}, " ", date.monthLong)), React.createElement("div", null, events.map(function (evt, index) {
|
|
3583
|
-
var _options$event, _options$event2, _options$event3, _options$event4;
|
|
3584
|
-
var key = "" + (typeof evt.id === 'function' ? evt.id() : evt.id);
|
|
3700
|
+
var _ref2, _options$event, _options$event2, _options$event3, _options$event4;
|
|
3701
|
+
var key = (_ref2 = "" + (typeof evt.id === 'function' ? evt.id() : evt.id)) != null ? _ref2 : index;
|
|
3585
3702
|
if (evt.allDay && index < 4) return React.createElement(CalendarColoredItem, {
|
|
3586
3703
|
desc: function desc(evt) {
|
|
3587
3704
|
return React.createElement("span", null, typeof evt.title === 'string' ? evt.title : evt.title());
|
|
@@ -7196,5 +7313,5 @@ function ConfirmDialog() {
|
|
|
7196
7313
|
}, confirmState.cancel), confirmState.others)))) : null;
|
|
7197
7314
|
}
|
|
7198
7315
|
|
|
7199
|
-
export { AspectRatio, Box, Button, ButtonGroup, Calendar, CheckBox, ColorInput, Column, Columns, ConfirmProvider, Container, Content, LbrCurrencyInput as CurrencyInput, DOTS, DataTable, DateInput, DateTimeInput, EmailInput, FileInput, Footer, Form, FormBuilder, Hero, HiddenInput, Icon, IconText, Image, Indicator, Input, JSDateTime, Kbd, Kbds, Link, LinkButton, Menu, Message, Modal, MultiRangeInput, MultiSelect, Notification, Notifier, NotifierProvider, NumberInput, PasswordInput, ProgressBar, Radio, RadioGroup, RangeInput, ScrollArea, Section, Select, SimpleTable, Steps, Subtitle, TabBar, Tag, Tags, TextArea, TextInput, TimeInput, TimeLine, Title, TitleWithSubtitle, ToggleBar, calculateTxtColor, deserializeJSON, getHotkeyHandler, getHotkeyMatcher, hasBSN, parseHotkey, serializeJSON, useBoolToggle, useClipboard, useConfirm, useDebouncedValue, useHotkeys, useLocalStoredState, useNotifier, usePagination, useToggle, useUncontrolled, useValidatedState };
|
|
7316
|
+
export { AspectRatio, Box, Button, ButtonGroup, Calendar, CheckBox, ColorInput, Column, Columns, ConfirmProvider, Container, Content, LbrCurrencyInput as CurrencyInput, DOTS, DataTable, DateInput, DateTimeInput, EmailInput, FileInput, Footer, Form, FormBuilder, Hero, HiddenInput, Icon, IconText, Image, Indicator, Input, JSDateTime, JSDuration, Kbd, Kbds, Link, LinkButton, Menu, Message, Modal, MultiRangeInput, MultiSelect, Notification, Notifier, NotifierProvider, NumberInput, PasswordInput, ProgressBar, Radio, RadioGroup, RangeInput, ScrollArea, Section, Select, SimpleTable, Steps, Subtitle, TabBar, Tag, Tags, TextArea, TextInput, TimeInput, TimeLine, Title, TitleWithSubtitle, ToggleBar, calculateTxtColor, deserializeJSON, getHotkeyHandler, getHotkeyMatcher, hasBSN, parseHotkey, serializeJSON, useBoolToggle, useClipboard, useConfirm, useDebouncedValue, useHotkeys, useLocalStoredState, useNotifier, usePagination, useToggle, useUncontrolled, useValidatedState };
|
|
7200
7317
|
//# sourceMappingURL=index.modern.js.map
|