@mackin.com/styleguide 10.1.0 → 10.1.5
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 +13 -1
- package/index.esm.js +45 -12
- package/index.js +49 -15
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1155,4 +1155,16 @@ interface Entity<T extends string | number> {
|
|
|
1155
1155
|
name: string;
|
|
1156
1156
|
}
|
|
1157
1157
|
|
|
1158
|
-
|
|
1158
|
+
declare enum StyleGuideLanguage {
|
|
1159
|
+
English = 0,
|
|
1160
|
+
Spanish = 1,
|
|
1161
|
+
French = 2
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
declare const LocalizationProvider: (p: {
|
|
1165
|
+
children: React__default.ReactNode;
|
|
1166
|
+
language: StyleGuideLanguage;
|
|
1167
|
+
__debug?: boolean;
|
|
1168
|
+
}) => React__default.JSX.Element;
|
|
1169
|
+
|
|
1170
|
+
export { Accordian, type AccordianProps, type Alignment, Autocomplete, AutocompleteController, AutocompleteEntityController, type AutocompleteProps, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, type ButtonProps, Calendar, type CalendarProps, Checkbox, type CheckboxProps, ConfirmModal, type ConfirmModalProps, CopyButton, DateInput, type DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, type FormProps, GlobalStyles, Header, Highlight, ICONS, Icon, Image, type ImageProps, InfoPanel, InfoTip, type InfoTipProps, ItemPager, Label, type LabelProps, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, LocalizationProvider, type MackinTheme, Modal, type ModalProps, Nav, NormalizeCss, NumberInput, type NumberInputProps, OmniLink, type OmniLinkProps, PagedResult, type PagedResultDto, Pager, type PagerProps, Picker, type PickerOption, type PickerProps, type PickerValue, Popover, ProgressBar, type ProgressBarProps, SearchBox, type SearchBoxProps, Slider, type SliderProps, type SliderValue, StyleGuideLanguage, TabContainer, type TabContainerProps, TabHeader, type TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, modalScrollFixClassName, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
package/index.esm.js
CHANGED
|
@@ -982,11 +982,11 @@ const Autocomplete = (p) => {
|
|
|
982
982
|
return p.options.slice(0, maxShowValues);
|
|
983
983
|
}
|
|
984
984
|
return p.options.slice();
|
|
985
|
-
}, [p.options]);
|
|
985
|
+
}, [p.options, p.allowScroll, maxShowValues]);
|
|
986
986
|
const { getText, language } = useLocalization();
|
|
987
987
|
const resultsText = React.useMemo(() => {
|
|
988
988
|
return `${getText("Showing")} ${displayOptions.length.toLocaleString()} ${getText("of")} ${p.options.length.toLocaleString()} ${getText("results")}.`;
|
|
989
|
-
}, [language]);
|
|
989
|
+
}, [language, displayOptions, p.options]);
|
|
990
990
|
const getNextTabElement = (fromIndex, direction) => {
|
|
991
991
|
var _a, _b, _c;
|
|
992
992
|
if (fromIndex === -1) {
|
|
@@ -1409,7 +1409,7 @@ const Calendar = (p) => {
|
|
|
1409
1409
|
const monthTitle = getText(format(monthStart, 'LLLL'));
|
|
1410
1410
|
const weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].map(d => getText(d));
|
|
1411
1411
|
return { monthTitle, weekdays };
|
|
1412
|
-
}, [language]);
|
|
1412
|
+
}, [language, monthStart]);
|
|
1413
1413
|
const days = getDaysInMonth(monthStart);
|
|
1414
1414
|
const startDayOfWeek = getDay(monthStart);
|
|
1415
1415
|
const dayEndIndex = startDayOfWeek + days - 1;
|
|
@@ -1766,7 +1766,7 @@ const ConfirmModal = (props) => {
|
|
|
1766
1766
|
const confirmText = props.confirmText || getText('OK');
|
|
1767
1767
|
const cancelText = props.cancelText || getText('Cancel');
|
|
1768
1768
|
return { confirmText, cancelText };
|
|
1769
|
-
}, [language]);
|
|
1769
|
+
}, [language, props.confirmText, props.cancelText]);
|
|
1770
1770
|
return (React.createElement(Modal, { id: props.id, __debug: props.__debug, className: cx('confirmModal', modalStyle, props.className), heading: props.header, closeButton: true, show: props.show, onClick: props.onCancel },
|
|
1771
1771
|
React.createElement("div", { className: css({ padding: '1rem' }) },
|
|
1772
1772
|
React.createElement(Text, { align: "center" }, props.text),
|
|
@@ -1783,7 +1783,7 @@ const CopyButton = React.forwardRef((props, ref) => {
|
|
|
1783
1783
|
const copiedText = getText('Copied!');
|
|
1784
1784
|
const titleText = props.title || getText('Copy to clipboard');
|
|
1785
1785
|
return { copiedText, titleText };
|
|
1786
|
-
}, [language]);
|
|
1786
|
+
}, [language, props.title]);
|
|
1787
1787
|
return (React.createElement(Button, Object.assign({}, buttonProps, { ref: ref, title: copied ? copiedText : titleText, variant: "icon", onBlur: e => {
|
|
1788
1788
|
var _a;
|
|
1789
1789
|
setCopied(false);
|
|
@@ -1989,7 +1989,7 @@ const FileUploader = (p) => {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
1991
|
return "";
|
|
1992
|
-
}, [language]);
|
|
1992
|
+
}, [language, files, p.instructionMessage, totalFileSize, message]);
|
|
1993
1993
|
const setAllFiles = (inputFiles) => {
|
|
1994
1994
|
if (input.current && inputFiles === undefined) {
|
|
1995
1995
|
input.current.value = '';
|
|
@@ -2424,7 +2424,7 @@ const DateInput = React.forwardRef((props, ref) => {
|
|
|
2424
2424
|
}, [dateValue, textValue, language]);
|
|
2425
2425
|
const [showCalendar, setShowCalendar] = React.useState(false);
|
|
2426
2426
|
const [calendarDate, setCalendarDate] = React.useState(getCalendarDate(props.value, props.min, props.max));
|
|
2427
|
-
const monthTitle = React.useMemo(() => getText(format(calendarDate, 'LLLL')), [language]);
|
|
2427
|
+
const monthTitle = React.useMemo(() => getText(format(calendarDate, 'LLLL')), [language, calendarDate]);
|
|
2428
2428
|
// controls the one-time focus set on show
|
|
2429
2429
|
const needsFocus = React.useRef(false);
|
|
2430
2430
|
const toggleCalendar = React.useCallback((show) => {
|
|
@@ -3230,7 +3230,7 @@ const Pager = (props) => {
|
|
|
3230
3230
|
pageText = `${(_a = props.pageText) !== null && _a !== void 0 ? _a : getText('Page')} ${(props.pageIndex + 1).toLocaleString()} ${dividerText} ${props.totalPages.toLocaleString()}`;
|
|
3231
3231
|
}
|
|
3232
3232
|
return { itemText, pageText };
|
|
3233
|
-
}, [language]);
|
|
3233
|
+
}, [language, props.totalItems, props.pageIndex, props.totalPages]);
|
|
3234
3234
|
const theme = useThemeSafely();
|
|
3235
3235
|
const pagerStyles = css `
|
|
3236
3236
|
display: grid;
|
|
@@ -3282,7 +3282,7 @@ const BoundMemoryPager = (p) => {
|
|
|
3282
3282
|
const limitText = (_a = p.limitText) !== null && _a !== void 0 ? _a : getText("Limit");
|
|
3283
3283
|
const sortText = (_b = p.sortText) !== null && _b !== void 0 ? _b : getText("Sort");
|
|
3284
3284
|
return { limitText, sortText };
|
|
3285
|
-
}, [language]);
|
|
3285
|
+
}, [language, p.limitText, p.sortText]);
|
|
3286
3286
|
return (React.createElement(Pager, Object.assign({}, rest, { pageIndex: showPageText ? pager.page : undefined, totalPages: showPageText ? pager.totalPages : undefined, canGoNext: pager.hasNext, canGoPrevious: pager.hasPrevious, minItem: pager.minItemIndex + 1, maxItem: pager.maxItemIndex + 1, totalItems: pager.totalItems, leftControls: pager.limitOptions.length > 1 && p.onLimit ? (React.createElement(Label, { text: limitText, orientation: "horizontal" },
|
|
3287
3287
|
React.createElement(Picker, { value: pager.limit, options: pager.limitOptions, onValueChange: v => { var _a; return (_a = p.onLimit) === null || _a === void 0 ? void 0 : _a.call(p, v); } }))) : undefined, rightControls: pager.sortOptions.length > 1 && p.onSort ? (React.createElement(Label, { text: sortText, orientation: "horizontalReverse" },
|
|
3288
3288
|
React.createElement(Picker, { value: (_a = pager.sort) !== null && _a !== void 0 ? _a : '', options: pager.sortOptions, onValueChange: v => { var _a; return (_a = p.onSort) === null || _a === void 0 ? void 0 : _a.call(p, v); } }))) : undefined, page: d => {
|
|
@@ -3299,7 +3299,7 @@ const BoundStaticPager = (p) => {
|
|
|
3299
3299
|
const limitText = (_a = p.limitText) !== null && _a !== void 0 ? _a : getText("Limit");
|
|
3300
3300
|
const sortText = (_b = p.sortText) !== null && _b !== void 0 ? _b : getText("Sort");
|
|
3301
3301
|
return { limitText, sortText };
|
|
3302
|
-
}, [language]);
|
|
3302
|
+
}, [language, p.limitText, p.sortText]);
|
|
3303
3303
|
const showLimit = !!(result.limit && p.limitOptions && p.limitOptions.length > 1 && p.onLimit);
|
|
3304
3304
|
const showSort = !!(p.sort !== undefined && p.sortOptions && p.sortOptions.length > 1 && p.onSort);
|
|
3305
3305
|
return (React.createElement(Pager, Object.assign({}, rest, { pageIndex: showPageText ? result.page : undefined, totalPages: showPageText ? result.totalPages : undefined, canGoNext: result.hasNext, canGoPrevious: result.hasPrevious, minItem: result.minPageItemIndex + 1, maxItem: result.maxPageItemIndex + 1, totalItems: result.total, leftControls: showLimit ? (React.createElement(Label, { text: limitText, orientation: "horizontal" },
|
|
@@ -3917,7 +3917,7 @@ const HandleText = (p) => {
|
|
|
3917
3917
|
const renderValueWidth = (_c = p.renderValueWidth) !== null && _c !== void 0 ? _c : p.sliderHandleSize;
|
|
3918
3918
|
const renderValueLeft = useMemo(() => {
|
|
3919
3919
|
return `calc(${renderValueWidth} * 0.5 * -1 + (${p.sliderHandleSize} * 0.5))`;
|
|
3920
|
-
}, [p.renderValueWidth]);
|
|
3920
|
+
}, [p.renderValueWidth, p.sliderHandleSize]);
|
|
3921
3921
|
const [flipText, setFlipText] = useState(false);
|
|
3922
3922
|
const offset = '2px';
|
|
3923
3923
|
useEffect(() => {
|
|
@@ -4942,5 +4942,38 @@ class AutocompleteEntityController {
|
|
|
4942
4942
|
}
|
|
4943
4943
|
}
|
|
4944
4944
|
|
|
4945
|
-
|
|
4945
|
+
var decimal=["decimal","décimale"];var place=["lugar","lieu"];var places=["lugares","lieux"];var file=["archivo","fichier"];var selected=["seleccionado","choisi"];var Upload=["Subir","Télécharger"];var Clear=["Cerrar","Fermer"];var Showing=["Mostrando","Affichage de"];var of=["de","sur"];var results=["resultados","résultats"];var Page=["Página","Page"];var Limit=["Límite","Limite"];var Sort=["Ordenar","Trier"];var January=["Enero","Janvier"];var February=["Febrero","Février"];var March=["Marzo","Mars"];var April=["Abril","Avril"];var May=["Mayo","Mai"];var June=["Junio","Juin"];var July=["Julio","Juillet"];var August=["Agosto","Août"];var September=["Septiembre","Septembre"];var October=["Octubre","Octobre"];var November=["Noviembre","Novembre"];var December=["Diciembre","Décembre"];var Sun=["Dom","Dim"];var Mon=["Lun","Lun"];var Tue=["Mar","Mar"];var Wed=["Mié","Mer"];var Thu=["Jue","Jeu"];var Fri=["Vie","Ven"];var Sat=["Sáb","Sam"];var OK=["Aceptar","Accepter"];var Cancel=["Cancelar","Annuler"];var strings = {"Required.":["Requerido.","Requis."],"Must be at least":["Debe ser al menos","Doit être au moins"],"characters in length.":["caracteres de longitud.","caractères de longueur."],"Must be an integer.":["Debe ser un número entero.","Doit être un entier."],"Limited to":["Limitado a","Limité à"],decimal:decimal,place:place,places:places,"Must be greater than or equal to":["Debe ser mayor o igual a","Doit être supérieur ou égal à"],"Must be less than or equal to":["Debe ser menor o igual a","Doit être inférieur ou égal à"],"Invalid email.":["Correo electrónico no válido.","Email invalide."],"Invalid URL.":["URL no válida.","URL non valide."],"Click or drag and drop files.":["Haga clic o arrastre y suelte archivos.","Cliquez ou faites glisser et déposez les fichiers."],file:file,selected:selected,"Upload failed.":["Error en la carga.","Le téléchargement a échoué."],Upload:Upload,"Upload successful.":["Carga exitosa","Téléchargement réussi."],"Invalid files":["Archivos no válidos","Fichiers invalides"],"Max file size exceeded":["Se ha excedido el tamaño máximo de archivo","La taille maximale du fichier a été dépassée"],"Error":["Error","Erreur"],Clear:Clear,Showing:Showing,of:of,results:results,"No Results":["No Hay Resultados","Aucun Résultat"],Page:Page,Limit:Limit,Sort:Sort,January:January,February:February,March:March,April:April,May:May,June:June,July:July,August:August,September:September,October:October,November:November,December:December,Sun:Sun,Mon:Mon,Tue:Tue,Wed:Wed,Thu:Thu,Fri:Fri,Sat:Sat,OK:OK,Cancel:Cancel,"Copied!":["¡Copiado!","Copié!"],"Copy to clipboard":["Copiar al portapapeles","Copier dans le presse-papier"]};
|
|
4946
|
+
|
|
4947
|
+
const LocalizationProvider = (p) => {
|
|
4948
|
+
var _a;
|
|
4949
|
+
const log = useLogger('LocalizationProvider', (_a = p.__debug) !== null && _a !== void 0 ? _a : false);
|
|
4950
|
+
const stringsDb = strings;
|
|
4951
|
+
return (React__default.createElement(LocalizationContext.Provider, { value: {
|
|
4952
|
+
language: p.language,
|
|
4953
|
+
getText: (text) => {
|
|
4954
|
+
if (!text) {
|
|
4955
|
+
return '';
|
|
4956
|
+
}
|
|
4957
|
+
if (!isNaN(parseInt(text))) {
|
|
4958
|
+
return text;
|
|
4959
|
+
}
|
|
4960
|
+
const wordArray = stringsDb[text];
|
|
4961
|
+
if (!wordArray) {
|
|
4962
|
+
log(`No localization data exists for "${text}".`);
|
|
4963
|
+
}
|
|
4964
|
+
if (p.language === StyleGuideLanguage.English) {
|
|
4965
|
+
return text;
|
|
4966
|
+
}
|
|
4967
|
+
const languageIndex = p.language - 1;
|
|
4968
|
+
const translation = wordArray === null || wordArray === void 0 ? void 0 : wordArray[languageIndex];
|
|
4969
|
+
if (translation) {
|
|
4970
|
+
return translation;
|
|
4971
|
+
}
|
|
4972
|
+
log(`No ${StyleGuideLanguage[p.language]} translations exist for "${text}".`);
|
|
4973
|
+
return text;
|
|
4974
|
+
}
|
|
4975
|
+
} }, p.children));
|
|
4976
|
+
};
|
|
4977
|
+
|
|
4978
|
+
export { Accordian, Autocomplete, AutocompleteController, AutocompleteEntityController, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, Calendar, Checkbox, ConfirmModal, CopyButton, DateInput, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, ItemPager, Label, Link, List, ListItem, LocalizationProvider, Modal, Nav, NormalizeCss, NumberInput, OmniLink, PagedResult, Pager, Picker, Popover, ProgressBar, SearchBox, Slider, StyleGuideLanguage, TabContainer, TabHeader, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextInput, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, modalScrollFixClassName, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
|
4946
4979
|
//# sourceMappingURL=index.esm.js.map
|
package/index.js
CHANGED
|
@@ -749,15 +749,15 @@ const tryClampDecimals = (value, step = 0) => {
|
|
|
749
749
|
return parseFloat(value.toFixed(decimals));
|
|
750
750
|
};
|
|
751
751
|
|
|
752
|
-
|
|
752
|
+
exports.StyleGuideLanguage = void 0;
|
|
753
753
|
(function (StyleGuideLanguage) {
|
|
754
754
|
StyleGuideLanguage[StyleGuideLanguage["English"] = 0] = "English";
|
|
755
755
|
StyleGuideLanguage[StyleGuideLanguage["Spanish"] = 1] = "Spanish";
|
|
756
756
|
StyleGuideLanguage[StyleGuideLanguage["French"] = 2] = "French";
|
|
757
|
-
})(StyleGuideLanguage || (StyleGuideLanguage = {}));
|
|
757
|
+
})(exports.StyleGuideLanguage || (exports.StyleGuideLanguage = {}));
|
|
758
758
|
|
|
759
759
|
const LocalizationContext = React.createContext({
|
|
760
|
-
language: StyleGuideLanguage.English,
|
|
760
|
+
language: exports.StyleGuideLanguage.English,
|
|
761
761
|
getText: text => text
|
|
762
762
|
});
|
|
763
763
|
|
|
@@ -765,7 +765,7 @@ const useLocalization = () => {
|
|
|
765
765
|
const localization = React.useContext(LocalizationContext);
|
|
766
766
|
if (!localization) {
|
|
767
767
|
return {
|
|
768
|
-
language: StyleGuideLanguage.English,
|
|
768
|
+
language: exports.StyleGuideLanguage.English,
|
|
769
769
|
getText: (text) => text
|
|
770
770
|
};
|
|
771
771
|
}
|
|
@@ -1000,11 +1000,11 @@ const Autocomplete = (p) => {
|
|
|
1000
1000
|
return p.options.slice(0, maxShowValues);
|
|
1001
1001
|
}
|
|
1002
1002
|
return p.options.slice();
|
|
1003
|
-
}, [p.options]);
|
|
1003
|
+
}, [p.options, p.allowScroll, maxShowValues]);
|
|
1004
1004
|
const { getText, language } = useLocalization();
|
|
1005
1005
|
const resultsText = React__namespace.useMemo(() => {
|
|
1006
1006
|
return `${getText("Showing")} ${displayOptions.length.toLocaleString()} ${getText("of")} ${p.options.length.toLocaleString()} ${getText("results")}.`;
|
|
1007
|
-
}, [language]);
|
|
1007
|
+
}, [language, displayOptions, p.options]);
|
|
1008
1008
|
const getNextTabElement = (fromIndex, direction) => {
|
|
1009
1009
|
var _a, _b, _c;
|
|
1010
1010
|
if (fromIndex === -1) {
|
|
@@ -1427,7 +1427,7 @@ const Calendar = (p) => {
|
|
|
1427
1427
|
const monthTitle = getText(dateFns.format(monthStart, 'LLLL'));
|
|
1428
1428
|
const weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].map(d => getText(d));
|
|
1429
1429
|
return { monthTitle, weekdays };
|
|
1430
|
-
}, [language]);
|
|
1430
|
+
}, [language, monthStart]);
|
|
1431
1431
|
const days = dateFns.getDaysInMonth(monthStart);
|
|
1432
1432
|
const startDayOfWeek = dateFns.getDay(monthStart);
|
|
1433
1433
|
const dayEndIndex = startDayOfWeek + days - 1;
|
|
@@ -1784,7 +1784,7 @@ const ConfirmModal = (props) => {
|
|
|
1784
1784
|
const confirmText = props.confirmText || getText('OK');
|
|
1785
1785
|
const cancelText = props.cancelText || getText('Cancel');
|
|
1786
1786
|
return { confirmText, cancelText };
|
|
1787
|
-
}, [language]);
|
|
1787
|
+
}, [language, props.confirmText, props.cancelText]);
|
|
1788
1788
|
return (React__namespace.createElement(Modal, { id: props.id, __debug: props.__debug, className: css.cx('confirmModal', modalStyle, props.className), heading: props.header, closeButton: true, show: props.show, onClick: props.onCancel },
|
|
1789
1789
|
React__namespace.createElement("div", { className: css.css({ padding: '1rem' }) },
|
|
1790
1790
|
React__namespace.createElement(Text, { align: "center" }, props.text),
|
|
@@ -1801,7 +1801,7 @@ const CopyButton = React__namespace.forwardRef((props, ref) => {
|
|
|
1801
1801
|
const copiedText = getText('Copied!');
|
|
1802
1802
|
const titleText = props.title || getText('Copy to clipboard');
|
|
1803
1803
|
return { copiedText, titleText };
|
|
1804
|
-
}, [language]);
|
|
1804
|
+
}, [language, props.title]);
|
|
1805
1805
|
return (React__namespace.createElement(Button, Object.assign({}, buttonProps, { ref: ref, title: copied ? copiedText : titleText, variant: "icon", onBlur: e => {
|
|
1806
1806
|
var _a;
|
|
1807
1807
|
setCopied(false);
|
|
@@ -2007,7 +2007,7 @@ const FileUploader = (p) => {
|
|
|
2007
2007
|
}
|
|
2008
2008
|
}
|
|
2009
2009
|
return "";
|
|
2010
|
-
}, [language]);
|
|
2010
|
+
}, [language, files, p.instructionMessage, totalFileSize, message]);
|
|
2011
2011
|
const setAllFiles = (inputFiles) => {
|
|
2012
2012
|
if (input.current && inputFiles === undefined) {
|
|
2013
2013
|
input.current.value = '';
|
|
@@ -2442,7 +2442,7 @@ const DateInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2442
2442
|
}, [dateValue, textValue, language]);
|
|
2443
2443
|
const [showCalendar, setShowCalendar] = React__namespace.useState(false);
|
|
2444
2444
|
const [calendarDate, setCalendarDate] = React__namespace.useState(getCalendarDate(props.value, props.min, props.max));
|
|
2445
|
-
const monthTitle = React__namespace.useMemo(() => getText(dateFns.format(calendarDate, 'LLLL')), [language]);
|
|
2445
|
+
const monthTitle = React__namespace.useMemo(() => getText(dateFns.format(calendarDate, 'LLLL')), [language, calendarDate]);
|
|
2446
2446
|
// controls the one-time focus set on show
|
|
2447
2447
|
const needsFocus = React__namespace.useRef(false);
|
|
2448
2448
|
const toggleCalendar = React__namespace.useCallback((show) => {
|
|
@@ -3248,7 +3248,7 @@ const Pager = (props) => {
|
|
|
3248
3248
|
pageText = `${(_a = props.pageText) !== null && _a !== void 0 ? _a : getText('Page')} ${(props.pageIndex + 1).toLocaleString()} ${dividerText} ${props.totalPages.toLocaleString()}`;
|
|
3249
3249
|
}
|
|
3250
3250
|
return { itemText, pageText };
|
|
3251
|
-
}, [language]);
|
|
3251
|
+
}, [language, props.totalItems, props.pageIndex, props.totalPages]);
|
|
3252
3252
|
const theme = useThemeSafely();
|
|
3253
3253
|
const pagerStyles = css.css `
|
|
3254
3254
|
display: grid;
|
|
@@ -3300,7 +3300,7 @@ const BoundMemoryPager = (p) => {
|
|
|
3300
3300
|
const limitText = (_a = p.limitText) !== null && _a !== void 0 ? _a : getText("Limit");
|
|
3301
3301
|
const sortText = (_b = p.sortText) !== null && _b !== void 0 ? _b : getText("Sort");
|
|
3302
3302
|
return { limitText, sortText };
|
|
3303
|
-
}, [language]);
|
|
3303
|
+
}, [language, p.limitText, p.sortText]);
|
|
3304
3304
|
return (React__namespace.createElement(Pager, Object.assign({}, rest, { pageIndex: showPageText ? pager.page : undefined, totalPages: showPageText ? pager.totalPages : undefined, canGoNext: pager.hasNext, canGoPrevious: pager.hasPrevious, minItem: pager.minItemIndex + 1, maxItem: pager.maxItemIndex + 1, totalItems: pager.totalItems, leftControls: pager.limitOptions.length > 1 && p.onLimit ? (React__namespace.createElement(Label, { text: limitText, orientation: "horizontal" },
|
|
3305
3305
|
React__namespace.createElement(Picker, { value: pager.limit, options: pager.limitOptions, onValueChange: v => { var _a; return (_a = p.onLimit) === null || _a === void 0 ? void 0 : _a.call(p, v); } }))) : undefined, rightControls: pager.sortOptions.length > 1 && p.onSort ? (React__namespace.createElement(Label, { text: sortText, orientation: "horizontalReverse" },
|
|
3306
3306
|
React__namespace.createElement(Picker, { value: (_a = pager.sort) !== null && _a !== void 0 ? _a : '', options: pager.sortOptions, onValueChange: v => { var _a; return (_a = p.onSort) === null || _a === void 0 ? void 0 : _a.call(p, v); } }))) : undefined, page: d => {
|
|
@@ -3317,7 +3317,7 @@ const BoundStaticPager = (p) => {
|
|
|
3317
3317
|
const limitText = (_a = p.limitText) !== null && _a !== void 0 ? _a : getText("Limit");
|
|
3318
3318
|
const sortText = (_b = p.sortText) !== null && _b !== void 0 ? _b : getText("Sort");
|
|
3319
3319
|
return { limitText, sortText };
|
|
3320
|
-
}, [language]);
|
|
3320
|
+
}, [language, p.limitText, p.sortText]);
|
|
3321
3321
|
const showLimit = !!(result.limit && p.limitOptions && p.limitOptions.length > 1 && p.onLimit);
|
|
3322
3322
|
const showSort = !!(p.sort !== undefined && p.sortOptions && p.sortOptions.length > 1 && p.onSort);
|
|
3323
3323
|
return (React__namespace.createElement(Pager, Object.assign({}, rest, { pageIndex: showPageText ? result.page : undefined, totalPages: showPageText ? result.totalPages : undefined, canGoNext: result.hasNext, canGoPrevious: result.hasPrevious, minItem: result.minPageItemIndex + 1, maxItem: result.maxPageItemIndex + 1, totalItems: result.total, leftControls: showLimit ? (React__namespace.createElement(Label, { text: limitText, orientation: "horizontal" },
|
|
@@ -3935,7 +3935,7 @@ const HandleText = (p) => {
|
|
|
3935
3935
|
const renderValueWidth = (_c = p.renderValueWidth) !== null && _c !== void 0 ? _c : p.sliderHandleSize;
|
|
3936
3936
|
const renderValueLeft = React.useMemo(() => {
|
|
3937
3937
|
return `calc(${renderValueWidth} * 0.5 * -1 + (${p.sliderHandleSize} * 0.5))`;
|
|
3938
|
-
}, [p.renderValueWidth]);
|
|
3938
|
+
}, [p.renderValueWidth, p.sliderHandleSize]);
|
|
3939
3939
|
const [flipText, setFlipText] = React.useState(false);
|
|
3940
3940
|
const offset = '2px';
|
|
3941
3941
|
React.useEffect(() => {
|
|
@@ -4960,6 +4960,39 @@ class AutocompleteEntityController {
|
|
|
4960
4960
|
}
|
|
4961
4961
|
}
|
|
4962
4962
|
|
|
4963
|
+
var decimal=["decimal","décimale"];var place=["lugar","lieu"];var places=["lugares","lieux"];var file=["archivo","fichier"];var selected=["seleccionado","choisi"];var Upload=["Subir","Télécharger"];var Clear=["Cerrar","Fermer"];var Showing=["Mostrando","Affichage de"];var of=["de","sur"];var results=["resultados","résultats"];var Page=["Página","Page"];var Limit=["Límite","Limite"];var Sort=["Ordenar","Trier"];var January=["Enero","Janvier"];var February=["Febrero","Février"];var March=["Marzo","Mars"];var April=["Abril","Avril"];var May=["Mayo","Mai"];var June=["Junio","Juin"];var July=["Julio","Juillet"];var August=["Agosto","Août"];var September=["Septiembre","Septembre"];var October=["Octubre","Octobre"];var November=["Noviembre","Novembre"];var December=["Diciembre","Décembre"];var Sun=["Dom","Dim"];var Mon=["Lun","Lun"];var Tue=["Mar","Mar"];var Wed=["Mié","Mer"];var Thu=["Jue","Jeu"];var Fri=["Vie","Ven"];var Sat=["Sáb","Sam"];var OK=["Aceptar","Accepter"];var Cancel=["Cancelar","Annuler"];var strings = {"Required.":["Requerido.","Requis."],"Must be at least":["Debe ser al menos","Doit être au moins"],"characters in length.":["caracteres de longitud.","caractères de longueur."],"Must be an integer.":["Debe ser un número entero.","Doit être un entier."],"Limited to":["Limitado a","Limité à"],decimal:decimal,place:place,places:places,"Must be greater than or equal to":["Debe ser mayor o igual a","Doit être supérieur ou égal à"],"Must be less than or equal to":["Debe ser menor o igual a","Doit être inférieur ou égal à"],"Invalid email.":["Correo electrónico no válido.","Email invalide."],"Invalid URL.":["URL no válida.","URL non valide."],"Click or drag and drop files.":["Haga clic o arrastre y suelte archivos.","Cliquez ou faites glisser et déposez les fichiers."],file:file,selected:selected,"Upload failed.":["Error en la carga.","Le téléchargement a échoué."],Upload:Upload,"Upload successful.":["Carga exitosa","Téléchargement réussi."],"Invalid files":["Archivos no válidos","Fichiers invalides"],"Max file size exceeded":["Se ha excedido el tamaño máximo de archivo","La taille maximale du fichier a été dépassée"],"Error":["Error","Erreur"],Clear:Clear,Showing:Showing,of:of,results:results,"No Results":["No Hay Resultados","Aucun Résultat"],Page:Page,Limit:Limit,Sort:Sort,January:January,February:February,March:March,April:April,May:May,June:June,July:July,August:August,September:September,October:October,November:November,December:December,Sun:Sun,Mon:Mon,Tue:Tue,Wed:Wed,Thu:Thu,Fri:Fri,Sat:Sat,OK:OK,Cancel:Cancel,"Copied!":["¡Copiado!","Copié!"],"Copy to clipboard":["Copiar al portapapeles","Copier dans le presse-papier"]};
|
|
4964
|
+
|
|
4965
|
+
const LocalizationProvider = (p) => {
|
|
4966
|
+
var _a;
|
|
4967
|
+
const log = useLogger('LocalizationProvider', (_a = p.__debug) !== null && _a !== void 0 ? _a : false);
|
|
4968
|
+
const stringsDb = strings;
|
|
4969
|
+
return (React.createElement(LocalizationContext.Provider, { value: {
|
|
4970
|
+
language: p.language,
|
|
4971
|
+
getText: (text) => {
|
|
4972
|
+
if (!text) {
|
|
4973
|
+
return '';
|
|
4974
|
+
}
|
|
4975
|
+
if (!isNaN(parseInt(text))) {
|
|
4976
|
+
return text;
|
|
4977
|
+
}
|
|
4978
|
+
const wordArray = stringsDb[text];
|
|
4979
|
+
if (!wordArray) {
|
|
4980
|
+
log(`No localization data exists for "${text}".`);
|
|
4981
|
+
}
|
|
4982
|
+
if (p.language === exports.StyleGuideLanguage.English) {
|
|
4983
|
+
return text;
|
|
4984
|
+
}
|
|
4985
|
+
const languageIndex = p.language - 1;
|
|
4986
|
+
const translation = wordArray === null || wordArray === void 0 ? void 0 : wordArray[languageIndex];
|
|
4987
|
+
if (translation) {
|
|
4988
|
+
return translation;
|
|
4989
|
+
}
|
|
4990
|
+
log(`No ${exports.StyleGuideLanguage[p.language]} translations exist for "${text}".`);
|
|
4991
|
+
return text;
|
|
4992
|
+
}
|
|
4993
|
+
} }, p.children));
|
|
4994
|
+
};
|
|
4995
|
+
|
|
4963
4996
|
exports.Accordian = Accordian;
|
|
4964
4997
|
exports.Autocomplete = Autocomplete;
|
|
4965
4998
|
exports.AutocompleteController = AutocompleteController;
|
|
@@ -4993,6 +5026,7 @@ exports.Label = Label;
|
|
|
4993
5026
|
exports.Link = Link;
|
|
4994
5027
|
exports.List = List;
|
|
4995
5028
|
exports.ListItem = ListItem;
|
|
5029
|
+
exports.LocalizationProvider = LocalizationProvider;
|
|
4996
5030
|
exports.Modal = Modal;
|
|
4997
5031
|
exports.Nav = Nav;
|
|
4998
5032
|
exports.NormalizeCss = NormalizeCss;
|