@castlabs/ui 8.0.0 → 8.1.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/dist/castlabs-ui-editor.common.js +17 -17
- package/dist/castlabs-ui-editor.common.js.map +1 -1
- package/dist/castlabs-ui-editor.css +1 -1
- package/dist/castlabs-ui-editor.umd.js +18 -18
- package/dist/castlabs-ui-editor.umd.js.map +1 -1
- package/dist/castlabs-ui.common.js +3 -3
- package/dist/castlabs-ui.common.js.map +1 -1
- package/dist/castlabs-ui.core.js +26 -9
- package/dist/castlabs-ui.css +1 -1
- package/dist/castlabs-ui.module.d.ts +1 -0
- package/dist/castlabs-ui.module.js +26 -9
- package/dist/castlabs-ui.umd.js +4 -4
- package/dist/castlabs-ui.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/components/form/ClFieldCheck/style.scss +9 -0
- package/src/components/navigation/ClNavSide/style.scss +17 -0
- package/src/styles/layout/meta.scss +1 -1
- package/src/styles/themes/dark.variables.scss +1 -1
- package/types/castlabs-ui.module.d.ts +1 -0
- package/types/index.d.ts +1 -1
package/dist/castlabs-ui.core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @castlabs/ui v8.
|
|
1
|
+
/* @castlabs/ui v8.1.1 */
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
4
|
* Bootstrap v5.3.8 (https://getbootstrap.com/)
|
|
@@ -918,6 +918,14 @@ function getDomain () {
|
|
|
918
918
|
// -----------------------------------------------------------------------------
|
|
919
919
|
|
|
920
920
|
let modal = null // the open modal (if any)
|
|
921
|
+
let modalDelay = null // a just-closed modal to circumvent unlucky event order
|
|
922
|
+
|
|
923
|
+
function setModalDelay (newModal) {
|
|
924
|
+
modal = newModal
|
|
925
|
+
setTimeout(function () {
|
|
926
|
+
modalDelay = newModal
|
|
927
|
+
}, 10)
|
|
928
|
+
}
|
|
921
929
|
|
|
922
930
|
/**
|
|
923
931
|
* Hide a bootstrap modal via it's ID.
|
|
@@ -928,7 +936,7 @@ let modal = null // the open modal (if any)
|
|
|
928
936
|
*/
|
|
929
937
|
function clModalHide () {
|
|
930
938
|
modal?.hide()
|
|
931
|
-
|
|
939
|
+
setModalDelay(null)
|
|
932
940
|
}
|
|
933
941
|
|
|
934
942
|
/**
|
|
@@ -945,10 +953,11 @@ function clModalShow (id, value) {
|
|
|
945
953
|
// find & show the modal
|
|
946
954
|
const element = document.getElementById(id)
|
|
947
955
|
if (element) {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
956
|
+
const newModal = new bootstrap.Modal(element, { backdrop: 'static' })
|
|
957
|
+
newModal.value = value
|
|
958
|
+
newModal.id = id
|
|
959
|
+
newModal.show()
|
|
960
|
+
setModalDelay(newModal)
|
|
952
961
|
|
|
953
962
|
// focus the first auto-focus field in the Modal
|
|
954
963
|
const autofocus = document.querySelector(`#${id} [autofocus]`)
|
|
@@ -973,8 +982,16 @@ function clModalValue (id) {
|
|
|
973
982
|
*/
|
|
974
983
|
function clModalIsShown (modalId) {
|
|
975
984
|
if (!modal) return false
|
|
976
|
-
if (
|
|
977
|
-
return modal.id === modalId
|
|
985
|
+
if (modal._isShown) return true
|
|
986
|
+
return modal.id === modalId
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Determine if a modal is/was open. It considers modal a few more ms as open, as
|
|
991
|
+
* sometimes browser/bootstrap events might fire in unlucky orders.
|
|
992
|
+
*/
|
|
993
|
+
function clModalWasShown () {
|
|
994
|
+
return !!modalDelay
|
|
978
995
|
}
|
|
979
996
|
|
|
980
997
|
/**
|
|
@@ -1165,7 +1182,7 @@ function clFormFieldFocusFirstInvalid (formId, moreSelectors = []) {
|
|
|
1165
1182
|
const invalid = document.querySelector(
|
|
1166
1183
|
clSubselectorQuery(`#${formId}`, [':invalid', '.invalid', ...moreSelectors])
|
|
1167
1184
|
)
|
|
1168
|
-
invalid?.focus()
|
|
1185
|
+
invalid?.focus({ focusVisible: true })
|
|
1169
1186
|
}
|
|
1170
1187
|
|
|
1171
1188
|
function clSubselectorQuery (main, subselectors) {
|