Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mercury/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"license": "MIT",
"devDependencies": {
"@atao60/fse-cli": "^0.1.9",
"@genexus/chameleon-controls-library": "6.0.0-next.46",
"@genexus/chameleon-controls-library": "6.0.0-next.47",
"@genexus/svg-sass-generator": "1.1.24",
"chokidar": "^3.6.0",
"chokidar-cli": "^3.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/mercury/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 33 additions & 81 deletions packages/mercury/showcase/accordion.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/mercury/showcase/all.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/mercury/showcase/assets/scripts/scripts-header.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BUTTON_ICONS } from "./icons-showcase-paths.js";
// All definitions in this script are used for local testing purposes
// only. The IDE Web's SDK implements all this and more
import { defineCustomElements } from "https://unpkg.com/@genexus/chameleon-controls-library@6.0.0-next.46/dist/esm/loader.js";
import { registryProperty } from "https://unpkg.com/@genexus/chameleon-controls-library@6.0.0-next.46/dist/esm/index.js";
import { defineCustomElements } from "https://unpkg.com/@genexus/chameleon-controls-library@6.0.0-next.47/dist/esm/loader.js";
import { registryProperty } from "https://unpkg.com/@genexus/chameleon-controls-library@6.0.0-next.47/dist/esm/index.js";
import {
getImagePathCallbackDefinitions,
getIconPath
Expand Down
115 changes: 58 additions & 57 deletions packages/mercury/showcase/assets/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,73 +612,74 @@ const includeBundleButtonV2 = () => {
let chImage;
let buttonCaption;

if (bundleValue.length !== 0) {
// Icons references
COPY_ICON = getIconPath({
category: "system",
name: "copy",
colorType: "primary"
});
CHECK_ICON = getIconPath({
category: "system",
name: "check",
colorType: "primary"
});
WARNING_ICON = getIconPath({
category: "system",
name: "warning",
colorType: "primary"
});
}
// Icons references
COPY_ICON = getIconPath({
category: "system",
name: "copy",
colorType: "primary"
});
CHECK_ICON = getIconPath({
category: "system",
name: "check",
colorType: "primary"
});
WARNING_ICON = getIconPath({
category: "system",
name: "warning",
colorType: "primary"
});

// Create and add the ch-image element
if (bundleValue.length !== 0) {
chImage = document.createElement("ch-image");
chImage.className = "icon-md";
chImage.src = COPY_ICON;
}
chImage = document.createElement("ch-image");
chImage.className = "icon-md";
chImage.src = COPY_ICON;

// "copy bundle" container (for Label + Button)
const copyBundleContainer = document.createElement("div");
copyBundleContainer.classList.add("copy-bundle__container");

// "copy bundle" label
const copyBundleLabel = document.createElement("label");
copyBundleLabel.classList.add("copy-bundle__label");
copyBundleLabel.textContent = "Bundle:";

// Create the "copy bundle" button
const copyBundleButton = document.createElement("button");
copyBundleButton.className = "button-tertiary button-icon-and-text";
if (bundleValue.length !== 0) {
buttonCaption = `Copy ${PAGE_TITLE} Bundle`;
} else {
buttonCaption = `No Bundle Required For ${PAGE_TITLE}`;
}
buttonCaption = `${bundleValue}`;

console.log(buttonCaption);

const buttonCaptionTextNode = document.createTextNode(buttonCaption);

if (bundleValue.length !== 0) {
copyBundleButton.addEventListener("click", e => {
navigator.clipboard
.writeText(`"${bundleValue}"`)
.then(() => {
chImage.nextSibling.textContent = "Bundle Copied!";
chImage.src = CHECK_ICON;
e.target.style.pointerEvents = "none";
})
.catch(err => {
chImage.nextSibling.textContent = "Failed to Copy";
chImage.src = WARNING_ICON;
e.target.style.pointerEvents = "none";
});
setTimeout(() => {
chImage.nextSibling.textContent = buttonCaption;
chImage.src = COPY_ICON;
e.target.style.pointerEvents = "auto";
}, 1500);
});
}
copyBundleButton.addEventListener("click", e => {
navigator.clipboard
.writeText(`"${bundleValue}"`)
.then(() => {
chImage.previousSibling.textContent = "Copied!";
chImage.src = CHECK_ICON;
e.target.style.pointerEvents = "none";
})
.catch(err => {
chImage.previousSibling.textContent = "Failed to Copy";
chImage.src = WARNING_ICON;
e.target.style.pointerEvents = "none";
});
setTimeout(() => {
chImage.previousSibling.textContent = buttonCaption;
chImage.src = COPY_ICON;
e.target.style.pointerEvents = "auto";
}, 1500);
});

// Appends
if (bundleValue.length !== 0) {
copyBundleButton.appendChild(chImage);
chImage.after(buttonCaptionTextNode);
} else {
copyBundleButton.innerText = buttonCaption;
copyBundleButton.disabled = true;
}
topBarRef.appendChild(copyBundleButton);
copyBundleButton.appendChild(buttonCaptionTextNode);
copyBundleButton.appendChild(chImage);
// chImage.after(buttonCaptionTextNode);
copyBundleContainer.appendChild(copyBundleLabel);
copyBundleContainer.appendChild(copyBundleButton);

topBarRef.appendChild(copyBundleContainer);
}
};

Expand Down
16 changes: 0 additions & 16 deletions packages/mercury/showcase/assets/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,22 +276,6 @@ Top Bar
filter: brightness(1.2);
}

/*====================
Main Header
====================*/
.bundle-container {
border-block-end: 1px solid var(--mer-surface__elevation--01);
block-size: var(--sc-top-bar__height);
background-color: var(--mer-color__surface);
z-index: 99;
display: grid;
align-items: center;
text-transform: capitalize;
position: fixed;
top: var(--sc-top-bar__height);
inline-size: calc(100vw - var(--sc-sidebar__width));
}

/*====================
Container
====================*/
Expand Down
23 changes: 23 additions & 0 deletions packages/mercury/showcase/assets/styles/top-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,26 @@
.container__top-bar a {
text-decoration: none !important;
}

/*copy bundle*/
.copy-bundle__label {
font-size: var(--control__font-size--regular);
color: var(--mer-text__on-disabled);
}
.copy-bundle__container {
display: flex;
align-items: center;
}

/* .bundle-container {
border-block-end: 1px solid var(--mer-surface__elevation--01);
block-size: var(--sc-top-bar__height);
background-color: var(--mer-color__surface);
z-index: 99;
display: grid;
align-items: center;
text-transform: capitalize;
position: fixed;
top: var(--sc-top-bar__height);
inline-size: calc(100vw - var(--sc-sidebar__width));
} */
8 changes: 4 additions & 4 deletions packages/mercury/showcase/combo-box.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ <h1 class="section__title">combo box</h1>
<div class="article__content">
<ch-combo-box-render
accessible-name="Colors"
id="combo-box-3"
id="combo-box-4"
class="combo-box combo-box-error scrollable"
></ch-combo-box-render>
<script type="module">
import { comboBox1Model } from "./assets/models/combo-box.js";
const comboBox3 = document.getElementById("combo-box-3");
comboBox3.model = comboBox1Model;
comboBox3.placeholder = "Option";
const comboBox4 = document.getElementById("combo-box-4");
comboBox4.model = comboBox1Model;
comboBox4.placeholder = "Option";
// comboBox1.filterType = "caption";
</script>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/mercury/showcase/list-box.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1 class="section__title">list box</h1>
<div class="article__code">
<ch-code language="tsx" class="code"> </ch-code>
<script>
code = `<ch-action-list-render class="list-box"><ch-action-list-render>`;
code = `<ch-action-list-render class="list-box"></ch-action-list-render>`;
</script>
</div>
<!-- /.article__content -->
Expand Down Expand Up @@ -99,7 +99,7 @@ <h1 class="section__title">list box</h1>
<div class="article__code">
<ch-code language="tsx" class="code"> </ch-code>
<script>
code = `<ch-action-list-render class="list-box"><ch-action-list-render>`;
code = `<ch-action-list-render class="list-box"></ch-action-list-render>`;
</script>
</div>
<!-- /.article__content -->
Expand Down
Loading
Loading