@genexus/genexus-ide-ui 0.0.47 → 0.0.48
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/cjs/ch-icon.cjs.entry.js +116 -0
- package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
- package/dist/cjs/gx-ide-share-kb.cjs.entry.js +61 -0
- package/dist/cjs/{gxg-button.cjs.entry.js → gxg-button_2.cjs.entry.js} +61 -0
- package/dist/cjs/gxg-form-text.cjs.entry.js +51 -4
- package/dist/cjs/gxg-ide-loader.cjs.entry.js +79 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/share-kb/gx-ide-assets/share-kb/langs/share-kb.lang.en.json +12 -0
- package/dist/collection/components/share-kb/gx-ide-assets/share-kb/langs/share-kb.lang.ja.json +3 -0
- package/dist/collection/components/share-kb/gx-ide-assets/share-kb/langs/share-kb.lang.zh.json +3 -0
- package/dist/collection/components/share-kb/share-kb.css +183 -0
- package/dist/collection/components/share-kb/share-kb.js +157 -0
- package/dist/components/form-text.js +55 -4
- package/dist/components/gx-ide-share-kb.d.ts +11 -0
- package/dist/components/gx-ide-share-kb.js +152 -0
- package/dist/components/gxg-ide-loader.js +117 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/esm/ch-icon.entry.js +112 -0
- package/dist/esm/genexus-ide-ui.js +1 -1
- package/dist/esm/gx-ide-share-kb.entry.js +57 -0
- package/dist/esm/{gxg-button.entry.js → gxg-button_2.entry.js} +62 -2
- package/dist/esm/gxg-form-text.entry.js +51 -4
- package/dist/esm/gxg-ide-loader.entry.js +75 -0
- package/dist/esm/loader.js +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.css +1 -1
- package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
- package/dist/genexus-ide-ui/gx-ide-assets/share-kb/langs/share-kb.lang.en.json +12 -0
- package/dist/genexus-ide-ui/gx-ide-assets/share-kb/langs/share-kb.lang.ja.json +3 -0
- package/dist/genexus-ide-ui/gx-ide-assets/share-kb/langs/share-kb.lang.zh.json +3 -0
- package/dist/genexus-ide-ui/p-510330c9.entry.js +1 -0
- package/dist/genexus-ide-ui/p-5ad757f4.entry.js +1 -0
- package/dist/genexus-ide-ui/p-6e232a6f.entry.js +1 -0
- package/dist/genexus-ide-ui/p-9943e7db.entry.js +1 -0
- package/dist/genexus-ide-ui/p-d8d00971.entry.js +1 -0
- package/dist/node_modules/@genexus/gemini/dist/collection/components/form-text/form-text.css +8 -0
- package/dist/node_modules/@genexus/gemini/dist/collection/components/ide-loader/ide-loader.css +89 -0
- package/dist/types/common/types.d.ts +1 -0
- package/dist/types/components/create-kb-from-server/create-kb-from-server.d.ts +2 -3
- package/dist/types/components/share-kb/share-kb.d.ts +46 -0
- package/dist/types/components.d.ts +54 -0
- package/package.json +3 -3
- package/dist/cjs/ch-icon_2.cjs.entry.js +0 -177
- package/dist/esm/ch-icon_2.entry.js +0 -172
- package/dist/genexus-ide-ui/p-54d15f4d.entry.js +0 -1
- package/dist/genexus-ide-ui/p-98c6b820.entry.js +0 -1
- package/dist/genexus-ide-ui/p-a708db45.entry.js +0 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { L as Locale } from './locale.js';
|
|
3
|
+
import { f as formSubmitValidation } from './form-validation.js';
|
|
4
|
+
import { r as renderFormItems } from './common.js';
|
|
5
|
+
import { d as defineCustomElement$d } from './icon.js';
|
|
6
|
+
import { d as defineCustomElement$c } from './button.js';
|
|
7
|
+
import { d as defineCustomElement$b } from './combo-box.js';
|
|
8
|
+
import { d as defineCustomElement$a } from './combo-box-item.js';
|
|
9
|
+
import { d as defineCustomElement$9 } from './container2.js';
|
|
10
|
+
import { d as defineCustomElement$8 } from './form-checkbox.js';
|
|
11
|
+
import { d as defineCustomElement$7 } from './form-radio.js';
|
|
12
|
+
import { d as defineCustomElement$6 } from './form-text.js';
|
|
13
|
+
import { d as defineCustomElement$5 } from './icon2.js';
|
|
14
|
+
import { d as defineCustomElement$4 } from './gxg-label2.js';
|
|
15
|
+
import { d as defineCustomElement$3 } from './title.js';
|
|
16
|
+
import { d as defineCustomElement$2 } from './tooltip.js';
|
|
17
|
+
|
|
18
|
+
const shareKbCss = ".gxi-hidden{display:none !important}.gxi-full-height{height:100%}.gxi-overflow-auto{overflow:auto}.gxi-display-flex{display:flex}.align-start{display:flex;align-items:start}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.grid{display:grid;grid-row-gap:var(--gx-ide-grid-row-gap);grid-column-gap:var(--gx-ide-grid-column-gap);grid-template-rows:auto}ch-grid-cell{display:flex}ch-grid{overflow:auto;height:100%}ch-grid-column{z-index:999;border-bottom:1px solid var(--gray-01)}gxg-tabs{box-shadow:none}:host(.gx-ide-component){box-shadow:var(--box-shadow-01) !important;height:100% !important;display:flex !important;flex-direction:column !important}:host(:focus-within) gx-ide-top-bar::part(wrapper){background-color:var(--color-secondary-enabled)}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--font-weight-regular);font-size:var(--font-size-lg);line-height:1.6em;height:100%;background-color:var(--gx-ide-component-background-color);display:flex;flex-direction:column;flex-grow:1}.gx-ide-main{flex-grow:1;overflow-y:auto;}.gx-ide-main::-webkit-scrollbar{width:6px;height:6px}.gx-ide-main::-webkit-scrollbar-track{background-color:var(--gray-02);border-radius:10px}.gx-ide-main::-webkit-scrollbar-thumb{background:var(--gray-05);border-radius:10px}.gx-ide-main::-webkit-scrollbar-thumb:hover{background:var(--gray-04);cursor:pointer}.gx-ide-main .gxg-scroll{display:block;overflow-y:auto;padding-inline-end:2px}.gx-ide-overflow{overflow-y:auto;}.gx-ide-overflow::-webkit-scrollbar{width:6px;height:6px}.gx-ide-overflow::-webkit-scrollbar-track{background-color:var(--gray-02);border-radius:10px}.gx-ide-overflow::-webkit-scrollbar-thumb{background:var(--gray-05);border-radius:10px}.gx-ide-overflow::-webkit-scrollbar-thumb:hover{background:var(--gray-04);cursor:pointer}.gx-ide-overflow .gxg-scroll{display:block;overflow-y:auto;padding-inline-end:2px}:host{display:block}.main{grid-template-columns:auto 1fr;grid-template-areas:\"kb-label kb-input \" \"server-label server-input\" \"auth-type-input auth-type-input\" \"user-name-label user-name-input\" \"password-label password-input\"}.main .kb-input{grid-area:kb-input}.main .kb-name-label{grid-area:kb-label}.main .server-url-input{grid-area:server-input}.main .server-url-label{grid-area:server-label}.main .auth-type-input{grid-area:auth-type-input}.main .user-name-input{grid-area:user-name-input}.main .user-name-label{grid-area:user-name-label}.main .password-input{grid-area:password-input}.main .password-label{grid-area:password-label}";
|
|
19
|
+
|
|
20
|
+
// Define your constants
|
|
21
|
+
const AUTHENTICATION_TYPE = ["GeneXus Account", "Local"];
|
|
22
|
+
const GxIdeShareKb$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.__registerHost();
|
|
26
|
+
this.__attachShadow();
|
|
27
|
+
this.componentDidRenderEvent = createEvent(this, "componentDidRenderEvent", 7);
|
|
28
|
+
// 7.LISTENERS //
|
|
29
|
+
// 8.PUBLIC METHODS API //
|
|
30
|
+
this.createKBCallbackHandler = async () => {
|
|
31
|
+
const kbData = {
|
|
32
|
+
name: this.kbNameEl.value,
|
|
33
|
+
serverUrl: this.serverUrlEl.value,
|
|
34
|
+
authenticationType: this.authTypeEl.value,
|
|
35
|
+
user: this.userNameEl.value,
|
|
36
|
+
password: this.passwordEl.value
|
|
37
|
+
};
|
|
38
|
+
const createCallbackPromise = this.createKBCallback(kbData);
|
|
39
|
+
createCallbackPromise.then(formSubmitResult => {
|
|
40
|
+
formSubmitValidation(formSubmitResult, this);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
this.kbName = undefined;
|
|
44
|
+
this.serverUrls = undefined;
|
|
45
|
+
this.enableCustomServer = undefined;
|
|
46
|
+
this.createKBCallback = undefined;
|
|
47
|
+
}
|
|
48
|
+
// 6.COMPONENT LIFECYCLE METHODS //
|
|
49
|
+
async componentWillLoad() {
|
|
50
|
+
this._componentLocale = await Locale.getComponentStrings(this.el);
|
|
51
|
+
}
|
|
52
|
+
componentDidRender() {
|
|
53
|
+
this.componentDidRenderEvent.emit(this._componentLocale.componentName);
|
|
54
|
+
}
|
|
55
|
+
// 9.LOCAL METHODS //
|
|
56
|
+
// 10.RENDER() FUNCTION //
|
|
57
|
+
render() {
|
|
58
|
+
return (h(Host, { class: "gx-ide-component" }, h("div", { class: "gx-ide-main-wrapper gx-ide-overflow" }, h("gxg-container", { footerJustify: "end" }, h("main", { class: "main grid" }, h("gxg-label", { labelPosition: "start", class: "kb-label", noMargin: true }, this._componentLocale.main.kbName), h("gxg-form-text", { labelPosition: "start", placeholder: "SalesInventory", "max-width": "100%", value: this.kbName, ref: (el) => (this.kbNameEl = el), part: "kb-name", class: "kb-input" }), h("gxg-label", { labelPosition: "start", class: "server-url-label", noMargin: true }, this._componentLocale.main.serverUrl), h("gxg-combo-box", { disableFilter: !this.enableCustomServer, labelPosition: "start", placeholder: "https://myexampleserver.com", strict: true, "max-width": "100%", value: this.serverUrls[0], ref: (el) => (this.serverUrlEl = el), part: "server-url", class: "server-url-input" }, renderFormItems("gxg-combo-box-item", this.serverUrls.map((item) => ({
|
|
59
|
+
id: item,
|
|
60
|
+
label: item
|
|
61
|
+
})), "server-url")), h("gxg-combo-box", { labelPosition: "start", placeholder: "https://myexampleserver.com", "max-width": "100%", value: AUTHENTICATION_TYPE[0], ref: (el) => (this.authTypeEl = el), part: "auth-type", class: "auth-type-input" }, renderFormItems("gxg-combo-box-item", AUTHENTICATION_TYPE.map((item) => ({
|
|
62
|
+
id: item,
|
|
63
|
+
label: item
|
|
64
|
+
})), "auth-type")), h("gxg-label", { labelPosition: "start", class: "user-name-label", noMargin: true }, this._componentLocale.main.userName), h("gxg-form-text", { labelPosition: "start", placeholder: "My User", "max-width": "100%", ref: (el) => (this.userNameEl = el), part: "user-name", class: "user-name-input" }), h("gxg-label", { labelPosition: "start", class: "password-label", noMargin: true }, this._componentLocale.main.password), h("gxg-form-text", { labelPosition: "start", password: true, "max-width": "100%", ref: (el) => (this.passwordEl = el), part: "password", class: "password-input" })), h("gxg-button", { slot: "footer", type: "primary-text-only", onClick: this.createKBCallbackHandler }, this._componentLocale.footer.shareBtn)))));
|
|
65
|
+
}
|
|
66
|
+
static get assetsDirs() { return ["gx-ide-assets/share-kb"]; }
|
|
67
|
+
get el() { return this; }
|
|
68
|
+
static get style() { return shareKbCss; }
|
|
69
|
+
}, [1, "gx-ide-share-kb", {
|
|
70
|
+
"kbName": [1, "kb-name"],
|
|
71
|
+
"serverUrls": [16],
|
|
72
|
+
"enableCustomServer": [4, "enable-custom-server"],
|
|
73
|
+
"createKBCallback": [16]
|
|
74
|
+
}]);
|
|
75
|
+
function defineCustomElement$1() {
|
|
76
|
+
if (typeof customElements === "undefined") {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const components = ["gx-ide-share-kb", "ch-icon", "gxg-button", "gxg-combo-box", "gxg-combo-box-item", "gxg-container", "gxg-form-checkbox", "gxg-form-radio", "gxg-form-text", "gxg-icon", "gxg-label", "gxg-title", "gxg-tooltip"];
|
|
80
|
+
components.forEach(tagName => { switch (tagName) {
|
|
81
|
+
case "gx-ide-share-kb":
|
|
82
|
+
if (!customElements.get(tagName)) {
|
|
83
|
+
customElements.define(tagName, GxIdeShareKb$1);
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
case "ch-icon":
|
|
87
|
+
if (!customElements.get(tagName)) {
|
|
88
|
+
defineCustomElement$d();
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case "gxg-button":
|
|
92
|
+
if (!customElements.get(tagName)) {
|
|
93
|
+
defineCustomElement$c();
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
case "gxg-combo-box":
|
|
97
|
+
if (!customElements.get(tagName)) {
|
|
98
|
+
defineCustomElement$b();
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
case "gxg-combo-box-item":
|
|
102
|
+
if (!customElements.get(tagName)) {
|
|
103
|
+
defineCustomElement$a();
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
case "gxg-container":
|
|
107
|
+
if (!customElements.get(tagName)) {
|
|
108
|
+
defineCustomElement$9();
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
case "gxg-form-checkbox":
|
|
112
|
+
if (!customElements.get(tagName)) {
|
|
113
|
+
defineCustomElement$8();
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
case "gxg-form-radio":
|
|
117
|
+
if (!customElements.get(tagName)) {
|
|
118
|
+
defineCustomElement$7();
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
case "gxg-form-text":
|
|
122
|
+
if (!customElements.get(tagName)) {
|
|
123
|
+
defineCustomElement$6();
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
case "gxg-icon":
|
|
127
|
+
if (!customElements.get(tagName)) {
|
|
128
|
+
defineCustomElement$5();
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
case "gxg-label":
|
|
132
|
+
if (!customElements.get(tagName)) {
|
|
133
|
+
defineCustomElement$4();
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
case "gxg-title":
|
|
137
|
+
if (!customElements.get(tagName)) {
|
|
138
|
+
defineCustomElement$3();
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
case "gxg-tooltip":
|
|
142
|
+
if (!customElements.get(tagName)) {
|
|
143
|
+
defineCustomElement$2();
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
} });
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const GxIdeShareKb = GxIdeShareKb$1;
|
|
150
|
+
const defineCustomElement = defineCustomElement$1;
|
|
151
|
+
|
|
152
|
+
export { GxIdeShareKb, defineCustomElement };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$4 } from './ch-window2.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './ch-window-close2.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './title.js';
|
|
5
|
+
|
|
6
|
+
const ideLoaderCss = ":host(.gxg--disabled) .form-element,:host(.gxg--disabled.form-element){pointer-events:none;background-color:var(--gxg-background-color--disabled) !important;color:var(--gxg-color--disabled) !important;border-color:var(--gxg-border-color--disabled) !important;cursor:default !important}:host{display:block}ch-window::part(mask){overflow:hidden}ch-window::part(main){height:100%}ch-window::part(window){width:100%;height:100%}.loader-wrapper{opacity:0;transition:var(--show-transition) opacity;width:100%;height:100%;display:flex;background-color:rgba(var(--color-background--rgb), 0.45);backdrop-filter:blur(15px);padding:var(--spacing-comp-05);flex-direction:column;gap:var(--spacing-comp-04);align-items:center;justify-content:center;box-sizing:border-box;-webkit-animation:wrapper 0.6s infinite alternate;animation:wrapper 0.6s infinite alternate;color:var(--color-on-secondary)}.loader-wrapper--visible{opacity:1}.loader-spinner{border:2px var(--gray-01) solid;border-top:2px var(--color-primary-enabled) solid;border-radius:50%;-webkit-animation:spinner 0.6s infinite linear;animation:spinner 0.6s infinite linear;width:30px;height:30px}.loader-description{max-width:400px;text-align:center}@keyframes wrapper{from{background-color:rgba(var(--color-background--rgb), 0.45)}to{background-color:rgba(var(--gray-02--rgb), 0.25)}}@-webkit-keyframes spinner{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@keyframes spinner{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}";
|
|
7
|
+
|
|
8
|
+
const IdeLoader = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
/*
|
|
14
|
+
INDEX:
|
|
15
|
+
1.OWN PROPERTIES
|
|
16
|
+
2.REFERENCE TO ELEMENTS
|
|
17
|
+
3.STATE() VARIABLES
|
|
18
|
+
4.PUBLIC PROPERTY API | WATCH'S
|
|
19
|
+
5.EVENTS (EMIT)
|
|
20
|
+
6.COMPONENT LIFECYCLE EVENTS
|
|
21
|
+
7.LISTENERS
|
|
22
|
+
8.PUBLIC METHODS API
|
|
23
|
+
9.LOCAL METHODS
|
|
24
|
+
10.RENDER() FUNCTION
|
|
25
|
+
*/
|
|
26
|
+
// 1.OWN PROPERTIES //
|
|
27
|
+
/**
|
|
28
|
+
* The transition speed for displaying/hiding the ch-window
|
|
29
|
+
*/
|
|
30
|
+
this.showTransition = 200;
|
|
31
|
+
// 3.STATE() VARIABLES //
|
|
32
|
+
/**
|
|
33
|
+
* shows the ch-window
|
|
34
|
+
*/
|
|
35
|
+
this.showWindow = false;
|
|
36
|
+
/**
|
|
37
|
+
* shows the '.loader-wrapper'
|
|
38
|
+
*/
|
|
39
|
+
this.showWrapper = false;
|
|
40
|
+
/**
|
|
41
|
+
* It shows the loader
|
|
42
|
+
*/
|
|
43
|
+
this.show = false;
|
|
44
|
+
}
|
|
45
|
+
showHandler(show) {
|
|
46
|
+
const timeout = 50;
|
|
47
|
+
if (show) {
|
|
48
|
+
this.showWindow = true;
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
this.showWrapper = true;
|
|
51
|
+
}, timeout);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.showWrapper = false;
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
this.showWindow = false;
|
|
57
|
+
}, this.showTransition);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// 5.EVENTS (EMIT) //
|
|
61
|
+
// 6.COMPONENT LIFECYCLE EVENTS //
|
|
62
|
+
// 7.LISTENERS //
|
|
63
|
+
// 8.PUBLIC METHODS API //
|
|
64
|
+
// 9.LOCAL METHODS //
|
|
65
|
+
// 10.RENDER() FUNCTION //
|
|
66
|
+
render() {
|
|
67
|
+
console.log(this.showTransition);
|
|
68
|
+
return (h(Host, null, h("ch-window", { closeOnEscape: false, closeOnOutsideClick: false, container: this.container, hidden: !this.showWindow, modal: false, showFooter: false, showHeader: false, style: { "--show-transition": `${this.showTransition}ms` } }, h("div", { class: {
|
|
69
|
+
"loader-wrapper": true,
|
|
70
|
+
"loader-wrapper--visible": this.showWrapper,
|
|
71
|
+
} }, h("div", { class: "loader-spinner" }), this.description ? (h("gxg-title", { class: "loader-description", type: "title-04", alignment: "center" }, this.description)) : // <gxg-title>{this.description}</gxg-title>
|
|
72
|
+
null))));
|
|
73
|
+
}
|
|
74
|
+
static get watchers() { return {
|
|
75
|
+
"show": ["showHandler"]
|
|
76
|
+
}; }
|
|
77
|
+
static get style() { return ideLoaderCss; }
|
|
78
|
+
}, [1, "gxg-ide-loader", {
|
|
79
|
+
"description": [1],
|
|
80
|
+
"show": [4],
|
|
81
|
+
"container": [16],
|
|
82
|
+
"showWindow": [32],
|
|
83
|
+
"showWrapper": [32]
|
|
84
|
+
}]);
|
|
85
|
+
function defineCustomElement$1() {
|
|
86
|
+
if (typeof customElements === "undefined") {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const components = ["gxg-ide-loader", "ch-window", "ch-window-close", "gxg-title"];
|
|
90
|
+
components.forEach(tagName => { switch (tagName) {
|
|
91
|
+
case "gxg-ide-loader":
|
|
92
|
+
if (!customElements.get(tagName)) {
|
|
93
|
+
customElements.define(tagName, IdeLoader);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
case "ch-window":
|
|
97
|
+
if (!customElements.get(tagName)) {
|
|
98
|
+
defineCustomElement$4();
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
case "ch-window-close":
|
|
102
|
+
if (!customElements.get(tagName)) {
|
|
103
|
+
defineCustomElement$3();
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
case "gxg-title":
|
|
107
|
+
if (!customElements.get(tagName)) {
|
|
108
|
+
defineCustomElement$2();
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
} });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const GxgIdeLoader = IdeLoader;
|
|
115
|
+
const defineCustomElement = defineCustomElement$1;
|
|
116
|
+
|
|
117
|
+
export { GxgIdeLoader, defineCustomElement };
|
|
@@ -10,6 +10,7 @@ export { GxIdeNewKb as GxIdeNewKb } from '../types/components/new-kb/new-kb';
|
|
|
10
10
|
export { GxIdeNewObject as GxIdeNewObject } from '../types/components/new-object/new-object';
|
|
11
11
|
export { GxIdeObjectSelector as GxIdeObjectSelector } from '../types/components/object-selector/object-selector';
|
|
12
12
|
export { GxIdeReferences as GxIdeReferences } from '../types/components/references/references';
|
|
13
|
+
export { GxIdeShareKb as GxIdeShareKb } from '../types/components/share-kb/share-kb';
|
|
13
14
|
export { GxIdeTeamDevCommit as GxIdeTeamDevCommit } from '../types/components/team-dev-commit/team-dev-commit';
|
|
14
15
|
export { GxIdeTeamDevSelectRecentComment as GxIdeTeamDevSelectRecentComment } from '../types/components/team-dev-select-recent-comment/team-dev-select-recent-comment';
|
|
15
16
|
export { GxIdeTeamDevUpdate as GxIdeTeamDevUpdate } from '../types/components/team-dev-update/team-dev-update';
|
package/dist/components/index.js
CHANGED
|
@@ -72,6 +72,7 @@ export { GxIdeNewKb, defineCustomElement as defineCustomElementGxIdeNewKb } from
|
|
|
72
72
|
export { GxIdeNewObject, defineCustomElement as defineCustomElementGxIdeNewObject } from './gx-ide-new-object.js';
|
|
73
73
|
export { GxIdeObjectSelector, defineCustomElement as defineCustomElementGxIdeObjectSelector } from './gx-ide-object-selector.js';
|
|
74
74
|
export { GxIdeReferences, defineCustomElement as defineCustomElementGxIdeReferences } from './gx-ide-references.js';
|
|
75
|
+
export { GxIdeShareKb, defineCustomElement as defineCustomElementGxIdeShareKb } from './gx-ide-share-kb.js';
|
|
75
76
|
export { GxIdeTeamDevCommit, defineCustomElement as defineCustomElementGxIdeTeamDevCommit } from './gx-ide-team-dev-commit.js';
|
|
76
77
|
export { GxIdeTeamDevSelectRecentComment, defineCustomElement as defineCustomElementGxIdeTeamDevSelectRecentComment } from './gx-ide-team-dev-select-recent-comment.js';
|
|
77
78
|
export { GxIdeTeamDevUpdate, defineCustomElement as defineCustomElementGxIdeTeamDevUpdate } from './gx-ide-team-dev-update.js';
|
|
@@ -115,6 +116,7 @@ export { GxgFormText, defineCustomElement as defineCustomElementGxgFormText } fr
|
|
|
115
116
|
export { GxgFormTextarea, defineCustomElement as defineCustomElementGxgFormTextarea } from './gxg-form-textarea.js';
|
|
116
117
|
export { GxgGrid, defineCustomElement as defineCustomElementGxgGrid } from './gxg-grid.js';
|
|
117
118
|
export { GxgIcon, defineCustomElement as defineCustomElementGxgIcon } from './gxg-icon.js';
|
|
119
|
+
export { GxgIdeLoader, defineCustomElement as defineCustomElementGxgIdeLoader } from './gxg-ide-loader.js';
|
|
118
120
|
export { GxgLabel, defineCustomElement as defineCustomElementGxgLabel } from './gxg-label.js';
|
|
119
121
|
export { GxgListBox, defineCustomElement as defineCustomElementGxgListBox } from './gxg-list-box.js';
|
|
120
122
|
export { GxgListBoxItem, defineCustomElement as defineCustomElementGxgListBoxItem } from './gxg-list-box-item.js';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-0da01575.js';
|
|
2
|
+
|
|
3
|
+
const iconContent = new Map();
|
|
4
|
+
const requests = new Map();
|
|
5
|
+
function getSvgContent(url) {
|
|
6
|
+
// see if we already have a request for this url
|
|
7
|
+
let request = requests.get(url);
|
|
8
|
+
if (!request) {
|
|
9
|
+
// we don't already have a request
|
|
10
|
+
request = fetch(url).then(response => {
|
|
11
|
+
if (response.ok) {
|
|
12
|
+
return response.text().then(svgContent => {
|
|
13
|
+
iconContent.set(url, svgContent);
|
|
14
|
+
return svgContent;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
iconContent.set(url, "");
|
|
18
|
+
});
|
|
19
|
+
// cache for the same requests
|
|
20
|
+
requests.set(url, request);
|
|
21
|
+
}
|
|
22
|
+
return request;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const iconCss = ":host(:not([auto-color])){}:host(:not([auto-color])) svg *{fill:var(--icon-color) !important}:host(:not([auto-color])) path.icons01{fill:var(--icons01-enabled)}:host(:not([auto-color])) path.icons02{fill:var(--icons02-enabled)}:host(:not([auto-color])) path.icons03{fill:var(--icons03-enabled)}:host(:not([auto-color])) path.icons04{fill:var(--icons04-enabled)}:host(:not([auto-color])) path.icons05{fill:var(--icons05-enabled)}:host(:not([auto-color])) path.icons06{fill:var(--icons06-enabled)}:host(:not([auto-color])) path.icons07{fill:var(--icons07-enabled)}:host(:not([auto-color])) path.icons08{fill:var(--icons08-enabled)}:host(:not([auto-color])) path.icons09{fill:var(--icons09-enabled)}:host{display:inline-flex;line-height:0}:host svg{width:var(--icon-size);height:var(--icon-size)}";
|
|
26
|
+
|
|
27
|
+
const ChIcon = class {
|
|
28
|
+
constructor(hostRef) {
|
|
29
|
+
registerInstance(this, hostRef);
|
|
30
|
+
/**
|
|
31
|
+
* If enabled, the icon will be loaded lazily when it's visible in the viewport.
|
|
32
|
+
*/
|
|
33
|
+
this.lazy = false;
|
|
34
|
+
/**
|
|
35
|
+
* If enabled, the icon will display its inherent/natural color
|
|
36
|
+
*/
|
|
37
|
+
this.autoColor = false;
|
|
38
|
+
/**
|
|
39
|
+
* The URL of the icon.
|
|
40
|
+
*/
|
|
41
|
+
this.src = "";
|
|
42
|
+
/**
|
|
43
|
+
* The size of the icon. Possible values: regular, small.
|
|
44
|
+
*/
|
|
45
|
+
this.size = "regular";
|
|
46
|
+
this.isVisible = false;
|
|
47
|
+
}
|
|
48
|
+
/** *******************************
|
|
49
|
+
METHODS
|
|
50
|
+
*********************************/
|
|
51
|
+
connectedCallback() {
|
|
52
|
+
// purposely do not return the promise here because loading
|
|
53
|
+
// the svg file should not hold up loading the app
|
|
54
|
+
// only load the svg if it's visible
|
|
55
|
+
this.waitUntilVisible(this.element, "50px", () => {
|
|
56
|
+
this.isVisible = true;
|
|
57
|
+
this.getIcon();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
disconnectedCallback() {
|
|
61
|
+
if (this.io !== undefined) {
|
|
62
|
+
this.io.disconnect();
|
|
63
|
+
this.io = undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
waitUntilVisible(el, rootMargin, callback) {
|
|
67
|
+
if (this.lazy &&
|
|
68
|
+
typeof window !== "undefined" &&
|
|
69
|
+
window.IntersectionObserver) {
|
|
70
|
+
const io = (this.io = new window.IntersectionObserver((data) => {
|
|
71
|
+
if (data[0].isIntersecting) {
|
|
72
|
+
io.disconnect();
|
|
73
|
+
this.io = undefined;
|
|
74
|
+
callback();
|
|
75
|
+
}
|
|
76
|
+
}, { rootMargin }));
|
|
77
|
+
io.observe(el);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
// browser doesn't support IntersectionObserver
|
|
81
|
+
// so just fallback to always show it
|
|
82
|
+
callback();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async getIcon() {
|
|
86
|
+
if (this.isVisible) {
|
|
87
|
+
if (this.src) {
|
|
88
|
+
if (iconContent.has(this.src)) {
|
|
89
|
+
this.svgContent = iconContent.get(this.src);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.svgContent = await getSvgContent(this.src);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this.svgContent = "";
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
return h("div", { innerHTML: this.svgContent });
|
|
103
|
+
}
|
|
104
|
+
static get assetsDirs() { return ["ch-icon-assets"]; }
|
|
105
|
+
get element() { return getElement(this); }
|
|
106
|
+
static get watchers() { return {
|
|
107
|
+
"src": ["getIcon"]
|
|
108
|
+
}; }
|
|
109
|
+
};
|
|
110
|
+
ChIcon.style = iconCss;
|
|
111
|
+
|
|
112
|
+
export { ChIcon as ch_icon };
|