@registrucentras/rc-ses-react-components 2.7.0 → 2.7.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/README.md +1 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +8 -17
- package/package.json +2 -1
- package/src/components/form/inputs/PhoneInputFormControl/index.test.tsx +11 -0
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +1 -0
- package/src/components/form/inputs/Select/index.test.tsx +11 -0
- package/src/components/form/inputs/Select/index.tsx +2 -0
- package/src/components/overlays/BottomSheet/index.tsx +2 -1
- package/src/components/overlays/Drawer/index.tsx +1 -10
- package/src/i18n/namespaces/input/en.json +5 -2
- package/src/i18n/namespaces/input/lt.json +5 -2
|
@@ -6379,9 +6379,9 @@ const sc = { ServiceFormActions: { draft: "Save for later", discard: "Discard an
|
|
|
6379
6379
|
components: sc
|
|
6380
6380
|
}, lc = { ServiceFormActions: { draft: "Baigti pildyti vėliau", discard: "Atšaukti pildymą ir ištrinti formos duomenis", submit: "Baigti pildyti ir pridėti į krepšelį" }, Loader: { loading: "Kraunama..." }, Button: { loading: "Kraunasi" }, StepCard: { cancel: "Atšaukti", back: "Atgal", continue: "Tęsti", addToCart: "Pridėti į krepšelį", totalWithoutVat: "Suma be PVM" }, SegmentedControl: { options: "Parinktys", tabs: "Skirtukai" }, AdvancedListItemTrailing: { decrease: "Sumažinti", increase: "Padidinti", delete: "Pašalinti", toggle: "Perjungti", vat: "su PVM" }, Tooltip: { trigger: "Paaiškinimas" }, AdvancedListItemLeading: { moveUp: "Perkelti aukštyn", moveDown: "Perkelti žemyn" }, RcSesSideNav: { title: "Temos", itemLabel: "{{label}}, {{count}}" }, Drawer: { closeDrawer: "Uždaryti" } }, cc = {
|
|
6381
6381
|
components: lc
|
|
6382
|
-
}, dc = { RcSesAlert: { close: "Close" }, RcSesBadge: { aria: { close: "Remove {{label}}" } }, RcSesButtonWithPopover: { aria: { label: "Additional information" } }, RcSesDatepicker: { aria: { clearValue: "Clear current date selection", openCalendar: "Open datepicker calendar" }, prevYear: "Previous year", nextYear: "Next year" }, RcSesFileDropzone: { label: "Drag and drop file over this area or <1>click here</1> to browse" }, RcSesFileUpload: { label: "Upload file" }, RcSesFormControlWrapper: { search: "Search", required: "Field is required" }, RcSesNumberStepper: { add: "Add", subtract: "Subtract" }, RcSesPhoneInputFormControl: { aria: { countrySelectorLabel: "Select country phone code" }, search: "Search", invalid: "Invalid phone number format" }, RcSesSearchableField: { clearValueAriaLabel: "Clear search value", searchAriaLabel: "Open search" }, RcSesSelect: { searchPlaceholder: "Search", selectAllLabel: "All" }, RcSesSearchInput: { clearValueAriaLabel: "Clear search value", searchButtonLabel: "Search" }, RcSesSnackbar: { aria: { close: "Close notification" } }, Modal: { actions: { destructive: { primary: "Remove" }, confirm: { primary: "Continue" }, success: { primary: "Close" }, info: { primary: "I understand" }, cancel: "Cancel" } }, RcSesBottomSheet: { aria: { back: "Back" } }, RcSesFilterChip: { aria: { label: "Remove filter: {{label}}" } } }, uc = {
|
|
6382
|
+
}, dc = { RcSesAlert: { close: "Close" }, RcSesBadge: { aria: { close: "Remove {{label}}" } }, RcSesButtonWithPopover: { aria: { label: "Additional information" } }, RcSesDatepicker: { aria: { clearValue: "Clear current date selection", openCalendar: "Open datepicker calendar" }, prevYear: "Previous year", nextYear: "Next year" }, RcSesFileDropzone: { label: "Drag and drop file over this area or <1>click here</1> to browse" }, RcSesFileUpload: { label: "Upload file" }, RcSesFormControlWrapper: { search: "Search", required: "Field is required" }, RcSesNumberStepper: { add: "Add", subtract: "Subtract" }, RcSesPhoneInputFormControl: { aria: { countrySelectorLabel: "Select country phone code" }, search: "Search", invalid: "Invalid phone number format", noOptionsText: "No results found" }, RcSesSearchableField: { clearValueAriaLabel: "Clear search value", searchAriaLabel: "Open search" }, RcSesSelect: { searchPlaceholder: "Search", selectAllLabel: "All", noOptionsText: "No results found", loadingText: "Loading..." }, RcSesSearchInput: { clearValueAriaLabel: "Clear search value", searchButtonLabel: "Search" }, RcSesSnackbar: { aria: { close: "Close notification" } }, Modal: { actions: { destructive: { primary: "Remove" }, confirm: { primary: "Continue" }, success: { primary: "Close" }, info: { primary: "I understand" }, cancel: "Cancel" } }, RcSesBottomSheet: { aria: { back: "Back" } }, RcSesFilterChip: { aria: { label: "Remove filter: {{label}}" } } }, uc = {
|
|
6383
6383
|
components: dc
|
|
6384
|
-
}, pc = { RcSesAlert: { close: "Uždaryti" }, RcSesBadge: { aria: { close: "Pašalinti {{label}}" } }, RcSesButtonWithPopover: { aria: { label: "Daugiau informacijos" } }, RcSesDatepicker: { aria: { clearValue: "Išvalyti datos reikšmę", openCalendar: "Atverti datos pasirinkimo kalendorių" }, prevYear: "Ankstesni metai", nextYear: "Ateinantys metai" }, RcSesFileDropzone: { label: "Nutempkite failą čia arba <1>įkelkite</1> iš kompiuterio" }, RcSesFileUpload: { label: "Įkelti failą" }, RcSesFormControlWrapper: { search: "Ieškoti", required: "Laukas yra privalomas" }, RcSesNumberStepper: { add: "Pridėti", subtract: "Atimti" }, RcSesPhoneInputFormControl: { aria: { countrySelectorLabel: "Šalies telefono numerio kodo pasirinkimas" }, search: "Ieškoti", invalid: "Klaidingas telefono numerio formatas" }, RcSesSearchableField: { clearValueAriaLabel: "Išvalyti paieškos reikšmę", searchAriaLabel: "Ieškoti" }, RcSesSelect: { searchPlaceholder: "Ieškoti", selectAllLabel: "Visi" }, RcSesSearchInput: { clearValueAriaLabel: "Išvalyti paieškos reikšmę", searchButtonLabel: "Ieškoti" }, RcSesSnackbar: { aria: { close: "Uždaryti pranešimą" } }, Modal: { actions: { destructive: { primary: "Pašalinti" }, confirm: { primary: "Tęsti" }, success: { primary: "Uždaryti" }, info: { primary: "Suprantu" }, cancel: "Atšaukti" } }, RcSesBottomSheet: { aria: { back: "Atgal" } }, RcSesFilterChip: { aria: { label: "Pašalinti filtrą: {{label}}" } } }, hc = {
|
|
6384
|
+
}, pc = { RcSesAlert: { close: "Uždaryti" }, RcSesBadge: { aria: { close: "Pašalinti {{label}}" } }, RcSesButtonWithPopover: { aria: { label: "Daugiau informacijos" } }, RcSesDatepicker: { aria: { clearValue: "Išvalyti datos reikšmę", openCalendar: "Atverti datos pasirinkimo kalendorių" }, prevYear: "Ankstesni metai", nextYear: "Ateinantys metai" }, RcSesFileDropzone: { label: "Nutempkite failą čia arba <1>įkelkite</1> iš kompiuterio" }, RcSesFileUpload: { label: "Įkelti failą" }, RcSesFormControlWrapper: { search: "Ieškoti", required: "Laukas yra privalomas" }, RcSesNumberStepper: { add: "Pridėti", subtract: "Atimti" }, RcSesPhoneInputFormControl: { aria: { countrySelectorLabel: "Šalies telefono numerio kodo pasirinkimas" }, search: "Ieškoti", invalid: "Klaidingas telefono numerio formatas", noOptionsText: "Rezultatų nerasta" }, RcSesSearchableField: { clearValueAriaLabel: "Išvalyti paieškos reikšmę", searchAriaLabel: "Ieškoti" }, RcSesSelect: { searchPlaceholder: "Ieškoti", selectAllLabel: "Visi", noOptionsText: "Rezultatų nerasta", loadingText: "Kraunama..." }, RcSesSearchInput: { clearValueAriaLabel: "Išvalyti paieškos reikšmę", searchButtonLabel: "Ieškoti" }, RcSesSnackbar: { aria: { close: "Uždaryti pranešimą" } }, Modal: { actions: { destructive: { primary: "Pašalinti" }, confirm: { primary: "Tęsti" }, success: { primary: "Uždaryti" }, info: { primary: "Suprantu" }, cancel: "Atšaukti" } }, RcSesBottomSheet: { aria: { back: "Atgal" } }, RcSesFilterChip: { aria: { label: "Pašalinti filtrą: {{label}}" } } }, hc = {
|
|
6385
6385
|
components: pc
|
|
6386
6386
|
}, fc = new ic();
|
|
6387
6387
|
ge.use(Da).init({
|
|
@@ -9396,6 +9396,7 @@ function Cd(t) {
|
|
|
9396
9396
|
filterOptions: (y, { inputValue: E }) => y.filter((L) => L.searchable.includes(E.toUpperCase())),
|
|
9397
9397
|
getOptionLabel: (y) => y.name,
|
|
9398
9398
|
isOptionEqualToValue: (y, E) => y.code === E.code,
|
|
9399
|
+
noOptionsText: e("noOptionsText"),
|
|
9399
9400
|
onChange: (y, E) => {
|
|
9400
9401
|
y.preventDefault(), g(null), c(E), p.onChange("");
|
|
9401
9402
|
},
|
|
@@ -9937,6 +9938,8 @@ function w0(t) {
|
|
|
9937
9938
|
clearOnBlur: !1,
|
|
9938
9939
|
handleHomeEndKeys: !1,
|
|
9939
9940
|
loading: x,
|
|
9941
|
+
loadingText: e("loadingText"),
|
|
9942
|
+
noOptionsText: e("noOptionsText"),
|
|
9940
9943
|
popupIcon: /* @__PURE__ */ s(Kt, { size: 20, fillColor: u.grey[600] }),
|
|
9941
9944
|
value: ye,
|
|
9942
9945
|
inputValue: Zt,
|
|
@@ -11154,7 +11157,6 @@ function A0({
|
|
|
11154
11157
|
{
|
|
11155
11158
|
sx: {
|
|
11156
11159
|
display: "flex",
|
|
11157
|
-
justifyContent: "flex-end",
|
|
11158
11160
|
gap: 1.5,
|
|
11159
11161
|
padding: Re.actionsPadding,
|
|
11160
11162
|
flexShrink: 0
|
|
@@ -11167,6 +11169,7 @@ function A0({
|
|
|
11167
11169
|
color: "grey",
|
|
11168
11170
|
onClick: c,
|
|
11169
11171
|
disabled: d,
|
|
11172
|
+
sx: { flex: 1 },
|
|
11170
11173
|
children: a
|
|
11171
11174
|
}
|
|
11172
11175
|
),
|
|
@@ -11176,6 +11179,7 @@ function A0({
|
|
|
11176
11179
|
variant: "contained",
|
|
11177
11180
|
onClick: i,
|
|
11178
11181
|
disabled: l,
|
|
11182
|
+
sx: { flex: 1 },
|
|
11179
11183
|
children: o
|
|
11180
11184
|
}
|
|
11181
11185
|
)
|
|
@@ -11343,20 +11347,7 @@ const Un = 440, Ud = 250, Kd = 0.5, Gd = Ar((t, e) => /* @__PURE__ */ s(Rr, { re
|
|
|
11343
11347
|
gap: "1rem"
|
|
11344
11348
|
},
|
|
11345
11349
|
children: [
|
|
11346
|
-
/* @__PURE__ */ s(
|
|
11347
|
-
K,
|
|
11348
|
-
{
|
|
11349
|
-
id: m,
|
|
11350
|
-
component: "h2",
|
|
11351
|
-
sx: {
|
|
11352
|
-
fontSize: "14px",
|
|
11353
|
-
fontStyle: "normal",
|
|
11354
|
-
fontWeight: 600,
|
|
11355
|
-
lineHeight: "20px"
|
|
11356
|
-
},
|
|
11357
|
-
children: r
|
|
11358
|
-
}
|
|
11359
|
-
),
|
|
11350
|
+
/* @__PURE__ */ s(K, { id: m, variant: "h6", children: r }),
|
|
11360
11351
|
/* @__PURE__ */ s(
|
|
11361
11352
|
ue,
|
|
11362
11353
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@registrucentras/rc-ses-react-components",
|
|
3
3
|
"author": "VĮ REGISTRŲ CENTRAS",
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.2",
|
|
5
5
|
"description": "RC SES React komponentų biblioteka",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"private": false,
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"@testing-library/react": "^16.3.0",
|
|
96
96
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
97
97
|
"@types/js-cookie": "^3.0.6",
|
|
98
|
+
"@types/node": "^24.19.2",
|
|
98
99
|
"@types/react": "^18.3.3",
|
|
99
100
|
"@types/react-dom": "^18.3.0",
|
|
100
101
|
"@vitejs/plugin-react": "^4.3.4",
|
|
@@ -89,6 +89,17 @@ describe('RcSesPhoneInputFormControl', () => {
|
|
|
89
89
|
expect(screen.queryByText('Lithuania')).not.toBeInTheDocument()
|
|
90
90
|
})
|
|
91
91
|
|
|
92
|
+
test('shows the translated empty state when the search matches nothing', () => {
|
|
93
|
+
render(<TestComponent />)
|
|
94
|
+
openDropdown()
|
|
95
|
+
|
|
96
|
+
fireEvent.change(screen.getByPlaceholderText('search'), {
|
|
97
|
+
target: { value: 'XYZXYZ' },
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
expect(screen.getByText('noOptionsText')).toBeInTheDocument()
|
|
101
|
+
})
|
|
102
|
+
|
|
92
103
|
test('selecting a country updates the dial code and mask', () => {
|
|
93
104
|
render(<TestComponent />)
|
|
94
105
|
openDropdown()
|
|
@@ -223,6 +223,7 @@ function RcSesPhoneInputFormControl(props: Props) {
|
|
|
223
223
|
}
|
|
224
224
|
getOptionLabel={(option) => option.name}
|
|
225
225
|
isOptionEqualToValue={(o, v) => o.code === v.code}
|
|
226
|
+
noOptionsText={t('noOptionsText')}
|
|
226
227
|
onChange={(e, selection) => {
|
|
227
228
|
e.preventDefault()
|
|
228
229
|
setAnchorEl(null)
|
|
@@ -195,6 +195,17 @@ describe('RcSesSelect', () => {
|
|
|
195
195
|
expect(screen.getByRole('combobox')).toHaveAttribute('readonly')
|
|
196
196
|
})
|
|
197
197
|
|
|
198
|
+
test('shows a Lithuanian empty state when the typed text matches no option', async () => {
|
|
199
|
+
render(<TestWrapper />)
|
|
200
|
+
|
|
201
|
+
const input = screen.getByRole('combobox')
|
|
202
|
+
fireEvent.mouseDown(input)
|
|
203
|
+
fireEvent.change(input, { target: { value: 'JSD' } })
|
|
204
|
+
|
|
205
|
+
expect(await screen.findByText('Rezultatų nerasta')).toBeInTheDocument()
|
|
206
|
+
expect(screen.queryByText('No options')).not.toBeInTheDocument()
|
|
207
|
+
})
|
|
208
|
+
|
|
198
209
|
test('drops the value from the form by default when the field unmounts', () => {
|
|
199
210
|
render(<UnregisterTestWrapper />)
|
|
200
211
|
|
|
@@ -404,6 +404,8 @@ function RcSesSelect<TFieldValues extends FieldValues = FieldValues>(
|
|
|
404
404
|
clearOnBlur={false}
|
|
405
405
|
handleHomeEndKeys={false}
|
|
406
406
|
loading={loading}
|
|
407
|
+
loadingText={t('loadingText')}
|
|
408
|
+
noOptionsText={t('noOptionsText')}
|
|
407
409
|
popupIcon={<CaretDownIcon size={20} fillColor={palette.grey['600']} />}
|
|
408
410
|
value={resolvedValue}
|
|
409
411
|
inputValue={resolvedInputValue}
|
|
@@ -221,7 +221,6 @@ function RcSesBottomSheet({
|
|
|
221
221
|
<Box
|
|
222
222
|
sx={{
|
|
223
223
|
display: 'flex',
|
|
224
|
-
justifyContent: 'flex-end',
|
|
225
224
|
gap: 1.5,
|
|
226
225
|
padding: SHEET.actionsPadding,
|
|
227
226
|
flexShrink: 0,
|
|
@@ -233,6 +232,7 @@ function RcSesBottomSheet({
|
|
|
233
232
|
color='grey'
|
|
234
233
|
onClick={onSecondaryAction}
|
|
235
234
|
disabled={secondaryActionDisabled}
|
|
235
|
+
sx={{ flex: 1 }}
|
|
236
236
|
>
|
|
237
237
|
{secondaryActionLabel}
|
|
238
238
|
</RcSesButton>
|
|
@@ -242,6 +242,7 @@ function RcSesBottomSheet({
|
|
|
242
242
|
variant='contained'
|
|
243
243
|
onClick={onPrimaryAction}
|
|
244
244
|
disabled={primaryActionDisabled}
|
|
245
|
+
sx={{ flex: 1 }}
|
|
245
246
|
>
|
|
246
247
|
{primaryActionLabel}
|
|
247
248
|
</RcSesButton>
|
|
@@ -126,16 +126,7 @@ const RcSesDrawer = ({
|
|
|
126
126
|
gap: '1rem',
|
|
127
127
|
}}
|
|
128
128
|
>
|
|
129
|
-
<Typography
|
|
130
|
-
id={headerId}
|
|
131
|
-
component='h2'
|
|
132
|
-
sx={{
|
|
133
|
-
fontSize: '14px',
|
|
134
|
-
fontStyle: 'normal',
|
|
135
|
-
fontWeight: 600,
|
|
136
|
-
lineHeight: '20px',
|
|
137
|
-
}}
|
|
138
|
-
>
|
|
129
|
+
<Typography id={headerId} variant='h6'>
|
|
139
130
|
{title}
|
|
140
131
|
</Typography>
|
|
141
132
|
<RcSesButton
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"countrySelectorLabel": "Select country phone code"
|
|
49
49
|
},
|
|
50
50
|
"search": "Search",
|
|
51
|
-
"invalid": "Invalid phone number format"
|
|
51
|
+
"invalid": "Invalid phone number format",
|
|
52
|
+
"noOptionsText": "No results found"
|
|
52
53
|
},
|
|
53
54
|
|
|
54
55
|
"RcSesSearchableField": {
|
|
@@ -58,7 +59,9 @@
|
|
|
58
59
|
|
|
59
60
|
"RcSesSelect": {
|
|
60
61
|
"searchPlaceholder": "Search",
|
|
61
|
-
"selectAllLabel": "All"
|
|
62
|
+
"selectAllLabel": "All",
|
|
63
|
+
"noOptionsText": "No results found",
|
|
64
|
+
"loadingText": "Loading..."
|
|
62
65
|
},
|
|
63
66
|
|
|
64
67
|
"RcSesSearchInput": {
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"countrySelectorLabel": "Šalies telefono numerio kodo pasirinkimas"
|
|
49
49
|
},
|
|
50
50
|
"search": "Ieškoti",
|
|
51
|
-
"invalid": "Klaidingas telefono numerio formatas"
|
|
51
|
+
"invalid": "Klaidingas telefono numerio formatas",
|
|
52
|
+
"noOptionsText": "Rezultatų nerasta"
|
|
52
53
|
},
|
|
53
54
|
|
|
54
55
|
"RcSesSearchableField": {
|
|
@@ -58,7 +59,9 @@
|
|
|
58
59
|
|
|
59
60
|
"RcSesSelect": {
|
|
60
61
|
"searchPlaceholder": "Ieškoti",
|
|
61
|
-
"selectAllLabel": "Visi"
|
|
62
|
+
"selectAllLabel": "Visi",
|
|
63
|
+
"noOptionsText": "Rezultatų nerasta",
|
|
64
|
+
"loadingText": "Kraunama..."
|
|
62
65
|
},
|
|
63
66
|
|
|
64
67
|
"RcSesSearchInput": {
|