react-asc 25.10.1 → 25.12.0
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/index.d.ts +37 -2
- package/index.es.js +134 -12
- package/index.js +133 -11
- package/lib/components/List/ListItemAvatar.d.ts +7 -1
- package/lib/helpers/index.d.ts +1 -0
- package/lib/helpers/sort.helper.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/typings/array-extension.d.ts +10 -0
- package/lib/typings/date-extension.d.ts +13 -0
- package/lib/typings/index.d.ts +3 -0
- package/lib/typings/string-extensions.d.ts +6 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React$1, { ReactNode, Component, ComponentProps, ReactElement } from 'react';
|
|
3
3
|
import { UnparseObject, ParseResult } from 'papaparse';
|
|
4
|
+
import { ConfigType, OpUnitType, ManipulateType } from 'dayjs';
|
|
4
5
|
|
|
5
6
|
declare enum COLOR {
|
|
6
7
|
primary = "primary",
|
|
@@ -485,8 +486,14 @@ declare const ListItem: (props: IListItemProps) => JSX.Element;
|
|
|
485
486
|
|
|
486
487
|
interface IListItemAvatarProps extends React$1.ComponentProps<'div'> {
|
|
487
488
|
avatar: React$1.ReactNode;
|
|
489
|
+
avatarSize?: ListItemAvatarSize;
|
|
488
490
|
}
|
|
489
|
-
declare
|
|
491
|
+
declare enum ListItemAvatarSize {
|
|
492
|
+
sm = "sm",
|
|
493
|
+
md = "md",
|
|
494
|
+
lg = "lg"
|
|
495
|
+
}
|
|
496
|
+
declare const ListItemAvatar: ({ avatar, avatarSize, ...rest }: IListItemAvatarProps) => JSX.Element;
|
|
490
497
|
|
|
491
498
|
interface IListItemIconProps extends React$1.ComponentProps<'div'> {
|
|
492
499
|
icon: React$1.ReactNode;
|
|
@@ -1087,4 +1094,32 @@ declare class LoggerService implements ILoggerService {
|
|
|
1087
1094
|
}
|
|
1088
1095
|
declare const loggerService: LoggerService;
|
|
1089
1096
|
|
|
1090
|
-
|
|
1097
|
+
declare global {
|
|
1098
|
+
interface Array<T> {
|
|
1099
|
+
groupBy(valueGetter: (a: T) => string): IDictionary<T[]>;
|
|
1100
|
+
orderBy<T, G>(valueGetter: (a: T) => G, ascending?: boolean): T[];
|
|
1101
|
+
filterBy<G>(key?: string): G[];
|
|
1102
|
+
distinct<T>(comparator?: (obj1: unknown, obj2: unknown) => boolean): T[];
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
declare global {
|
|
1107
|
+
interface Date {
|
|
1108
|
+
isAfter(date: ConfigType, unit?: OpUnitType): boolean;
|
|
1109
|
+
isBefore(date: ConfigType, unit?: OpUnitType): boolean;
|
|
1110
|
+
format(template?: string): string;
|
|
1111
|
+
isValid(): boolean;
|
|
1112
|
+
add(value: number, unit?: ManipulateType): Date;
|
|
1113
|
+
subtract(value: number, unit?: ManipulateType): Date;
|
|
1114
|
+
firstDayOfMonth(): Date;
|
|
1115
|
+
lastDayOfMonth(): Date;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
declare global {
|
|
1120
|
+
interface String {
|
|
1121
|
+
capitalize(): string;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
export { Alert, AppBar, AppBarTitle, AutoComplete, Backdrop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonContext, ButtonGroup, COLOR, Card, CardBody, CardFooter, CardImage, CardSubtitle, CardText, CardTitle, CaretDownSolidIcon, CheckSolidIcon, CheckSquareRegularIcon, Checkbox, ChevronDownSolidIcon, ChevronLeftSolidIcon, ChevronRightSolidIcon, ChevronUpSolidIcon, Chip, CircleSolidIcon, Column, ConditionalWrapper, CssTransition, DATEMODE, DatePicker, DateSelect, DaySelect, Dot, Drawer, EmailValidator, ExpansionPanel, ExpansionPanelContent, ExpansionPanelHeader, FileInput, FileService, FloatingActionButton, Form, FormControl, FormError, FormGroup, FormHint, FormInput, FormLabel, GlobalModal, HomeSolidIcon, HourSelect, HtmlBaseProps, HtmlInputProps, IAlertProps, IAppBarProps, IAppBarTitleProps, IAutoCompleteProps, IBackdropProps, IBadgeProps, IBreadcrumbItemProps, IBreadcrumbProps, IButtonContext, IButtonGroupProps, IButtonProps, ICheckboxProps, IChipProps, IContainerProps, IControls, IDatePickerProps, IDateSelectProps, IDaySelectProps, IDictionary, IDot, IDrawerProps, IExpansionPanelContentProps, IExpansionPanelHeaderProps, IExpansionPanelProps, IFileInputProps, IFileUnparseConfig, IFloatingActionButtonProps, IFormAutoCompleteOptions, IFormControlConfig, IFormControlType, IFormInputError, IFormInputEvent, IFormInputOptions, IFormInputProps, IFormProps, IFormSelectOptions, IFormState, IFormTextAreaOptions, IFormValidatorType, IHourProps, IIconButtonProps, IIconProps, IListItemProps, IListProps, ILoadingIndicatorContainerProps, ILoadingIndicatorService, ILoggerService, IMenuBodyProps, IMenuProps, IMilliSecondProps, IMinuteProps, IModalButton, IModalOptions, IModalProps$1 as IModalProps, IModalService, IMonthProps, INumberSelectProps, IPortalProps, IProgressBarProps, ISecondProps, ISelectOption, ISelectProps, ISidebarItem, ISkeletonAvatarProps, ISkeletonFooterProps, ISkeletonImageProps, ISkeletonTextProps, ISnackbarOptions, ISnackbarProps, ISnackbarService, ISpeedDialActionProps, ISpeedDialIconProps, ISpeedDialProps, IStepProps, IStepperActionsProps, IStepperProps, ITabPanelProps, ITabProps, ITableCellProps, ITableProps, ITabsProps, ITextareaProps, ITimeSelectProps, ITooltipProps, ITreeItemProps, ITypographyProps, IUseWindowSize, IWrapperProps, IYearProps, Icon, IconButton, IsEmptyValidator, IsEqualValidator, Link, List, ListItem, ListItemAction, ListItemAvatar, ListItemAvatarSize, ListItemIcon, ListItemText, LoadingIndicator, LoadingIndicatorContainer, LogType, MODALBUTTONTYPE, MODALTYPE, MaxValidator, Menu, MenuBody, MenuDivider, MenuItem, MenuPosition, MenuToggle, MilliSecondSelect, MinValidator, MinuteSelect, Modal, ModalBody, ModalFooter, ModalHeader, MonthSelect, Nullable, NumberSelect, POSITION, PlusSolidIcon, Portal, ProgressBar, Row, SIZE, STATUS, SecondSelect, Select, Sidebar, SkeletonAvatar, SkeletonFooter, SkeletonImage, SkeletonText, Snackbar, SpeedDial, SpeedDialAction, SpeedDialIcon, SpinnerSolidIcon, SquareRegularIcon, Step, Stepper, StepperActions, TIMEMODE, Tab, TabPanel, Table, TableBody, TableCell, TableHead, TableRow, Tabs, Textarea, TimeSelect, TimesCircleSolidIcon, TimesSolidIcon, Tooltip, TooltipPlacement, TreeItem, TreeView, Typography, VARIANT, YearSelect, clipboardService, fileService, loadingIndicatorService, localService, loggerService, modalService, snackbarService, useButtonContext, useConstructor, useCssClasses, useDebounce, useHover, useMobileDetect, useOnDestroy, usePrevious, useWindowSize };
|
package/index.es.js
CHANGED
|
@@ -445,11 +445,25 @@ const ListItem = (props) => {
|
|
|
445
445
|
return (jsx("li", { onClick: handleClick, className: getCssClasses(), ...rest, children: children }));
|
|
446
446
|
};
|
|
447
447
|
|
|
448
|
-
var css_248z$Z = ".ListItemAvatar-module_avatar__sVWfR {\n display: flex;\n align-items: center;\n margin-right: 16px;\n}\n.ListItemAvatar-module_avatar__sVWfR svg
|
|
449
|
-
var styles$Z = {"avatar":"ListItemAvatar-module_avatar__sVWfR"};
|
|
448
|
+
var css_248z$Z = ".ListItemAvatar-module_avatar__sVWfR {\n display: flex;\n align-items: center;\n margin-right: 16px;\n}\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_sm__-lmR- svg,\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_sm__-lmR- img {\n width: 24px;\n height: 24px;\n}\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_md__SqRJi svg,\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_md__SqRJi img {\n width: 32px;\n height: 32px;\n}\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_lg__Z6LxN svg,\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_lg__Z6LxN img {\n width: 40px;\n height: 40px;\n}\n.ListItemAvatar-module_avatar__sVWfR img {\n border-radius: 50%;\n}";
|
|
449
|
+
var styles$Z = {"avatar":"ListItemAvatar-module_avatar__sVWfR","sm":"ListItemAvatar-module_sm__-lmR-","md":"ListItemAvatar-module_md__SqRJi","lg":"ListItemAvatar-module_lg__Z6LxN"};
|
|
450
450
|
styleInject(css_248z$Z);
|
|
451
451
|
|
|
452
|
-
|
|
452
|
+
var ListItemAvatarSize;
|
|
453
|
+
(function (ListItemAvatarSize) {
|
|
454
|
+
ListItemAvatarSize["sm"] = "sm";
|
|
455
|
+
ListItemAvatarSize["md"] = "md";
|
|
456
|
+
ListItemAvatarSize["lg"] = "lg";
|
|
457
|
+
})(ListItemAvatarSize || (ListItemAvatarSize = {}));
|
|
458
|
+
const ListItemAvatar = ({ avatar, avatarSize = ListItemAvatarSize.sm, ...rest }) => {
|
|
459
|
+
const getCssClasses = () => {
|
|
460
|
+
const cssClasses = [];
|
|
461
|
+
cssClasses.push(styles$Z.avatar);
|
|
462
|
+
cssClasses.push(styles$Z[avatarSize]);
|
|
463
|
+
return cssClasses.filter(css => css).join(' ');
|
|
464
|
+
};
|
|
465
|
+
return (jsx("div", { className: getCssClasses(), ...rest, children: avatar }));
|
|
466
|
+
};
|
|
453
467
|
|
|
454
468
|
var css_248z$Y = ".ListItemIcon-module_icon__cCvEv {\n margin-right: 32px;\n}\n.ListItemIcon-module_icon__cCvEv svg {\n width: 24px;\n height: 24px;\n}";
|
|
455
469
|
var styles$Y = {"icon":"ListItemIcon-module_icon__cCvEv"};
|
|
@@ -461,7 +475,17 @@ var css_248z$X = ".ListItemAction-module_listItemAction__gAQRj {\n display: fle
|
|
|
461
475
|
var styles$X = {"listItemAction":"ListItemAction-module_listItemAction__gAQRj"};
|
|
462
476
|
styleInject(css_248z$X);
|
|
463
477
|
|
|
464
|
-
const ListItemAction = ({ children, onClick, ...rest }) =>
|
|
478
|
+
const ListItemAction = ({ children, onClick, ...rest }) => {
|
|
479
|
+
const getCssClasses = () => {
|
|
480
|
+
const cssClasses = [];
|
|
481
|
+
cssClasses.push(styles$X.listItemAction);
|
|
482
|
+
return cssClasses.filter(css => css).join(' ');
|
|
483
|
+
};
|
|
484
|
+
const handleClick = (e) => {
|
|
485
|
+
onClick && onClick(e);
|
|
486
|
+
};
|
|
487
|
+
return (jsx("div", { className: getCssClasses(), onClick: handleClick, ...rest, children: children }));
|
|
488
|
+
};
|
|
465
489
|
|
|
466
490
|
var css_248z$W = ".ListItemTextIcon-module_listItemText__xCBLW {\n flex: 1;\n}";
|
|
467
491
|
var styles$W = {"listItemText":"ListItemTextIcon-module_listItemText__xCBLW"};
|
|
@@ -2109,7 +2133,7 @@ var root = freeGlobal || freeSelf || Function('return this')();
|
|
|
2109
2133
|
* @param {string} key The key of the property to get.
|
|
2110
2134
|
* @returns {*} Returns the property value.
|
|
2111
2135
|
*/
|
|
2112
|
-
function getValue$
|
|
2136
|
+
function getValue$2(object, key) {
|
|
2113
2137
|
return object == null ? undefined : object[key];
|
|
2114
2138
|
}
|
|
2115
2139
|
|
|
@@ -2534,7 +2558,7 @@ function getMapData(map, key) {
|
|
|
2534
2558
|
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
2535
2559
|
*/
|
|
2536
2560
|
function getNative(object, key) {
|
|
2537
|
-
var value = getValue$
|
|
2561
|
+
var value = getValue$2(object, key);
|
|
2538
2562
|
return baseIsNative(value) ? value : undefined;
|
|
2539
2563
|
}
|
|
2540
2564
|
|
|
@@ -4631,7 +4655,7 @@ function getValueType(view) {
|
|
|
4631
4655
|
var index = allViews.indexOf(view);
|
|
4632
4656
|
return allValueTypes[index];
|
|
4633
4657
|
}
|
|
4634
|
-
function getValue(value, index) {
|
|
4658
|
+
function getValue$1(value, index) {
|
|
4635
4659
|
var rawValue = Array.isArray(value) ? value[index] : value;
|
|
4636
4660
|
if (!rawValue) {
|
|
4637
4661
|
return null;
|
|
@@ -4644,7 +4668,7 @@ function getValue(value, index) {
|
|
|
4644
4668
|
}
|
|
4645
4669
|
function getDetailValue(_a, index) {
|
|
4646
4670
|
var value = _a.value, minDate = _a.minDate, maxDate = _a.maxDate, maxDetail = _a.maxDetail;
|
|
4647
|
-
var valuePiece = getValue(value, index);
|
|
4671
|
+
var valuePiece = getValue$1(value, index);
|
|
4648
4672
|
if (!valuePiece) {
|
|
4649
4673
|
return null;
|
|
4650
4674
|
}
|
|
@@ -5407,9 +5431,7 @@ const FormLabel = ({ children, className, htmlFor, ...rest }) => {
|
|
|
5407
5431
|
return (jsx("label", { htmlFor: htmlFor, className: getCssClasses(), ...rest, children: children }));
|
|
5408
5432
|
};
|
|
5409
5433
|
|
|
5410
|
-
const IsEmptyValidator = (value) => value?.trim() === ''
|
|
5411
|
-
|| value === null
|
|
5412
|
-
|| value === undefined;
|
|
5434
|
+
const IsEmptyValidator = (value) => value?.toString().trim() === '' || value === null || value === undefined;
|
|
5413
5435
|
|
|
5414
5436
|
const EmailValidator = (value) => {
|
|
5415
5437
|
const isInvalidEmailFormat = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i) === null;
|
|
@@ -7208,4 +7230,104 @@ class LocalService {
|
|
|
7208
7230
|
}
|
|
7209
7231
|
const localService = new LocalService();
|
|
7210
7232
|
|
|
7211
|
-
|
|
7233
|
+
var SortOrder;
|
|
7234
|
+
(function (SortOrder) {
|
|
7235
|
+
SortOrder[SortOrder["NONE"] = 0] = "NONE";
|
|
7236
|
+
SortOrder[SortOrder["ASC"] = 1] = "ASC";
|
|
7237
|
+
SortOrder[SortOrder["DESC"] = -1] = "DESC";
|
|
7238
|
+
})(SortOrder || (SortOrder = {}));
|
|
7239
|
+
const compareString = (valA, valB, ascending) => {
|
|
7240
|
+
return valA.localeCompare(valB) * (ascending ? SortOrder.ASC : SortOrder.DESC);
|
|
7241
|
+
};
|
|
7242
|
+
const getSortOrder = (valA, valB) => {
|
|
7243
|
+
return valA < valB ? SortOrder.DESC : valA === valB ? SortOrder.NONE : SortOrder.ASC;
|
|
7244
|
+
};
|
|
7245
|
+
const compareNonString = (valA, valB, ascending) => {
|
|
7246
|
+
return getSortOrder(valA, valB) * (ascending ? SortOrder.ASC : SortOrder.DESC);
|
|
7247
|
+
};
|
|
7248
|
+
const getValue = (valA, valB, ascending) => {
|
|
7249
|
+
let result = 0;
|
|
7250
|
+
if (typeof valA === 'string' && typeof valB === 'string') {
|
|
7251
|
+
result = compareString(valA, valB, ascending);
|
|
7252
|
+
}
|
|
7253
|
+
else {
|
|
7254
|
+
result = compareNonString(valA, valB, ascending);
|
|
7255
|
+
}
|
|
7256
|
+
return result;
|
|
7257
|
+
};
|
|
7258
|
+
const sortHelper = (a, b, valueGetter, ascending) => {
|
|
7259
|
+
const valA = valueGetter(a);
|
|
7260
|
+
const valB = valueGetter(b);
|
|
7261
|
+
return getValue(valA, valB, ascending);
|
|
7262
|
+
};
|
|
7263
|
+
|
|
7264
|
+
Array.prototype.groupBy = function (valueGetter) {
|
|
7265
|
+
return this.reduce((curr, obj) => {
|
|
7266
|
+
const key = valueGetter(obj);
|
|
7267
|
+
(curr[key] = curr[key] || []).push(obj);
|
|
7268
|
+
return curr;
|
|
7269
|
+
}, {});
|
|
7270
|
+
};
|
|
7271
|
+
Array.prototype.orderBy = function (valueGetter, ascending = true) {
|
|
7272
|
+
this?.sort((a, b) => sortHelper(a, b, valueGetter, ascending));
|
|
7273
|
+
return this;
|
|
7274
|
+
};
|
|
7275
|
+
Array.prototype.filterBy = function (key) {
|
|
7276
|
+
return this.filter(a => {
|
|
7277
|
+
let result = false;
|
|
7278
|
+
if (key && a[key]) {
|
|
7279
|
+
result = a[key] === key;
|
|
7280
|
+
}
|
|
7281
|
+
else {
|
|
7282
|
+
result = a === key;
|
|
7283
|
+
}
|
|
7284
|
+
return result;
|
|
7285
|
+
});
|
|
7286
|
+
};
|
|
7287
|
+
Array.prototype.distinct = function (comparator) {
|
|
7288
|
+
const thisAsArray = this;
|
|
7289
|
+
const result = comparator
|
|
7290
|
+
? thisAsArray.filter((value, index, array) => array.findIndex(o => comparator(o, value)) === index)
|
|
7291
|
+
: thisAsArray.filter((value, index, array) => array.indexOf(value) === index);
|
|
7292
|
+
return result;
|
|
7293
|
+
};
|
|
7294
|
+
|
|
7295
|
+
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
7296
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:O.s(this.$y,4,"0"),M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w}));
|
|
7297
|
+
});
|
|
7298
|
+
|
|
7299
|
+
var localizedFormat = createCommonjsModule(function (module, exports) {
|
|
7300
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,o,n){var r=o.prototype,i=r.format;n.en.formats=e,r.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var o=this.$locale().formats,n=function(t,o){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,o){return t||o.slice(1)}))}))}(t,void 0===o?{}:o);return i.call(this,n)};}}));
|
|
7301
|
+
});
|
|
7302
|
+
|
|
7303
|
+
dayjs_min.extend(localizedFormat);
|
|
7304
|
+
Date.prototype.isAfter = function (date, unit) {
|
|
7305
|
+
return dayjs_min(this).isAfter(date, unit);
|
|
7306
|
+
};
|
|
7307
|
+
Date.prototype.isBefore = function (date, unit) {
|
|
7308
|
+
return dayjs_min(this).isBefore(date, unit);
|
|
7309
|
+
};
|
|
7310
|
+
Date.prototype.format = function (template) {
|
|
7311
|
+
return dayjs_min(this).format(template);
|
|
7312
|
+
};
|
|
7313
|
+
Date.prototype.isValid = function () {
|
|
7314
|
+
return dayjs_min(this).isValid();
|
|
7315
|
+
};
|
|
7316
|
+
Date.prototype.add = function (value, unit) {
|
|
7317
|
+
return dayjs_min(this).add(value, unit).toDate();
|
|
7318
|
+
};
|
|
7319
|
+
Date.prototype.subtract = function (value, unit) {
|
|
7320
|
+
return dayjs_min(this).subtract(value, unit).toDate();
|
|
7321
|
+
};
|
|
7322
|
+
Date.prototype.firstDayOfMonth = function () {
|
|
7323
|
+
return dayjs_min(this).startOf('month').toDate();
|
|
7324
|
+
};
|
|
7325
|
+
Date.prototype.lastDayOfMonth = function () {
|
|
7326
|
+
return dayjs_min(this).endOf('month').toDate();
|
|
7327
|
+
};
|
|
7328
|
+
|
|
7329
|
+
String.prototype.capitalize = function () {
|
|
7330
|
+
return this.charAt(0).toUpperCase() + this.slice(1);
|
|
7331
|
+
};
|
|
7332
|
+
|
|
7333
|
+
export { Alert, AppBar, AppBarTitle, AutoComplete, Backdrop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonContext, ButtonGroup, COLOR, Card, CardBody, CardFooter, CardImage, CardSubtitle, CardText, CardTitle, CaretDownSolidIcon, CheckSolidIcon, CheckSquareRegularIcon, Checkbox, ChevronDownSolidIcon, ChevronLeftSolidIcon, ChevronRightSolidIcon, ChevronUpSolidIcon, Chip, CircleSolidIcon, Column, ConditionalWrapper, CssTransition, DATEMODE, DatePicker, DateSelect, DaySelect, Dot, Drawer, EmailValidator, ExpansionPanel, ExpansionPanelContent, ExpansionPanelHeader, FileInput, FileService, FloatingActionButton, Form, FormControl, FormError, FormGroup, FormHint, FormInput, FormLabel, GlobalModal, HomeSolidIcon, HourSelect, Icon, IconButton, IsEmptyValidator, IsEqualValidator, Link, List, ListItem, ListItemAction, ListItemAvatar, ListItemAvatarSize, ListItemIcon, ListItemText, LoadingIndicator, LoadingIndicatorContainer, LogType, MODALBUTTONTYPE, MODALTYPE, MaxValidator, Menu, MenuBody, MenuDivider, MenuItem, MenuToggle, MilliSecondSelect, MinValidator, MinuteSelect, Modal, ModalBody, ModalFooter, ModalHeader, MonthSelect, NumberSelect, POSITION, PlusSolidIcon, Portal$1 as Portal, ProgressBar, Row, SIZE, STATUS, SecondSelect, Select, Sidebar, SkeletonAvatar, SkeletonFooter, SkeletonImage, SkeletonText, Snackbar, SpeedDial, SpeedDialAction, SpeedDialIcon, SpinnerSolidIcon, SquareRegularIcon, Step, Stepper, StepperActions, TIMEMODE, Tab, TabPanel, Table, TableBody, TableCell, TableHead, TableRow, Tabs, Textarea, TimeSelect, TimesCircleSolidIcon, TimesSolidIcon, Tooltip, TooltipPlacement, TreeItem, TreeView, Typography, VARIANT, YearSelect, clipboardService, fileService, loadingIndicatorService, localService, loggerService, modalService, snackbarService, useButtonContext, useConstructor, useCssClasses, useDebounce, useHover, useMobileDetect, useOnDestroy, usePrevious, useWindowSize };
|
package/index.js
CHANGED
|
@@ -447,11 +447,25 @@ const ListItem = (props) => {
|
|
|
447
447
|
return (jsxRuntime.jsx("li", { onClick: handleClick, className: getCssClasses(), ...rest, children: children }));
|
|
448
448
|
};
|
|
449
449
|
|
|
450
|
-
var css_248z$Z = ".ListItemAvatar-module_avatar__sVWfR {\n display: flex;\n align-items: center;\n margin-right: 16px;\n}\n.ListItemAvatar-module_avatar__sVWfR svg
|
|
451
|
-
var styles$Z = {"avatar":"ListItemAvatar-module_avatar__sVWfR"};
|
|
450
|
+
var css_248z$Z = ".ListItemAvatar-module_avatar__sVWfR {\n display: flex;\n align-items: center;\n margin-right: 16px;\n}\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_sm__-lmR- svg,\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_sm__-lmR- img {\n width: 24px;\n height: 24px;\n}\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_md__SqRJi svg,\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_md__SqRJi img {\n width: 32px;\n height: 32px;\n}\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_lg__Z6LxN svg,\n.ListItemAvatar-module_avatar__sVWfR.ListItemAvatar-module_lg__Z6LxN img {\n width: 40px;\n height: 40px;\n}\n.ListItemAvatar-module_avatar__sVWfR img {\n border-radius: 50%;\n}";
|
|
451
|
+
var styles$Z = {"avatar":"ListItemAvatar-module_avatar__sVWfR","sm":"ListItemAvatar-module_sm__-lmR-","md":"ListItemAvatar-module_md__SqRJi","lg":"ListItemAvatar-module_lg__Z6LxN"};
|
|
452
452
|
styleInject(css_248z$Z);
|
|
453
453
|
|
|
454
|
-
|
|
454
|
+
exports.ListItemAvatarSize = void 0;
|
|
455
|
+
(function (ListItemAvatarSize) {
|
|
456
|
+
ListItemAvatarSize["sm"] = "sm";
|
|
457
|
+
ListItemAvatarSize["md"] = "md";
|
|
458
|
+
ListItemAvatarSize["lg"] = "lg";
|
|
459
|
+
})(exports.ListItemAvatarSize || (exports.ListItemAvatarSize = {}));
|
|
460
|
+
const ListItemAvatar = ({ avatar, avatarSize = exports.ListItemAvatarSize.sm, ...rest }) => {
|
|
461
|
+
const getCssClasses = () => {
|
|
462
|
+
const cssClasses = [];
|
|
463
|
+
cssClasses.push(styles$Z.avatar);
|
|
464
|
+
cssClasses.push(styles$Z[avatarSize]);
|
|
465
|
+
return cssClasses.filter(css => css).join(' ');
|
|
466
|
+
};
|
|
467
|
+
return (jsxRuntime.jsx("div", { className: getCssClasses(), ...rest, children: avatar }));
|
|
468
|
+
};
|
|
455
469
|
|
|
456
470
|
var css_248z$Y = ".ListItemIcon-module_icon__cCvEv {\n margin-right: 32px;\n}\n.ListItemIcon-module_icon__cCvEv svg {\n width: 24px;\n height: 24px;\n}";
|
|
457
471
|
var styles$Y = {"icon":"ListItemIcon-module_icon__cCvEv"};
|
|
@@ -463,7 +477,17 @@ var css_248z$X = ".ListItemAction-module_listItemAction__gAQRj {\n display: fle
|
|
|
463
477
|
var styles$X = {"listItemAction":"ListItemAction-module_listItemAction__gAQRj"};
|
|
464
478
|
styleInject(css_248z$X);
|
|
465
479
|
|
|
466
|
-
const ListItemAction = ({ children, onClick, ...rest }) =>
|
|
480
|
+
const ListItemAction = ({ children, onClick, ...rest }) => {
|
|
481
|
+
const getCssClasses = () => {
|
|
482
|
+
const cssClasses = [];
|
|
483
|
+
cssClasses.push(styles$X.listItemAction);
|
|
484
|
+
return cssClasses.filter(css => css).join(' ');
|
|
485
|
+
};
|
|
486
|
+
const handleClick = (e) => {
|
|
487
|
+
onClick && onClick(e);
|
|
488
|
+
};
|
|
489
|
+
return (jsxRuntime.jsx("div", { className: getCssClasses(), onClick: handleClick, ...rest, children: children }));
|
|
490
|
+
};
|
|
467
491
|
|
|
468
492
|
var css_248z$W = ".ListItemTextIcon-module_listItemText__xCBLW {\n flex: 1;\n}";
|
|
469
493
|
var styles$W = {"listItemText":"ListItemTextIcon-module_listItemText__xCBLW"};
|
|
@@ -2111,7 +2135,7 @@ var root = freeGlobal || freeSelf || Function('return this')();
|
|
|
2111
2135
|
* @param {string} key The key of the property to get.
|
|
2112
2136
|
* @returns {*} Returns the property value.
|
|
2113
2137
|
*/
|
|
2114
|
-
function getValue$
|
|
2138
|
+
function getValue$2(object, key) {
|
|
2115
2139
|
return object == null ? undefined : object[key];
|
|
2116
2140
|
}
|
|
2117
2141
|
|
|
@@ -2536,7 +2560,7 @@ function getMapData(map, key) {
|
|
|
2536
2560
|
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
2537
2561
|
*/
|
|
2538
2562
|
function getNative(object, key) {
|
|
2539
|
-
var value = getValue$
|
|
2563
|
+
var value = getValue$2(object, key);
|
|
2540
2564
|
return baseIsNative(value) ? value : undefined;
|
|
2541
2565
|
}
|
|
2542
2566
|
|
|
@@ -4633,7 +4657,7 @@ function getValueType(view) {
|
|
|
4633
4657
|
var index = allViews.indexOf(view);
|
|
4634
4658
|
return allValueTypes[index];
|
|
4635
4659
|
}
|
|
4636
|
-
function getValue(value, index) {
|
|
4660
|
+
function getValue$1(value, index) {
|
|
4637
4661
|
var rawValue = Array.isArray(value) ? value[index] : value;
|
|
4638
4662
|
if (!rawValue) {
|
|
4639
4663
|
return null;
|
|
@@ -4646,7 +4670,7 @@ function getValue(value, index) {
|
|
|
4646
4670
|
}
|
|
4647
4671
|
function getDetailValue(_a, index) {
|
|
4648
4672
|
var value = _a.value, minDate = _a.minDate, maxDate = _a.maxDate, maxDetail = _a.maxDetail;
|
|
4649
|
-
var valuePiece = getValue(value, index);
|
|
4673
|
+
var valuePiece = getValue$1(value, index);
|
|
4650
4674
|
if (!valuePiece) {
|
|
4651
4675
|
return null;
|
|
4652
4676
|
}
|
|
@@ -5409,9 +5433,7 @@ const FormLabel = ({ children, className, htmlFor, ...rest }) => {
|
|
|
5409
5433
|
return (jsxRuntime.jsx("label", { htmlFor: htmlFor, className: getCssClasses(), ...rest, children: children }));
|
|
5410
5434
|
};
|
|
5411
5435
|
|
|
5412
|
-
const IsEmptyValidator = (value) => value?.trim() === ''
|
|
5413
|
-
|| value === null
|
|
5414
|
-
|| value === undefined;
|
|
5436
|
+
const IsEmptyValidator = (value) => value?.toString().trim() === '' || value === null || value === undefined;
|
|
5415
5437
|
|
|
5416
5438
|
const EmailValidator = (value) => {
|
|
5417
5439
|
const isInvalidEmailFormat = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i) === null;
|
|
@@ -7210,6 +7232,106 @@ class LocalService {
|
|
|
7210
7232
|
}
|
|
7211
7233
|
const localService = new LocalService();
|
|
7212
7234
|
|
|
7235
|
+
var SortOrder;
|
|
7236
|
+
(function (SortOrder) {
|
|
7237
|
+
SortOrder[SortOrder["NONE"] = 0] = "NONE";
|
|
7238
|
+
SortOrder[SortOrder["ASC"] = 1] = "ASC";
|
|
7239
|
+
SortOrder[SortOrder["DESC"] = -1] = "DESC";
|
|
7240
|
+
})(SortOrder || (SortOrder = {}));
|
|
7241
|
+
const compareString = (valA, valB, ascending) => {
|
|
7242
|
+
return valA.localeCompare(valB) * (ascending ? SortOrder.ASC : SortOrder.DESC);
|
|
7243
|
+
};
|
|
7244
|
+
const getSortOrder = (valA, valB) => {
|
|
7245
|
+
return valA < valB ? SortOrder.DESC : valA === valB ? SortOrder.NONE : SortOrder.ASC;
|
|
7246
|
+
};
|
|
7247
|
+
const compareNonString = (valA, valB, ascending) => {
|
|
7248
|
+
return getSortOrder(valA, valB) * (ascending ? SortOrder.ASC : SortOrder.DESC);
|
|
7249
|
+
};
|
|
7250
|
+
const getValue = (valA, valB, ascending) => {
|
|
7251
|
+
let result = 0;
|
|
7252
|
+
if (typeof valA === 'string' && typeof valB === 'string') {
|
|
7253
|
+
result = compareString(valA, valB, ascending);
|
|
7254
|
+
}
|
|
7255
|
+
else {
|
|
7256
|
+
result = compareNonString(valA, valB, ascending);
|
|
7257
|
+
}
|
|
7258
|
+
return result;
|
|
7259
|
+
};
|
|
7260
|
+
const sortHelper = (a, b, valueGetter, ascending) => {
|
|
7261
|
+
const valA = valueGetter(a);
|
|
7262
|
+
const valB = valueGetter(b);
|
|
7263
|
+
return getValue(valA, valB, ascending);
|
|
7264
|
+
};
|
|
7265
|
+
|
|
7266
|
+
Array.prototype.groupBy = function (valueGetter) {
|
|
7267
|
+
return this.reduce((curr, obj) => {
|
|
7268
|
+
const key = valueGetter(obj);
|
|
7269
|
+
(curr[key] = curr[key] || []).push(obj);
|
|
7270
|
+
return curr;
|
|
7271
|
+
}, {});
|
|
7272
|
+
};
|
|
7273
|
+
Array.prototype.orderBy = function (valueGetter, ascending = true) {
|
|
7274
|
+
this?.sort((a, b) => sortHelper(a, b, valueGetter, ascending));
|
|
7275
|
+
return this;
|
|
7276
|
+
};
|
|
7277
|
+
Array.prototype.filterBy = function (key) {
|
|
7278
|
+
return this.filter(a => {
|
|
7279
|
+
let result = false;
|
|
7280
|
+
if (key && a[key]) {
|
|
7281
|
+
result = a[key] === key;
|
|
7282
|
+
}
|
|
7283
|
+
else {
|
|
7284
|
+
result = a === key;
|
|
7285
|
+
}
|
|
7286
|
+
return result;
|
|
7287
|
+
});
|
|
7288
|
+
};
|
|
7289
|
+
Array.prototype.distinct = function (comparator) {
|
|
7290
|
+
const thisAsArray = this;
|
|
7291
|
+
const result = comparator
|
|
7292
|
+
? thisAsArray.filter((value, index, array) => array.findIndex(o => comparator(o, value)) === index)
|
|
7293
|
+
: thisAsArray.filter((value, index, array) => array.indexOf(value) === index);
|
|
7294
|
+
return result;
|
|
7295
|
+
};
|
|
7296
|
+
|
|
7297
|
+
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
7298
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:O.s(this.$y,4,"0"),M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w}));
|
|
7299
|
+
});
|
|
7300
|
+
|
|
7301
|
+
var localizedFormat = createCommonjsModule(function (module, exports) {
|
|
7302
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,o,n){var r=o.prototype,i=r.format;n.en.formats=e,r.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var o=this.$locale().formats,n=function(t,o){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var i=r&&r.toUpperCase();return n||o[r]||e[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,o){return t||o.slice(1)}))}))}(t,void 0===o?{}:o);return i.call(this,n)};}}));
|
|
7303
|
+
});
|
|
7304
|
+
|
|
7305
|
+
dayjs_min.extend(localizedFormat);
|
|
7306
|
+
Date.prototype.isAfter = function (date, unit) {
|
|
7307
|
+
return dayjs_min(this).isAfter(date, unit);
|
|
7308
|
+
};
|
|
7309
|
+
Date.prototype.isBefore = function (date, unit) {
|
|
7310
|
+
return dayjs_min(this).isBefore(date, unit);
|
|
7311
|
+
};
|
|
7312
|
+
Date.prototype.format = function (template) {
|
|
7313
|
+
return dayjs_min(this).format(template);
|
|
7314
|
+
};
|
|
7315
|
+
Date.prototype.isValid = function () {
|
|
7316
|
+
return dayjs_min(this).isValid();
|
|
7317
|
+
};
|
|
7318
|
+
Date.prototype.add = function (value, unit) {
|
|
7319
|
+
return dayjs_min(this).add(value, unit).toDate();
|
|
7320
|
+
};
|
|
7321
|
+
Date.prototype.subtract = function (value, unit) {
|
|
7322
|
+
return dayjs_min(this).subtract(value, unit).toDate();
|
|
7323
|
+
};
|
|
7324
|
+
Date.prototype.firstDayOfMonth = function () {
|
|
7325
|
+
return dayjs_min(this).startOf('month').toDate();
|
|
7326
|
+
};
|
|
7327
|
+
Date.prototype.lastDayOfMonth = function () {
|
|
7328
|
+
return dayjs_min(this).endOf('month').toDate();
|
|
7329
|
+
};
|
|
7330
|
+
|
|
7331
|
+
String.prototype.capitalize = function () {
|
|
7332
|
+
return this.charAt(0).toUpperCase() + this.slice(1);
|
|
7333
|
+
};
|
|
7334
|
+
|
|
7213
7335
|
exports.Alert = Alert;
|
|
7214
7336
|
exports.AppBar = AppBar;
|
|
7215
7337
|
exports.AppBarTitle = AppBarTitle;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface IListItemAvatarProps extends React.ComponentProps<'div'> {
|
|
3
3
|
avatar: React.ReactNode;
|
|
4
|
+
avatarSize?: ListItemAvatarSize;
|
|
4
5
|
}
|
|
5
|
-
export declare
|
|
6
|
+
export declare enum ListItemAvatarSize {
|
|
7
|
+
sm = "sm",
|
|
8
|
+
md = "md",
|
|
9
|
+
lg = "lg"
|
|
10
|
+
}
|
|
11
|
+
export declare const ListItemAvatar: ({ avatar, avatarSize, ...rest }: IListItemAvatarProps) => JSX.Element;
|
|
6
12
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sort.helper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sortHelper: <T, G>(a: T, b: T, valueGetter: (a: T) => G, ascending?: boolean) => number;
|
package/lib/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDictionary } from '../interfaces';
|
|
2
|
+
export {};
|
|
3
|
+
declare global {
|
|
4
|
+
interface Array<T> {
|
|
5
|
+
groupBy(valueGetter: (a: T) => string): IDictionary<T[]>;
|
|
6
|
+
orderBy<T, G>(valueGetter: (a: T) => G, ascending?: boolean): T[];
|
|
7
|
+
filterBy<G>(key?: string): G[];
|
|
8
|
+
distinct<T>(comparator?: (obj1: unknown, obj2: unknown) => boolean): T[];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ConfigType, ManipulateType, OpUnitType } from 'dayjs';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Date {
|
|
4
|
+
isAfter(date: ConfigType, unit?: OpUnitType): boolean;
|
|
5
|
+
isBefore(date: ConfigType, unit?: OpUnitType): boolean;
|
|
6
|
+
format(template?: string): string;
|
|
7
|
+
isValid(): boolean;
|
|
8
|
+
add(value: number, unit?: ManipulateType): Date;
|
|
9
|
+
subtract(value: number, unit?: ManipulateType): Date;
|
|
10
|
+
firstDayOfMonth(): Date;
|
|
11
|
+
lastDayOfMonth(): Date;
|
|
12
|
+
}
|
|
13
|
+
}
|