@genexus/mercury 0.3.5 → 0.4.0
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/README.md +28 -0
- package/dist/assets-manager.d.ts +16 -15
- package/dist/assets-manager.js +20 -5
- package/dist/bundles/css/all.css +1 -0
- package/dist/bundles/css/base/base.css +1 -0
- package/dist/bundles/css/base/icons.css +1 -0
- package/dist/bundles/css/components/button.css +1 -0
- package/dist/bundles/css/components/checkbox.css +1 -0
- package/dist/bundles/css/components/code.css +1 -0
- package/dist/bundles/css/components/combo-box.css +1 -0
- package/dist/bundles/css/components/dialog.css +1 -0
- package/dist/bundles/css/components/edit.css +1 -0
- package/dist/bundles/css/components/radio-group.css +1 -0
- package/dist/bundles/css/components/tab.css +1 -0
- package/dist/bundles/css/components/tabular-grid.css +1 -0
- package/dist/bundles/css/components/tree-view.css +1 -0
- package/dist/bundles/css/resets/box-sizing.css +1 -0
- package/dist/bundles/css/utils/form--full.css +1 -0
- package/dist/bundles/css/utils/form.css +1 -0
- package/dist/bundles/css/utils/layout.css +1 -0
- package/dist/bundles/css/utils/typography.css +1 -0
- package/dist/bundles/scss/all.scss +4 -0
- package/dist/bundles/scss/base/base.scss +24 -0
- package/dist/bundles/scss/base/icons.scss +4 -0
- package/dist/bundles/scss/components/button.scss +8 -0
- package/dist/bundles/scss/components/checkbox.scss +3 -0
- package/dist/bundles/scss/components/code.scss +3 -0
- package/dist/bundles/scss/components/combo-box.scss +3 -0
- package/dist/bundles/scss/components/dialog.scss +3 -0
- package/dist/bundles/scss/components/edit.scss +3 -0
- package/dist/bundles/scss/components/radio-group.scss +3 -0
- package/dist/bundles/scss/components/tab.scss +3 -0
- package/dist/bundles/scss/components/tabular-grid.scss +10 -0
- package/dist/bundles/scss/components/tree-view.scss +3 -0
- package/dist/bundles/scss/resets/box-sizing.scss +3 -0
- package/dist/bundles/scss/utils/form--full.scss +16 -0
- package/dist/bundles/scss/utils/form.scss +4 -0
- package/dist/bundles/scss/utils/layout.scss +4 -0
- package/dist/bundles/scss/utils/typography.scss +9 -0
- package/dist/bundles.d.ts +71 -0
- package/dist/bundles.js +40 -0
- package/dist/mercury.scss +10236 -1168
- package/package.json +4 -3
- package/dist/css/mercury.css +0 -21805
- package/dist/css/mercury.css.map +0 -1
package/README.md
CHANGED
|
@@ -72,3 +72,31 @@ npm i @genexus/mercury
|
|
|
72
72
|
]
|
|
73
73
|
});
|
|
74
74
|
```
|
|
75
|
+
|
|
76
|
+
- Using the bundles from this repository.
|
|
77
|
+
|
|
78
|
+
1. Install `sass` dependency to transpile the bundles.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm i -D sass
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
2. Add a config file in your project to determine the path to the assets.
|
|
85
|
+
Include the following configuration:
|
|
86
|
+
|
|
87
|
+
```scss
|
|
88
|
+
$icons-path: "assets/custom/path/icons/";
|
|
89
|
+
$font-face-path: "assets/custom/path/fonts/";
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. Run the following command to transpile the bundles with the new path for the assets:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npx sass --load-path=path/to/config/file/directory --no-source-map --style compressed node_modules/@genexus/mercury/dist/bundles/scss:untracked-folder/bundles
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For example:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx sass --load-path=src --no-source-map --style compressed node_modules/@genexus/mercury/dist/bundles/scss:untracked-folder/bundles
|
|
102
|
+
```
|
package/dist/assets-manager.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { GxImageMultiState, TreeViewImagePathCallback } from "@genexus/chameleon-controls-library";
|
|
2
|
+
import { RegistryGetImagePathCallback } from "@genexus/chameleon-controls-library/dist/types/index";
|
|
3
|
+
export { MercuryBundleBase, MercuryBundleComponent, MercuryBundleComponentForm, MercuryBundleFull, MercuryBundleOptimized, MercuryBundleReset, MercuryBundleUtil, MercuryBundleUtilFormFull, MercuryBundles } from "./bundles.js";
|
|
4
|
+
export { getThemeBundles } from "./bundles.js";
|
|
1
5
|
export type AssetsMetadata = {
|
|
2
6
|
category: string;
|
|
3
7
|
name: string;
|
|
@@ -48,13 +52,6 @@ export type AssetsColorType = {
|
|
|
48
52
|
export interface AssetsIconMetadata {
|
|
49
53
|
name: string;
|
|
50
54
|
}
|
|
51
|
-
export type ImageMultiState = {
|
|
52
|
-
base: string;
|
|
53
|
-
hover?: string;
|
|
54
|
-
active?: string;
|
|
55
|
-
focus?: string;
|
|
56
|
-
disabled?: string;
|
|
57
|
-
};
|
|
58
55
|
/**
|
|
59
56
|
* Given a vendor and its assets, it register the assets of the vendor. After
|
|
60
57
|
* the registration, the `getAsset` function can be used to retrieve any assets
|
|
@@ -80,11 +77,15 @@ export declare const getIconPath: (iconMetadata: AssetsMetadata, vendorAlias?: s
|
|
|
80
77
|
* transforms both metadata into a string that contains the given information.
|
|
81
78
|
*/
|
|
82
79
|
export declare const getIconPathExpanded: (iconMetadata: AssetsMetadata, iconMetadataExpanded: AssetsMetadata, vendorAlias?: string) => `${string}/${string}/${string}${string}:${string}/${string}/${string}${string}`;
|
|
83
|
-
export declare const getImagePathCallback: (iconPath: string) =>
|
|
84
|
-
export declare const getTreeViewImagePathCallback:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
export declare const getImagePathCallback: (iconPath: string) => GxImageMultiState | undefined;
|
|
81
|
+
export declare const getTreeViewImagePathCallback: TreeViewImagePathCallback;
|
|
82
|
+
/**
|
|
83
|
+
* This object is used to register the getImagePathCallback definitions for all
|
|
84
|
+
* controls in Chameleon.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* registryProperty("getImagePathCallback", getImagePathCallbackDefinitions);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare const getImagePathCallbackDefinitions: RegistryGetImagePathCallback;
|
package/dist/assets-manager.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { MERCURY_ASSETS } from "./assets/MERCURY_ASSETS";
|
|
1
|
+
import { MERCURY_ASSETS } from "./assets/MERCURY_ASSETS.js";
|
|
2
|
+
export { getThemeBundles } from "./bundles.js";
|
|
2
3
|
const ASSETS_BY_VENDOR = {};
|
|
3
4
|
const ALIAS_TO_VENDOR_NAME = {};
|
|
4
5
|
const SEPARATOR = "/";
|
|
@@ -117,12 +118,12 @@ export const getImagePathCallback = (iconPath) => {
|
|
|
117
118
|
}
|
|
118
119
|
return result;
|
|
119
120
|
};
|
|
120
|
-
export const getTreeViewImagePathCallback = (item,
|
|
121
|
-
if ((!item.startImgSrc &&
|
|
122
|
-
(!item.endImgSrc &&
|
|
121
|
+
export const getTreeViewImagePathCallback = (item, iconDirection) => {
|
|
122
|
+
if ((!item.startImgSrc && iconDirection === "start") ||
|
|
123
|
+
(!item.endImgSrc && iconDirection === "end")) {
|
|
123
124
|
return undefined;
|
|
124
125
|
}
|
|
125
|
-
const imgSrc =
|
|
126
|
+
const imgSrc = iconDirection === "start" ? item.startImgSrc : item.endImgSrc;
|
|
126
127
|
// Split the path into the collapsed (default) and expanded
|
|
127
128
|
const collapsedAndExpandedSrc = imgSrc.split(EXPANDED_SEPARATOR);
|
|
128
129
|
const defaultPath = getImagePathCallback(collapsedAndExpandedSrc[0]);
|
|
@@ -137,5 +138,19 @@ export const getTreeViewImagePathCallback = (item, direction) => {
|
|
|
137
138
|
}
|
|
138
139
|
: { default: defaultPath };
|
|
139
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* This object is used to register the getImagePathCallback definitions for all
|
|
143
|
+
* controls in Chameleon.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* registryProperty("getImagePathCallback", getImagePathCallbackDefinitions);
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
export const getImagePathCallbackDefinitions = {
|
|
151
|
+
"ch-edit": getImagePathCallback,
|
|
152
|
+
"ch-image": getImagePathCallback,
|
|
153
|
+
"ch-tree-view-render": getTreeViewImagePathCallback
|
|
154
|
+
};
|
|
140
155
|
// Initialize Mercury at the start
|
|
141
156
|
registerAssets("Mercury", MERCURY_ALIAS, MERCURY_ASSETS);
|