@genexus/mercury 0.16.0 → 0.17.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/dist/bundles.d.ts +11 -6
- package/dist/bundles.js +1 -1
- package/package.json +1 -1
package/dist/bundles.d.ts
CHANGED
|
@@ -298,10 +298,10 @@ export declare const getThemeBundles: (basePath: string, bundleNamePrefix?: stri
|
|
|
298
298
|
readonly attachStyleSheet: boolean;
|
|
299
299
|
}];
|
|
300
300
|
/**
|
|
301
|
-
* Given the bundles array and the basePath (optional), returns the
|
|
302
|
-
* bundles in the format of type `ThemeModel`.
|
|
301
|
+
* Given the bundles array and the basePath or options (optional), returns the
|
|
302
|
+
* given bundles in the format of type `ThemeModel`.
|
|
303
303
|
*
|
|
304
|
-
* This is useful for
|
|
304
|
+
* This is useful for loading the themes in a component. Example:
|
|
305
305
|
*
|
|
306
306
|
* ```tsx
|
|
307
307
|
* const CSS_BUNDLES: ThemeModel = getBundles(
|
|
@@ -315,8 +315,7 @@ export declare const getThemeBundles: (basePath: string, bundleNamePrefix?: stri
|
|
|
315
315
|
* "utils/form",
|
|
316
316
|
* "utils/layout",
|
|
317
317
|
* ],
|
|
318
|
-
* "
|
|
319
|
-
* "mercury" (optional)
|
|
318
|
+
* "/assets/css/" or { basePath: "/assets/css/", bundleNamePrefix: ..., bundleMappings: ... }, (optional)
|
|
320
319
|
* );
|
|
321
320
|
*
|
|
322
321
|
* HTML/render/template:
|
|
@@ -326,12 +325,18 @@ export declare const getThemeBundles: (basePath: string, bundleNamePrefix?: stri
|
|
|
326
325
|
* </Host>
|
|
327
326
|
* ```
|
|
328
327
|
*/
|
|
329
|
-
export declare const getBundles: (bundles: MercuryBundleOptimized[] | MercuryBundleFull[],
|
|
328
|
+
export declare const getBundles: (bundles: MercuryBundleOptimized[] | MercuryBundleFull[], optionsOrBasePath?: string | {
|
|
329
|
+
basePath?: string;
|
|
330
|
+
bundleNamePrefix?: string;
|
|
331
|
+
bundleMappings?: MercuryBundleMapping;
|
|
332
|
+
}) => ThemeModel;
|
|
330
333
|
/**
|
|
331
334
|
* Establish the mapping between the bundle name and its generated hash.
|
|
332
335
|
*
|
|
333
336
|
* If the bundles are created with the CLI that provides Mercury
|
|
334
337
|
* (`mercury` command), this mapping must be set to download the right bundles
|
|
335
338
|
* with the ch-theme component.
|
|
339
|
+
*
|
|
340
|
+
* After that, the `getBundles` utility can be used.
|
|
336
341
|
*/
|
|
337
342
|
export declare const setBundleMapping: (mappings: MercuryBundleMapping) => void;
|
package/dist/bundles.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";let s;const
|
|
1
|
+
"use strict";let s;const c=(o,n)=>{const{attachStyleSheet:t,bundleName:l,bundleNamePrefix:p,bundleMappings:m}=n,e=p?p+l:l,u=m??s,g=u?u[l]:l,d=`${o}${g}.css`;return t===void 0?{name:e,url:d}:{name:e,url:d,attachStyleSheet:t}};export const getThemeBundles=(o,n)=>[c(o,{bundleName:"components/accordion",bundleNamePrefix:n}),c(o,{bundleName:"components/button",bundleNamePrefix:n}),c(o,{bundleName:"components/chat",bundleNamePrefix:n}),c(o,{bundleName:"components/checkbox",bundleNamePrefix:n}),c(o,{bundleName:"components/code",bundleNamePrefix:n}),c(o,{bundleName:"components/combo-box",bundleNamePrefix:n}),c(o,{bundleName:"components/flexible-layout",bundleNamePrefix:n}),c(o,{bundleName:"components/dialog",bundleNamePrefix:n}),c(o,{bundleName:"components/dropdown",bundleNamePrefix:n}),c(o,{bundleName:"components/icon",bundleNamePrefix:n}),c(o,{bundleName:"components/edit",bundleNamePrefix:n}),c(o,{bundleName:"components/layout-splitter",bundleNamePrefix:n}),c(o,{bundleName:"components/list-box",bundleNamePrefix:n}),c(o,{bundleName:"components/markdown-viewer",bundleNamePrefix:n,attachStyleSheet:!1}),c(o,{bundleName:"components/navigation-list",bundleNamePrefix:n}),c(o,{bundleName:"components/pills",bundleNamePrefix:n}),c(o,{bundleName:"components/radio-group",bundleNamePrefix:n}),c(o,{bundleName:"components/segmented-control",bundleNamePrefix:n}),c(o,{bundleName:"components/sidebar",bundleNamePrefix:n}),c(o,{bundleName:"components/slider",bundleNamePrefix:n}),c(o,{bundleName:"components/switch",bundleNamePrefix:n}),c(o,{bundleName:"components/tab",bundleNamePrefix:n}),c(o,{bundleName:"components/tabular-grid",bundleNamePrefix:n}),c(o,{bundleName:"components/ticket-list",bundleNamePrefix:n}),c(o,{bundleName:"components/tooltip",bundleNamePrefix:n}),c(o,{bundleName:"components/tree-view",bundleNamePrefix:n}),c(o,{bundleName:"components/widget",bundleNamePrefix:n}),c(o,{bundleName:"resets/box-sizing",bundleNamePrefix:n}),c(o,{bundleName:"utils/form",bundleNamePrefix:n}),c(o,{bundleName:"utils/elevation",bundleNamePrefix:n}),c(o,{bundleName:"utils/form--full",bundleNamePrefix:n}),c(o,{bundleName:"utils/layout",bundleNamePrefix:n}),c(o,{bundleName:"utils/spacing",bundleNamePrefix:n}),c(o,{bundleName:"utils/typography",bundleNamePrefix:n}),c(o,{bundleName:"chameleon/scrollbar",bundleNamePrefix:n})];const y=(o,n)=>n?o.map(t=>n+t):o;export const getBundles=(o,n)=>{let t,l,p;return typeof n=="object"?(t=n.basePath,l=n.bundleNamePrefix,p=n.bundleMappings):t=n,t?o.map(m=>c(t,{bundleName:m,bundleNamePrefix:l,bundleMappings:p})):y(o,l)},setBundleMapping=o=>{s=o};
|
package/package.json
CHANGED