@rio-cloud/rio-uikit 1.7.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarList.d.ts +2 -0
- package/BarList.js +2 -0
- package/README.md +4 -0
- package/SaveableDateInput.d.ts +2 -0
- package/SaveableDateInput.js +2 -0
- package/SvgImage.d.ts +2 -0
- package/SvgImage.js +2 -0
- package/TableCol.d.ts +2 -0
- package/TableCol.js +2 -0
- package/TableHead.d.ts +2 -0
- package/TableHead.js +2 -0
- package/components/actionBarItem/ActionBarItemIcon.js +1 -1
- package/components/actionBarItem/ActionBarOverlay.js +1 -1
- package/components/activity/Activity.d.ts +2 -2
- package/components/applicationHeader/CollapsedNavItem.js +1 -0
- package/components/assetTree/Tree.d.ts +20 -0
- package/components/assetTree/Tree.js +75 -38
- package/components/assetTree/TreeLeaf.js +1 -1
- package/components/assetTree/TreeNodeContainer.d.ts +1 -1
- package/components/assetTree/TreeSearch.js +1 -1
- package/components/assetTree/TreeSummary.js +1 -1
- package/components/assetTree/TypeCounter.d.ts +2 -0
- package/components/assetTree/TypeCounter.js +1 -1
- package/components/assetTree/useTreeExpansion.d.ts +4 -0
- package/components/assetTree/useTreeExpansion.js +25 -0
- package/components/assetTree/useTreeHeight.d.ts +1 -0
- package/components/assetTree/useTreeHeight.js +60 -0
- package/components/assetTree/useTreeScrollPosition.d.ts +3 -0
- package/components/assetTree/useTreeScrollPosition.js +19 -0
- package/components/assetTree/useTreeVirtualization.d.ts +17 -0
- package/components/assetTree/useTreeVirtualization.js +71 -0
- package/components/autosuggest/AutoSuggest.js +2 -1
- package/components/barList/BarList.d.ts +97 -0
- package/components/barList/BarList.js +42 -0
- package/components/barList/useSortedBars.d.ts +2 -0
- package/components/barList/useSortedBars.js +14 -0
- package/components/button/ButtonToolbar.d.ts +1 -1
- package/components/button/ButtonToolbar.js +1 -1
- package/components/button/ToggleButton.js +0 -1
- package/components/charts/PieChart.js +1 -1
- package/components/clearableInput/ClearableInput.d.ts +20 -7
- package/components/clearableInput/ClearableInput.js +68 -8
- package/components/dialog/Dialog.js +1 -1
- package/components/dialog/FrameDialog.js +1 -1
- package/components/dropdown/ButtonDropdown.d.ts +11 -3
- package/components/dropdown/ButtonDropdown.js +79 -64
- package/components/dropdown/DropdownToggleButton.d.ts +7 -4
- package/components/dropdown/DropdownToggleButton.js +11 -3
- package/components/formLabel/FormLabel.d.ts +2 -2
- package/components/formLabel/FormLabel.js +1 -1
- package/components/listMenu/ListMenu.js +4 -1
- package/components/map/components/Map.js +21 -6
- package/components/map/components/constants.d.ts +2 -0
- package/components/map/components/constants.js +3 -0
- package/components/map/components/features/basics/InfoBubble.js +1 -1
- package/components/map/components/features/layers/overlayLayers/IncidentsLayer.js +1 -1
- package/components/map/utils/mapTypes.d.ts +5 -0
- package/components/map/utils/rendering.d.ts +5 -2
- package/components/map/utils/rendering.js +46 -39
- package/components/menuItems/MenuItem.js +1 -1
- package/components/notification/Notification.js +1 -1
- package/components/overlay/OverlayTrigger.js +3 -3
- package/components/saveableInput/SaveableDateInput.d.ts +83 -0
- package/components/saveableInput/SaveableDateInput.js +122 -0
- package/components/selects/BaseSelectDropdown.js +1 -1
- package/components/selects/Multiselect.d.ts +8 -0
- package/components/selects/Multiselect.js +4 -4
- package/components/smoothScrollbars/SmoothScrollbars.d.ts +1 -0
- package/components/smoothScrollbars/SmoothScrollbars.js +3 -3
- package/components/statsWidget/StatsWidget.d.ts +2 -2
- package/components/statsWidget/StatsWidgets.d.ts +2 -2
- package/components/svgImage/SvgElement.d.ts +8 -0
- package/components/svgImage/SvgElement.js +11 -0
- package/components/svgImage/SvgImage.d.ts +30 -0
- package/components/svgImage/SvgImage.js +20 -0
- package/components/svgImage/svgConverter.d.ts +17 -0
- package/components/svgImage/svgConverter.js +78 -0
- package/components/svgImage/useSvgLoader.d.ts +9 -0
- package/components/svgImage/useSvgLoader.js +43 -0
- package/components/switch/Switch.d.ts +4 -0
- package/components/switch/Switch.js +5 -6
- package/components/table/TableCardsSorting.d.ts +0 -1
- package/components/table/TableCol.d.ts +18 -0
- package/components/table/TableCol.js +11 -0
- package/components/table/TableHead.d.ts +33 -0
- package/components/table/TableHead.js +11 -0
- package/components/table/TableSettingsDialog.js +1 -1
- package/components/tag/Tag.js +1 -1
- package/components/timepicker/TimePicker.d.ts +1 -2
- package/components/timepicker/TimePicker.js +35 -8
- package/components/tooltip/SimpleTooltip.d.ts +1 -1
- package/components/virtualList/VirtualList.js +1 -1
- package/hooks/useIsFocusWithin.d.ts +33 -0
- package/hooks/useIsFocusWithin.js +55 -0
- package/hooks/useLocationSuggestions.d.ts +27 -0
- package/hooks/useLocationSuggestions.js +94 -0
- package/hooks/useOnboarding.d.ts +17 -5
- package/hooks/useOnboarding.js +7 -1
- package/hooks/usePostMessage.js +0 -1
- package/hooks/useSearch.d.ts +63 -0
- package/hooks/useSearch.js +73 -0
- package/hooks/useSorting.d.ts +6 -0
- package/hooks/useSorting.js +7 -4
- package/hooks/useTableExport.d.ts +49 -0
- package/hooks/useTableExport.js +57 -0
- package/hooks/useTableSelection.d.ts +166 -0
- package/hooks/useTableSelection.js +201 -0
- package/lib/es/BarList.d.ts +2 -0
- package/lib/es/BarList.js +7 -0
- package/lib/es/SaveableDateInput.d.ts +2 -0
- package/lib/es/SaveableDateInput.js +7 -0
- package/lib/es/SvgImage.d.ts +2 -0
- package/lib/es/SvgImage.js +7 -0
- package/lib/es/TableCol.d.ts +2 -0
- package/lib/es/TableCol.js +7 -0
- package/lib/es/TableHead.d.ts +2 -0
- package/lib/es/TableHead.js +7 -0
- package/lib/es/components/actionBarItem/ActionBarItemIcon.js +1 -1
- package/lib/es/components/actionBarItem/ActionBarOverlay.js +1 -1
- package/lib/es/components/activity/Activity.d.ts +2 -2
- package/lib/es/components/applicationHeader/CollapsedNavItem.js +1 -0
- package/lib/es/components/assetTree/Tree.d.ts +20 -0
- package/lib/es/components/assetTree/Tree.js +74 -37
- package/lib/es/components/assetTree/TreeLeaf.js +1 -1
- package/lib/es/components/assetTree/TreeNodeContainer.d.ts +1 -1
- package/lib/es/components/assetTree/TreeSearch.js +1 -1
- package/lib/es/components/assetTree/TreeSummary.js +1 -1
- package/lib/es/components/assetTree/TypeCounter.d.ts +2 -0
- package/lib/es/components/assetTree/TypeCounter.js +1 -1
- package/lib/es/components/assetTree/useTreeExpansion.d.ts +4 -0
- package/lib/es/components/assetTree/useTreeExpansion.js +29 -0
- package/lib/es/components/assetTree/useTreeHeight.d.ts +1 -0
- package/lib/es/components/assetTree/useTreeHeight.js +64 -0
- package/lib/es/components/assetTree/useTreeScrollPosition.d.ts +3 -0
- package/lib/es/components/assetTree/useTreeScrollPosition.js +23 -0
- package/lib/es/components/assetTree/useTreeVirtualization.d.ts +17 -0
- package/lib/es/components/assetTree/useTreeVirtualization.js +76 -0
- package/lib/es/components/autosuggest/AutoSuggest.js +2 -1
- package/lib/es/components/barList/BarList.d.ts +97 -0
- package/lib/es/components/barList/BarList.js +45 -0
- package/lib/es/components/barList/useSortedBars.d.ts +2 -0
- package/lib/es/components/barList/useSortedBars.js +17 -0
- package/lib/es/components/button/ButtonToolbar.d.ts +1 -1
- package/lib/es/components/button/ButtonToolbar.js +1 -1
- package/lib/es/components/button/ToggleButton.js +0 -1
- package/lib/es/components/charts/PieChart.js +1 -1
- package/lib/es/components/clearableInput/ClearableInput.d.ts +20 -7
- package/lib/es/components/clearableInput/ClearableInput.js +67 -7
- package/lib/es/components/dialog/Dialog.js +1 -1
- package/lib/es/components/dialog/FrameDialog.js +1 -1
- package/lib/es/components/dropdown/ButtonDropdown.d.ts +11 -3
- package/lib/es/components/dropdown/ButtonDropdown.js +79 -64
- package/lib/es/components/dropdown/DropdownToggleButton.d.ts +7 -4
- package/lib/es/components/dropdown/DropdownToggleButton.js +11 -3
- package/lib/es/components/formLabel/FormLabel.d.ts +2 -2
- package/lib/es/components/formLabel/FormLabel.js +1 -1
- package/lib/es/components/listMenu/ListMenu.js +4 -1
- package/lib/es/components/map/components/Map.js +20 -5
- package/lib/es/components/map/components/constants.d.ts +2 -0
- package/lib/es/components/map/components/constants.js +4 -1
- package/lib/es/components/map/components/features/basics/InfoBubble.js +1 -1
- package/lib/es/components/map/components/features/layers/overlayLayers/IncidentsLayer.js +1 -1
- package/lib/es/components/map/utils/mapTypes.d.ts +5 -0
- package/lib/es/components/map/utils/rendering.d.ts +5 -2
- package/lib/es/components/map/utils/rendering.js +46 -39
- package/lib/es/components/menuItems/MenuItem.js +1 -1
- package/lib/es/components/notification/Notification.js +1 -1
- package/lib/es/components/overlay/OverlayTrigger.js +3 -3
- package/lib/es/components/saveableInput/SaveableDateInput.d.ts +83 -0
- package/lib/es/components/saveableInput/SaveableDateInput.js +125 -0
- package/lib/es/components/selects/BaseSelectDropdown.js +1 -1
- package/lib/es/components/selects/Multiselect.d.ts +8 -0
- package/lib/es/components/selects/Multiselect.js +4 -4
- package/lib/es/components/smoothScrollbars/SmoothScrollbars.d.ts +1 -0
- package/lib/es/components/smoothScrollbars/SmoothScrollbars.js +3 -3
- package/lib/es/components/statsWidget/StatsWidget.d.ts +2 -2
- package/lib/es/components/statsWidget/StatsWidgets.d.ts +2 -2
- package/lib/es/components/svgImage/SvgElement.d.ts +8 -0
- package/lib/es/components/svgImage/SvgElement.js +14 -0
- package/lib/es/components/svgImage/SvgImage.d.ts +30 -0
- package/lib/es/components/svgImage/SvgImage.js +23 -0
- package/lib/es/components/svgImage/svgConverter.d.ts +17 -0
- package/lib/es/components/svgImage/svgConverter.js +84 -0
- package/lib/es/components/svgImage/useSvgLoader.d.ts +9 -0
- package/lib/es/components/svgImage/useSvgLoader.js +48 -0
- package/lib/es/components/switch/Switch.d.ts +4 -0
- package/lib/es/components/switch/Switch.js +5 -6
- package/lib/es/components/table/TableCardsSorting.d.ts +0 -1
- package/lib/es/components/table/TableCol.d.ts +18 -0
- package/lib/es/components/table/TableCol.js +13 -0
- package/lib/es/components/table/TableHead.d.ts +33 -0
- package/lib/es/components/table/TableHead.js +14 -0
- package/lib/es/components/table/TableSettingsDialog.js +1 -1
- package/lib/es/components/tag/Tag.js +1 -1
- package/lib/es/components/timepicker/TimePicker.d.ts +1 -2
- package/lib/es/components/timepicker/TimePicker.js +35 -8
- package/lib/es/components/tooltip/SimpleTooltip.d.ts +1 -1
- package/lib/es/components/virtualList/VirtualList.js +1 -1
- package/lib/es/hooks/useIsFocusWithin.d.ts +33 -0
- package/lib/es/hooks/useIsFocusWithin.js +57 -0
- package/lib/es/hooks/useLocationSuggestions.d.ts +27 -0
- package/lib/es/hooks/useLocationSuggestions.js +97 -0
- package/lib/es/hooks/useOnboarding.d.ts +17 -5
- package/lib/es/hooks/useOnboarding.js +7 -1
- package/lib/es/hooks/usePostMessage.js +0 -1
- package/lib/es/hooks/useSearch.d.ts +63 -0
- package/lib/es/hooks/useSearch.js +75 -0
- package/lib/es/hooks/useSorting.d.ts +6 -0
- package/lib/es/hooks/useSorting.js +7 -4
- package/lib/es/hooks/useTableExport.d.ts +49 -0
- package/lib/es/hooks/useTableExport.js +59 -0
- package/lib/es/hooks/useTableSelection.d.ts +166 -0
- package/lib/es/hooks/useTableSelection.js +210 -0
- package/lib/es/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
- package/lib/es/useIsFocusWithin.d.ts +2 -0
- package/lib/es/useIsFocusWithin.js +7 -0
- package/lib/es/useLocationSuggestions.d.ts +2 -0
- package/lib/es/useLocationSuggestions.js +7 -0
- package/lib/es/useSearch.d.ts +2 -0
- package/lib/es/useSearch.js +7 -0
- package/lib/es/useTableExport.d.ts +2 -0
- package/lib/es/useTableExport.js +7 -0
- package/lib/es/useTableSelection.d.ts +2 -0
- package/lib/es/useTableSelection.js +7 -0
- package/lib/es/utils/storageUtils.d.ts +2 -2
- package/lib/es/utils/storageUtils.js +2 -0
- package/lib/es/utils/urlFeatureToggles.d.ts +12 -6
- package/lib/es/utils/urlFeatureToggles.js +14 -8
- package/lib/es/utils/useDropDirection.js +1 -0
- package/lib/es/version.json +1 -1
- package/package.json +48 -40
- package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
- package/useIsFocusWithin.d.ts +2 -0
- package/useIsFocusWithin.js +2 -0
- package/useLocationSuggestions.d.ts +2 -0
- package/useLocationSuggestions.js +2 -0
- package/useSearch.d.ts +2 -0
- package/useSearch.js +2 -0
- package/useTableExport.d.ts +2 -0
- package/useTableExport.js +2 -0
- package/useTableSelection.d.ts +2 -0
- package/useTableSelection.js +2 -0
- package/utils/storageUtils.d.ts +2 -2
- package/utils/storageUtils.js +2 -0
- package/utils/urlFeatureToggles.d.ts +12 -6
- package/utils/urlFeatureToggles.js +10 -7
- package/utils/useDropDirection.js +1 -0
- package/version.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rio-cloud/rio-uikit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "The RIO UIKIT component library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,8 +27,10 @@
|
|
|
27
27
|
"build:rioglyph": "svgo -f rioglyph/svgs && vite build --mode rioglyph",
|
|
28
28
|
"fixCssMinified": "node tools/fixCssMinified.mjs",
|
|
29
29
|
"format-code": "npm run format-code:uikit && npm run format-code:demo",
|
|
30
|
-
"format-code:uikit": "
|
|
31
|
-
"format-code:demo": "
|
|
30
|
+
"format-code:uikit": "biome format --write src",
|
|
31
|
+
"format-code:demo": "biome format --write uikit-demo",
|
|
32
|
+
"lint": "biome check src",
|
|
33
|
+
"lint-fix": "biome check src --write",
|
|
32
34
|
"copy-to-package": "copyfiles package.json README.md LICENSE package",
|
|
33
35
|
"test": "vitest run",
|
|
34
36
|
"test:ci": "vitest run --reporter=junit --outputFile.junit=./results/jest/junit.xml",
|
|
@@ -36,9 +38,7 @@
|
|
|
36
38
|
"test:ui": "node tools/testUI.js && backstop reference --config='test/backstop/config.js' && backstop test --config='test/backstop/config.js'",
|
|
37
39
|
"coverage": "vitest run --coverage",
|
|
38
40
|
"check-licenses": "node tools/check-licenses.mjs .",
|
|
39
|
-
"license-check": "license-checker --production --json --onlyAllow \"`cat whitelist.txt`\" --excludePackages \"@rio-cloud/rio-uikit\" --out licenses.txt"
|
|
40
|
-
"lint": "eslint src",
|
|
41
|
-
"lint-fix": "npm run lint -- --fix"
|
|
41
|
+
"license-check": "license-checker --production --json --onlyAllow \"`cat whitelist.txt`\" --excludePackages \"@rio-cloud/rio-uikit\" --out licenses.txt"
|
|
42
42
|
},
|
|
43
43
|
"author": "TB Digital Services GmbH",
|
|
44
44
|
"license": "Apache-2.0",
|
|
@@ -46,47 +46,47 @@
|
|
|
46
46
|
"module": "index.js",
|
|
47
47
|
"types": "index.d.ts",
|
|
48
48
|
"less": "./styles/css/rio-uikit.less",
|
|
49
|
-
"files": [
|
|
49
|
+
"files": [
|
|
50
|
+
"**/*.*"
|
|
51
|
+
],
|
|
52
|
+
"exports": {
|
|
53
|
+
".": {
|
|
54
|
+
"import": "./index.js",
|
|
55
|
+
"types": "./index.d.ts"
|
|
56
|
+
},
|
|
57
|
+
"./*": {
|
|
58
|
+
"import": "./*.js",
|
|
59
|
+
"types": "./*.d.ts"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
50
62
|
"devDependencies": {
|
|
63
|
+
"@biomejs/biome": "2.0.5",
|
|
51
64
|
"@testing-library/dom": "10.4.0",
|
|
52
65
|
"@testing-library/jest-dom": "6.6.3",
|
|
53
|
-
"@testing-library/react": "16.
|
|
66
|
+
"@testing-library/react": "16.3.0",
|
|
54
67
|
"@testing-library/react-hooks": "8.0.1",
|
|
55
68
|
"@testing-library/user-event": "14.6.1",
|
|
56
69
|
"@types/heremaps": "3.1.14",
|
|
57
|
-
"@types/lodash": "4.17.
|
|
58
|
-
"@types/qs": "6.
|
|
70
|
+
"@types/lodash": "4.17.18",
|
|
71
|
+
"@types/qs": "6.14.0",
|
|
59
72
|
"@types/react": "18.3.18",
|
|
60
73
|
"@types/react-dom": "18.3.5",
|
|
61
|
-
"@types/react-input-mask": "3.0.6",
|
|
62
74
|
"@types/react-redux": "7.1.34",
|
|
63
75
|
"@types/resize-observer-browser": "0.1.11",
|
|
64
|
-
"@
|
|
65
|
-
"@typescript-eslint/parser": "6.13.2",
|
|
66
|
-
"@vitejs/plugin-react": "4.3.4",
|
|
76
|
+
"@vitejs/plugin-react": "4.6.0",
|
|
67
77
|
"@vitest/coverage-c8": "0.33.0",
|
|
68
|
-
"autoprefixer": "10.4.
|
|
78
|
+
"autoprefixer": "10.4.21",
|
|
69
79
|
"backstopjs": "6.3.25",
|
|
70
80
|
"copyfiles": "2.4.1",
|
|
71
|
-
"dotenv": "16.
|
|
72
|
-
"
|
|
73
|
-
"eslint-config-prettier": "9.1.0",
|
|
74
|
-
"eslint-plugin-compat": "4.2.0",
|
|
75
|
-
"eslint-plugin-getsentry": "2.0.0",
|
|
76
|
-
"eslint-plugin-import": "2.31.0",
|
|
77
|
-
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
78
|
-
"eslint-plugin-prettier": "5.2.3",
|
|
79
|
-
"eslint-plugin-react": "7.37.4",
|
|
80
|
-
"eslint-plugin-react-hooks": "4.6.2",
|
|
81
|
-
"jsdom": "26.0.0",
|
|
81
|
+
"dotenv": "16.5.0",
|
|
82
|
+
"jsdom": "26.1.0",
|
|
82
83
|
"jsdom-global": "3.0.2",
|
|
83
|
-
"less": "4.
|
|
84
|
+
"less": "4.3.0",
|
|
84
85
|
"license-checker": "25.0.1",
|
|
85
|
-
"postcss": "8.5.
|
|
86
|
+
"postcss": "8.5.6",
|
|
86
87
|
"postcss-preset-env": "8.5.1",
|
|
87
88
|
"postcss-short": "5.0.0",
|
|
88
89
|
"pre-commit": "1.2.2",
|
|
89
|
-
"prettier": "3.4.2",
|
|
90
90
|
"react": "18.0.0",
|
|
91
91
|
"react-dom": "18.0.0",
|
|
92
92
|
"react-intl": "6.6.8",
|
|
@@ -94,10 +94,11 @@
|
|
|
94
94
|
"strip-ansi": "7.1.0",
|
|
95
95
|
"svgo": "3.3.2",
|
|
96
96
|
"tiny-invariant": "1.3.3",
|
|
97
|
-
"typescript": "5.
|
|
98
|
-
"vite": "6.
|
|
97
|
+
"typescript": "5.8.3",
|
|
98
|
+
"vite": "6.3.5",
|
|
99
99
|
"vite-plugin-zip-pack": "1.2.4",
|
|
100
|
-
"vitest": "3.
|
|
100
|
+
"vitest": "3.2.4",
|
|
101
|
+
"vitest-fetch-mock": "^0.4.5"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|
|
103
104
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -109,8 +110,9 @@
|
|
|
109
110
|
"@dnd-kit/sortable": "7.0.2",
|
|
110
111
|
"@formkit/auto-animate": "0.8.2",
|
|
111
112
|
"@popperjs/core": "2.11.8",
|
|
113
|
+
"@tanstack/react-virtual": "^3.13.11",
|
|
112
114
|
"classnames": "2.5.1",
|
|
113
|
-
"driver.js": "1.3.
|
|
115
|
+
"driver.js": "1.3.6",
|
|
114
116
|
"events": "3.3.0",
|
|
115
117
|
"framer-motion": "4.1.17",
|
|
116
118
|
"iframe-resizer-react": "1.1.0",
|
|
@@ -124,19 +126,25 @@
|
|
|
124
126
|
"react-content-loader": "7.0.2",
|
|
125
127
|
"react-custom-scrollbars-2": "4.5.0",
|
|
126
128
|
"react-datetime": "github:rio-cloud/react-datetime#v3.1.1-1-merged",
|
|
127
|
-
"react-dropzone": "14.3.
|
|
128
|
-
"react-
|
|
129
|
+
"react-dropzone": "14.3.8",
|
|
130
|
+
"react-imask": "7.6.1",
|
|
129
131
|
"react-notifications": "1.7.4",
|
|
130
|
-
"react-onclickoutside": "6.13.
|
|
132
|
+
"react-onclickoutside": "6.13.2",
|
|
131
133
|
"react-popper": "2.3.0",
|
|
132
134
|
"react-shadow-root": "6.2.0",
|
|
133
|
-
"react-toastify": "11.0.
|
|
134
|
-
"recharts": "2.15.
|
|
135
|
+
"react-toastify": "11.0.5",
|
|
136
|
+
"recharts": "2.15.3",
|
|
135
137
|
"tslib": "2.8.1"
|
|
136
138
|
},
|
|
137
139
|
"overrides": {
|
|
138
140
|
"iframe-resizer": "4.3.11"
|
|
139
141
|
},
|
|
140
|
-
"pre-commit": [
|
|
141
|
-
|
|
142
|
+
"pre-commit": [
|
|
143
|
+
"format-code"
|
|
144
|
+
],
|
|
145
|
+
"browserslist": [
|
|
146
|
+
"> 0.5%",
|
|
147
|
+
"Firefox ESR",
|
|
148
|
+
"not dead"
|
|
149
|
+
]
|
|
142
150
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
//
|
|
2
|
+
// biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
5
5
|
import classNames from 'classnames';
|
package/useSearch.d.ts
ADDED
package/useSearch.js
ADDED
package/utils/storageUtils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const storage: {
|
|
2
|
-
save: (key: string, value: string
|
|
3
|
-
load: (key: string, prefix?: string) => string |
|
|
2
|
+
save: (key: string, value: string, prefix?: string) => string | null;
|
|
3
|
+
load: (key: string, prefix?: string) => string | null;
|
|
4
4
|
removeItem: (key: string, prefix?: string) => void;
|
|
5
5
|
};
|
package/utils/storageUtils.js
CHANGED
|
@@ -8,6 +8,7 @@ const save = (key, value, prefix = STORAGE_PREFIX) => {
|
|
|
8
8
|
catch (_) {
|
|
9
9
|
// Intentionally left blank
|
|
10
10
|
}
|
|
11
|
+
return null;
|
|
11
12
|
};
|
|
12
13
|
const removeItem = (key, prefix = STORAGE_PREFIX) => {
|
|
13
14
|
try {
|
|
@@ -25,5 +26,6 @@ const load = (key, prefix = STORAGE_PREFIX) => {
|
|
|
25
26
|
catch (_) {
|
|
26
27
|
// Intentionally left blank
|
|
27
28
|
}
|
|
29
|
+
return null;
|
|
28
30
|
};
|
|
29
31
|
export const storage = { save, load, removeItem };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
export declare const DEFAULT_PREFIX = "featureToggle.";
|
|
2
2
|
export type ToggleType = string | boolean | number;
|
|
3
3
|
export declare const cleanupOldToggles: (oldToggles: string[], prefix: string) => void;
|
|
4
|
-
export declare const asBoolean: (urlParamName: string) => (prefix: string) =>
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export declare const asBoolean: (urlParamName: string) => (prefix: string) => boolean | null;
|
|
5
|
+
export declare const asBooleanWithDefault: (urlParamName: string, defaultValue: boolean) => (prefix: string) => boolean;
|
|
6
|
+
export declare const asString: (urlParamName: string) => (prefix: string) => string | null;
|
|
7
|
+
export declare const asStringWithDefault: (urlParamName: string, defaultValue: string) => (prefix: string) => string;
|
|
8
|
+
export declare const asNumber: (urlParamName: string) => (prefix: string) => number | null;
|
|
9
|
+
export declare const asNumberWithDefault: (urlParamName: string, defaultValue: number) => (prefix: string) => number;
|
|
10
|
+
type ToggleValueExtractor = (prefix: string) => ToggleType | null;
|
|
11
|
+
type ToggleValues<TOGGLE_DEFS> = TOGGLE_DEFS extends Record<string, ToggleValueExtractor> ? {
|
|
12
|
+
[K in keyof TOGGLE_DEFS]: ReturnType<TOGGLE_DEFS[K]>;
|
|
13
|
+
} : never;
|
|
14
|
+
export declare const detectFeatureToggles: <TOGGLE_DEFS extends Record<string, ToggleValueExtractor>>(toggleDefinitions: TOGGLE_DEFS, oldToggles?: string[], prefix?: string) => ToggleValues<TOGGLE_DEFS>;
|
|
15
|
+
export {};
|
|
@@ -12,19 +12,22 @@ export const cleanupOldToggles = (oldToggles, prefix) => {
|
|
|
12
12
|
console.error(error);
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
const detectToggle = (param, prefix, transformFn) => {
|
|
15
|
+
const detectToggle = (param, prefix, transformFn, defaultValue) => {
|
|
16
16
|
const [_, searchParams = ''] = window.location.hash.split('?');
|
|
17
17
|
const urlSearchParams = qs.parse(searchParams);
|
|
18
18
|
const urlValue = get(param, urlSearchParams)?.toString() || '';
|
|
19
19
|
const storageValue = urlValue ? storage.save(param, urlValue, prefix) : storage.load(param, prefix);
|
|
20
|
-
return storageValue
|
|
20
|
+
return storageValue ? transformFn(storageValue) : defaultValue;
|
|
21
21
|
};
|
|
22
22
|
const transformBoolean = (value) => value === 'true' || value === '1';
|
|
23
|
-
const transformString = (value) => value
|
|
24
|
-
const transformNumber = (value) =>
|
|
25
|
-
export const asBoolean = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformBoolean);
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
23
|
+
const transformString = (value) => value;
|
|
24
|
+
const transformNumber = (value) => Number.parseFloat(value);
|
|
25
|
+
export const asBoolean = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformBoolean, null);
|
|
26
|
+
export const asBooleanWithDefault = (urlParamName, defaultValue) => (prefix) => detectToggle(urlParamName, prefix, transformBoolean, defaultValue);
|
|
27
|
+
export const asString = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformString, null);
|
|
28
|
+
export const asStringWithDefault = (urlParamName, defaultValue) => (prefix) => detectToggle(urlParamName, prefix, transformString, defaultValue);
|
|
29
|
+
export const asNumber = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformNumber, null);
|
|
30
|
+
export const asNumberWithDefault = (urlParamName, defaultValue) => (prefix) => detectToggle(urlParamName, prefix, transformNumber, defaultValue);
|
|
28
31
|
export const detectFeatureToggles = (toggleDefinitions, oldToggles = [], prefix = DEFAULT_PREFIX) => {
|
|
29
32
|
cleanupOldToggles(oldToggles, prefix);
|
|
30
33
|
return mapValues(toggleFn => toggleFn(prefix), toggleDefinitions);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains
|
|
1
2
|
import { useEffect, useState } from 'react';
|
|
2
3
|
import getDropDirection from './getDropDirection';
|
|
3
4
|
export const useDropDirection = ({ pullRight = false, dropup = false, autoDropDirection = false, dropdownMenuRef }, dependencies) => {
|
package/version.json
CHANGED