web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

app.ts (1102B)


      1 import type { AppLayoutKey, LabelFieldKind } from "$lib/types/app";
      2 import type { ThemeLayer } from "@radroots/themes";
      3 
      4 type ConfigWindow = {
      5     layout: Record<AppLayoutKey, {
      6         h: number;
      7     }>;
      8     debounce: {
      9         search: number;
     10     }
     11 };
     12 
     13 export const CFG_APP: ConfigWindow = {
     14     layout: {
     15         ios0: {
     16             h: 600
     17         },
     18         ios1: {
     19             h: 750
     20         },
     21         webm0: {
     22             h: 600
     23         },
     24         webm1: {
     25             h: 750
     26         }
     27     },
     28     debounce: {
     29         search: 200
     30     },
     31 };
     32 
     33 export const fmt_trellis = (hide_border_t: boolean, hide_border_b: boolean): string => {
     34     return `${hide_border_t ? `group-first:border-t-0` : `group-first:border-t-line`} ${hide_border_b ? `group-last:border-b-0` : `group-last:border-b-line`}`;
     35 };
     36 
     37 export const get_label_classes_kind = (layer: ThemeLayer, label_kind: LabelFieldKind | undefined, hide_active: boolean): string => {
     38     return `text-ly${layer}-gl${label_kind ? `-${label_kind}` : ``} ${hide_active ? `` : `group-active:text-ly${layer}-gl${label_kind ? `-${label_kind}_a` : `_a`}`}`
     39 };