@genexus/genexus-ide-ui 3.2.20 → 3.2.21

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.
Files changed (24) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-db-properties-configurator.cjs.entry.js +15 -5
  3. package/dist/cjs/gx-ide-db-properties-configurator.cjs.entry.js.map +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/components/db-properties-configurator/db-properties-configurator.css +2 -7
  6. package/dist/collection/components/db-properties-configurator/db-properties-configurator.js +40 -5
  7. package/dist/collection/components/db-properties-configurator/db-properties-configurator.js.map +1 -1
  8. package/dist/collection/components/db-properties-configurator/gx-ide-assets/db-properties-configurator/shortcuts.json +15 -0
  9. package/dist/components/gx-ide-db-properties-configurator.js +18 -7
  10. package/dist/components/gx-ide-db-properties-configurator.js.map +1 -1
  11. package/dist/esm/genexus-ide-ui.js +1 -1
  12. package/dist/esm/gx-ide-db-properties-configurator.entry.js +16 -6
  13. package/dist/esm/gx-ide-db-properties-configurator.entry.js.map +1 -1
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  16. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  17. package/dist/genexus-ide-ui/gx-ide-assets/db-properties-configurator/shortcuts.json +15 -0
  18. package/dist/genexus-ide-ui/p-9cf62f0a.entry.js +292 -0
  19. package/dist/genexus-ide-ui/p-9cf62f0a.entry.js.map +1 -0
  20. package/dist/types/components/db-properties-configurator/db-properties-configurator.d.ts +4 -0
  21. package/dist/types/components.d.ts +4 -0
  22. package/package.json +1 -1
  23. package/dist/genexus-ide-ui/p-e759cfdb.entry.js +0 -281
  24. package/dist/genexus-ide-ui/p-e759cfdb.entry.js.map +0 -1
@@ -0,0 +1,292 @@
1
+ import { r as e, g as t, h as i, H as s, a as o } from "./p-9b9ccd0c.js";
2
+
3
+ import { g as a } from "./p-d42e842b.js";
4
+
5
+ import "./p-6534555e.js";
6
+
7
+ import "lit";
8
+
9
+ import "lit/directives/when.js";
10
+
11
+ import "lit/directives/if-defined.js";
12
+
13
+ import { L as n } from "./p-311eedf3.js";
14
+
15
+ import { c as r } from "./p-c5196b3b.js";
16
+
17
+ const c = "button.button-secondary{border-color:var(--color-border-neutral-default)}:host{display:grid;block-size:100%;overflow:hidden;grid-template-rows:max-content 1fr max-content;background-color:var(--color-accent-surface-elevation-1);color:var(--color-text-neutral-default)}.section{display:contents}.hero{display:flex;align-items:flex-start;gap:var(--spacing-gap-xl);padding-block:var(--spacing-padding-l);padding-inline:var(--spacing-padding-l);border-block-end:var(--size-1) solid var(--color-border-surface-on-elevation-1)}.hero__text{flex:1;min-inline-size:0}.hero__description{margin-block:var(--spacing-gap-xs) 0;margin-inline:0;color:var(--color-text-neutral-neutral)}.hero__badge{flex:none;display:grid;place-items:center;pointer-events:none;inline-size:44px;block-size:44px;border-radius:var(--border-radius-m);background-color:var(--color-accent-item-hover);color:var(--color-icon-primary-default)}.main{overflow:auto;display:flex;flex-direction:column;gap:var(--spacing-gap-xxl);padding-block:var(--spacing-padding-l);padding-inline:var(--spacing-padding-l)}.field-section{display:flex;flex-direction:column;gap:var(--spacing-gap-l)}.field-section+.field-section{padding-block-start:var(--spacing-padding-xl);border-block-start:var(--size-1) solid var(--color-border-surface-on-elevation-1)}.field-section__head{display:flex;align-items:baseline;gap:var(--spacing-gap-m)}.field-section__title{font-family:var(--font-family-body);font-weight:var(--font-style-semi-bold);font-size:var(--font-size-caption-m);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-neutral-neutral)}.fields{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:var(--spacing-gap-l)}.field--full{grid-column:1/-1}.field--checkbox{display:flex;flex-direction:column;gap:var(--spacing-gap-xs)}.field--checkbox .field__row{display:flex;align-items:center;gap:var(--spacing-gap-xs)}.field--checkbox .label{margin:0;cursor:pointer}.field--checkbox .field__hint{margin:0;margin-inline-start:calc(var(--spacing-gap-m) + var(--spacing-gap-m));color:var(--color-text-neutral-disabled);text-wrap:pretty}.footer{padding-block:var(--spacing-padding-m);padding-inline:var(--spacing-padding-l)}";
18
+
19
+ var l = undefined && undefined.__classPrivateFieldGet || function(e, t, i, s) {
20
+ if (i === "a" && !s) throw new TypeError("Private accessor was defined without a getter");
21
+ if (typeof t === "function" ? e !== t || !s : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
22
+ return i === "m" ? s : i === "a" ? s.call(e) : s ? s.value : t.get(e);
23
+ };
24
+
25
+ var d = undefined && undefined.__classPrivateFieldSet || function(e, t, i, s, o) {
26
+ if (s === "m") throw new TypeError("Private method is not writable");
27
+ if (s === "a" && !o) throw new TypeError("Private accessor was defined without a setter");
28
+ if (typeof t === "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
29
+ return s === "a" ? o.call(e, i) : o ? o.value = i : t.set(e, i), i;
30
+ };
31
+
32
+ var p, h, u, f, b, g, v, m, x, w, y, k, _, W;
33
+
34
+ const M = [ "resets/box-sizing", "components/button", "components/combo-box", "components/edit", "components/icon", "utils/form", "utils/layout", "utils/typography", "utils/spacing", "chameleon/scrollbar" ];
35
+
36
+ const j = a({
37
+ category: "system",
38
+ name: "database",
39
+ colorType: "primary"
40
+ });
41
+
42
+ /**
43
+ * Name of the property that toggles integrated security. Its presence in
44
+ * `properties` is what drives the rendering of the Authentication section.
45
+ */ const z = "TRUSTED_CONNECTION";
46
+
47
+ const C = "USER_ID";
48
+
49
+ const E = "USER_PASSWORD";
50
+
51
+ /** Category that groups the authentication-related fields. */ const T = "authentication";
52
+
53
+ const I = class {
54
+ constructor(s) {
55
+ e(this, s);
56
+ // eslint-disable-next-line @stencil-community/own-props-must-be-private
57
+ p.set(this, void 0);
58
+ h.set(this, void 0);
59
+ u.set(this, t(`./gx-ide-assets/db-properties-configurator/shortcuts.json`));
60
+ f.set(this, (e => {
61
+ var t;
62
+ return (t = e.value) !== null && t !== void 0 ? t : "";
63
+ }));
64
+ b.set(this, (() => {
65
+ var e;
66
+ return ((e = this.properties) !== null && e !== void 0 ? e : []).some((e => e.missing && l(this, f, "f").call(this, e).trim() === ""));
67
+ }));
68
+ g.set(this, (e => {
69
+ var t;
70
+ return ((t = e.standardValues) !== null && t !== void 0 ? t : []).map((e => ({
71
+ value: e,
72
+ caption: e
73
+ })));
74
+ }));
75
+ v.set(this, (e => {
76
+ var t;
77
+ return e.name === z || e.name === C || e.name === E || ((t = e.category) === null || t === void 0 ? void 0 : t.toLowerCase()) === T;
78
+ }));
79
+ /** Whether the host sent the TRUSTED_CONNECTION property. Only then is the
80
+ * Authentication section rendered. */ m.set(this, (() => {
81
+ var e;
82
+ return ((e = this.properties) !== null && e !== void 0 ? e : []).some((e => e.name === z));
83
+ }));
84
+ x.set(this, (e => t => {
85
+ var i, s;
86
+ const o = t.detail;
87
+ const a = typeof o === "string" ? o : (s = (i = t.target) === null || i === void 0 ? void 0 : i.value) !== null && s !== void 0 ? s : "";
88
+ this.propertyChangeCallback(e, a);
89
+ }));
90
+ w.set(this, (() => {
91
+ var e;
92
+ (e = this.cancelCallback) === null || e === void 0 ? void 0 : e.call(this);
93
+ }));
94
+ y.set(this, (() => {
95
+ var e;
96
+ if (l(this, b, "f").call(this)) {
97
+ return;
98
+ }
99
+ (e = this.confirmCallback) === null || e === void 0 ? void 0 : e.call(this);
100
+ }));
101
+ // #region Renders
102
+ k.set(this, (e => {
103
+ const t = `field-${e.name}`;
104
+ const s = l(this, f, "f").call(this, e);
105
+ switch (e.control) {
106
+ case "password":
107
+ return i("ch-edit", {
108
+ id: t,
109
+ class: "input",
110
+ type: "password",
111
+ showPasswordButton: true,
112
+ debounce: r.inputDebounce,
113
+ value: s,
114
+ onInput: l(this, x, "f").call(this, e.name)
115
+ });
116
+
117
+ case "combo":
118
+ return i("ch-combo-box-render", {
119
+ id: t,
120
+ class: "combo-box",
121
+ value: s,
122
+ model: l(this, g, "f").call(this, e),
123
+ onInput: l(this, x, "f").call(this, e.name),
124
+ onChange: l(this, x, "f").call(this, e.name)
125
+ });
126
+
127
+ case "checkbox":
128
+ return i("ch-checkbox", {
129
+ id: t,
130
+ class: "checkbox",
131
+ value: s,
132
+ checkedValue: "Yes",
133
+ unCheckedValue: "No",
134
+ onInput: l(this, x, "f").call(this, e.name)
135
+ });
136
+
137
+ case "combo-editable":
138
+ return i("ch-combo-box-render", {
139
+ id: t,
140
+ class: "combo-box",
141
+ suggest: true,
142
+ suggestDebounce: r.inputDebounce,
143
+ value: s,
144
+ model: l(this, g, "f").call(this, e),
145
+ onInput: l(this, x, "f").call(this, e.name),
146
+ onChange: l(this, x, "f").call(this, e.name),
147
+ part: `combo-box combo-box--editable combo-box--${e.name}`
148
+ });
149
+
150
+ case "custom":
151
+ case "readonly":
152
+ return i("ch-edit", {
153
+ id: t,
154
+ class: "input",
155
+ readonly: true,
156
+ value: s,
157
+ part: `input input--${e.control} input--${e.name}`
158
+ });
159
+
160
+ // "text"
161
+ default:
162
+ return i("ch-edit", {
163
+ id: t,
164
+ class: "input",
165
+ debounce: r.inputDebounce,
166
+ value: s,
167
+ onInput: l(this, x, "f").call(this, e.name),
168
+ part: `input input--text input--${e.name}`
169
+ });
170
+ }
171
+ }));
172
+ _.set(this, (e => {
173
+ const t = `field-${e.name}`;
174
+ const s = e.control === "readonly" || e.control === "custom";
175
+ const o = e.control === "checkbox";
176
+ if (o) {
177
+ return i("div", {
178
+ class: "field field--checkbox field--full",
179
+ key: e.name
180
+ }, i("div", {
181
+ class: "field__row"
182
+ }, l(this, k, "f").call(this, e), i("label", {
183
+ class: "label",
184
+ htmlFor: t
185
+ }, e.label)), e.description && i("p", {
186
+ class: "field__hint body-regular-s"
187
+ }, e.description));
188
+ }
189
+ return i("div", {
190
+ class: "field field-block",
191
+ key: e.name
192
+ }, i("label", {
193
+ class: {
194
+ label: true,
195
+ "label--disabled": s
196
+ },
197
+ htmlFor: t
198
+ }, e.label), l(this, k, "f").call(this, e));
199
+ }));
200
+ W.set(this, ((e, t) => i("section", {
201
+ class: "field-section"
202
+ }, i("div", {
203
+ class: "field-section__head"
204
+ }, i("span", {
205
+ class: "field-section__title"
206
+ }, e)), i("div", {
207
+ class: "fields"
208
+ }, t.map(l(this, _, "f"))))));
209
+ this.properties = [];
210
+ this.cancelCallback = undefined;
211
+ this.confirmCallback = undefined;
212
+ this.propertyChangeCallback = undefined;
213
+ }
214
+ async componentWillLoad() {
215
+ d(this, p, await n.getComponentStrings(this.el), "f");
216
+ }
217
+ /**
218
+ * Suspends or reactivates the shortcuts.
219
+ */ async suspendShortcuts(e) {
220
+ l(this, h, "f").suspend = e;
221
+ }
222
+ // #endregion Renders
223
+ render() {
224
+ var e;
225
+ const t = l(this, p, "f").header.description;
226
+ const o = l(this, p, "f").sections;
227
+ const a = (e = this.properties) !== null && e !== void 0 ? e : [];
228
+ const n = l(this, m, "f").call(this);
229
+ // The Authentication section is only rendered when TRUSTED_CONNECTION is
230
+ // present; otherwise every field stays in the always-present Connection
231
+ // section so nothing is dropped.
232
+ const r = n ? a.filter(l(this, v, "f")) : [];
233
+ const c = n ? a.filter((e => !l(this, v, "f").call(this, e))) : a;
234
+ return i(s, {
235
+ class: "widget"
236
+ }, i("ch-theme", {
237
+ model: M
238
+ }), i("ch-shortcuts", {
239
+ src: l(this, u, "f"),
240
+ ref: e => d(this, h, e, "f")
241
+ }), i("section", {
242
+ class: "section"
243
+ }, i("div", {
244
+ class: "hero"
245
+ }, i("div", {
246
+ class: "hero__badge",
247
+ "aria-hidden": "true"
248
+ }, i("ch-image", {
249
+ class: "icon-xl",
250
+ src: j,
251
+ type: "mask"
252
+ })), i("div", {
253
+ class: "hero__text"
254
+ }, t && i("p", {
255
+ class: "hero__description body-regular-s"
256
+ }, t))), i("div", {
257
+ class: "main scrollable"
258
+ }, c.length > 0 && l(this, W, "f").call(this, o.connection, c), n && r.length > 0 && l(this, W, "f").call(this, o.authentication, r)), i("footer", {
259
+ class: "dialog-footer-with-border footer"
260
+ }, i("div", {
261
+ class: "buttons-spacer"
262
+ }, i("button", {
263
+ class: "button-secondary",
264
+ id: "button-cancel",
265
+ type: "button",
266
+ onClick: l(this, w, "f"),
267
+ part: "button-cancel"
268
+ }, l(this, p, "f").footer.btnCancel), i("button", {
269
+ class: "button-primary",
270
+ id: "button-confirm",
271
+ type: "button",
272
+ disabled: l(this, b, "f").call(this),
273
+ onClick: l(this, y, "f"),
274
+ part: "button-confirm"
275
+ }, l(this, p, "f").footer.btnConfirm)))));
276
+ }
277
+ static get assetsDirs() {
278
+ return [ "gx-ide-assets/db-properties-configurator" ];
279
+ }
280
+ get el() {
281
+ return o(this);
282
+ }
283
+ };
284
+
285
+ p = new WeakMap, h = new WeakMap, u = new WeakMap, f = new WeakMap, b = new WeakMap,
286
+ g = new WeakMap, v = new WeakMap, m = new WeakMap, x = new WeakMap, w = new WeakMap,
287
+ y = new WeakMap, k = new WeakMap, _ = new WeakMap, W = new WeakMap;
288
+
289
+ I.style = c;
290
+
291
+ export { I as gx_ide_db_properties_configurator };
292
+ //# sourceMappingURL=p-9cf62f0a.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["dbPropertiesConfiguratorCss","CSS_BUNDLES","DATABASE_ICON","getIconPath","category","name","colorType","TRUSTED_CONNECTION","USER_ID","USER_PASSWORD","AUTH_CATEGORY","GxIdeDbPropertiesConfigurator","_GxIdeDbPropertiesConfigurator_componentLocale","set","this","_GxIdeDbPropertiesConfigurator_chShortcutsEl","_GxIdeDbPropertiesConfigurator_shortcutsSrc","getAssetPath","_GxIdeDbPropertiesConfigurator_getValue","field","_a","value","_GxIdeDbPropertiesConfigurator_hasPendingRequired","properties","some","missing","__classPrivateFieldGet","call","trim","_GxIdeDbPropertiesConfigurator_buildComboModel","standardValues","map","caption","_GxIdeDbPropertiesConfigurator_isAuthField","toLowerCase","_GxIdeDbPropertiesConfigurator_hasTrustedConnection","_GxIdeDbPropertiesConfigurator_valueChangeHandler","event","detail","_b","target","propertyChangeCallback","_GxIdeDbPropertiesConfigurator_cancelButtonClickedHandler","cancelCallback","_GxIdeDbPropertiesConfigurator_confirmButtonClickedHandler","confirmCallback","_GxIdeDbPropertiesConfigurator_renderControl","fieldId","control","h","id","class","type","showPasswordButton","debounce","config","inputDebounce","onInput","model","onChange","checkedValue","unCheckedValue","suggest","suggestDebounce","part","readonly","_GxIdeDbPropertiesConfigurator_renderField","isReadonly","isCheckbox","key","htmlFor","label","description","_GxIdeDbPropertiesConfigurator_renderSection","title","fields","componentWillLoad","__classPrivateFieldSet","Locale","getComponentStrings","el","suspendShortcuts","suspend","render","header","sections","allFields","hasAuthSection","authFields","filter","connectionFields","Host","src","ref","length","connection","authentication","onClick","footer","btnCancel","disabled","btnConfirm"],"sources":["src/components/db-properties-configurator/db-properties-configurator.scss?tag=gx-ide-db-properties-configurator&encapsulation=shadow","src/components/db-properties-configurator/db-properties-configurator.tsx"],"sourcesContent":["@import \"../../global/temporary-mercury-overrides/_button.scss\";\n\n// The component reproduces the Mercury \"Set required properties\" connection\n// dialog. Real Mercury classes (.dialog-header-with-border, .field-group-\n// justified-end, .label, .input, .combo-box, .button-*, typography) come from\n// the loaded bundles; the rules below only add the scaffolding Mercury does\n// not define (hero banner, badge, close button, field help) using DS tokens.\n\n:host {\n display: grid;\n block-size: 100%;\n overflow: hidden;\n grid-template-rows: max-content 1fr max-content;\n background-color: var(--color-accent-surface-elevation-1);\n color: var(--color-text-neutral-default);\n}\n\n.section {\n // section is just for semantics; the host owns the grid.\n display: contents;\n}\n\n// #region Hero\n.hero {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-gap-xl);\n padding-block: var(--spacing-padding-l);\n padding-inline: var(--spacing-padding-l);\n border-block-end: var(--size-1) solid\n var(--color-border-surface-on-elevation-1);\n}\n\n.hero__text {\n flex: 1;\n min-inline-size: 0;\n}\n\n.hero__description {\n margin-block: var(--spacing-gap-xs) 0;\n margin-inline: 0;\n color: var(--color-text-neutral-neutral);\n}\n\n.hero__badge {\n flex: none;\n display: grid;\n place-items: center;\n // Decorative badge: neutralize ch-image's hover/active/focus state swap\n // (driven by the [data-ch-image] attribute it adds to this parent), which\n // otherwise makes the icon flicker and read as clickable.\n pointer-events: none;\n inline-size: 44px;\n block-size: 44px;\n border-radius: var(--border-radius-m);\n background-color: var(--color-accent-item-hover);\n color: var(--color-icon-primary-default);\n}\n// #endregion Hero\n\n// #region Body\n.main {\n overflow: auto;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-xxl);\n padding-block: var(--spacing-padding-l);\n padding-inline: var(--spacing-padding-l);\n}\n\n// Field section: a quiet uppercase header + its field grid. Sections after\n// the first get a divider so the body reads as structured groups.\n.field-section {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-l);\n}\n\n.field-section + .field-section {\n padding-block-start: var(--spacing-padding-xl);\n border-block-start: var(--size-1) solid\n var(--color-border-surface-on-elevation-1);\n}\n\n.field-section__head {\n display: flex;\n align-items: baseline;\n gap: var(--spacing-gap-m);\n}\n\n.field-section__title {\n font-family: var(--font-family-body);\n font-weight: var(--font-style-semi-bold);\n font-size: var(--font-size-caption-m);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--color-text-neutral-neutral);\n}\n\n// Two-column field grid. Each field occupies one column; checkbox fields\n// (and any other field marked as full-width) span the entire row, forcing\n// the following fields to wrap onto the next row.\n.fields {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: var(--spacing-gap-l);\n}\n\n.field--full {\n grid-column: 1 / -1;\n}\n\n// Inline checkbox field: control + label on the same row, optional help text\n// flows below aligned with the label.\n.field--checkbox {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-gap-xs);\n}\n\n.field--checkbox .field__row {\n display: flex;\n align-items: center;\n gap: var(--spacing-gap-xs);\n}\n\n.field--checkbox .label {\n margin: 0;\n cursor: pointer;\n}\n\n// Help text below a checkbox, indented to align with the label past the box.\n.field--checkbox .field__hint {\n margin: 0;\n margin-inline-start: calc(var(--spacing-gap-m) + var(--spacing-gap-m));\n color: var(--color-text-neutral-disabled);\n text-wrap: pretty;\n}\n// #endregion Body\n\n// #region Footer\n.footer {\n padding-block: var(--spacing-padding-m);\n padding-inline: var(--spacing-padding-l);\n}\n// #endregion Footer\n","import {\n Component,\n Host,\n Prop,\n Element,\n Method,\n getAssetPath,\n h\n} from \"@stencil/core\";\n\nimport { MercuryBundles, getIconPath } from \"@genexus/mercury\";\nimport { ComboBoxModel } from \"@genexus/chameleon-controls-library\";\n\nimport { Locale } from \"../../common/locale\";\nimport { config } from \"../../common/config\";\n\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/button\",\n \"components/combo-box\",\n \"components/edit\",\n \"components/icon\",\n \"utils/form\",\n \"utils/layout\",\n \"utils/typography\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\n\nconst DATABASE_ICON = getIconPath({\n category: \"system\",\n name: \"database\",\n colorType: \"primary\"\n});\n\n/**\n * Name of the property that toggles integrated security. Its presence in\n * `properties` is what drives the rendering of the Authentication section.\n */\nconst TRUSTED_CONNECTION = \"TRUSTED_CONNECTION\";\nconst USER_ID = \"USER_ID\";\nconst USER_PASSWORD = \"USER_PASSWORD\";\n\n/** Category that groups the authentication-related fields. */\nconst AUTH_CATEGORY = \"authentication\";\n\n@Component({\n tag: \"gx-ide-db-properties-configurator\",\n styleUrl: \"db-properties-configurator.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/db-properties-configurator\"]\n})\nexport class GxIdeDbPropertiesConfigurator {\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n #componentLocale: any;\n\n #chShortcutsEl: HTMLChShortcutsElement;\n #shortcutsSrc = getAssetPath(\n `./gx-ide-assets/db-properties-configurator/shortcuts.json`\n );\n\n @Element() el: HTMLGxIdeDbPropertiesConfiguratorElement;\n\n /**\n * The list of properties to configure. Acts as the single source of truth:\n * the dialog reads each value from `DSPropertyField.value` and notifies the\n * host of every edit through `propertyChangeCallback`.\n */\n @Prop() readonly properties: DSPropertyField[] = [];\n\n /**\n * Callback invoked when the user cancels the configuration.\n */\n @Prop() readonly cancelCallback!: CancelCallback;\n\n /**\n * Callback invoked when the user confirms the configuration.\n */\n @Prop() readonly confirmCallback!: ConfirmCallback;\n\n /**\n * Callback invoked on every input change. Receives the name of the\n * property that changed and its new value. The host is expected to apply\n * the change and push an updated `properties` array back to the component.\n */\n @Prop() readonly propertyChangeCallback!: PropertyChangeCallback;\n\n async componentWillLoad() {\n this.#componentLocale = await Locale.getComponentStrings(this.el);\n }\n\n /**\n * Suspends or reactivates the shortcuts.\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n this.#chShortcutsEl.suspend = suspendShortcuts;\n }\n\n #getValue = (field: DSPropertyField): string => field.value ?? \"\";\n\n #hasPendingRequired = (): boolean =>\n (this.properties ?? []).some(\n field => field.missing && this.#getValue(field).trim() === \"\"\n );\n\n #buildComboModel = (field: DSPropertyField): ComboBoxModel =>\n (field.standardValues ?? []).map(value => ({ value, caption: value }));\n\n #isAuthField = (field: DSPropertyField): boolean =>\n field.name === TRUSTED_CONNECTION ||\n field.name === USER_ID ||\n field.name === USER_PASSWORD ||\n field.category?.toLowerCase() === AUTH_CATEGORY;\n\n /** Whether the host sent the TRUSTED_CONNECTION property. Only then is the\n * Authentication section rendered. */\n #hasTrustedConnection = (): boolean =>\n (this.properties ?? []).some(field => field.name === TRUSTED_CONNECTION);\n\n #valueChangeHandler =\n (name: string) => (event: CustomEvent<string> | InputEvent) => {\n const detail = (event as CustomEvent<string>).detail;\n const value =\n typeof detail === \"string\"\n ? detail\n : ((event.target as HTMLChEditElement)?.value ?? \"\");\n this.propertyChangeCallback(name, value);\n };\n\n #cancelButtonClickedHandler = () => {\n this.cancelCallback?.();\n };\n\n #confirmButtonClickedHandler = () => {\n if (this.#hasPendingRequired()) {\n return;\n }\n this.confirmCallback?.();\n };\n\n // #region Renders\n\n #renderControl = (field: DSPropertyField) => {\n const fieldId = `field-${field.name}`;\n const value = this.#getValue(field);\n\n switch (field.control) {\n case \"password\":\n return (\n <ch-edit\n id={fieldId}\n class=\"input\"\n type=\"password\"\n showPasswordButton\n debounce={config.inputDebounce}\n value={value}\n onInput={this.#valueChangeHandler(field.name)}\n ></ch-edit>\n );\n\n case \"combo\":\n return (\n <ch-combo-box-render\n id={fieldId}\n class=\"combo-box\"\n value={value}\n model={this.#buildComboModel(field)}\n onInput={this.#valueChangeHandler(field.name)}\n onChange={this.#valueChangeHandler(field.name)}\n ></ch-combo-box-render>\n );\n\n case \"checkbox\":\n return (\n <ch-checkbox\n id={fieldId}\n class=\"checkbox\"\n value={value}\n checkedValue=\"Yes\"\n unCheckedValue=\"No\"\n onInput={this.#valueChangeHandler(field.name)}\n ></ch-checkbox>\n );\n\n case \"combo-editable\":\n return (\n <ch-combo-box-render\n id={fieldId}\n class=\"combo-box\"\n suggest\n suggestDebounce={config.inputDebounce}\n value={value}\n model={this.#buildComboModel(field)}\n onInput={this.#valueChangeHandler(field.name)}\n onChange={this.#valueChangeHandler(field.name)}\n part={`combo-box combo-box--editable combo-box--${field.name}`}\n ></ch-combo-box-render>\n );\n\n case \"custom\":\n case \"readonly\":\n return (\n <ch-edit\n id={fieldId}\n class=\"input\"\n readonly\n value={value}\n part={`input input--${field.control} input--${field.name}`}\n ></ch-edit>\n );\n\n // \"text\"\n default:\n return (\n <ch-edit\n id={fieldId}\n class=\"input\"\n debounce={config.inputDebounce}\n value={value}\n onInput={this.#valueChangeHandler(field.name)}\n part={`input input--text input--${field.name}`}\n ></ch-edit>\n );\n }\n };\n\n #renderField = (field: DSPropertyField) => {\n const fieldId = `field-${field.name}`;\n const isReadonly =\n field.control === \"readonly\" || field.control === \"custom\";\n const isCheckbox = field.control === \"checkbox\";\n\n if (isCheckbox) {\n return (\n <div class=\"field field--checkbox field--full\" key={field.name}>\n <div class=\"field__row\">\n {this.#renderControl(field)}\n <label class=\"label\" htmlFor={fieldId}>\n {field.label}\n </label>\n </div>\n {field.description && (\n <p class=\"field__hint body-regular-s\">{field.description}</p>\n )}\n </div>\n );\n }\n\n return (\n <div class=\"field field-block\" key={field.name}>\n <label\n class={{ \"label\": true, \"label--disabled\": isReadonly }}\n htmlFor={fieldId}\n >\n {field.label}\n </label>\n\n {this.#renderControl(field)}\n </div>\n );\n };\n\n #renderSection = (title: string, fields: DSPropertyField[]) => (\n <section class=\"field-section\">\n <div class=\"field-section__head\">\n <span class=\"field-section__title\">{title}</span>\n </div>\n <div class=\"fields\">{fields.map(this.#renderField)}</div>\n </section>\n );\n\n // #endregion Renders\n\n render() {\n const description = this.#componentLocale.header.description;\n const sections = this.#componentLocale.sections;\n\n const allFields = this.properties ?? [];\n const hasAuthSection = this.#hasTrustedConnection();\n\n // The Authentication section is only rendered when TRUSTED_CONNECTION is\n // present; otherwise every field stays in the always-present Connection\n // section so nothing is dropped.\n const authFields = hasAuthSection\n ? allFields.filter(this.#isAuthField)\n : [];\n const connectionFields = hasAuthSection\n ? allFields.filter(field => !this.#isAuthField(field))\n : allFields;\n\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-shortcuts\n src={this.#shortcutsSrc}\n ref={(el: HTMLChShortcutsElement) =>\n (this.#chShortcutsEl = el as HTMLChShortcutsElement)\n }\n ></ch-shortcuts>\n <section class=\"section\">\n <div class=\"hero\">\n <div class=\"hero__badge\" aria-hidden=\"true\">\n <ch-image\n class=\"icon-xl\"\n src={DATABASE_ICON}\n type=\"mask\"\n ></ch-image>\n </div>\n <div class=\"hero__text\">\n {description && (\n <p class=\"hero__description body-regular-s\">{description}</p>\n )}\n </div>\n </div>\n\n <div class=\"main scrollable\">\n {connectionFields.length > 0 &&\n this.#renderSection(sections.connection, connectionFields)}\n\n {hasAuthSection &&\n authFields.length > 0 &&\n this.#renderSection(sections.authentication, authFields)}\n </div>\n\n <footer class=\"dialog-footer-with-border footer\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n id=\"button-cancel\"\n type=\"button\"\n onClick={this.#cancelButtonClickedHandler}\n part=\"button-cancel\"\n >\n {this.#componentLocale.footer.btnCancel}\n </button>\n <button\n class=\"button-primary\"\n id=\"button-confirm\"\n type=\"button\"\n disabled={this.#hasPendingRequired()}\n onClick={this.#confirmButtonClickedHandler}\n part=\"button-confirm\"\n >\n {this.#componentLocale.footer.btnConfirm}\n </button>\n </div>\n </footer>\n </section>\n </Host>\n );\n }\n}\n\nexport type DSControlKind =\n | \"checkbox\"\n | \"text\"\n | \"password\"\n | \"combo\"\n | \"combo-editable\"\n | \"custom\"\n | \"readonly\";\n\nexport interface DSPropertyField {\n /** `PropertyData.name` — key used to set the property value. */\n name: string;\n /** `definition.displayName`. */\n label: string;\n /** `definition.description` (rendered below the control). */\n description?: string;\n /** `definition.category` (optional grouping). */\n category?: string;\n\n /** Control resolved by the host. */\n control: DSControlKind;\n\n /** `PropertyData.value` (masked when password). */\n value: string;\n /** `required && isDefault` (host detection). */\n missing: boolean;\n\n // combos:\n /** `PropertyData.standardValues`. */\n standardValues?: string[];\n /** `PropertyData.isStandardValuesExclusive`. */\n exclusive?: boolean;\n}\n\nexport type CancelCallback = () => void | Promise<void>;\n\nexport type ConfirmCallback = () => void | Promise<void>;\n\nexport type PropertyChangeCallback = (\n name: string,\n value: string\n) => void | Promise<void>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAMA,IAA8B;;;;;;;;;;;;;;;;;ACgBpC,MAAMC,IAA8B,EAClC,qBACA,qBACA,wBACA,mBACA,mBACA,cACA,gBACA,oBACA,iBACA;;AAGF,MAAMC,IAAgBC,EAAY;EAChCC,UAAU;EACVC,MAAM;EACNC,WAAW;;;;;;GAOb,OAAMC,IAAqB;;AAC3B,MAAMC,IAAU;;AAChB,MAAMC,IAAgB;;8DAGtB,OAAMC,IAAgB;;MAQTC,IAA6B;;;;QAExCC,EAAAC,IAAAC,WAAA;IAEAC,EAAAF,I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R,KAGjDvC,EAAA;MAAQE,OAAM;OACZF,EAAA;MAAKE,OAAM;OACTF,EAAA;MACEE,OAAM;MACND,IAAG;MACHE,MAAK;MACL6C,SAASvE,EAAAZ,MAAI4B,GAAA;MACbsB,MAAK;OAEJtC,EAAAZ,MAAIF,GAAA,KAAkBsF,OAAOC,YAEhClD,EAAA;MACEE,OAAM;MACND,IAAG;MACHE,MAAK;MACLgD,UAAU1E,EAAAZ,MAAIQ,GAAA,KAAoBK,KAAxBb;MACVmF,SAASvE,EAAAZ,MAAI8B,GAAA;MACboB,MAAK;OAEJtC,EAAAZ,MAAIF,GAAA,KAAkBsF,OAAOG"}
@@ -22,6 +22,10 @@ export declare class GxIdeDbPropertiesConfigurator {
22
22
  */
23
23
  readonly propertyChangeCallback: PropertyChangeCallback;
24
24
  componentWillLoad(): Promise<void>;
25
+ /**
26
+ * Suspends or reactivates the shortcuts.
27
+ */
28
+ suspendShortcuts(suspendShortcuts: boolean): Promise<void>;
25
29
  render(): any;
26
30
  }
27
31
  export type DSControlKind = "checkbox" | "text" | "password" | "combo" | "combo-editable" | "custom" | "readonly";
@@ -890,6 +890,10 @@ export namespace Components {
890
890
  * Callback invoked on every input change. Receives the name of the property that changed and its new value. The host is expected to apply the change and push an updated `properties` array back to the component.
891
891
  */
892
892
  "propertyChangeCallback": PropertyChangeCallback;
893
+ /**
894
+ * Suspends or reactivates the shortcuts.
895
+ */
896
+ "suspendShortcuts": (suspendShortcuts: boolean) => Promise<void>;
893
897
  }
894
898
  interface GxIdeDeploymentTool {
895
899
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genexus/genexus-ide-ui",
3
3
  "license": "Apache-2.0",
4
- "version": "3.2.20",
4
+ "version": "3.2.21",
5
5
  "description": "GeneXus IDE UI components",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.js",
@@ -1,281 +0,0 @@
1
- import { r as e, h as t, H as i, a as o } from "./p-9b9ccd0c.js";
2
-
3
- import { g as a } from "./p-d42e842b.js";
4
-
5
- import "./p-6534555e.js";
6
-
7
- import "lit";
8
-
9
- import "lit/directives/when.js";
10
-
11
- import "lit/directives/if-defined.js";
12
-
13
- import { L as s } from "./p-311eedf3.js";
14
-
15
- import { c as n } from "./p-c5196b3b.js";
16
-
17
- const r = "button.button-secondary{border-color:var(--color-border-neutral-default)}:host{display:grid;block-size:100%;overflow:hidden;grid-template-rows:max-content 1fr max-content;background-color:var(--color-accent-surface-elevation-1);color:var(--color-text-neutral-default)}.section{display:contents}.hero{display:flex;align-items:flex-start;gap:var(--spacing-gap-xl);padding-block:var(--spacing-padding-l);padding-inline:var(--spacing-padding-l);border-block-end:var(--size-1) solid var(--color-border-surface-on-elevation-1)}.hero__text{flex:1;min-inline-size:0}.hero__title{margin:0;color:var(--color-text-neutral-default)}.hero__description{margin-block:var(--spacing-gap-xs) 0;margin-inline:0;color:var(--color-text-neutral-disabled);text-wrap:pretty}.hero__badge{flex:none;display:grid;place-items:center;inline-size:44px;block-size:44px;border-radius:var(--border-radius-m);background-color:var(--color-accent-item-hover);color:var(--color-icon-primary-default)}.main{overflow:auto;display:flex;flex-direction:column;gap:var(--spacing-gap-xxl);padding-block:var(--spacing-padding-l);padding-inline:var(--spacing-padding-l)}.field-section{display:flex;flex-direction:column;gap:var(--spacing-gap-l)}.field-section+.field-section{padding-block-start:var(--spacing-padding-xl);border-block-start:var(--size-1) solid var(--color-border-surface-on-elevation-1)}.field-section__head{display:flex;align-items:baseline;gap:var(--spacing-gap-m)}.field-section__title{font-family:var(--font-family-body);font-weight:var(--font-style-semi-bold);font-size:var(--font-size-caption-m);letter-spacing:0.06em;text-transform:uppercase;color:var(--color-text-neutral-neutral)}.fields{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:var(--spacing-gap-l)}.field--full{grid-column:1/-1}.field--checkbox{display:flex;flex-direction:column;gap:var(--spacing-gap-xs)}.field--checkbox .field__row{display:flex;align-items:center;gap:var(--spacing-gap-xs)}.field--checkbox .label{margin:0;cursor:pointer}.field--checkbox .field__hint{margin:0;margin-inline-start:calc(var(--spacing-gap-m) + var(--spacing-gap-m));color:var(--color-text-neutral-disabled);text-wrap:pretty}.footer{padding-block:var(--spacing-padding-m);padding-inline:var(--spacing-padding-l)}";
18
-
19
- var l = undefined && undefined.__classPrivateFieldGet || function(e, t, i, o) {
20
- if (i === "a" && !o) throw new TypeError("Private accessor was defined without a getter");
21
- if (typeof t === "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
22
- return i === "m" ? o : i === "a" ? o.call(e) : o ? o.value : t.get(e);
23
- };
24
-
25
- var c = undefined && undefined.__classPrivateFieldSet || function(e, t, i, o, a) {
26
- if (o === "m") throw new TypeError("Private method is not writable");
27
- if (o === "a" && !a) throw new TypeError("Private accessor was defined without a setter");
28
- if (typeof t === "function" ? e !== t || !a : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
29
- return o === "a" ? a.call(e, i) : a ? a.value = i : t.set(e, i), i;
30
- };
31
-
32
- var d, p, h, u, f, b, g, v, m, x, w, y;
33
-
34
- const k = [ "resets/box-sizing", "components/button", "components/combo-box", "components/edit", "components/icon", "utils/form", "utils/layout", "utils/typography", "utils/spacing", "chameleon/scrollbar" ];
35
-
36
- const _ = a({
37
- category: "system",
38
- name: "database",
39
- colorType: "primary"
40
- });
41
-
42
- /**
43
- * Name of the property that toggles integrated security. Its presence in
44
- * `properties` is what drives the rendering of the Authentication section.
45
- */ const W = "TRUSTED_CONNECTION";
46
-
47
- const M = "USER_ID";
48
-
49
- const j = "USER_PASSWORD";
50
-
51
- /** Category that groups the authentication-related fields. */ const z = "authentication";
52
-
53
- const C = class {
54
- constructor(i) {
55
- e(this, i);
56
- // eslint-disable-next-line @stencil-community/own-props-must-be-private
57
- d.set(this, void 0);
58
- p.set(this, (e => {
59
- var t;
60
- return (t = e.value) !== null && t !== void 0 ? t : "";
61
- }));
62
- h.set(this, (() => {
63
- var e;
64
- return ((e = this.properties) !== null && e !== void 0 ? e : []).some((e => e.missing && l(this, p, "f").call(this, e).trim() === ""));
65
- }));
66
- u.set(this, (e => {
67
- var t;
68
- return ((t = e.standardValues) !== null && t !== void 0 ? t : []).map((e => ({
69
- value: e,
70
- caption: e
71
- })));
72
- }));
73
- f.set(this, (e => {
74
- var t;
75
- return e.name === W || e.name === M || e.name === j || ((t = e.category) === null || t === void 0 ? void 0 : t.toLowerCase()) === z;
76
- }));
77
- /** Whether the host sent the TRUSTED_CONNECTION property. Only then is the
78
- * Authentication section rendered. */ b.set(this, (() => {
79
- var e;
80
- return ((e = this.properties) !== null && e !== void 0 ? e : []).some((e => e.name === W));
81
- }));
82
- g.set(this, (e => t => {
83
- var i, o;
84
- const a = t.detail;
85
- const s = typeof a === "string" ? a : (o = (i = t.target) === null || i === void 0 ? void 0 : i.value) !== null && o !== void 0 ? o : "";
86
- this.propertyChangeCallback(e, s);
87
- }));
88
- v.set(this, (() => {
89
- var e;
90
- (e = this.cancelCallback) === null || e === void 0 ? void 0 : e.call(this);
91
- }));
92
- m.set(this, (() => {
93
- var e;
94
- (e = this.confirmCallback) === null || e === void 0 ? void 0 : e.call(this);
95
- }));
96
- // #region Renders
97
- x.set(this, (e => {
98
- const i = `field-${e.name}`;
99
- const o = l(this, p, "f").call(this, e);
100
- switch (e.control) {
101
- case "password":
102
- return t("ch-edit", {
103
- id: i,
104
- class: "input",
105
- type: "password",
106
- showPasswordButton: true,
107
- debounce: n.inputDebounce,
108
- value: o,
109
- onInput: l(this, g, "f").call(this, e.name)
110
- });
111
-
112
- case "combo":
113
- return t("ch-combo-box-render", {
114
- id: i,
115
- class: "combo-box",
116
- value: o,
117
- model: l(this, u, "f").call(this, e),
118
- onInput: l(this, g, "f").call(this, e.name),
119
- onChange: l(this, g, "f").call(this, e.name)
120
- });
121
-
122
- case "checkbox":
123
- return t("ch-checkbox", {
124
- id: i,
125
- class: "checkbox",
126
- value: o,
127
- checkedValue: "Yes",
128
- unCheckedValue: "No",
129
- onInput: l(this, g, "f").call(this, e.name)
130
- });
131
-
132
- case "combo-editable":
133
- return t("ch-combo-box-render", {
134
- id: i,
135
- class: "combo-box",
136
- suggest: true,
137
- suggestDebounce: n.inputDebounce,
138
- value: o,
139
- model: l(this, u, "f").call(this, e),
140
- onInput: l(this, g, "f").call(this, e.name),
141
- onChange: l(this, g, "f").call(this, e.name),
142
- part: `combo-box combo-box--editable combo-box--${e.name}`
143
- });
144
-
145
- case "custom":
146
- case "readonly":
147
- return t("ch-edit", {
148
- id: i,
149
- class: "input",
150
- readonly: true,
151
- value: o,
152
- part: `input input--${e.control} input--${e.name}`
153
- });
154
-
155
- // "text"
156
- default:
157
- return t("ch-edit", {
158
- id: i,
159
- class: "input",
160
- debounce: n.inputDebounce,
161
- value: o,
162
- onInput: l(this, g, "f").call(this, e.name),
163
- part: `input input--text input--${e.name}`
164
- });
165
- }
166
- }));
167
- w.set(this, (e => {
168
- const i = `field-${e.name}`;
169
- const o = e.control === "readonly" || e.control === "custom";
170
- const a = e.control === "checkbox";
171
- if (a) {
172
- return t("div", {
173
- class: "field field--checkbox field--full",
174
- key: e.name
175
- }, t("div", {
176
- class: "field__row"
177
- }, l(this, x, "f").call(this, e), t("label", {
178
- class: "label",
179
- htmlFor: i
180
- }, e.label)), e.description && t("p", {
181
- class: "field__hint body-regular-s"
182
- }, e.description));
183
- }
184
- return t("div", {
185
- class: "field field-block",
186
- key: e.name
187
- }, t("label", {
188
- class: {
189
- label: true,
190
- "label--disabled": o
191
- },
192
- htmlFor: i
193
- }, e.label), l(this, x, "f").call(this, e));
194
- }));
195
- y.set(this, ((e, i) => t("section", {
196
- class: "field-section"
197
- }, t("div", {
198
- class: "field-section__head"
199
- }, t("span", {
200
- class: "field-section__title"
201
- }, e)), t("div", {
202
- class: "fields"
203
- }, i.map(l(this, w, "f"))))));
204
- this.properties = [];
205
- this.cancelCallback = undefined;
206
- this.confirmCallback = undefined;
207
- this.propertyChangeCallback = undefined;
208
- }
209
- async componentWillLoad() {
210
- c(this, d, await s.getComponentStrings(this.el), "f");
211
- }
212
- // #endregion Renders
213
- render() {
214
- var e;
215
- const o = l(this, d, "f").header.title;
216
- const a = l(this, d, "f").header.description;
217
- const s = l(this, d, "f").sections;
218
- const n = (e = this.properties) !== null && e !== void 0 ? e : [];
219
- const r = l(this, b, "f").call(this);
220
- // The Authentication section is only rendered when TRUSTED_CONNECTION is
221
- // present; otherwise every field stays in the always-present Connection
222
- // section so nothing is dropped.
223
- const c = r ? n.filter(l(this, f, "f")) : [];
224
- const p = r ? n.filter((e => !l(this, f, "f").call(this, e))) : n;
225
- return t(i, {
226
- class: "widget"
227
- }, t("ch-theme", {
228
- model: k
229
- }), t("section", {
230
- class: "section"
231
- }, t("div", {
232
- class: "hero"
233
- }, t("div", {
234
- class: "hero__text"
235
- }, t("h1", {
236
- class: "hero__title subtitle-semi-bold-l"
237
- }, o), a && t("p", {
238
- class: "hero__description body-regular-s"
239
- }, a)), t("div", {
240
- class: "hero__badge",
241
- "aria-hidden": "true"
242
- }, t("ch-image", {
243
- class: "icon-xl",
244
- src: _
245
- }))), t("div", {
246
- class: "main scrollable"
247
- }, p.length > 0 && l(this, y, "f").call(this, s.connection, p), r && c.length > 0 && l(this, y, "f").call(this, s.authentication, c)), t("footer", {
248
- class: "dialog-footer-with-border footer"
249
- }, t("div", {
250
- class: "buttons-spacer"
251
- }, t("button", {
252
- class: "button-secondary",
253
- id: "button-cancel",
254
- type: "button",
255
- onClick: l(this, v, "f"),
256
- part: "button-cancel"
257
- }, l(this, d, "f").footer.btnCancel), t("button", {
258
- class: "button-primary",
259
- id: "button-confirm",
260
- type: "button",
261
- disabled: l(this, h, "f").call(this),
262
- onClick: l(this, m, "f"),
263
- part: "button-confirm"
264
- }, l(this, d, "f").footer.btnConfirm)))));
265
- }
266
- static get assetsDirs() {
267
- return [ "gx-ide-assets/db-properties-configurator" ];
268
- }
269
- get el() {
270
- return o(this);
271
- }
272
- };
273
-
274
- d = new WeakMap, p = new WeakMap, h = new WeakMap, u = new WeakMap, f = new WeakMap,
275
- b = new WeakMap, g = new WeakMap, v = new WeakMap, m = new WeakMap, x = new WeakMap,
276
- w = new WeakMap, y = new WeakMap;
277
-
278
- C.style = r;
279
-
280
- export { C as gx_ide_db_properties_configurator };
281
- //# sourceMappingURL=p-e759cfdb.entry.js.map