@deix/rossini-core 6.2.1 → 6.3.1
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/lib/components/display/PaginatedList/PaginatedList.d.ts +1 -1
- package/lib/components/display/PaginatedList/PaginatedList.d.ts.map +1 -1
- package/lib/components/display/PaginatedList/PaginatedList.js +9 -13
- package/lib/components/filters/DateFilter.d.ts +11 -0
- package/lib/components/filters/DateFilter.d.ts.map +1 -0
- package/lib/components/filters/DateFilter.js +29 -0
- package/lib/components/filters/FilterForm.d.ts +10 -0
- package/lib/components/filters/FilterForm.d.ts.map +1 -0
- package/lib/components/filters/FilterForm.js +15 -0
- package/lib/components/filters/NumberFilter.d.ts +12 -0
- package/lib/components/filters/NumberFilter.d.ts.map +1 -0
- package/lib/components/filters/NumberFilter.js +26 -0
- package/lib/components/filters/SelectFilter.d.ts +20 -0
- package/lib/components/filters/SelectFilter.d.ts.map +1 -0
- package/lib/components/filters/SelectFilter.js +40 -0
- package/lib/components/filters/TextFilter.d.ts +12 -0
- package/lib/components/filters/TextFilter.d.ts.map +1 -0
- package/lib/components/filters/TextFilter.js +25 -0
- package/lib/components/filters/index.d.ts +11 -0
- package/lib/components/filters/index.d.ts.map +1 -0
- package/lib/components/filters/index.js +5 -0
- package/lib/components/i18n/Link.d.ts.map +1 -1
- package/lib/components/index.d.ts +14 -12
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +7 -6
- package/lib/components/provider/UserInfoProvider.d.ts.map +1 -1
- package/lib/components/provider/UserInfoProvider.js +5 -4
- package/lib/index.d.ts +5 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/helpers/index.d.ts +3 -3
- package/lib/utils/helpers/index.d.ts.map +1 -1
- package/lib/utils/helpers/index.js +3 -3
- package/lib/utils/helpers/stringHelpers.d.ts +2 -0
- package/lib/utils/helpers/stringHelpers.d.ts.map +1 -1
- package/lib/utils/helpers/stringHelpers.js +14 -0
- package/lib/utils/hooks/useFormattedQueryState.d.ts +8 -0
- package/lib/utils/hooks/useFormattedQueryState.d.ts.map +1 -0
- package/lib/utils/hooks/useFormattedQueryState.js +18 -0
- package/lib/utils/index.d.ts +4 -4
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +3 -3
- package/lib/utils/middleware/index.d.ts +1 -1
- package/lib/utils/middleware/index.d.ts.map +1 -1
- package/lib/utils/middleware/index.js +1 -1
- package/package.json +16 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './colorHelpers';
|
|
2
|
+
export * from './dateHelpers';
|
|
3
|
+
export * from './stringHelpers';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './colorHelpers';
|
|
2
|
+
export * from './dateHelpers';
|
|
3
|
+
export * from './stringHelpers';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Locale, StringTranslation } from '../../types';
|
|
1
2
|
export declare const camelToSnake: (inputString: string) => string;
|
|
2
3
|
export declare const snakeToCamel: (inputString: string) => string;
|
|
3
4
|
export declare const toTitleCase: (inputString: string, sep?: string) => string;
|
|
4
5
|
export declare const stringToColor: (string: string) => string;
|
|
5
6
|
export declare const commonStart: (strings: string[]) => string;
|
|
6
7
|
export declare const interpolate: (template: string, values: Record<string, string>) => string;
|
|
8
|
+
export declare const getStringTranslation: (value: string | StringTranslation, locale?: Locale, defaultValue?: string) => string;
|
|
7
9
|
//# sourceMappingURL=stringHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringHelpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/stringHelpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAC0B,CAAC;AAE9E,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAGhD,CAAC;AAEJ,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,YAAS,KAAG,MAI/C,CAAC;AAEf,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,WAgB3C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,WAS5C,CAAC;AAIF,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAO/B,CAAC"}
|
|
1
|
+
{"version":3,"file":"stringHelpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/stringHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAC0B,CAAC;AAE9E,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAGhD,CAAC;AAEJ,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,YAAS,KAAG,MAI/C,CAAC;AAEf,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,WAgB3C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,WAS5C,CAAC;AAIF,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAO/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,GAAG,iBAAiB,EACjC,SAAS,MAAM,EACf,eAAe,MAAM,KACpB,MAYF,CAAC"}
|
|
@@ -36,3 +36,17 @@ export const interpolate = (template, values) => {
|
|
|
36
36
|
};
|
|
37
37
|
return template.replace(/\{(\w+)\}/gi, replaceVariable);
|
|
38
38
|
};
|
|
39
|
+
export const getStringTranslation = (value, locale, defaultValue) => {
|
|
40
|
+
if (typeof value === 'string') {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
if (!locale) {
|
|
44
|
+
if (value.en) {
|
|
45
|
+
return value.en;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return defaultValue || '';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return value[locale] || defaultValue || '';
|
|
52
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface FormattedQueryStateOptions {
|
|
2
|
+
defaultValue?: string;
|
|
3
|
+
parseUrlParam?: (param: string) => string;
|
|
4
|
+
formatUrlParam?: (param: string) => string;
|
|
5
|
+
}
|
|
6
|
+
export declare const useFormattedQueryState: (name: string, { defaultValue, parseUrlParam, formatUrlParam }: FormattedQueryStateOptions) => readonly [string, (unformattedUrlValue?: string) => void];
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=useFormattedQueryState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormattedQueryState.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormattedQueryState.ts"],"names":[],"mappings":"AAEA,UAAU,0BAA0B;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C;AAED,eAAO,MAAM,sBAAsB,GACjC,MAAM,MAAM,EACZ,iDAAiD,0BAA0B,8CAUrB,MAAM,UAW7D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useQueryState } from 'nuqs';
|
|
2
|
+
export const useFormattedQueryState = (name, { defaultValue, parseUrlParam, formatUrlParam }) => {
|
|
3
|
+
const [urlValue, setUrlValue] = useQueryState(name, {
|
|
4
|
+
defaultValue: defaultValue || '',
|
|
5
|
+
});
|
|
6
|
+
// If a function was provided, use it to parse the value coming from the url
|
|
7
|
+
const parsedUrlValue = urlValue && parseUrlParam ? parseUrlParam(urlValue) : urlValue;
|
|
8
|
+
console.log('urlValue parsedUrlValue', urlValue, parseUrlParam);
|
|
9
|
+
const setUnformattedUrlValue = (unformattedUrlValue) => {
|
|
10
|
+
// If a function was provided, use it to format the value before setting the url param
|
|
11
|
+
const formattedUrlValue = formatUrlParam && unformattedUrlValue
|
|
12
|
+
? formatUrlParam(unformattedUrlValue)
|
|
13
|
+
: unformattedUrlValue;
|
|
14
|
+
console.log('setUnformattedUrlValue', formattedUrlValue);
|
|
15
|
+
setUrlValue(formattedUrlValue || null);
|
|
16
|
+
};
|
|
17
|
+
return [parsedUrlValue, setUnformattedUrlValue];
|
|
18
|
+
};
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export type
|
|
4
|
-
export
|
|
1
|
+
export * from './helpers';
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
export type * from './hooks';
|
|
4
|
+
export * from './middleware';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,mBAAmB,SAAS,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
package/lib/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './helpers';
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
export * from './middleware';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './createI18nMiddleware';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/middleware/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './createI18nMiddleware';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deix/rossini-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,32 +37,30 @@
|
|
|
37
37
|
"@emotion/react": "^11.13.5",
|
|
38
38
|
"@emotion/styled": "^11.13.5",
|
|
39
39
|
"@eslint/js": "^10.0.1",
|
|
40
|
-
"@eslint/plugin-kit": "^0.
|
|
40
|
+
"@eslint/plugin-kit": "^0.6.0",
|
|
41
41
|
"@fontsource/raleway": "^5.1.0",
|
|
42
42
|
"@mui/icons-material": "^7.2.0",
|
|
43
|
-
"@mui/material": "^7.
|
|
44
|
-
"@storybook/addon-docs": "^10.
|
|
45
|
-
"@storybook/addon-links": "^10.
|
|
46
|
-
"@storybook/addon-onboarding": "^10.
|
|
47
|
-
"@storybook/nextjs": "^10.
|
|
43
|
+
"@mui/material": "^7.3.9",
|
|
44
|
+
"@storybook/addon-docs": "^10.2.16",
|
|
45
|
+
"@storybook/addon-links": "^10.2.16",
|
|
46
|
+
"@storybook/addon-onboarding": "^10.2.16",
|
|
47
|
+
"@storybook/nextjs": "^10.2.16",
|
|
48
48
|
"@tanstack/react-query": "^5.64.2",
|
|
49
49
|
"@tanstack/react-query-devtools": "^5.64.2",
|
|
50
|
-
"@types/node": "^24.
|
|
50
|
+
"@types/node": "^24.12.0",
|
|
51
51
|
"@types/react": "19.2.7",
|
|
52
52
|
"@types/react-dom": "19.2.3",
|
|
53
53
|
"axios": "^1.12.2",
|
|
54
|
-
"babel-loader": "^10.
|
|
55
|
-
"commitizen": "^4.3.1",
|
|
56
|
-
"cz-conventional-changelog": "^3.3.0",
|
|
54
|
+
"babel-loader": "^10.1.0",
|
|
57
55
|
"eslint": "^10.0.2",
|
|
58
56
|
"eslint-config-prettier": "^10.1.1",
|
|
59
57
|
"eslint-plugin-prettier": "^5.5.5",
|
|
60
|
-
"eslint-plugin-storybook": "^10.
|
|
58
|
+
"eslint-plugin-storybook": "^10.2.16",
|
|
61
59
|
"form-data": "^4.0.4",
|
|
62
|
-
"react": "19.2.
|
|
60
|
+
"react": "^19.2.4",
|
|
63
61
|
"react-docgen-typescript-plugin": "^1.0.8",
|
|
64
|
-
"react-dom": "19.2.
|
|
65
|
-
"storybook": "^10.
|
|
62
|
+
"react-dom": "^19.2.4",
|
|
63
|
+
"storybook": "^10.2.16",
|
|
66
64
|
"typescript": "^5.6.3",
|
|
67
65
|
"typescript-eslint": "^8.15.0"
|
|
68
66
|
},
|
|
@@ -76,12 +74,14 @@
|
|
|
76
74
|
},
|
|
77
75
|
"dependencies": {
|
|
78
76
|
"@formatjs/intl-localematcher": "^0.6.0",
|
|
77
|
+
"@mui/x-date-pickers": "^8.27.2",
|
|
79
78
|
"@types/negotiator": "^0.6.3",
|
|
79
|
+
"date-fns": "^4.1.0",
|
|
80
80
|
"negotiator": "^1.0.0",
|
|
81
81
|
"next": "^16.1.4",
|
|
82
82
|
"notistack": "^3.0.2",
|
|
83
83
|
"nuqs": "^2.8.8",
|
|
84
|
-
"
|
|
84
|
+
"react-hook-form": "^7.71.2"
|
|
85
85
|
},
|
|
86
86
|
"overrides": {
|
|
87
87
|
"tmp": "^0.2.4",
|