2022-05-12 23:22:49 +02:00
|
|
|
import {css} from "lit";
|
|
|
|
|
2022-05-13 19:51:29 +02:00
|
|
|
import {registerIconLibrary} from '@shoelace-style/shoelace/dist/utilities/icon-library.js';
|
|
|
|
import {egw} from "../../jsapi/egw_global";
|
|
|
|
|
2022-08-22 22:05:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Here is the common overrides and customisations for Shoelace
|
|
|
|
*/
|
|
|
|
|
2022-08-22 22:58:55 +02:00
|
|
|
/**
|
|
|
|
* Make shoelace icons available
|
|
|
|
*/
|
|
|
|
registerIconLibrary('default', {
|
|
|
|
resolver: name =>
|
|
|
|
{
|
2024-06-12 23:49:52 +02:00
|
|
|
return typeof egw !== "undefined" && typeof egw.image == "function" ? (egw.image(name) ?? `${egw.webserverUrl || ""}/node_modules/@shoelace-style/shoelace/dist/assets/icons/${name}.svg`) : ''
|
2022-08-22 22:58:55 +02:00
|
|
|
},
|
|
|
|
});
|
2022-08-22 22:05:11 +02:00
|
|
|
|
2022-05-13 19:51:29 +02:00
|
|
|
/**
|
2022-08-22 22:05:11 +02:00
|
|
|
* Register egw images as an icon library
|
|
|
|
* @example <sl-icon library="egw" name="infolog/navbar"/>
|
|
|
|
* @example <sl-icon library="egw" name="5_day_view"/>
|
2022-05-13 19:51:29 +02:00
|
|
|
*/
|
2023-10-27 19:50:51 +02:00
|
|
|
if(typeof egw !== "undefined" && typeof egw.image == "function")
|
|
|
|
{
|
|
|
|
registerIconLibrary('egw', {
|
|
|
|
resolver: name =>
|
|
|
|
{
|
|
|
|
return (egw.image(name) || '');
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
2022-05-13 19:51:29 +02:00
|
|
|
|
2022-05-12 23:22:49 +02:00
|
|
|
/**
|
|
|
|
* Customise shoelace styles to match our stuff
|
2022-07-21 20:39:00 +02:00
|
|
|
* External CSS & widget styles will override this
|
2022-05-12 23:22:49 +02:00
|
|
|
*/
|
2024-07-15 17:40:28 +02:00
|
|
|
export default [css`
|
2024-08-14 14:30:07 +02:00
|
|
|
.form-control--has-label .form-control__label {
|
|
|
|
display: inline-block;
|
|
|
|
color: var(--sl-input-label-color);
|
|
|
|
margin-right: var(--sl-spacing-medium);
|
|
|
|
}
|
|
|
|
`];
|