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

8
node_modules/buetify/lib/utils/eventHelpers.d.ts generated vendored Executable file
View File

@@ -0,0 +1,8 @@
export declare function isEnterEvent(e: KeyboardEvent): boolean;
export declare function isSpaceEvent(e: KeyboardEvent): boolean;
export declare function isEscEvent(e: KeyboardEvent): boolean;
export declare function isArrowDownEvent(e: KeyboardEvent): boolean;
export declare function isArrowRightEvent(e: KeyboardEvent): boolean;
export declare function isArrowLeftEvent(e: KeyboardEvent): boolean;
export declare function isArrowUpEvent(e: KeyboardEvent): boolean;
export declare function isTabEvent(e: KeyboardEvent): boolean;

25
node_modules/buetify/lib/utils/eventHelpers.js generated vendored Executable file
View File

@@ -0,0 +1,25 @@
export function isEnterEvent(e) {
return e.key === 'Enter' || e.keyCode === 13;
}
export function isSpaceEvent(e) {
return e.code === 'Space' || e.which === 32 || e.key === ' ';
}
export function isEscEvent(e) {
return e.key === 'Escape' || e.code === 'Escape' || e.which === 27;
}
export function isArrowDownEvent(e) {
return e.key === 'ArrowDown' || e.code === 'ArrowDown' || e.which === 40;
}
export function isArrowRightEvent(e) {
return e.key === 'ArrowRight' || e.code === 'ArrowRight' || e.which === 39;
}
export function isArrowLeftEvent(e) {
return e.key === 'ArrowLeft' || e.code === 'ArrowLeft' || e.which === 37;
}
export function isArrowUpEvent(e) {
return e.key === 'ArrowUp' || e.code === 'ArrowUp' || e.which === 38;
}
export function isTabEvent(e) {
return e.key === 'Tab' || e.code === 'Tab' || e.which === 9;
}
//# sourceMappingURL=eventHelpers.js.map

1
node_modules/buetify/lib/utils/eventHelpers.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utils/eventHelpers.ts"],"names":[],"mappings":"AAAA,OAAM,SAAU,YAAV,CAAuB,CAAvB,EAAuC;AAC3C,SAAO,CAAC,CAAC,GAAF,KAAU,OAAV,IAAqB,CAAC,CAAC,OAAF,KAAc,EAA1C;AACD;AAED,OAAM,SAAU,YAAV,CAAuB,CAAvB,EAAuC;AAC3C,SAAO,CAAC,CAAC,IAAF,KAAW,OAAX,IAAsB,CAAC,CAAC,KAAF,KAAY,EAAlC,IAAwC,CAAC,CAAC,GAAF,KAAU,GAAzD;AACD;AAED,OAAM,SAAU,UAAV,CAAqB,CAArB,EAAqC;AACzC,SAAO,CAAC,CAAC,GAAF,KAAU,QAAV,IAAsB,CAAC,CAAC,IAAF,KAAW,QAAjC,IAA6C,CAAC,CAAC,KAAF,KAAY,EAAhE;AACD;AAED,OAAM,SAAU,gBAAV,CAA2B,CAA3B,EAA2C;AAC/C,SAAO,CAAC,CAAC,GAAF,KAAU,WAAV,IAAyB,CAAC,CAAC,IAAF,KAAW,WAApC,IAAmD,CAAC,CAAC,KAAF,KAAY,EAAtE;AACD;AAED,OAAM,SAAU,iBAAV,CAA4B,CAA5B,EAA4C;AAChD,SAAO,CAAC,CAAC,GAAF,KAAU,YAAV,IAA0B,CAAC,CAAC,IAAF,KAAW,YAArC,IAAqD,CAAC,CAAC,KAAF,KAAY,EAAxE;AACD;AAED,OAAM,SAAU,gBAAV,CAA2B,CAA3B,EAA2C;AAC/C,SAAO,CAAC,CAAC,GAAF,KAAU,WAAV,IAAyB,CAAC,CAAC,IAAF,KAAW,WAApC,IAAmD,CAAC,CAAC,KAAF,KAAY,EAAtE;AACD;AAED,OAAM,SAAU,cAAV,CAAyB,CAAzB,EAAyC;AAC7C,SAAO,CAAC,CAAC,GAAF,KAAU,SAAV,IAAuB,CAAC,CAAC,IAAF,KAAW,SAAlC,IAA+C,CAAC,CAAC,KAAF,KAAY,EAAlE;AACD;AAED,OAAM,SAAU,UAAV,CAAqB,CAArB,EAAqC;AACzC,SAAO,CAAC,CAAC,GAAF,KAAU,KAAV,IAAmB,CAAC,CAAC,IAAF,KAAW,KAA9B,IAAuC,CAAC,CAAC,KAAF,KAAY,CAA1D;AACD","sourcesContent":["export function isEnterEvent(e: KeyboardEvent): boolean {\n return e.key === 'Enter' || e.keyCode === 13;\n}\n\nexport function isSpaceEvent(e: KeyboardEvent): boolean {\n return e.code === 'Space' || e.which === 32 || e.key === ' ';\n}\n\nexport function isEscEvent(e: KeyboardEvent): boolean {\n return e.key === 'Escape' || e.code === 'Escape' || e.which === 27;\n}\n\nexport function isArrowDownEvent(e: KeyboardEvent): boolean {\n return e.key === 'ArrowDown' || e.code === 'ArrowDown' || e.which === 40;\n}\n\nexport function isArrowRightEvent(e: KeyboardEvent): boolean {\n return e.key === 'ArrowRight' || e.code === 'ArrowRight' || e.which === 39;\n}\n\nexport function isArrowLeftEvent(e: KeyboardEvent): boolean {\n return e.key === 'ArrowLeft' || e.code === 'ArrowLeft' || e.which === 37;\n}\n\nexport function isArrowUpEvent(e: KeyboardEvent): boolean {\n return e.key === 'ArrowUp' || e.code === 'ArrowUp' || e.which === 38;\n}\n\nexport function isTabEvent(e: KeyboardEvent): boolean {\n return e.key === 'Tab' || e.code === 'Tab' || e.which === 9;\n}\n"],"sourceRoot":"","file":"eventHelpers.js"}

View File

@@ -0,0 +1,4 @@
import { FunctionalComponent } from 'vue';
export declare function getSimpleFunctionalComponent(cls: string, el?: string): FunctionalComponent<{
tag?: string;
}>;

View File

@@ -0,0 +1,11 @@
import { h } from 'vue';
export function getSimpleFunctionalComponent(cls, el = 'div') {
return function (props, {
slots
}) {
return h(props.tag ?? el, {
class: cls
}, slots.default ? slots.default() : undefined);
};
}
//# sourceMappingURL=getSimpleFunctionalComponent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utils/getSimpleFunctionalComponent.ts"],"names":[],"mappings":"AAAA,SAAS,CAAT,QAAqD,KAArD;AAEA,OAAM,SAAU,4BAAV,CAAuC,GAAvC,EAAoD,EAAE,GAAG,KAAzD,EAA8D;AAClE,SAAO,UAAS,KAAT,EAAkC;AAAE,IAAA;AAAF,GAAlC,EAAyD;AAC9D,WAAO,CAAC,CAAC,KAAK,CAAC,GAAN,IAAa,EAAd,EAAkB;AAAE,MAAA,KAAK,EAAE;AAAT,KAAlB,EAAkC,KAAK,CAAC,OAAN,GAAgB,KAAK,CAAC,OAAN,EAAhB,GAAkC,SAApE,CAAR;AACD,GAFD;AAGD","sourcesContent":["import { h, SetupContext, FunctionalComponent } from 'vue';\n\nexport function getSimpleFunctionalComponent(cls: string, el = 'div'): FunctionalComponent<{ tag?: string }> {\n return function(props: { tag?: string }, { slots }: SetupContext) {\n return h(props.tag ?? el, { class: cls }, slots.default ? slots.default() : undefined);\n };\n}\n"],"sourceRoot":"","file":"getSimpleFunctionalComponent.js"}

View File

@@ -0,0 +1,37 @@
import { ThemeInjection, ThemeProps } from '../composables/theme';
import { ThemeColorMap } from '../types/ThemeColorMap';
export interface ThemeableComponentOptions {
cls: string;
el?: string;
themeMap?: ThemeColorMap;
}
export interface ThemeableComponentProps extends Partial<ThemeProps> {
tag?: string;
}
export declare function isThemeable(props: Partial<ThemeProps>, injection: ThemeInjection): boolean;
export declare function getThemeableFunctionalComponent({ cls, el, themeMap }: ThemeableComponentOptions): import("vue").DefineComponent<{
tag: {
type: (FunctionConstructor | StringConstructor)[];
default: string;
};
themeMap: {
type: import("vue").PropType<ThemeColorMap>;
required: boolean;
default: import("fp-ts/lib/function").Lazy<ThemeColorMap>;
};
isThemeable: {
type: import("vue").PropType<boolean>;
required: boolean;
default: boolean;
};
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
isThemeable: boolean;
themeMap: ThemeColorMap;
tag: string | Function;
} & {}>, {
isThemeable: boolean;
themeMap: ThemeColorMap;
tag: string | Function;
}>;

View File

@@ -0,0 +1,32 @@
import { isSome } from 'fp-ts/lib/Option';
import { inject, h, defineComponent } from 'vue';
import { DEFAULT_THEME_COLOR_MAP, DEFAULT_THEME_INJECTION, getThemeClasses, useThemePropsDefinition, THEME_INJECTION_SYMBOL } from '../composables/theme';
import { mergeClasses } from './mergeClasses';
export function isThemeable(props, injection) {
return !!props.isThemeable && !!props.themeMap && isSome(injection.currentTheme.value);
}
export function getThemeableFunctionalComponent({
cls,
el = 'div',
themeMap = DEFAULT_THEME_COLOR_MAP
}) {
return defineComponent({
props: { ...useThemePropsDefinition(themeMap, true),
tag: {
type: [String, Function],
default: el
}
},
setup(props, {
slots
}) {
const themeInjection = inject(THEME_INJECTION_SYMBOL, DEFAULT_THEME_INJECTION);
return () => h(props.tag, {
class: isThemeable(props, themeInjection) ? mergeClasses(getThemeClasses(props.themeMap, themeInjection), cls) : cls
}, slots.default && slots.default());
}
});
}
//# sourceMappingURL=getThemeableFunctionalComponent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utils/getThemeableFunctionalComponent.ts"],"names":[],"mappings":"AAAA,SAAS,MAAT,QAAuB,kBAAvB;AACA,SAAS,MAAT,EAAiB,CAAjB,EAAoB,eAApB,QAA2C,KAA3C;AACA,SACE,uBADF,EAEE,uBAFF,EAGE,eAHF,EAIE,uBAJF,EAKE,sBALF,QAQO,sBARP;AAUA,SAAS,YAAT,QAA6B,gBAA7B;AAYA,OAAM,SAAU,WAAV,CAAsB,KAAtB,EAAkD,SAAlD,EAA2E;AAC/E,SAAO,CAAC,CAAC,KAAK,CAAC,WAAR,IAAuB,CAAC,CAAC,KAAK,CAAC,QAA/B,IAA2C,MAAM,CAAC,SAAS,CAAC,YAAV,CAAuB,KAAxB,CAAxD;AACD;AAED,OAAM,SAAU,+BAAV,CAA0C;AAC9C,EAAA,GAD8C;AAE9C,EAAA,EAAE,GAAG,KAFyC;AAG9C,EAAA,QAAQ,GAAG;AAHmC,CAA1C,EAIsB;AAC1B,SAAO,eAAe,CAAC;AACrB,IAAA,KAAK,EAAE,EACL,GAAG,uBAAuB,CAAC,QAAD,EAAW,IAAX,CADrB;AAEL,MAAA,GAAG,EAAE;AACH,QAAA,IAAI,EAAE,CAAC,MAAD,EAAS,QAAT,CADH;AAEH,QAAA,OAAO,EAAE;AAFN;AAFA,KADc;;AAQrB,IAAA,KAAK,CAAC,KAAD,EAAQ;AAAE,MAAA;AAAF,KAAR,EAAiB;AACpB,YAAM,cAAc,GAAG,MAAM,CAAC,sBAAD,EAAyB,uBAAzB,CAA7B;AACA,aAAO,MACL,CAAC,CACC,KAAK,CAAC,GADP,EAEC;AACE,QAAA,KAAK,EAAE,WAAW,CAAC,KAAD,EAAQ,cAAR,CAAX,GACH,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,QAAP,EAAiB,cAAjB,CAAhB,EAAkD,GAAlD,CADT,GAEH;AAHN,OAFD,EAOC,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,OAAN,EAPlB,CADH;AAUD;;AApBoB,GAAD,CAAtB;AAsBD","sourcesContent":["import { isSome } from 'fp-ts/lib/Option';\nimport { inject, h, defineComponent } from 'vue';\nimport {\n DEFAULT_THEME_COLOR_MAP,\n DEFAULT_THEME_INJECTION,\n getThemeClasses,\n useThemePropsDefinition,\n THEME_INJECTION_SYMBOL,\n ThemeInjection,\n ThemeProps\n} from '../composables/theme';\nimport { ThemeColorMap } from '../types/ThemeColorMap';\nimport { mergeClasses } from './mergeClasses';\n\nexport interface ThemeableComponentOptions {\n cls: string;\n el?: string;\n themeMap?: ThemeColorMap;\n}\n\nexport interface ThemeableComponentProps extends Partial<ThemeProps> {\n tag?: string;\n}\n\nexport function isThemeable(props: Partial<ThemeProps>, injection: ThemeInjection): boolean {\n return !!props.isThemeable && !!props.themeMap && isSome(injection.currentTheme.value);\n}\n\nexport function getThemeableFunctionalComponent({\n cls,\n el = 'div',\n themeMap = DEFAULT_THEME_COLOR_MAP\n}: ThemeableComponentOptions) {\n return defineComponent({\n props: {\n ...useThemePropsDefinition(themeMap, true),\n tag: {\n type: [String, Function],\n default: el\n }\n },\n setup(props, { slots }) {\n const themeInjection = inject(THEME_INJECTION_SYMBOL, DEFAULT_THEME_INJECTION);\n return () =>\n h(\n props.tag as string,\n {\n class: isThemeable(props, themeInjection)\n ? mergeClasses(getThemeClasses(props.themeMap, themeInjection), cls)\n : cls\n },\n slots.default && slots.default()\n );\n }\n });\n}\n"],"sourceRoot":"","file":"getThemeableFunctionalComponent.js"}

40
node_modules/buetify/lib/utils/helpers.d.ts generated vendored Executable file
View File

@@ -0,0 +1,40 @@
import { VNode } from 'vue';
import { Eq } from 'fp-ts/lib/Eq';
/**
* Mobile detection
* https://www.abeautifulsite.net/detecting-mobile-devices-with-javascript
*/
export declare const isMobile: {
Android: () => false | RegExpMatchArray | null;
BlackBerry: () => false | RegExpMatchArray | null;
iOS: () => false | RegExpMatchArray | null;
Opera: () => false | RegExpMatchArray | null;
Windows: () => false | RegExpMatchArray | null;
any: () => false | RegExpMatchArray | null;
};
export declare function capitalizeFirstLetter(str: string): string;
export declare function keys<O>(o: O): Array<keyof O>;
export declare function deepEqual(a: any, b: any): boolean;
export declare function getNestedValue(obj: any, path: (string | number)[], fallback?: any): any;
export declare function getObjectValueByPath(obj: any, path: string, fallback?: any): any;
export declare function isBoolean(val: any): val is boolean;
export declare function isObject(obj: any): obj is object;
export declare function isFunction(obj: any): obj is Function;
export declare function isPrimitive(val: any): val is number | string | boolean;
export declare function isNil(arg: any): boolean;
export declare const exists: import("fp-ts/lib/function").Predicate<any>;
export declare function isString(arg: any): arg is string;
export declare function isNumber(arg: any): arg is number;
export declare function isHTMLElement(obj: any): obj is HTMLElement;
export declare const constEmptyArray: import("fp-ts/lib/function").Lazy<never[]>;
export declare const constNone: import("fp-ts/lib/function").Lazy<import("fp-ts/lib/Option").Option<never>>;
export declare const constZero: import("fp-ts/lib/function").Lazy<number>;
export declare const constEmptyString: import("fp-ts/lib/function").Lazy<string>;
export declare function removeListItem<A>(E: Eq<A>): (a: A, as: A[]) => A[];
export declare function toggleListItem<A>(E: Eq<A>): (a: A, as: A[]) => A[];
export declare function isFragment(node: VNode): boolean;
export declare function isEmptyString(str: string): boolean;
export declare type Result<T, P> = P extends keyof T ? T[P] : P extends (item: T) => any ? ReturnType<P> : never;
export declare type Extractor<T> = keyof T | ((item: T) => any);
export declare function extractProp<T, P extends (item: T) => any | keyof T>(extractor: Extractor<T>, item: T): Result<T, P>;
export declare function camelize(str: string): string;

162
node_modules/buetify/lib/utils/helpers.js generated vendored Executable file
View File

@@ -0,0 +1,162 @@
import { Fragment } from 'vue';
import { snoc, unsafeDeleteAt } from 'fp-ts/lib/Array';
import { constant, not } from 'fp-ts/lib/function';
import { none } from 'fp-ts/lib/Option';
/**
* Mobile detection
* https://www.abeautifulsite.net/detecting-mobile-devices-with-javascript
*/
export const isMobile = {
Android: function () {
return typeof window !== 'undefined' && window.navigator.userAgent.match(/Android/i);
},
BlackBerry: function () {
return typeof window !== 'undefined' && window.navigator.userAgent.match(/BlackBerry/i);
},
iOS: function () {
return typeof window !== 'undefined' && window.navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function () {
return typeof window !== 'undefined' && window.navigator.userAgent.match(/Opera Mini/i);
},
Windows: function () {
return typeof window !== 'undefined' && window.navigator.userAgent.match(/IEMobile/i);
},
any: function () {
return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
}
};
export function capitalizeFirstLetter(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
export function keys(o) {
return Object.keys(o);
} // eslint-disable-next-line
export function deepEqual(a, b) {
if (a === b) return true;
if (a instanceof Date && b instanceof Date) {
// If the values are Date, they were convert to timestamp with getTime and compare it
if (a.getTime() !== b.getTime()) return false;
}
if (a !== Object(a) || b !== Object(b)) {
// If the values aren't objects, they were already checked for equality
return false;
}
const props = Object.keys(a);
if (props.length !== Object.keys(b).length) {
// Different number of props, don't bother to check
return false;
}
return props.every(p => deepEqual(a[p], b[p]));
} // eslint-disable-next-line
export function getNestedValue(obj, path, fallback) {
const last = path.length - 1;
if (last < 0) return obj === undefined ? fallback : obj;
for (let i = 0; i < last; i++) {
if (obj == null) {
return fallback;
}
obj = obj[path[i]];
}
if (obj == null) return fallback;
return obj[path[last]] === undefined ? fallback : obj[path[last]];
} // eslint-disable-next-line
export function getObjectValueByPath(obj, path, fallback) {
// credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621
if (obj == null || !path || typeof path !== 'string') return fallback;
if (obj[path] !== undefined) return obj[path];
path = path.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
path = path.replace(/^\./, ''); // strip a leading dot
return getNestedValue(obj, path.split('.'), fallback);
} // eslint-disable-next-line
export function isBoolean(val) {
return typeof val === 'boolean';
} // eslint-disable-next-line
export function isObject(obj) {
return obj !== null && typeof obj === 'object';
} // eslint-disable-next-line
export function isFunction(obj) {
return typeof obj === 'function';
} // eslint-disable-next-line
export function isPrimitive(val) {
return typeof val === 'number' || typeof val === 'string' || typeof val === 'boolean';
} // eslint-disable-next-line
export function isNil(arg) {
return arg === null || arg === undefined;
}
export const exists = not(isNil); // eslint-disable-next-line
export function isString(arg) {
return typeof arg === 'string';
} // eslint-disable-next-line
export function isNumber(arg) {
return typeof arg === 'number';
} // eslint-disable-next-line
export function isHTMLElement(obj) {
return typeof HTMLElement === 'object' ? obj instanceof HTMLElement //DOM2
: obj && typeof isObject(obj) && obj.nodeType === 1 && typeof obj.nodeName === 'string';
}
export const constEmptyArray = constant([]);
export const constNone = constant(none);
export const constZero = constant(0);
export const constEmptyString = constant('');
export function removeListItem(E) {
return (a, as) => {
const index = as.findIndex(i => E.equals(a, i));
return index > -1 ? unsafeDeleteAt(index, as) : as;
};
}
export function toggleListItem(E) {
return (a, as) => {
const index = as.findIndex(i => E.equals(a, i));
return index > -1 ? unsafeDeleteAt(index, as) : snoc(as, a);
};
}
export function isFragment(node) {
return node.type === Fragment;
}
export function isEmptyString(str) {
return str === '';
}
function prop(key, obj) {
return obj[key];
} // eslint-disable-next-line
export function extractProp(extractor, item) {
if (isFunction(extractor)) {
return extractor(item);
} else if (isObject(item) && isString(extractor) && Object.hasOwnProperty.call(item, extractor)) {
// eslint-disable-next-line
return prop(extractor, item);
} else {
return item;
}
}
const camelizeRE = /-(\w)/g;
export function camelize(str) {
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '');
}
//# sourceMappingURL=helpers.js.map

1
node_modules/buetify/lib/utils/helpers.js.map generated vendored Executable file

File diff suppressed because one or more lines are too long

4
node_modules/buetify/lib/utils/mergeClasses.d.ts generated vendored Executable file
View File

@@ -0,0 +1,4 @@
export declare type Classes = string | {
[K: string]: boolean;
} | null | undefined | Classes[];
export declare function mergeClasses(existingClasses?: Classes, newClasses?: Classes): Classes;

12
node_modules/buetify/lib/utils/mergeClasses.js generated vendored Executable file
View File

@@ -0,0 +1,12 @@
import { identity } from 'fp-ts/lib/function';
import { isObject, isString } from './helpers';
export function mergeClasses(existingClasses, newClasses) {
if (Array.isArray(existingClasses)) {
return [...existingClasses.filter(identity), ...(Array.isArray(newClasses) ? newClasses.filter(identity) : [newClasses])];
} else if (isObject(existingClasses) || isString(existingClasses)) {
return [existingClasses, ...(Array.isArray(newClasses) ? newClasses.filter(identity) : [newClasses])];
} else {
return newClasses;
}
}
//# sourceMappingURL=mergeClasses.js.map

1
node_modules/buetify/lib/utils/mergeClasses.js.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utils/mergeClasses.ts"],"names":[],"mappings":"AAAA,SAAS,QAAT,QAAyB,oBAAzB;AACA,SAAS,QAAT,EAAmB,QAAnB,QAAmC,WAAnC;AAIA,OAAM,SAAU,YAAV,CAAuB,eAAvB,EAAkD,UAAlD,EAAsE;AAC1E,MAAI,KAAK,CAAC,OAAN,CAAc,eAAd,CAAJ,EAAoC;AAClC,WAAO,CACL,GAAG,eAAe,CAAC,MAAhB,CAAuB,QAAvB,CADE,EAEL,IAAI,KAAK,CAAC,OAAN,CAAc,UAAd,IAA4B,UAAU,CAAC,MAAX,CAAkB,QAAlB,CAA5B,GAA0D,CAAC,UAAD,CAA9D,CAFK,CAAP;AAID,GALD,MAKO,IAAI,QAAQ,CAAC,eAAD,CAAR,IAA6B,QAAQ,CAAC,eAAD,CAAzC,EAA4D;AACjE,WAAO,CAAC,eAAD,EAAkB,IAAI,KAAK,CAAC,OAAN,CAAc,UAAd,IAA4B,UAAU,CAAC,MAAX,CAAkB,QAAlB,CAA5B,GAA0D,CAAC,UAAD,CAA9D,CAAlB,CAAP;AACD,GAFM,MAEA;AACL,WAAO,UAAP;AACD;AACF","sourcesContent":["import { identity } from 'fp-ts/lib/function';\nimport { isObject, isString } from './helpers';\n\nexport type Classes = string | { [K: string]: boolean } | null | undefined | Classes[];\n\nexport function mergeClasses(existingClasses?: Classes, newClasses?: Classes): Classes {\n if (Array.isArray(existingClasses)) {\n return [\n ...existingClasses.filter(identity),\n ...(Array.isArray(newClasses) ? newClasses.filter(identity) : [newClasses])\n ];\n } else if (isObject(existingClasses) || isString(existingClasses)) {\n return [existingClasses, ...(Array.isArray(newClasses) ? newClasses.filter(identity) : [newClasses])];\n } else {\n return newClasses;\n }\n}\n"],"sourceRoot":"","file":"mergeClasses.js"}