@ostack.tech/ui 0.11.0 → 0.11.2
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/locales/pt-PT.js +2 -2
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +10 -7
- package/dist/ostack-ui.js +142 -147
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/Calendar/Calendar.d.ts +21 -3
- package/package.json +1 -1
- package/scss/components/DataTable/_DataTable-variables.scss +8 -5
- package/scss/components/DataTable/_DataTable.scss +4 -2
- package/scss/components/DateRangeInput/_DateRangeInput.scss +6 -1
- package/scss/components/FeedbackList/_FeedbackList.scss +1 -0
- package/scss/components/Stepper/_Stepper.scss +4 -4
- package/scss/components/Tabs/_Tabs-variables.scss +1 -0
- package/scss/components/Tabs/_Tabs.scss +1 -0
package/dist/locales/pt-PT.js
CHANGED
|
@@ -44,8 +44,8 @@ const locale = {
|
|
|
44
44
|
emptyMessage: "Nada a mostrar."
|
|
45
45
|
},
|
|
46
46
|
DataTableFilter: {
|
|
47
|
-
"aria-label": "
|
|
48
|
-
placeholder: "
|
|
47
|
+
"aria-label": "Pesquisar tabela",
|
|
48
|
+
placeholder: "Pesquisar…"
|
|
49
49
|
},
|
|
50
50
|
DataTablePagination: {
|
|
51
51
|
"aria-label": "Paginação da tabela",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pt-PT.js","sources":["../../src/locales/pt-PT.tsx"],"sourcesContent":["import { pt as dayPickerPt } from \"react-day-picker/locale\";\n\nimport type { LocalizationObject } from \"../providers/LocalizationProvider\";\nimport { IS_APPLE } from \"../utils/platformUtils.ts\";\n\n/** `pt-PT` locale. */\nexport const locale: LocalizationObject = {\n languageTag: \"pt-PT\",\n dayPickerLocale: dayPickerPt,\n AlertDialog: {\n okText: \"OK\",\n },\n Calendar: {\n monthSelectLabel: \"Mês\",\n yearSelectLabel: \"Ano\",\n previousMonthLabel: \"Mês anterior\",\n nextMonthLabel: \"Próximo mês\",\n },\n CloseButton: {\n label: \"Fechar\",\n },\n CollapsibleTrigger: {\n expandLabel: \"Mostrar\",\n collapseLabel: \"Ocultar\",\n },\n CommandMenu: {\n searchPlaceholder: \"Pesquisar…\",\n listLabel: \"Sugestões\",\n loadingLabel: \"A carregar…\",\n emptyMessage: \"Nenhum resultado encontrado.\",\n },\n CommandMenuDialog: {\n title: \"Paleta de comandos\",\n description: \"Pesquise por um comando…\",\n },\n ConfirmDialog: {\n cancelText: \"Cancelar\",\n },\n ControlCode: {\n visuallyHiddenPrefix: \"Campo\",\n },\n DataTable: {\n selectAllRowsLabel: \"Selecionar tudo\",\n selectRowLabel: \"Selecionar\",\n },\n DataTableContent: {\n emptyMessage: \"Nada a mostrar.\",\n },\n DataTableFilter: {\n \"aria-label\": \"
|
|
1
|
+
{"version":3,"file":"pt-PT.js","sources":["../../src/locales/pt-PT.tsx"],"sourcesContent":["import { pt as dayPickerPt } from \"react-day-picker/locale\";\n\nimport type { LocalizationObject } from \"../providers/LocalizationProvider\";\nimport { IS_APPLE } from \"../utils/platformUtils.ts\";\n\n/** `pt-PT` locale. */\nexport const locale: LocalizationObject = {\n languageTag: \"pt-PT\",\n dayPickerLocale: dayPickerPt,\n AlertDialog: {\n okText: \"OK\",\n },\n Calendar: {\n monthSelectLabel: \"Mês\",\n yearSelectLabel: \"Ano\",\n previousMonthLabel: \"Mês anterior\",\n nextMonthLabel: \"Próximo mês\",\n },\n CloseButton: {\n label: \"Fechar\",\n },\n CollapsibleTrigger: {\n expandLabel: \"Mostrar\",\n collapseLabel: \"Ocultar\",\n },\n CommandMenu: {\n searchPlaceholder: \"Pesquisar…\",\n listLabel: \"Sugestões\",\n loadingLabel: \"A carregar…\",\n emptyMessage: \"Nenhum resultado encontrado.\",\n },\n CommandMenuDialog: {\n title: \"Paleta de comandos\",\n description: \"Pesquise por um comando…\",\n },\n ConfirmDialog: {\n cancelText: \"Cancelar\",\n },\n ControlCode: {\n visuallyHiddenPrefix: \"Campo\",\n },\n DataTable: {\n selectAllRowsLabel: \"Selecionar tudo\",\n selectRowLabel: \"Selecionar\",\n },\n DataTableContent: {\n emptyMessage: \"Nada a mostrar.\",\n },\n DataTableFilter: {\n \"aria-label\": \"Pesquisar tabela\",\n placeholder: \"Pesquisar…\",\n },\n DataTablePagination: {\n \"aria-label\": \"Paginação da tabela\",\n rowsRangeSelectLabel: (total) => `Linhas visíveis de um total de ${total}`,\n rowsRange: (range, total) => (\n <>\n Linhas {range} de {total}\n </>\n ),\n previousPageButtonLabel: \"Página anterior\",\n nextPageButtonLabel: \"Próxima página\",\n },\n DataTableRowsPerPage: {\n label: \"Linhas por página:\",\n },\n DateInput: {\n placeholder: \"dia/mês/ano\",\n formatDescription:\n \"Introduza a data no formato, D D barra M M barra A A A A.\",\n selectedDateDescription: (date) => `Data selecionada, ${date}`,\n calendarButtonLabel: \"Abrir calendário\",\n },\n DateRangeInput: {\n startInputLabel: \"Data de início\",\n endInputLabel: \"Data de fim\",\n selectedDateRangeDescription: ({ start, end }) =>\n `Período selecionado, ${start || \"data de início ausente\"} a ${\n end || \"data de fim ausente\"\n }`,\n },\n ErrorBoundary: {\n fallbackMessage: (\n <>\n Algo correu mal.\n <br />\n Pressione o botão à direita para tentar novamente. Se o problema\n persistir, volte a tentar mais tarde.\n </>\n ),\n resetButtonLabel: \"Tentar novamente\",\n },\n Feedback: {\n visuallyHiddenPrefix: (type) =>\n type === \"error\" ? \"Erro,\" : type === \"warning\" ? \"Alerta,\" : null,\n },\n FeedbackPopover: {\n label: \"Mostrar observações\",\n },\n FieldGroupHeader: {\n visuallyHiddenCodePrefix: \"Secção\",\n },\n Input: {\n loadingDescription: \"A carregar…\",\n clearButtonLabel: \"Limpar\",\n },\n Keybinds: {\n keybindsSeparatorLabel: \"ou\",\n keyPressesSeparatorLabel: \"seguido de\",\n keySymbols: {\n Space: \"Espaço\",\n },\n keyLabels: {\n Meta: IS_APPLE ? undefined : \"Tecla Windows\",\n Space: \"Espaço\",\n ArrowUp: \"Seta para cima\",\n ArrowDown: \"Seta para baixo\",\n ArrowLeft: \"Seta para esquerda\",\n ArrowRight: \"Seta para direita\",\n Enter: IS_APPLE ? \"Retorno\" : undefined,\n Home: \"Início\",\n End: \"Fim\",\n PageUp: \"Página para cima\",\n PageDown: \"Página para baixo\",\n },\n },\n Label: {\n helperButtonLabel: \"Mostrar ajuda\",\n },\n NumericInput: {\n decimalSeparator: \",\",\n groupingStyle: \"thousand\",\n groupSeparator: \"\\u00A0\",\n },\n RadioGroup: {\n clearDescription: \"Pressione Backspace ou Delete para limpar.\",\n },\n Select: {\n placeholder: \"Selecionar…\",\n clearDescription: \"Pressione Backspace ou Delete para limpar.\",\n searchLabel: \"Pesquisar opções\",\n optionsLabel: \"Opções\",\n valueTagCloseButtonLabel: \"Remover\",\n },\n Step: {\n stepNumberLabel: (number) => `Passo ${number}`,\n completedLabel: \"Concluído\",\n },\n StepperFinishTrigger: {\n label: \"Concluir\",\n },\n StepperNextTrigger: {\n label: \"Seguinte\",\n },\n StepperPreviousTrigger: {\n label: \"Anterior\",\n },\n TableColumn: {\n helperButtonLabel: \"Mostrar ajuda\",\n },\n TableHead: {\n sortByColumnDescription: (columnName, sortDirection) =>\n sortDirection === null\n ? `Deixar de ordenar tabela pela coluna “${columnName}”`\n : `Ordenar tabela pela coluna “${columnName}” em ordem ${\n sortDirection === \"asc\" ? \"ascendente\" : \"descendente\"\n }`,\n },\n TabList: {\n scrollLeftButtonLabel: \"Deslocar para a esquerda\",\n scrollRightButtonLabel: \"Deslocar para a direita\",\n },\n ToastProvider: {\n label: \"Notificação\",\n },\n ToastViewport: {\n label: \"Notificações ({hotkey})\",\n },\n};\n"],"names":["dayPickerPt"],"mappings":"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"}
|
package/dist/ostack-ui.css
CHANGED
|
@@ -1702,8 +1702,6 @@ a > .o-ui-code {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
.o-ui-data-table__rows-per-page-label {
|
|
1704
1704
|
margin-right: var(--o-ui-space);
|
|
1705
|
-
font-size: var(--o-ui-font-size-sm);
|
|
1706
|
-
line-height: var(--o-ui-line-height-sm);
|
|
1707
1705
|
font-weight: 400 !important;
|
|
1708
1706
|
}
|
|
1709
1707
|
.o-ui-data-table__rows-per-page-select-root, .o-ui-data-table__pagination-select-root {
|
|
@@ -1715,6 +1713,7 @@ a > .o-ui-code {
|
|
|
1715
1713
|
align-items: center;
|
|
1716
1714
|
font-size: var(--o-ui-font-size-sm);
|
|
1717
1715
|
line-height: var(--o-ui-line-height-sm);
|
|
1716
|
+
font-weight: 400;
|
|
1718
1717
|
}
|
|
1719
1718
|
.o-ui-data-table__pagination-arrows {
|
|
1720
1719
|
margin-left: calc(var(--o-ui-space) * 2);
|
|
@@ -1987,12 +1986,15 @@ a > .o-ui-code {
|
|
|
1987
1986
|
.o-ui-date-range-input__container[data-variant=cell] {
|
|
1988
1987
|
height: 100%;
|
|
1989
1988
|
}
|
|
1989
|
+
.o-ui-date-range-input__popover-anchor {
|
|
1990
|
+
box-shadow: none;
|
|
1991
|
+
}
|
|
1990
1992
|
.o-ui-date-range-input__popover-anchor > .o-ui-date-range-input__container {
|
|
1991
1993
|
margin: calc(var(--o-ui-control-border-width) * -1);
|
|
1992
|
-
background: none;
|
|
1993
1994
|
}
|
|
1994
1995
|
.o-ui-date-range-input__popover-anchor > .o-ui-date-range-input__container:not([data-focused]) {
|
|
1995
1996
|
border-color: transparent;
|
|
1997
|
+
background: none;
|
|
1996
1998
|
}
|
|
1997
1999
|
.o-ui-date-range-input__popover-anchor > .o-ui-date-range-input__container:not(:first-child) {
|
|
1998
2000
|
border-top-left-radius: 0;
|
|
@@ -2149,6 +2151,7 @@ a > .o-ui-code {
|
|
|
2149
2151
|
}
|
|
2150
2152
|
.o-ui-feedback-list > .o-ui-feedback {
|
|
2151
2153
|
margin-left: calc(var(--o-ui-space) * 3.5) !important;
|
|
2154
|
+
text-align: left !important;
|
|
2152
2155
|
}
|
|
2153
2156
|
.o-ui-feedback-list > .o-ui-feedback ~ .o-ui-feedback {
|
|
2154
2157
|
margin-top: calc(var(--o-ui-space) * 0.5);
|
|
@@ -3588,10 +3591,10 @@ a > .o-ui-code {
|
|
|
3588
3591
|
.o-ui-stepper__step[data-status]::before {
|
|
3589
3592
|
background-color: var(--o-ui-accent-a3);
|
|
3590
3593
|
}
|
|
3591
|
-
.o-ui-stepper__step:is([data-completed], [data-
|
|
3594
|
+
.o-ui-stepper__step:is([data-completed], [data-current])::before {
|
|
3592
3595
|
background-color: var(--o-ui-primary-a9);
|
|
3593
3596
|
}
|
|
3594
|
-
.o-ui-stepper__step:is([data-completed], [data-
|
|
3597
|
+
.o-ui-stepper__step:is([data-completed], [data-current])[data-status]::before {
|
|
3595
3598
|
background-color: var(--o-ui-accent-a9);
|
|
3596
3599
|
}
|
|
3597
3600
|
.o-ui-stepper__step-button {
|
|
@@ -3604,7 +3607,7 @@ a > .o-ui-code {
|
|
|
3604
3607
|
margin-bottom: calc(var(--o-ui-space) * 2);
|
|
3605
3608
|
text-align: center;
|
|
3606
3609
|
}
|
|
3607
|
-
.o-ui-stepper__step-label:not([data-completed], [data-
|
|
3610
|
+
.o-ui-stepper__step-label:not([data-completed], [data-current]) {
|
|
3608
3611
|
color: var(--o-ui-neutral-a9);
|
|
3609
3612
|
}
|
|
3610
3613
|
.o-ui-stepper__step-content-label {
|
|
@@ -3633,7 +3636,7 @@ a > .o-ui-code {
|
|
|
3633
3636
|
outline: 2px solid var(--o-ui-primary-8);
|
|
3634
3637
|
}
|
|
3635
3638
|
@media screen and (prefers-reduced-motion: no-preference) {
|
|
3636
|
-
.o-ui-stepper__step-content[data-
|
|
3639
|
+
.o-ui-stepper__step-content[data-current] {
|
|
3637
3640
|
animation: o-ui-fade-in var(--o-ui-animation-fade-duration) var(--o-ui-animation-fade-timing-function);
|
|
3638
3641
|
}
|
|
3639
3642
|
}
|
package/dist/ostack-ui.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { forwardRef, createContext, useContext, useCallback, useRef, useEffect, useId, useMemo, useState, memo, Fragment as Fragment$1, isValidElement, cloneElement, Children, useImperativeHandle, startTransition, useLayoutEffect as useLayoutEffect$2, useSyncExternalStore, useDeferredValue } from "react";
|
|
3
3
|
import { parseKeybinding, tinykeys } from "tinykeys";
|
|
4
4
|
import fromExponential from "from-exponential";
|
|
5
|
-
import { isValid, isDate, addMonths, isAfter, isBefore, startOfMonth, setMonth, getYear, setYear, startOfYear, format, isSameYear, getMonth, max, min,
|
|
5
|
+
import { isValid, isDate, addMonths, isAfter, isBefore, startOfMonth, setMonth, getYear, setYear, startOfYear, format, isSameYear, getMonth, max, min, endOfMonth, isWithinInterval, lastDayOfMonth, isSameDay, isEqual, parseISO, parse } from "date-fns";
|
|
6
6
|
import { createStore, useStore as useStore$1, create } from "zustand";
|
|
7
7
|
import { shallow } from "zustand/shallow";
|
|
8
8
|
import { numericFormatter, removeNumericFormat, NumericFormat } from "react-number-format";
|
|
@@ -6098,7 +6098,7 @@ const ScrolledDataTablePagination = forwardRef(function ScrolledDataTablePaginat
|
|
|
6098
6098
|
return /* @__PURE__ */ jsxs(
|
|
6099
6099
|
"div",
|
|
6100
6100
|
{
|
|
6101
|
-
className: cx(prefix("data-table__pagination"), className),
|
|
6101
|
+
className: cx(prefix("data-table__pagination-label"), className),
|
|
6102
6102
|
...otherProps,
|
|
6103
6103
|
"data-prefer-right-alignment": boolDataAttr(preferRightAlignment),
|
|
6104
6104
|
ref: forwardedRef,
|
|
@@ -8787,18 +8787,24 @@ const CalendarHeader = memo(function CalendarHeader2({
|
|
|
8787
8787
|
}
|
|
8788
8788
|
return months2;
|
|
8789
8789
|
}, []);
|
|
8790
|
+
const displayYear = getYear(displayDate);
|
|
8791
|
+
const curYear = getYear(/* @__PURE__ */ new Date());
|
|
8792
|
+
const nearestCentury = curYear + 50 - (curYear + 50) % 100;
|
|
8793
|
+
const minYear = minAllowedDate ? getYear(minAllowedDate) : Math.min(displayYear, nearestCentury - 100);
|
|
8794
|
+
const maxYear = maxAllowedDate ? getYear(maxAllowedDate) : Math.max(displayYear, nearestCentury + 99);
|
|
8790
8795
|
const yearDates = useMemo(() => {
|
|
8791
|
-
const displayYear = getYear(displayDate);
|
|
8792
|
-
const curYear = getYear(/* @__PURE__ */ new Date());
|
|
8793
|
-
const nearestCentury = curYear + 50 - (curYear + 50) % 100;
|
|
8794
|
-
const minYear = minAllowedDate ? getYear(minAllowedDate) : Math.min(displayYear, nearestCentury - 100);
|
|
8795
|
-
const maxYear = maxAllowedDate ? getYear(maxAllowedDate) : Math.max(displayYear, nearestCentury + 99);
|
|
8796
8796
|
const years = [];
|
|
8797
|
+
if (displayYear < minYear) {
|
|
8798
|
+
years.push(setYear(startOfYear(/* @__PURE__ */ new Date()), displayYear));
|
|
8799
|
+
}
|
|
8797
8800
|
for (let year = minYear; year <= maxYear; year++) {
|
|
8798
8801
|
years.push(setYear(startOfYear(/* @__PURE__ */ new Date()), year));
|
|
8799
8802
|
}
|
|
8803
|
+
if (displayYear > maxYear) {
|
|
8804
|
+
years.push(setYear(startOfYear(/* @__PURE__ */ new Date()), displayYear));
|
|
8805
|
+
}
|
|
8800
8806
|
return years;
|
|
8801
|
-
}, [
|
|
8807
|
+
}, [displayYear, minYear, maxYear]);
|
|
8802
8808
|
const handleMonthChange = useCallback(
|
|
8803
8809
|
(value) => goToMonth(
|
|
8804
8810
|
addMonths(
|
|
@@ -8868,20 +8874,33 @@ const CalendarHeader = memo(function CalendarHeader2({
|
|
|
8868
8874
|
}
|
|
8869
8875
|
);
|
|
8870
8876
|
const monthOptions = useMemo(
|
|
8871
|
-
() => monthDates.map((monthDate) =>
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8877
|
+
() => monthDates.map((monthDate) => {
|
|
8878
|
+
return /* @__PURE__ */ jsx(
|
|
8879
|
+
Option,
|
|
8880
|
+
{
|
|
8881
|
+
value: getMonth(monthDate),
|
|
8882
|
+
disabled: minAllowedDate && maxAllowedDate && isSameYear(minAllowedDate, maxAllowedDate) && (getMonth(monthDate) < getMonth(minAllowedDate) || getMonth(monthDate) > getMonth(maxAllowedDate)),
|
|
8883
|
+
children: format(monthDate, MONTH_FORMAT, { locale: locale7 })
|
|
8884
|
+
},
|
|
8885
|
+
getMonth(monthDate)
|
|
8886
|
+
);
|
|
8887
|
+
}),
|
|
8880
8888
|
[locale7, maxAllowedDate, minAllowedDate, monthDates]
|
|
8881
8889
|
);
|
|
8882
8890
|
const yearOptions = useMemo(
|
|
8883
|
-
() => yearDates.map((yearDate) =>
|
|
8884
|
-
|
|
8891
|
+
() => yearDates.map((yearDate) => {
|
|
8892
|
+
const year = getYear(yearDate);
|
|
8893
|
+
return /* @__PURE__ */ jsx(
|
|
8894
|
+
Option,
|
|
8895
|
+
{
|
|
8896
|
+
value: year,
|
|
8897
|
+
disabled: year < minYear || year > maxYear,
|
|
8898
|
+
children: format(yearDate, YEAR_FORMAT, { locale: locale7 })
|
|
8899
|
+
},
|
|
8900
|
+
year
|
|
8901
|
+
);
|
|
8902
|
+
}),
|
|
8903
|
+
[locale7, maxYear, minYear, yearDates]
|
|
8885
8904
|
);
|
|
8886
8905
|
return /* @__PURE__ */ jsxs(
|
|
8887
8906
|
"header",
|
|
@@ -8981,6 +9000,7 @@ function Calendar({
|
|
|
8981
9000
|
disableNavigation,
|
|
8982
9001
|
disabled,
|
|
8983
9002
|
modifiers,
|
|
9003
|
+
apiRef,
|
|
8984
9004
|
headerProps,
|
|
8985
9005
|
headerLabelProps,
|
|
8986
9006
|
previousButtonProps,
|
|
@@ -9038,15 +9058,16 @@ function Calendar({
|
|
|
9038
9058
|
return normalizedValue === null ? { start: null, end: null } : isDate(normalizedValue) ? { start: normalizedValue, end: null } : Array.isArray(normalizedValue) ? normalizedValue.length === 0 ? { start: null, end: null } : { start: min(normalizedValue), end: max(normalizedValue) } : normalizedValue;
|
|
9039
9059
|
}
|
|
9040
9060
|
}, [normalizedValue, selectionMode]);
|
|
9041
|
-
const firstSelectedDate = selectionMode === "none" ? void 0 : selectionMode === "single" ? value ?? void 0 : selectionMode === "multiple" ? value[0] : value.start ?? value.end ?? void 0;
|
|
9042
9061
|
const [focusedRange, setFocusedRange] = useState({
|
|
9043
9062
|
start: null,
|
|
9044
9063
|
end: null
|
|
9045
9064
|
});
|
|
9065
|
+
minMonth = useMemo(() => toValidDate(minMonth), [minMonth]);
|
|
9066
|
+
maxMonth = useMemo(() => toValidDate(maxMonth), [maxMonth]);
|
|
9046
9067
|
const minAllowedDate = useMemo(() => {
|
|
9047
9068
|
const minDates = [
|
|
9048
9069
|
toValidDate(minDate),
|
|
9049
|
-
|
|
9070
|
+
minMonth && startOfMonth(minMonth),
|
|
9050
9071
|
minYear != null && new Date(minYear, 0, 1)
|
|
9051
9072
|
].filter((d) => d);
|
|
9052
9073
|
return minDates.length > 0 ? max(minDates) : void 0;
|
|
@@ -9054,16 +9075,70 @@ function Calendar({
|
|
|
9054
9075
|
const maxAllowedDate = useMemo(() => {
|
|
9055
9076
|
const maxDates = [
|
|
9056
9077
|
toValidDate(maxDate),
|
|
9057
|
-
|
|
9078
|
+
maxMonth && endOfMonth(maxMonth),
|
|
9058
9079
|
maxYear != null && new Date(maxYear, 11, 31)
|
|
9059
9080
|
].filter((d) => d);
|
|
9060
9081
|
return maxDates.length > 0 ? min(maxDates) : void 0;
|
|
9061
9082
|
}, [maxDate, maxMonth, maxYear]);
|
|
9062
|
-
const
|
|
9063
|
-
const
|
|
9064
|
-
|
|
9083
|
+
const curDateStr = (/* @__PURE__ */ new Date()).toISOString();
|
|
9084
|
+
const curMonth = useMemo(
|
|
9085
|
+
() => startOfMonth(new Date(curDateStr)),
|
|
9086
|
+
[curDateStr]
|
|
9087
|
+
);
|
|
9088
|
+
const initialMonth = useMemo(() => {
|
|
9089
|
+
if (controlledMonth !== void 0) {
|
|
9090
|
+
return controlledMonth;
|
|
9091
|
+
}
|
|
9092
|
+
if (defaultMonth !== void 0) {
|
|
9093
|
+
return defaultMonth;
|
|
9094
|
+
}
|
|
9095
|
+
const selectedMonth = selectionMode === "none" ? null : selectionMode === "single" ? value : selectionMode === "multiple" ? value[0] : selectionMode === "range-end" ? value.end ?? value.start : value.start ?? value.end;
|
|
9096
|
+
if (selectedMonth != null) {
|
|
9097
|
+
return selectedMonth;
|
|
9098
|
+
}
|
|
9099
|
+
const minAllowedMonth = minAllowedDate && startOfMonth(minAllowedDate);
|
|
9100
|
+
const maxAllowedMonth = maxAllowedDate && startOfMonth(maxAllowedDate);
|
|
9101
|
+
return (!minAllowedMonth || !isBefore(curMonth, minAllowedMonth)) && (!maxAllowedMonth || !isAfter(curMonth, maxAllowedMonth)) ? curMonth : minAllowedMonth ?? maxAllowedMonth ?? curMonth;
|
|
9102
|
+
}, [
|
|
9103
|
+
controlledMonth,
|
|
9104
|
+
curMonth,
|
|
9105
|
+
defaultMonth,
|
|
9106
|
+
maxAllowedDate,
|
|
9107
|
+
minAllowedDate,
|
|
9108
|
+
selectionMode,
|
|
9109
|
+
value
|
|
9110
|
+
]);
|
|
9111
|
+
const [unnormalizedMonth, setMonth2] = useControllableState(
|
|
9112
|
+
initialMonth,
|
|
9065
9113
|
controlledMonth
|
|
9066
9114
|
);
|
|
9115
|
+
const month = useMemo(
|
|
9116
|
+
() => toValidDate(unnormalizedMonth) ?? curMonth,
|
|
9117
|
+
[curMonth, unnormalizedMonth]
|
|
9118
|
+
);
|
|
9119
|
+
const latest = useLatestValues({ value, month, numberOfMonths });
|
|
9120
|
+
useImperativeHandle(
|
|
9121
|
+
apiRef,
|
|
9122
|
+
() => ({
|
|
9123
|
+
getValue: () => latest.value,
|
|
9124
|
+
setValue,
|
|
9125
|
+
getMonth: () => latest.month,
|
|
9126
|
+
setMonth: setMonth2,
|
|
9127
|
+
isVisible: (date) => {
|
|
9128
|
+
const validDate = toValidDate(date);
|
|
9129
|
+
if (!validDate) {
|
|
9130
|
+
throw new Error(`Invalid date argument: ${date.toString()}`);
|
|
9131
|
+
}
|
|
9132
|
+
return isWithinInterval(validDate, {
|
|
9133
|
+
start: latest.month,
|
|
9134
|
+
end: lastDayOfMonth(
|
|
9135
|
+
addMonths(latest.month, (latest.numberOfMonths ?? 1) - 1)
|
|
9136
|
+
)
|
|
9137
|
+
});
|
|
9138
|
+
}
|
|
9139
|
+
}),
|
|
9140
|
+
[latest, setMonth2, setValue]
|
|
9141
|
+
);
|
|
9067
9142
|
const handleMonthChange = useCallback(
|
|
9068
9143
|
(date) => {
|
|
9069
9144
|
onMonthChange?.(date);
|
|
@@ -9117,7 +9192,7 @@ function Calendar({
|
|
|
9117
9192
|
}
|
|
9118
9193
|
}
|
|
9119
9194
|
if (modifiers2.outside) {
|
|
9120
|
-
const firstDay = startOfMonth(
|
|
9195
|
+
const firstDay = startOfMonth(unnormalizedMonth);
|
|
9121
9196
|
const lastDay = lastDayOfMonth(addMonths(firstDay, numberOfMonths - 1));
|
|
9122
9197
|
if (isBefore(date, firstDay)) {
|
|
9123
9198
|
handleMonthChange(
|
|
@@ -9132,7 +9207,7 @@ function Calendar({
|
|
|
9132
9207
|
},
|
|
9133
9208
|
[
|
|
9134
9209
|
handleMonthChange,
|
|
9135
|
-
|
|
9210
|
+
unnormalizedMonth,
|
|
9136
9211
|
numberOfMonths,
|
|
9137
9212
|
onDayClick,
|
|
9138
9213
|
onValueChange,
|
|
@@ -9225,7 +9300,6 @@ function Calendar({
|
|
|
9225
9300
|
locale: locale7.dayPickerLocale,
|
|
9226
9301
|
required,
|
|
9227
9302
|
disabled: composedDisabled,
|
|
9228
|
-
selected: firstSelectedDate,
|
|
9229
9303
|
components: {
|
|
9230
9304
|
MonthCaption: CalendarHeader,
|
|
9231
9305
|
MonthGrid: CalendarMonthGrid,
|
|
@@ -9698,6 +9772,7 @@ const DateInput = forwardRef(
|
|
|
9698
9772
|
open: false,
|
|
9699
9773
|
modal: false
|
|
9700
9774
|
});
|
|
9775
|
+
const calendarApiRef = useRef(null);
|
|
9701
9776
|
const inputRef = useRef(null);
|
|
9702
9777
|
const clearButtonRef = useRef(null);
|
|
9703
9778
|
const addonButtonRef = useRef(null);
|
|
@@ -9713,60 +9788,27 @@ const DateInput = forwardRef(
|
|
|
9713
9788
|
},
|
|
9714
9789
|
[onPopoverOpenChange, popoverState.open]
|
|
9715
9790
|
);
|
|
9716
|
-
const monthToDisplay = useCallback(
|
|
9717
|
-
() => startOfMonth(calendarProps?.defaultMonth ?? dateValue ?? /* @__PURE__ */ new Date()),
|
|
9718
|
-
[calendarProps?.defaultMonth, dateValue]
|
|
9719
|
-
);
|
|
9720
|
-
const [month, setMonth2] = useControllableState(
|
|
9721
|
-
() => monthToDisplay(),
|
|
9722
|
-
calendarProps?.month
|
|
9723
|
-
);
|
|
9724
|
-
const dateIsVisible = useCallback(
|
|
9725
|
-
(date) => isWithinInterval(date, {
|
|
9726
|
-
start: month,
|
|
9727
|
-
end: lastDayOfMonth(
|
|
9728
|
-
addMonths(month, (calendarProps?.numberOfMonths ?? 1) - 1)
|
|
9729
|
-
)
|
|
9730
|
-
}),
|
|
9731
|
-
[calendarProps?.numberOfMonths, month]
|
|
9732
|
-
);
|
|
9733
|
-
const handleMonthChange = combineEventHandlers(
|
|
9734
|
-
calendarProps?.onMonthChange,
|
|
9735
|
-
setMonth2
|
|
9736
|
-
);
|
|
9737
9791
|
const handleInputChange = useCallback(
|
|
9738
9792
|
(evt) => {
|
|
9739
9793
|
const formattedValue2 = evt.currentTarget.value;
|
|
9740
9794
|
const dateValue2 = parseDate(formattedValue2);
|
|
9741
9795
|
onValueChange?.({ formattedValue: formattedValue2, dateValue: dateValue2 });
|
|
9742
9796
|
setFormattedValue(formattedValue2);
|
|
9743
|
-
|
|
9744
|
-
|
|
9797
|
+
const calendarApi = calendarApiRef.current;
|
|
9798
|
+
if (!evt.defaultPrevented && dateValue2 && calendarApi && !calendarApi?.isVisible(dateValue2)) {
|
|
9799
|
+
const month = startOfMonth(dateValue2);
|
|
9800
|
+
calendarProps?.onMonthChange?.(month);
|
|
9801
|
+
calendarApi.setMonth(month);
|
|
9745
9802
|
}
|
|
9746
9803
|
},
|
|
9747
|
-
[
|
|
9748
|
-
dateIsVisible,
|
|
9749
|
-
handleMonthChange,
|
|
9750
|
-
onValueChange,
|
|
9751
|
-
parseDate,
|
|
9752
|
-
setFormattedValue
|
|
9753
|
-
]
|
|
9804
|
+
[calendarProps, onValueChange, parseDate, setFormattedValue]
|
|
9754
9805
|
);
|
|
9755
9806
|
const handleInputFocus = useCallback(() => {
|
|
9756
|
-
if (!popoverState.open) {
|
|
9757
|
-
handleMonthChange(monthToDisplay());
|
|
9758
|
-
}
|
|
9759
9807
|
changePopoverState({ open: true, modal: false });
|
|
9760
|
-
}, [
|
|
9761
|
-
popoverState.open,
|
|
9762
|
-
changePopoverState,
|
|
9763
|
-
handleMonthChange,
|
|
9764
|
-
monthToDisplay
|
|
9765
|
-
]);
|
|
9808
|
+
}, [changePopoverState]);
|
|
9766
9809
|
const handleAddonButtonClick = useCallback(() => {
|
|
9767
|
-
handleMonthChange(monthToDisplay());
|
|
9768
9810
|
changePopoverState({ open: true, modal: true });
|
|
9769
|
-
}, [changePopoverState
|
|
9811
|
+
}, [changePopoverState]);
|
|
9770
9812
|
const handleCalendarValueChange = useCallback(
|
|
9771
9813
|
(date) => {
|
|
9772
9814
|
const formattedValue2 = formatDate(date);
|
|
@@ -9931,8 +9973,6 @@ const DateInput = forwardRef(
|
|
|
9931
9973
|
selectionMode: "single",
|
|
9932
9974
|
value: deferredDateValue,
|
|
9933
9975
|
onValueChange: handleCalendarValueChange,
|
|
9934
|
-
month,
|
|
9935
|
-
onMonthChange: handleMonthChange,
|
|
9936
9976
|
disabled: disabled || softDisabled || readOnly || calendarProps?.disabled,
|
|
9937
9977
|
minDate,
|
|
9938
9978
|
maxDate,
|
|
@@ -9940,6 +9980,7 @@ const DateInput = forwardRef(
|
|
|
9940
9980
|
maxMonth,
|
|
9941
9981
|
minYear,
|
|
9942
9982
|
maxYear,
|
|
9983
|
+
apiRef: calendarApiRef,
|
|
9943
9984
|
monthSelectProps: {
|
|
9944
9985
|
...calendarProps?.monthSelectProps,
|
|
9945
9986
|
popoverProps: {
|
|
@@ -10102,6 +10143,7 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10102
10143
|
open: false,
|
|
10103
10144
|
modal: false
|
|
10104
10145
|
});
|
|
10146
|
+
const calendarApiRef = useRef(null);
|
|
10105
10147
|
const startContainerRef = useRef(null);
|
|
10106
10148
|
const endContainerRef = useRef(null);
|
|
10107
10149
|
const startInputRef = useRef(null);
|
|
@@ -10121,43 +10163,6 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10121
10163
|
},
|
|
10122
10164
|
[onPopoverOpenChange, popoverState.open, selectionMode]
|
|
10123
10165
|
);
|
|
10124
|
-
const monthToDisplay = useCallback(
|
|
10125
|
-
(input) => {
|
|
10126
|
-
let toDisplay;
|
|
10127
|
-
if (calendarProps?.defaultMonth) {
|
|
10128
|
-
toDisplay = calendarProps.defaultMonth;
|
|
10129
|
-
} else if (input === "start" && dateValue.start) {
|
|
10130
|
-
toDisplay = dateValue.start;
|
|
10131
|
-
} else {
|
|
10132
|
-
const relevantForEnd = dateValue.end && addMonths(dateValue.end, -(calendarProps?.numberOfMonths ?? 1) + 1);
|
|
10133
|
-
toDisplay = relevantForEnd ?? dateValue.start ?? /* @__PURE__ */ new Date();
|
|
10134
|
-
}
|
|
10135
|
-
return startOfMonth(toDisplay);
|
|
10136
|
-
},
|
|
10137
|
-
[
|
|
10138
|
-
dateValue.end,
|
|
10139
|
-
dateValue.start,
|
|
10140
|
-
calendarProps?.defaultMonth,
|
|
10141
|
-
calendarProps?.numberOfMonths
|
|
10142
|
-
]
|
|
10143
|
-
);
|
|
10144
|
-
const [month, setMonth2] = useControllableState(
|
|
10145
|
-
() => monthToDisplay("start"),
|
|
10146
|
-
calendarProps?.month
|
|
10147
|
-
);
|
|
10148
|
-
const dateIsVisible = useCallback(
|
|
10149
|
-
(date) => isWithinInterval(date, {
|
|
10150
|
-
start: month,
|
|
10151
|
-
end: lastDayOfMonth(
|
|
10152
|
-
addMonths(month, (calendarProps?.numberOfMonths ?? 1) - 1)
|
|
10153
|
-
)
|
|
10154
|
-
}),
|
|
10155
|
-
[calendarProps?.numberOfMonths, month]
|
|
10156
|
-
);
|
|
10157
|
-
const handleMonthChange = combineEventHandlers(
|
|
10158
|
-
calendarProps?.onMonthChange,
|
|
10159
|
-
setMonth2
|
|
10160
|
-
);
|
|
10161
10166
|
const handleStartInputChange = useCallback(
|
|
10162
10167
|
(evt) => {
|
|
10163
10168
|
const formattedStart = evt.currentTarget.value;
|
|
@@ -10172,18 +10177,20 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10172
10177
|
dateValue: newDateValue
|
|
10173
10178
|
});
|
|
10174
10179
|
setFormattedValue(newFormattedValue);
|
|
10175
|
-
|
|
10176
|
-
|
|
10180
|
+
const calendarApi = calendarApiRef.current;
|
|
10181
|
+
if (!evt.defaultPrevented && dateStart && calendarApi && !calendarApi.isVisible(dateStart)) {
|
|
10182
|
+
const month = startOfMonth(dateStart);
|
|
10183
|
+
calendarProps?.onMonthChange?.(month);
|
|
10184
|
+
calendarApi.setMonth(month);
|
|
10177
10185
|
}
|
|
10178
10186
|
},
|
|
10179
10187
|
[
|
|
10180
|
-
|
|
10188
|
+
parseDate,
|
|
10189
|
+
formattedValue.end,
|
|
10181
10190
|
dateValue.end,
|
|
10182
|
-
handleMonthChange,
|
|
10183
10191
|
onValueChange,
|
|
10184
|
-
parseDate,
|
|
10185
10192
|
setFormattedValue,
|
|
10186
|
-
|
|
10193
|
+
calendarProps
|
|
10187
10194
|
]
|
|
10188
10195
|
);
|
|
10189
10196
|
const handleEndInputChange = useCallback(
|
|
@@ -10200,24 +10207,23 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10200
10207
|
dateValue: newDateValue
|
|
10201
10208
|
});
|
|
10202
10209
|
setFormattedValue(newFormattedValue);
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
)
|
|
10210
|
+
const calendarApi = calendarApiRef.current;
|
|
10211
|
+
if (!evt.defaultPrevented && dateEnd && calendarApi && !calendarApi.isVisible(dateEnd)) {
|
|
10212
|
+
const month = addMonths(
|
|
10213
|
+
startOfMonth(dateEnd),
|
|
10214
|
+
-(calendarProps?.numberOfMonths ?? 1) + 1
|
|
10209
10215
|
);
|
|
10216
|
+
calendarProps?.onMonthChange?.(month);
|
|
10217
|
+
calendarApi.setMonth(month);
|
|
10210
10218
|
}
|
|
10211
10219
|
},
|
|
10212
10220
|
[
|
|
10213
|
-
|
|
10221
|
+
parseDate,
|
|
10222
|
+
formattedValue.start,
|
|
10214
10223
|
dateValue.start,
|
|
10215
|
-
calendarProps?.numberOfMonths,
|
|
10216
|
-
handleMonthChange,
|
|
10217
10224
|
onValueChange,
|
|
10218
|
-
parseDate,
|
|
10219
10225
|
setFormattedValue,
|
|
10220
|
-
|
|
10226
|
+
calendarProps
|
|
10221
10227
|
]
|
|
10222
10228
|
);
|
|
10223
10229
|
const handleInputFocus = useCallback(
|
|
@@ -10225,19 +10231,10 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10225
10231
|
setFieldControlFocused(true);
|
|
10226
10232
|
setSelectionMode(input);
|
|
10227
10233
|
if (!evt.defaultPrevented) {
|
|
10228
|
-
if (!popoverState.open) {
|
|
10229
|
-
handleMonthChange(monthToDisplay(input));
|
|
10230
|
-
}
|
|
10231
10234
|
changePopoverState({ open: true, modal: false });
|
|
10232
10235
|
}
|
|
10233
10236
|
},
|
|
10234
|
-
[
|
|
10235
|
-
setFieldControlFocused,
|
|
10236
|
-
popoverState.open,
|
|
10237
|
-
changePopoverState,
|
|
10238
|
-
handleMonthChange,
|
|
10239
|
-
monthToDisplay
|
|
10240
|
-
]
|
|
10237
|
+
[setFieldControlFocused, changePopoverState]
|
|
10241
10238
|
);
|
|
10242
10239
|
const handleClearButtonClick = useCallback(
|
|
10243
10240
|
(ref) => () => {
|
|
@@ -10272,9 +10269,8 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10272
10269
|
);
|
|
10273
10270
|
const handleAddonButtonClick = useCallback(() => {
|
|
10274
10271
|
setSelectionMode("start");
|
|
10275
|
-
handleMonthChange(monthToDisplay("start"));
|
|
10276
10272
|
changePopoverState({ open: true, modal: true });
|
|
10277
|
-
}, [
|
|
10273
|
+
}, [changePopoverState]);
|
|
10278
10274
|
const handleCalendarValueChange = useCallback(
|
|
10279
10275
|
(range) => {
|
|
10280
10276
|
const newFormattedValue = {
|
|
@@ -10745,8 +10741,6 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10745
10741
|
selectionMode: `range-${selectionMode}`,
|
|
10746
10742
|
value: deferredDateValue,
|
|
10747
10743
|
onValueChange: handleCalendarValueChange,
|
|
10748
|
-
month,
|
|
10749
|
-
onMonthChange: handleMonthChange,
|
|
10750
10744
|
disabled: bothDisabled || bothSoftDisabled || bothReadOnly || (startDisabled || startSoftDisabled || startReadOnly) && (endDisabled || endSoftDisabled || endReadOnly) || calendarProps?.disabled,
|
|
10751
10745
|
minDate,
|
|
10752
10746
|
maxDate,
|
|
@@ -10754,6 +10748,7 @@ const DateRangeInput = forwardRef(function DateRangeInput2({
|
|
|
10754
10748
|
maxMonth,
|
|
10755
10749
|
minYear,
|
|
10756
10750
|
maxYear,
|
|
10751
|
+
apiRef: calendarApiRef,
|
|
10757
10752
|
monthSelectProps: {
|
|
10758
10753
|
...calendarProps?.monthSelectProps,
|
|
10759
10754
|
popoverProps: {
|
|
@@ -12693,7 +12688,7 @@ const Step = forwardRef(function Step2({
|
|
|
12693
12688
|
completedLabel ??= locale7.Step.completedLabel;
|
|
12694
12689
|
const prefix = usePrefix();
|
|
12695
12690
|
const { store } = useStepperContext();
|
|
12696
|
-
const
|
|
12691
|
+
const isActiveStep = useStore$1(store, (state) => state.activeStep() === index);
|
|
12697
12692
|
const isCompleted = useStore$1(
|
|
12698
12693
|
store,
|
|
12699
12694
|
(state) => completed ?? state.activeStep() > index
|
|
@@ -12722,7 +12717,7 @@ const Step = forwardRef(function Step2({
|
|
|
12722
12717
|
{
|
|
12723
12718
|
className: cx(prefix("stepper__step"), className),
|
|
12724
12719
|
"data-completed": boolDataAttr(isCompleted),
|
|
12725
|
-
"data-
|
|
12720
|
+
"data-current": boolDataAttr(isActiveStep),
|
|
12726
12721
|
"data-status": status,
|
|
12727
12722
|
"data-accent": controlStatusToAccent(
|
|
12728
12723
|
status,
|
|
@@ -12735,7 +12730,7 @@ const Step = forwardRef(function Step2({
|
|
|
12735
12730
|
Label,
|
|
12736
12731
|
{
|
|
12737
12732
|
"data-completed": boolDataAttr(isCompleted),
|
|
12738
|
-
"data-
|
|
12733
|
+
"data-current": boolDataAttr(isActiveStep),
|
|
12739
12734
|
...labelProps,
|
|
12740
12735
|
id: labelId,
|
|
12741
12736
|
className: cx(prefix("stepper__step-label"), labelProps?.className),
|
|
@@ -12756,19 +12751,19 @@ const Step = forwardRef(function Step2({
|
|
|
12756
12751
|
/* @__PURE__ */ jsx(
|
|
12757
12752
|
Button,
|
|
12758
12753
|
{
|
|
12759
|
-
variant: variant ?? (isCompleted ||
|
|
12754
|
+
variant: variant ?? (isCompleted || isActiveStep ? "solid" : "subtle"),
|
|
12760
12755
|
color: controlStatusToAccent(
|
|
12761
12756
|
status,
|
|
12762
|
-
isCompleted ||
|
|
12757
|
+
isCompleted || isActiveStep ? "primary" : "neutral"
|
|
12763
12758
|
),
|
|
12764
12759
|
"data-completed": boolDataAttr(isCompleted),
|
|
12765
|
-
"data-
|
|
12760
|
+
"data-current": boolDataAttr(isActiveStep),
|
|
12766
12761
|
"data-status": status,
|
|
12767
12762
|
loading,
|
|
12768
12763
|
showSpinner,
|
|
12769
12764
|
"aria-disabled": disabled,
|
|
12770
|
-
"aria-current":
|
|
12771
|
-
"aria-controls":
|
|
12765
|
+
"aria-current": isActiveStep ? "step" : void 0,
|
|
12766
|
+
"aria-controls": isActiveStep ? stepContentInfo?.id : void 0,
|
|
12772
12767
|
...buttonProps,
|
|
12773
12768
|
id: buttonId,
|
|
12774
12769
|
className: cx(prefix("stepper__step-button"), buttonProps?.className),
|