@castlabs/ui 8.1.0 → 8.2.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.
@@ -1,4 +1,4 @@
1
- /* @castlabs/ui v8.1.0 */
1
+ /* @castlabs/ui v8.2.0 */
2
2
 
3
3
  /*!
4
4
  * Bootstrap v5.3.8 (https://getbootstrap.com/)
@@ -1803,6 +1803,37 @@ function clThemeSetDark (dark) {
1803
1803
  setDomainCookieJson('cl_ui_settings', settings)
1804
1804
  }
1805
1805
 
1806
+ // ------------------------------------------------------------------------
1807
+
1808
+ function clGetUISettings () {
1809
+ try {
1810
+ return JSON.parse(localStorage.getItem('cl_ui_settings') ?? '{}')
1811
+ } catch (e) {
1812
+ e.ignore?.()
1813
+ } // catch & storage or parsing issues
1814
+ return {}
1815
+ }
1816
+
1817
+ function clSetUISettings (settings) {
1818
+ try {
1819
+ localStorage.setItem('cl_ui_settings', JSON.stringify(settings))
1820
+ } catch (e) {
1821
+ e.ignore?.()
1822
+ } // catch & storage or parsing issues
1823
+ }
1824
+
1825
+ function clGetSettingsTable (id) {
1826
+ const settings = clGetUISettings()
1827
+ return settings?.tables?.[id] ? settings?.tables?.[id] : {}
1828
+ }
1829
+
1830
+ function clSetSettingsTable (id, table) {
1831
+ const settings = clGetUISettings()
1832
+ if (!settings.tables) settings.tables = {}
1833
+ settings.tables[id] = table
1834
+ clSetUISettings(settings)
1835
+ }
1836
+
1806
1837
  const NBSP = '✺' // non-breakable space for searching substrings
1807
1838
 
1808
1839
  let cache = {}