@castlabs/ui 8.5.1 → 8.5.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/castlabs-ui.common.js +2 -2
- package/dist/castlabs-ui.common.js.map +1 -1
- package/dist/castlabs-ui.core.js +11 -11
- package/dist/castlabs-ui.css +1 -1
- package/dist/castlabs-ui.module.d.ts +4 -2
- package/dist/castlabs-ui.module.js +12 -12
- package/dist/castlabs-ui.umd.js +3 -3
- package/dist/castlabs-ui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/styles/layout/meta.scss +1 -1
- package/types/castlabs-ui.module.d.ts +4 -2
- package/types/index.d.ts +19 -4
package/dist/castlabs-ui.core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @castlabs/ui v8.5.
|
|
1
|
+
/* @castlabs/ui v8.5.2 */
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
4
|
* Bootstrap v5.3.8 (https://getbootstrap.com/)
|
|
@@ -170,9 +170,9 @@ function saveColWidth (id) {
|
|
|
170
170
|
|
|
171
171
|
const widths = clTableGetColWidthArray(id)
|
|
172
172
|
|
|
173
|
-
const settings =
|
|
173
|
+
const settings = _getSettingsTable(tableId) ?? {}
|
|
174
174
|
settings.w = widths
|
|
175
|
-
|
|
175
|
+
_setSettingsTable(tableId, settings)
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -181,7 +181,7 @@ function clTableRestoreColWidths (id, override = undefined) {
|
|
|
181
181
|
const tableId = document.querySelector(`#${id}`)?.closest('.cl-table-scroll')?.id
|
|
182
182
|
if (!tableId) return
|
|
183
183
|
|
|
184
|
-
const widths = override ? override : ((
|
|
184
|
+
const widths = override ? override : ((_getSettingsTable(tableId) ?? {}).w ?? [])
|
|
185
185
|
for (
|
|
186
186
|
let colIndex = 1;
|
|
187
187
|
colIndex <= document.querySelectorAll(`#${id} tr th`).length;
|
|
@@ -939,12 +939,12 @@ function clScrollToId (id, smooth = true) {
|
|
|
939
939
|
}, 0)
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
function
|
|
942
|
+
function _setDomainCookieJson (name, value, maxAge = 60 * 60 * 24 * (365 + 30)) {
|
|
943
943
|
const b64 = btoa(JSON.stringify(value))
|
|
944
944
|
document.cookie = `${name}=${b64}; max-age=${maxAge}; domain=${getDomain()}; path=/; SameSite=Lax;`
|
|
945
945
|
}
|
|
946
946
|
|
|
947
|
-
function
|
|
947
|
+
function _getDomainCookieJson (name) {
|
|
948
948
|
for (const cookie of document?.cookie?.split(/; */) ?? []) {
|
|
949
949
|
const [key, value] = cookie.split('=')
|
|
950
950
|
if (key === name) {
|
|
@@ -1854,7 +1854,7 @@ function clSleep (ms) {
|
|
|
1854
1854
|
// -----------------------------------------------------------------------------
|
|
1855
1855
|
|
|
1856
1856
|
function clThemeSetup () {
|
|
1857
|
-
const settings =
|
|
1857
|
+
const settings = _getDomainCookieJson('cl_ui_settings')
|
|
1858
1858
|
const dark = settings?.theme === 'dark'
|
|
1859
1859
|
clThemeSetDark(dark) // re-set to prolong expiration
|
|
1860
1860
|
const checkbox = document.querySelector('#cl-mode-dark')
|
|
@@ -1868,9 +1868,9 @@ function clThemeSetup () {
|
|
|
1868
1868
|
}
|
|
1869
1869
|
|
|
1870
1870
|
function clThemeSetDark (dark) {
|
|
1871
|
-
const settings =
|
|
1871
|
+
const settings = _getDomainCookieJson('cl_ui_settings')
|
|
1872
1872
|
settings.theme = dark ? 'dark' : 'light'
|
|
1873
|
-
|
|
1873
|
+
_setDomainCookieJson('cl_ui_settings', settings)
|
|
1874
1874
|
}
|
|
1875
1875
|
|
|
1876
1876
|
// ------------------------------------------------------------------------
|
|
@@ -1893,12 +1893,12 @@ function clSetUISettings (settings) {
|
|
|
1893
1893
|
return settings
|
|
1894
1894
|
}
|
|
1895
1895
|
|
|
1896
|
-
function
|
|
1896
|
+
function _getSettingsTable (id) {
|
|
1897
1897
|
const settings = clGetUISettings()
|
|
1898
1898
|
return settings?.tables?.[id] ? settings?.tables?.[id] : {}
|
|
1899
1899
|
}
|
|
1900
1900
|
|
|
1901
|
-
function
|
|
1901
|
+
function _setSettingsTable (id, table) {
|
|
1902
1902
|
if (!id) return undefined
|
|
1903
1903
|
const settings = clGetUISettings()
|
|
1904
1904
|
if (!settings.tables) settings.tables = {}
|