init component

This commit is contained in:
Robin COuret
2026-02-16 17:28:37 +01:00
parent 460c7a25e0
commit e0e50af706
4557 changed files with 666911 additions and 8 deletions

2
node_modules/buetify/lib/composables/theme/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,2 @@
export * from './provideTheme';
export * from './useTheme';

3
node_modules/buetify/lib/composables/theme/index.js generated vendored Executable file
View File

@@ -0,0 +1,3 @@
export * from './provideTheme';
export * from './useTheme';
//# sourceMappingURL=index.js.map

1
node_modules/buetify/lib/composables/theme/index.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/composables/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAd;AACA,cAAc,YAAd","sourcesContent":["export * from './provideTheme';\nexport * from './useTheme';\n"],"sourceRoot":"","file":"index.js"}

26
node_modules/buetify/lib/composables/theme/provideTheme.d.ts generated vendored Executable file
View File

@@ -0,0 +1,26 @@
import { Option } from 'fp-ts/lib/Option';
import { Ref, ExtractPropTypes, PropType } from 'vue';
export declare type ThemeVariant = 'dark' | 'light';
export interface ThemeInjection {
isThemeable: Ref<boolean>;
currentTheme: Ref<Option<ThemeVariant>>;
setTheme: (theme: ThemeVariant) => void;
}
export declare const DEFAULT_THEME_INJECTION: ThemeInjection;
export declare const THEME_INJECTION_SYMBOL: unique symbol;
export declare const ProvideThemePropDefinitions: {
isThemeable: {
type: PropType<boolean>;
default: boolean;
};
persistTheme: {
type: PropType<boolean>;
default: boolean;
};
};
export declare type ProvideThemeProps = ExtractPropTypes<typeof ProvideThemePropDefinitions>;
export declare function provideTheme(props: ProvideThemeProps): {
setTheme: (newTheme: ThemeVariant) => void;
currentTheme: Ref<import("fp-ts/lib/Option").None> | Ref<import("fp-ts/lib/Option").Some<ThemeVariant>>;
isThemeable: Ref<boolean>;
};

49
node_modules/buetify/lib/composables/theme/provideTheme.js generated vendored Executable file
View File

@@ -0,0 +1,49 @@
import { getItem, setItem } from 'fp-ts-local-storage';
import { constant, constVoid } from 'fp-ts/lib/function';
import { getOrElse, none, some } from 'fp-ts/lib/Option';
import { provide, shallowRef, watch } from 'vue';
export const DEFAULT_THEME_INJECTION = {
currentTheme: shallowRef(none),
isThemeable: shallowRef(false),
setTheme: constVoid
};
export const THEME_INJECTION_SYMBOL = Symbol('theme');
const persistentTheme = getOrElse(constant('dark'))(getItem('theme')());
export const ProvideThemePropDefinitions = {
isThemeable: {
type: Boolean,
default: true
},
persistTheme: {
type: Boolean,
default: true
}
};
export function provideTheme(props) {
const isThemeable = shallowRef(props.isThemeable);
watch(() => props.isThemeable, themeable => {
isThemeable.value = themeable;
});
const currentTheme = shallowRef(some(persistentTheme));
function setTheme(newTheme) {
currentTheme.value = some(newTheme);
if (props.persistTheme) {
setItem('theme', newTheme)();
}
}
const injection = {
isThemeable,
currentTheme,
setTheme
};
provide(THEME_INJECTION_SYMBOL, injection);
return {
setTheme,
currentTheme,
isThemeable
};
}
//# sourceMappingURL=provideTheme.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/composables/theme/provideTheme.ts"],"names":[],"mappings":"AAAA,SAAS,OAAT,EAAkB,OAAlB,QAAiC,qBAAjC;AACA,SAAS,QAAT,EAAmB,SAAnB,QAAoC,oBAApC;AACA,SAAS,SAAT,EAAoB,IAApB,EAAkC,IAAlC,QAA8C,kBAA9C;AACA,SAAS,OAAT,EAAkB,UAAlB,EAAmC,KAAnC,QAA4E,KAA5E;AAUA,OAAO,MAAM,uBAAuB,GAAmB;AACrD,EAAA,YAAY,EAAE,UAAU,CAAC,IAAD,CAD6B;AAErD,EAAA,WAAW,EAAE,UAAU,CAAC,KAAD,CAF8B;AAGrD,EAAA,QAAQ,EAAE;AAH2C,CAAhD;AAMP,OAAO,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAD,CAArC;AAEP,MAAM,eAAe,GAAG,SAAS,CAAe,QAAQ,CAAe,MAAf,CAAvB,CAAT,CACtB,OAAO,CAAC,OAAD,CAAP,EADsB,CAAxB;AAIA,OAAO,MAAM,2BAA2B,GAAG;AACzC,EAAA,WAAW,EAAE;AACX,IAAA,IAAI,EAAE,OADK;AAEX,IAAA,OAAO,EAAE;AAFE,GAD4B;AAKzC,EAAA,YAAY,EAAE;AACZ,IAAA,IAAI,EAAE,OADM;AAEZ,IAAA,OAAO,EAAE;AAFG;AAL2B,CAApC;AAaP,OAAM,SAAU,YAAV,CAAuB,KAAvB,EAA+C;AACnD,QAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,WAAP,CAA9B;AACA,EAAA,KAAK,CACH,MAAM,KAAK,CAAC,WADT,EAEH,SAAS,IAAG;AACV,IAAA,WAAW,CAAC,KAAZ,GAAoB,SAApB;AACD,GAJE,CAAL;AAMA,QAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,eAAD,CAAL,CAA/B;;AACA,WAAS,QAAT,CAAkB,QAAlB,EAAwC;AACtC,IAAA,YAAY,CAAC,KAAb,GAAqB,IAAI,CAAC,QAAD,CAAzB;;AACA,QAAI,KAAK,CAAC,YAAV,EAAwB;AACtB,MAAA,OAAO,CAAC,OAAD,EAAU,QAAV,CAAP;AACD;AACF;;AACD,QAAM,SAAS,GAAmB;AAChC,IAAA,WADgC;AAEhC,IAAA,YAFgC;AAGhC,IAAA;AAHgC,GAAlC;AAKA,EAAA,OAAO,CAAC,sBAAD,EAAyB,SAAzB,CAAP;AACA,SAAO;AACL,IAAA,QADK;AAEL,IAAA,YAFK;AAGL,IAAA;AAHK,GAAP;AAKD","sourcesContent":["import { getItem, setItem } from 'fp-ts-local-storage';\nimport { constant, constVoid } from 'fp-ts/lib/function';\nimport { getOrElse, none, Option, some } from 'fp-ts/lib/Option';\nimport { provide, shallowRef, Ref, watch, ExtractPropTypes, PropType } from 'vue';\n\nexport type ThemeVariant = 'dark' | 'light';\n\nexport interface ThemeInjection {\n isThemeable: Ref<boolean>;\n currentTheme: Ref<Option<ThemeVariant>>; // allows for easier defaults in injected component\n setTheme: (theme: ThemeVariant) => void;\n}\n\nexport const DEFAULT_THEME_INJECTION: ThemeInjection = {\n currentTheme: shallowRef(none),\n isThemeable: shallowRef(false),\n setTheme: constVoid\n};\n\nexport const THEME_INJECTION_SYMBOL = Symbol('theme');\n\nconst persistentTheme = getOrElse<ThemeVariant>(constant<ThemeVariant>('dark'))(\n getItem('theme')() as Option<ThemeVariant>\n);\n\nexport const ProvideThemePropDefinitions = {\n isThemeable: {\n type: Boolean as PropType<boolean>,\n default: true\n },\n persistTheme: {\n type: Boolean as PropType<boolean>,\n default: true\n }\n};\n\nexport type ProvideThemeProps = ExtractPropTypes<typeof ProvideThemePropDefinitions>;\n\nexport function provideTheme(props: ProvideThemeProps) {\n const isThemeable = shallowRef(props.isThemeable);\n watch(\n () => props.isThemeable,\n themeable => {\n isThemeable.value = themeable;\n }\n );\n const currentTheme = shallowRef(some(persistentTheme));\n function setTheme(newTheme: ThemeVariant) {\n currentTheme.value = some(newTheme);\n if (props.persistTheme) {\n setItem('theme', newTheme)();\n }\n }\n const injection: ThemeInjection = {\n isThemeable,\n currentTheme,\n setTheme\n };\n provide(THEME_INJECTION_SYMBOL, injection);\n return {\n setTheme,\n currentTheme,\n isThemeable\n };\n}\n"],"sourceRoot":"","file":"provideTheme.js"}

37
node_modules/buetify/lib/composables/theme/useTheme.d.ts generated vendored Executable file
View File

@@ -0,0 +1,37 @@
import { PropType, ExtractPropTypes } from 'vue';
import { ThemeColorMap } from '../../types/ThemeColorMap';
import { ThemeInjection } from './provideTheme';
export declare const DEFAULT_THEME_COLOR_MAP: ThemeColorMap;
export declare function useThemePropsDefinition(themeMap: ThemeColorMap, defaultIsThemeable?: boolean): {
themeMap: {
type: PropType<ThemeColorMap>;
required: boolean;
default: import("fp-ts/lib/function").Lazy<ThemeColorMap>;
};
isThemeable: {
type: PropType<boolean>;
required: boolean;
default: boolean;
};
};
export declare type ThemeProps = ExtractPropTypes<ReturnType<typeof useThemePropsDefinition>>;
export declare type FunctionalThemeProps = Partial<ThemeProps>;
export declare const DefaultThemePropsDefinition: {
themeMap: {
type: PropType<ThemeColorMap>;
required: boolean;
default: import("fp-ts/lib/function").Lazy<ThemeColorMap>;
};
isThemeable: {
type: PropType<boolean>;
required: boolean;
default: boolean;
};
};
export declare function getThemeClasses(themeMap: ThemeColorMap, themeInjection: ThemeInjection): string[];
export declare function useTheme(props?: ThemeProps): {
currentTheme: import("vue").Ref<import("fp-ts/lib/Option").Option<import("./provideTheme").ThemeVariant>>;
setTheme: (theme: import("./provideTheme").ThemeVariant) => void;
toggleTheme: () => void;
themeClasses: import("vue").ComputedRef<string[]>;
};

50
node_modules/buetify/lib/composables/theme/useTheme.js generated vendored Executable file
View File

@@ -0,0 +1,50 @@
import { isSome } from 'fp-ts/lib/Option';
import { inject, computed } from 'vue';
import { constant } from 'fp-ts/lib/function';
import { DEFAULT_THEME_INJECTION, THEME_INJECTION_SYMBOL } from './provideTheme';
export const DEFAULT_THEME_COLOR_MAP = {
dark: 'is-black-ter',
light: ''
};
export function useThemePropsDefinition(themeMap, defaultIsThemeable = true) {
return {
themeMap: {
type: Object,
required: false,
default: constant(themeMap)
},
isThemeable: {
type: Boolean,
required: false,
default: defaultIsThemeable
}
};
}
export const DefaultThemePropsDefinition = useThemePropsDefinition(DEFAULT_THEME_COLOR_MAP, true);
export function getThemeClasses(themeMap, themeInjection) {
if (themeInjection.isThemeable.value && isSome(themeInjection.currentTheme.value)) {
const classes = themeMap[themeInjection.currentTheme.value.value];
return Array.isArray(classes) ? classes : [classes];
} else {
return [];
}
}
export function useTheme(props) {
const themeInjection = inject(THEME_INJECTION_SYMBOL, DEFAULT_THEME_INJECTION);
const themeClasses = computed(() => props ? getThemeClasses(props.themeMap, themeInjection) : []);
return {
currentTheme: themeInjection.currentTheme,
setTheme: themeInjection.setTheme,
toggleTheme: () => {
if (isSome(themeInjection.currentTheme.value)) {
if (themeInjection.currentTheme.value.value === 'light') {
themeInjection.setTheme('dark');
} else {
themeInjection.setTheme('light');
}
}
},
themeClasses
};
}
//# sourceMappingURL=useTheme.js.map

1
node_modules/buetify/lib/composables/theme/useTheme.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/composables/theme/useTheme.ts"],"names":[],"mappings":"AAAA,SAAS,MAAT,QAAuB,kBAAvB;AACA,SAAmB,MAAnB,EAA6C,QAA7C,QAA6D,KAA7D;AACA,SAAS,QAAT,QAAyB,oBAAzB;AAEA,SAAS,uBAAT,EAAkC,sBAAlC,QAAgF,gBAAhF;AAEA,OAAO,MAAM,uBAAuB,GAAkB;AACpD,EAAA,IAAI,EAAE,cAD8C;AAEpD,EAAA,KAAK,EAAE;AAF6C,CAA/C;AAKP,OAAM,SAAU,uBAAV,CAAkC,QAAlC,EAA2D,kBAAkB,GAAG,IAAhF,EAAoF;AACxF,SAAO;AACL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE,MADE;AAER,MAAA,QAAQ,EAAE,KAFF;AAGR,MAAA,OAAO,EAAE,QAAQ,CAAC,QAAD;AAHT,KADL;AAML,IAAA,WAAW,EAAE;AACX,MAAA,IAAI,EAAE,OADK;AAEX,MAAA,QAAQ,EAAE,KAFC;AAGX,MAAA,OAAO,EAAE;AAHE;AANR,GAAP;AAYD;AAMD,OAAO,MAAM,2BAA2B,GAAG,uBAAuB,CAAC,uBAAD,EAA0B,IAA1B,CAA3D;AAEP,OAAM,SAAU,eAAV,CAA0B,QAA1B,EAAmD,cAAnD,EAAiF;AACrF,MAAI,cAAc,CAAC,WAAf,CAA2B,KAA3B,IAAoC,MAAM,CAAC,cAAc,CAAC,YAAf,CAA4B,KAA7B,CAA9C,EAAmF;AACjF,UAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,YAAf,CAA4B,KAA5B,CAAkC,KAAnC,CAAxB;AACA,WAAO,KAAK,CAAC,OAAN,CAAc,OAAd,IAAyB,OAAzB,GAAmC,CAAC,OAAD,CAA1C;AACD,GAHD,MAGO;AACL,WAAO,EAAP;AACD;AACF;AAED,OAAM,SAAU,QAAV,CAAmB,KAAnB,EAAqC;AACzC,QAAM,cAAc,GAAG,MAAM,CAAC,sBAAD,EAAyB,uBAAzB,CAA7B;AACA,QAAM,YAAY,GAAG,QAAQ,CAAC,MAAO,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,QAAP,EAAiB,cAAjB,CAAlB,GAAqD,EAAlE,CAA7B;AAEA,SAAO;AACL,IAAA,YAAY,EAAE,cAAc,CAAC,YADxB;AAEL,IAAA,QAAQ,EAAE,cAAc,CAAC,QAFpB;AAGL,IAAA,WAAW,EAAE,MAAK;AAChB,UAAI,MAAM,CAAC,cAAc,CAAC,YAAf,CAA4B,KAA7B,CAAV,EAA+C;AAC7C,YAAI,cAAc,CAAC,YAAf,CAA4B,KAA5B,CAAkC,KAAlC,KAA4C,OAAhD,EAAyD;AACvD,UAAA,cAAc,CAAC,QAAf,CAAwB,MAAxB;AACD,SAFD,MAEO;AACL,UAAA,cAAc,CAAC,QAAf,CAAwB,OAAxB;AACD;AACF;AACF,KAXI;AAYL,IAAA;AAZK,GAAP;AAcD","sourcesContent":["import { isSome } from 'fp-ts/lib/Option';\nimport { PropType, inject, ExtractPropTypes, computed } from 'vue';\nimport { constant } from 'fp-ts/lib/function';\nimport { ThemeColorMap } from '../../types/ThemeColorMap';\nimport { DEFAULT_THEME_INJECTION, THEME_INJECTION_SYMBOL, ThemeInjection } from './provideTheme';\n\nexport const DEFAULT_THEME_COLOR_MAP: ThemeColorMap = {\n dark: 'is-black-ter',\n light: ''\n};\n\nexport function useThemePropsDefinition(themeMap: ThemeColorMap, defaultIsThemeable = true) {\n return {\n themeMap: {\n type: Object as PropType<ThemeColorMap>,\n required: false,\n default: constant(themeMap)\n },\n isThemeable: {\n type: Boolean as PropType<boolean>,\n required: false,\n default: defaultIsThemeable\n }\n };\n}\n\nexport type ThemeProps = ExtractPropTypes<ReturnType<typeof useThemePropsDefinition>>;\n\nexport type FunctionalThemeProps = Partial<ThemeProps>;\n\nexport const DefaultThemePropsDefinition = useThemePropsDefinition(DEFAULT_THEME_COLOR_MAP, true);\n\nexport function getThemeClasses(themeMap: ThemeColorMap, themeInjection: ThemeInjection): string[] {\n if (themeInjection.isThemeable.value && isSome(themeInjection.currentTheme.value)) {\n const classes = themeMap[themeInjection.currentTheme.value.value];\n return Array.isArray(classes) ? classes : [classes];\n } else {\n return [];\n }\n}\n\nexport function useTheme(props?: ThemeProps) {\n const themeInjection = inject(THEME_INJECTION_SYMBOL, DEFAULT_THEME_INJECTION);\n const themeClasses = computed(() => (props ? getThemeClasses(props.themeMap, themeInjection) : []));\n\n return {\n currentTheme: themeInjection.currentTheme,\n setTheme: themeInjection.setTheme,\n toggleTheme: () => {\n if (isSome(themeInjection.currentTheme.value)) {\n if (themeInjection.currentTheme.value.value === 'light') {\n themeInjection.setTheme('dark');\n } else {\n themeInjection.setTheme('light');\n }\n }\n },\n themeClasses\n };\n}\n"],"sourceRoot":"","file":"useTheme.js"}