@melodicdev/components 1.6.0 → 1.6.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/assets/melodic-components.js +112 -44
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +1185 -1128
- package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
- package/lib/components/data-display/table/table.styles.js +18 -7
- package/package.json +1 -1
- package/lib/bundle.d.ts +0 -59
- package/lib/bundle.d.ts.map +0 -1
- package/lib/bundle.js +0 -68
- package/lib/components/data-display/empty-state/index.d.ts +0 -2
- package/lib/components/data-display/empty-state/index.d.ts.map +0 -1
- package/lib/components/data-display/empty-state/index.js +0 -2
- package/lib/components/data-display/stat/index.d.ts +0 -2
- package/lib/components/data-display/stat/index.d.ts.map +0 -1
- package/lib/components/data-display/stat/index.js +0 -2
- package/lib/components/feedback/skeleton/index.d.ts +0 -2
- package/lib/components/feedback/skeleton/index.d.ts.map +0 -1
- package/lib/components/feedback/skeleton/index.js +0 -2
- package/lib/components/foundation/grid/index.d.ts +0 -2
- package/lib/components/foundation/grid/index.d.ts.map +0 -1
- package/lib/components/foundation/grid/index.js +0 -2
- package/lib/components/general/icon/fonts/phosphor/bold/Phosphor-Bold.svg +0 -3057
- package/lib/components/general/icon/fonts/phosphor/bold/Phosphor-Bold.ttf +0 -0
- package/lib/components/general/icon/fonts/phosphor/bold/Phosphor-Bold.woff +0 -0
- package/lib/components/general/icon/fonts/phosphor/bold/Phosphor-Bold.woff2 +0 -0
- package/lib/components/general/icon/fonts/phosphor/bold/style.css +0 -4627
- package/lib/components/general/icon/fonts/phosphor/duotone/Phosphor-Duotone.svg +0 -3054
- package/lib/components/general/icon/fonts/phosphor/duotone/Phosphor-Duotone.ttf +0 -0
- package/lib/components/general/icon/fonts/phosphor/duotone/Phosphor-Duotone.woff +0 -0
- package/lib/components/general/icon/fonts/phosphor/duotone/Phosphor-Duotone.woff2 +0 -0
- package/lib/components/general/icon/fonts/phosphor/duotone/style.css +0 -12115
- package/lib/components/general/icon/fonts/phosphor/fill/Phosphor-Fill.svg +0 -3057
- package/lib/components/general/icon/fonts/phosphor/fill/Phosphor-Fill.ttf +0 -0
- package/lib/components/general/icon/fonts/phosphor/fill/Phosphor-Fill.woff +0 -0
- package/lib/components/general/icon/fonts/phosphor/fill/Phosphor-Fill.woff2 +0 -0
- package/lib/components/general/icon/fonts/phosphor/fill/style.css +0 -4627
- package/lib/components/general/icon/fonts/phosphor/light/Phosphor-Light.svg +0 -3057
- package/lib/components/general/icon/fonts/phosphor/light/Phosphor-Light.ttf +0 -0
- package/lib/components/general/icon/fonts/phosphor/light/Phosphor-Light.woff +0 -0
- package/lib/components/general/icon/fonts/phosphor/light/Phosphor-Light.woff2 +0 -0
- package/lib/components/general/icon/fonts/phosphor/light/style.css +0 -4627
- package/lib/components/general/icon/fonts/phosphor/regular/Phosphor.svg +0 -3056
- package/lib/components/general/icon/fonts/phosphor/regular/Phosphor.ttf +0 -0
- package/lib/components/general/icon/fonts/phosphor/regular/Phosphor.woff +0 -0
- package/lib/components/general/icon/fonts/phosphor/regular/Phosphor.woff2 +0 -0
- package/lib/components/general/icon/fonts/phosphor/regular/style.css +0 -4627
- package/lib/components/general/icon/fonts/phosphor/thin/Phosphor-Thin.svg +0 -3057
- package/lib/components/general/icon/fonts/phosphor/thin/Phosphor-Thin.ttf +0 -0
- package/lib/components/general/icon/fonts/phosphor/thin/Phosphor-Thin.woff +0 -0
- package/lib/components/general/icon/fonts/phosphor/thin/Phosphor-Thin.woff2 +0 -0
- package/lib/components/general/icon/fonts/phosphor/thin/style.css +0 -4627
- package/lib/components/general/icon/icon.registry.d.ts +0 -32
- package/lib/components/general/icon/icon.registry.d.ts.map +0 -1
- package/lib/components/general/icon/icon.registry.js +0 -45
- package/lib/components/general/icon/icon.types.d.ts +0 -8
- package/lib/components/general/icon/icon.types.d.ts.map +0 -1
- package/lib/components/general/icon/icon.types.js +0 -1
- package/lib/components/general/icon/phosphor-fonts.d.ts +0 -12
- package/lib/components/general/icon/phosphor-fonts.d.ts.map +0 -1
- package/lib/components/general/icon/phosphor-fonts.js +0 -77
- package/lib/components/general/icon/phosphor.d.ts +0 -41
- package/lib/components/general/icon/phosphor.d.ts.map +0 -1
- package/lib/components/general/icon/phosphor.js +0 -42
- package/lib/components/overlays/modal/index.d.ts +0 -2
- package/lib/components/overlays/modal/index.d.ts.map +0 -1
- package/lib/components/overlays/modal/index.js +0 -2
- package/lib/forms-adapters.d.ts +0 -2
- package/lib/forms-adapters.d.ts.map +0 -1
- package/lib/forms-adapters.js +0 -105
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IconWeight, IconDefinition } from './icon.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Icon registry for storing and retrieving icon SVG content.
|
|
4
|
-
* Icons are keyed by "name:weight" (e.g., "check:regular", "x:bold")
|
|
5
|
-
*/
|
|
6
|
-
declare class IconRegistry {
|
|
7
|
-
private readonly _icons;
|
|
8
|
-
private getKey;
|
|
9
|
-
/**
|
|
10
|
-
* Register a single icon
|
|
11
|
-
*/
|
|
12
|
-
register(name: string, svg: string, weight?: IconWeight): void;
|
|
13
|
-
/**
|
|
14
|
-
* Register multiple icons at once
|
|
15
|
-
*/
|
|
16
|
-
registerMany(icons: IconDefinition[]): void;
|
|
17
|
-
/**
|
|
18
|
-
* Get an icon's SVG content
|
|
19
|
-
*/
|
|
20
|
-
get(name: string, weight?: IconWeight): string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Check if an icon is registered
|
|
23
|
-
*/
|
|
24
|
-
has(name: string, weight?: IconWeight): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Get all registered icon keys
|
|
27
|
-
*/
|
|
28
|
-
list(): string[];
|
|
29
|
-
}
|
|
30
|
-
export declare const iconRegistry: IconRegistry;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=icon.registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon.registry.d.ts","sourceRoot":"","sources":["../../../../src/components/general/icon/icon.registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAElE;;;GAGG;AACH,cAAM,YAAY;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAEpD,OAAO,CAAC,MAAM;IAId;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,UAAsB,GAAG,IAAI;IAIzE;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI;IAM3C;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,UAAsB,GAAG,MAAM,GAAG,SAAS;IAIrE;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,UAAsB,GAAG,OAAO;IAI1D;;OAEG;IACH,IAAI,IAAI,MAAM,EAAE;CAGhB;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Icon registry for storing and retrieving icon SVG content.
|
|
3
|
-
* Icons are keyed by "name:weight" (e.g., "check:regular", "x:bold")
|
|
4
|
-
*/
|
|
5
|
-
class IconRegistry {
|
|
6
|
-
constructor() {
|
|
7
|
-
this._icons = new Map();
|
|
8
|
-
}
|
|
9
|
-
getKey(name, weight = 'regular') {
|
|
10
|
-
return `${name}:${weight}`;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Register a single icon
|
|
14
|
-
*/
|
|
15
|
-
register(name, svg, weight = 'regular') {
|
|
16
|
-
this._icons.set(this.getKey(name, weight), svg);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Register multiple icons at once
|
|
20
|
-
*/
|
|
21
|
-
registerMany(icons) {
|
|
22
|
-
for (const icon of icons) {
|
|
23
|
-
this.register(icon.name, icon.svg, icon.weight ?? 'regular');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get an icon's SVG content
|
|
28
|
-
*/
|
|
29
|
-
get(name, weight = 'regular') {
|
|
30
|
-
return this._icons.get(this.getKey(name, weight));
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Check if an icon is registered
|
|
34
|
-
*/
|
|
35
|
-
has(name, weight = 'regular') {
|
|
36
|
-
return this._icons.has(this.getKey(name, weight));
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Get all registered icon keys
|
|
40
|
-
*/
|
|
41
|
-
list() {
|
|
42
|
-
return Array.from(this._icons.keys());
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export const iconRegistry = new IconRegistry();
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type IconWeight = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
|
|
2
|
-
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
-
export interface IconDefinition {
|
|
4
|
-
name: string;
|
|
5
|
-
svg: string;
|
|
6
|
-
weight?: IconWeight;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=icon.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon.types.d.ts","sourceRoot":"","sources":["../../../../src/components/general/icon/icon.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpF,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,UAAU,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { IconWeight } from './icon.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get the URL for a Phosphor font weight stylesheet.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getPhosphorFontUrl(weight?: IconWeight): string;
|
|
6
|
-
/**
|
|
7
|
-
* Ensure Phosphor font styles are available in a shadow root.
|
|
8
|
-
* Injects a <link> element that the browser loads natively.
|
|
9
|
-
*/
|
|
10
|
-
export declare function ensurePhosphorFontStyles(weight?: IconWeight): void;
|
|
11
|
-
export declare function getPhosphorFontClass(weight?: IconWeight): string;
|
|
12
|
-
//# sourceMappingURL=phosphor-fonts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"phosphor-fonts.d.ts","sourceRoot":"","sources":["../../../../src/components/general/icon/phosphor-fonts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA+ClD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,UAAsB,GAAG,MAAM,CAEzE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,GAAE,UAAsB,GAAG,IAAI,CA8B7E;AAED,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,UAAsB,GAAG,MAAM,CAE3E"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { registerGlobalStyles } from '@melodicdev/core';
|
|
2
|
-
const phosphorWeightCss = {
|
|
3
|
-
thin: './fonts/phosphor/thin/style.css',
|
|
4
|
-
light: './fonts/phosphor/light/style.css',
|
|
5
|
-
regular: './fonts/phosphor/regular/style.css',
|
|
6
|
-
bold: './fonts/phosphor/bold/style.css',
|
|
7
|
-
fill: './fonts/phosphor/fill/style.css',
|
|
8
|
-
duotone: './fonts/phosphor/duotone/style.css'
|
|
9
|
-
};
|
|
10
|
-
const phosphorWeightClass = {
|
|
11
|
-
thin: 'ph-thin',
|
|
12
|
-
light: 'ph-light',
|
|
13
|
-
regular: 'ph',
|
|
14
|
-
bold: 'ph-bold',
|
|
15
|
-
fill: 'ph-fill',
|
|
16
|
-
duotone: 'ph-duotone'
|
|
17
|
-
};
|
|
18
|
-
const weightStates = new Map();
|
|
19
|
-
const supportsConstructableStylesheets = () => 'adoptedStyleSheets' in Document.prototype && 'replaceSync' in CSSStyleSheet.prototype;
|
|
20
|
-
const ensureWeightState = (weight) => {
|
|
21
|
-
let state = weightStates.get(weight);
|
|
22
|
-
if (!state) {
|
|
23
|
-
state = { loaded: false };
|
|
24
|
-
weightStates.set(weight, state);
|
|
25
|
-
}
|
|
26
|
-
return state;
|
|
27
|
-
};
|
|
28
|
-
const absolutizeFontUrls = (cssText, cssUrl) => {
|
|
29
|
-
const baseUrl = new URL('.', cssUrl).href;
|
|
30
|
-
return cssText.replace(/url\((['"]?)\.\/(.*?)\1\)/g, (_match, quote, file) => {
|
|
31
|
-
const url = `${baseUrl}${file}`;
|
|
32
|
-
return `url(${quote}${url}${quote})`;
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Get the URL for a Phosphor font weight stylesheet.
|
|
37
|
-
*/
|
|
38
|
-
export function getPhosphorFontUrl(weight = 'regular') {
|
|
39
|
-
return new URL(phosphorWeightCss[weight], import.meta.url).href;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Ensure Phosphor font styles are available in a shadow root.
|
|
43
|
-
* Injects a <link> element that the browser loads natively.
|
|
44
|
-
*/
|
|
45
|
-
export function ensurePhosphorFontStyles(weight = 'regular') {
|
|
46
|
-
if (typeof document === 'undefined') {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const state = ensureWeightState(weight);
|
|
50
|
-
if (state.loaded || state.loading) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const cssUrl = getPhosphorFontUrl(weight);
|
|
54
|
-
state.loading = fetch(cssUrl)
|
|
55
|
-
.then((response) => response.text())
|
|
56
|
-
.then((cssText) => {
|
|
57
|
-
const resolvedCss = absolutizeFontUrls(cssText, cssUrl);
|
|
58
|
-
if (supportsConstructableStylesheets()) {
|
|
59
|
-
const sheet = new CSSStyleSheet();
|
|
60
|
-
sheet.replaceSync(resolvedCss);
|
|
61
|
-
registerGlobalStyles(sheet);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
registerGlobalStyles(resolvedCss);
|
|
65
|
-
}
|
|
66
|
-
state.loaded = true;
|
|
67
|
-
})
|
|
68
|
-
.catch((error) => {
|
|
69
|
-
console.warn(`Failed to load Phosphor font styles: ${weight}`, error);
|
|
70
|
-
})
|
|
71
|
-
.finally(() => {
|
|
72
|
-
state.loading = undefined;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
export function getPhosphorFontClass(weight = 'regular') {
|
|
76
|
-
return phosphorWeightClass[weight] ?? phosphorWeightClass.regular;
|
|
77
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { IconWeight } from './icon.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Register a Phosphor icon with pre-loaded SVG content.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* // With Vite's ?raw imports (bundles SVG at build time):
|
|
8
|
-
* import checkSvg from '@phosphor-icons/core/regular/check.svg?raw';
|
|
9
|
-
* import checkBoldSvg from '@phosphor-icons/core/bold/check.svg?raw';
|
|
10
|
-
*
|
|
11
|
-
* registerPhosphorIcon('check', checkSvg);
|
|
12
|
-
* registerPhosphorIcon('check', checkBoldSvg, 'bold');
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export declare function registerPhosphorIcon(name: string, svg: string, weight?: IconWeight): void;
|
|
16
|
-
/**
|
|
17
|
-
* Register multiple Phosphor icons at once.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* import checkSvg from '@phosphor-icons/core/regular/check.svg?raw';
|
|
22
|
-
* import xSvg from '@phosphor-icons/core/regular/x.svg?raw';
|
|
23
|
-
* import warningSvg from '@phosphor-icons/core/fill/warning.svg?raw';
|
|
24
|
-
*
|
|
25
|
-
* registerPhosphorIcons([
|
|
26
|
-
* { name: 'check', svg: checkSvg },
|
|
27
|
-
* { name: 'x', svg: xSvg },
|
|
28
|
-
* { name: 'warning', svg: warningSvg, weight: 'fill' }
|
|
29
|
-
* ]);
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function registerPhosphorIcons(icons: Array<{
|
|
33
|
-
name: string;
|
|
34
|
-
svg: string;
|
|
35
|
-
weight?: IconWeight;
|
|
36
|
-
}>): void;
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated Use registerPhosphorIcon instead
|
|
39
|
-
*/
|
|
40
|
-
export declare const registerPhosphorIconSync: typeof registerPhosphorIcon;
|
|
41
|
-
//# sourceMappingURL=phosphor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"phosphor.d.ts","sourceRoot":"","sources":["../../../../src/components/general/icon/phosphor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,UAAsB,GAC5B,IAAI,CAEN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC,GAC9D,IAAI,CAIN;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,6BAAuB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { iconRegistry } from './icon.registry.js';
|
|
2
|
-
/**
|
|
3
|
-
* Register a Phosphor icon with pre-loaded SVG content.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* // With Vite's ?raw imports (bundles SVG at build time):
|
|
8
|
-
* import checkSvg from '@phosphor-icons/core/regular/check.svg?raw';
|
|
9
|
-
* import checkBoldSvg from '@phosphor-icons/core/bold/check.svg?raw';
|
|
10
|
-
*
|
|
11
|
-
* registerPhosphorIcon('check', checkSvg);
|
|
12
|
-
* registerPhosphorIcon('check', checkBoldSvg, 'bold');
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export function registerPhosphorIcon(name, svg, weight = 'regular') {
|
|
16
|
-
iconRegistry.register(name, svg, weight);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Register multiple Phosphor icons at once.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* import checkSvg from '@phosphor-icons/core/regular/check.svg?raw';
|
|
24
|
-
* import xSvg from '@phosphor-icons/core/regular/x.svg?raw';
|
|
25
|
-
* import warningSvg from '@phosphor-icons/core/fill/warning.svg?raw';
|
|
26
|
-
*
|
|
27
|
-
* registerPhosphorIcons([
|
|
28
|
-
* { name: 'check', svg: checkSvg },
|
|
29
|
-
* { name: 'x', svg: xSvg },
|
|
30
|
-
* { name: 'warning', svg: warningSvg, weight: 'fill' }
|
|
31
|
-
* ]);
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export function registerPhosphorIcons(icons) {
|
|
35
|
-
for (const icon of icons) {
|
|
36
|
-
iconRegistry.register(icon.name, icon.svg, icon.weight ?? 'regular');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated Use registerPhosphorIcon instead
|
|
41
|
-
*/
|
|
42
|
-
export const registerPhosphorIconSync = registerPhosphorIcon;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/modal/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,KAAK,IAAK,CAAC"}
|
package/lib/forms-adapters.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forms-adapters.d.ts","sourceRoot":"","sources":["../src/forms-adapters.ts"],"names":[],"mappings":"AA+FA,wBAAgB,2BAA2B,IAAI,IAAI,CAiBlD"}
|
package/lib/forms-adapters.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { registerAdapter } from '@melodicdev/core/forms';
|
|
2
|
-
const valueTextInputAdapter = {
|
|
3
|
-
inputEvent: 'ml:input',
|
|
4
|
-
blurEvent: 'focusout',
|
|
5
|
-
getValue(element) {
|
|
6
|
-
return element.value ?? '';
|
|
7
|
-
},
|
|
8
|
-
setValue(element, value) {
|
|
9
|
-
element.value = value !== null && value !== undefined ? String(value) : '';
|
|
10
|
-
},
|
|
11
|
-
setDisabled(element, disabled) {
|
|
12
|
-
element.disabled = disabled;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
const valueChangeInputAdapter = {
|
|
16
|
-
inputEvent: 'ml:change',
|
|
17
|
-
blurEvent: 'focusout',
|
|
18
|
-
getValue(element) {
|
|
19
|
-
return element.value ?? '';
|
|
20
|
-
},
|
|
21
|
-
setValue(element, value) {
|
|
22
|
-
element.value = value !== null && value !== undefined ? String(value) : '';
|
|
23
|
-
},
|
|
24
|
-
setDisabled(element, disabled) {
|
|
25
|
-
element.disabled = disabled;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const selectInputAdapter = {
|
|
29
|
-
inputEvent: 'ml:change',
|
|
30
|
-
blurEvent: 'focusout',
|
|
31
|
-
getValue(element) {
|
|
32
|
-
const el = element;
|
|
33
|
-
return el.multiple ? (el.values ?? []) : (el.value ?? '');
|
|
34
|
-
},
|
|
35
|
-
setValue(element, value) {
|
|
36
|
-
const el = element;
|
|
37
|
-
if (Array.isArray(value)) {
|
|
38
|
-
el.values = value;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
el.value = value !== null && value !== undefined ? String(value) : '';
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
setDisabled(element, disabled) {
|
|
45
|
-
element.disabled = disabled;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const booleanCheckedAdapter = {
|
|
49
|
-
inputEvent: 'ml:change',
|
|
50
|
-
blurEvent: 'focusout',
|
|
51
|
-
getValue(element) {
|
|
52
|
-
return Boolean(element.checked);
|
|
53
|
-
},
|
|
54
|
-
setValue(element, value) {
|
|
55
|
-
element.checked = Boolean(value);
|
|
56
|
-
},
|
|
57
|
-
setDisabled(element, disabled) {
|
|
58
|
-
element.disabled = disabled;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const numberValueAdapter = {
|
|
62
|
-
inputEvent: 'ml:input',
|
|
63
|
-
blurEvent: 'focusout',
|
|
64
|
-
getValue(element) {
|
|
65
|
-
return Number(element.value) || 0;
|
|
66
|
-
},
|
|
67
|
-
setValue(element, value) {
|
|
68
|
-
element.value = Number(value) || 0;
|
|
69
|
-
},
|
|
70
|
-
setDisabled(element, disabled) {
|
|
71
|
-
element.disabled = disabled;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
const datePickerAdapter = {
|
|
75
|
-
inputEvent: 'ml:select',
|
|
76
|
-
blurEvent: 'focusout',
|
|
77
|
-
getValue(element) {
|
|
78
|
-
return element.value ?? '';
|
|
79
|
-
},
|
|
80
|
-
setValue(element, value) {
|
|
81
|
-
element.value = value !== null && value !== undefined ? String(value) : '';
|
|
82
|
-
},
|
|
83
|
-
setDisabled(element, disabled) {
|
|
84
|
-
element.disabled = disabled;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
let registered = false;
|
|
88
|
-
export function registerMelodicFormAdapters() {
|
|
89
|
-
if (registered)
|
|
90
|
-
return;
|
|
91
|
-
registered = true;
|
|
92
|
-
const tagMatcher = (tag) => (el) => el.tagName === tag;
|
|
93
|
-
registerAdapter(tagMatcher('ML-INPUT'), valueTextInputAdapter);
|
|
94
|
-
registerAdapter(tagMatcher('ML-TEXTAREA'), valueTextInputAdapter);
|
|
95
|
-
registerAdapter(tagMatcher('ML-SLIDER'), numberValueAdapter);
|
|
96
|
-
registerAdapter(tagMatcher('ML-SELECT'), selectInputAdapter);
|
|
97
|
-
registerAdapter(tagMatcher('ML-AUTOCOMPLETE'), selectInputAdapter);
|
|
98
|
-
registerAdapter(tagMatcher('ML-CHECKBOX'), booleanCheckedAdapter);
|
|
99
|
-
registerAdapter(tagMatcher('ML-TOGGLE'), booleanCheckedAdapter);
|
|
100
|
-
registerAdapter(tagMatcher('ML-RADIO-GROUP'), valueChangeInputAdapter);
|
|
101
|
-
registerAdapter(tagMatcher('ML-DATE-PICKER'), datePickerAdapter);
|
|
102
|
-
registerAdapter(tagMatcher('ML-TIME-PICKER'), valueChangeInputAdapter);
|
|
103
|
-
registerAdapter(tagMatcher('ML-DATE-TIME-PICKER'), valueChangeInputAdapter);
|
|
104
|
-
}
|
|
105
|
-
registerMelodicFormAdapters();
|