@omegagrid/form 0.5.20 → 0.6.1
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/constants.d.ts +13 -11
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +8 -10
- package/dist/constants.js.map +1 -1
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/model/formAdapter.js +2 -6
- package/dist/model/formAdapter.js.map +1 -1
- package/dist/model/formControlModel.js +1 -5
- package/dist/model/formControlModel.js.map +1 -1
- package/dist/model/formModel.js +6 -13
- package/dist/model/formModel.js.map +1 -1
- package/dist/model/index.js +3 -19
- package/dist/model/index.js.map +1 -1
- package/dist/options.js +3 -7
- package/dist/options.js.map +1 -1
- package/dist/types.js +2 -5
- package/dist/types.js.map +1 -1
- package/dist/ui/controls/baseControl.js +10 -15
- package/dist/ui/controls/baseControl.js.map +1 -1
- package/dist/ui/controls/button.js +15 -18
- package/dist/ui/controls/button.js.map +1 -1
- package/dist/ui/controls/calendarDateInput.d.ts.map +1 -1
- package/dist/ui/controls/calendarDateInput.js +13 -16
- package/dist/ui/controls/calendarDateInput.js.map +1 -1
- package/dist/ui/controls/checkbox.js +8 -11
- package/dist/ui/controls/checkbox.js.map +1 -1
- package/dist/ui/controls/colorInput.js +13 -16
- package/dist/ui/controls/colorInput.js.map +1 -1
- package/dist/ui/controls/dateInput.js +15 -18
- package/dist/ui/controls/dateInput.js.map +1 -1
- package/dist/ui/controls/fileInput.js +9 -12
- package/dist/ui/controls/fileInput.js.map +1 -1
- package/dist/ui/controls/index.js +10 -26
- package/dist/ui/controls/index.js.map +1 -1
- package/dist/ui/controls/label.js +11 -14
- package/dist/ui/controls/label.js.map +1 -1
- package/dist/ui/controls/list.js +14 -19
- package/dist/ui/controls/list.js.map +1 -1
- package/dist/ui/controls/numericInput.js +17 -26
- package/dist/ui/controls/numericInput.js.map +1 -1
- package/dist/ui/controls/textInput.js +14 -24
- package/dist/ui/controls/textInput.js.map +1 -1
- package/dist/ui/form.js +54 -60
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/form.style.js +2 -5
- package/dist/ui/form.style.js.map +1 -1
- package/dist/ui/formContainer.js +45 -54
- package/dist/ui/formContainer.js.map +1 -1
- package/dist/ui/formContainer.style.js +2 -5
- package/dist/ui/formContainer.style.js.map +1 -1
- package/dist/ui/index.js +3 -19
- package/dist/ui/index.js.map +1 -1
- package/package.json +7 -7
package/dist/constants.d.ts
CHANGED
|
@@ -2,27 +2,29 @@ import { FormButtonConfig, FormButtonType } from './types';
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
PREFIX: string;
|
|
4
4
|
DEFAULT_ACCENT_COLOR: string;
|
|
5
|
-
DEFAULT_ACCENT_COLOR_2: import("color")<string | number |
|
|
5
|
+
DEFAULT_ACCENT_COLOR_2: import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | import("color")<string | number | any | ArrayLike<number> | {
|
|
6
6
|
[key: string]: any;
|
|
7
|
-
}> | {
|
|
7
|
+
}> | ArrayLike<number> | {
|
|
8
8
|
[key: string]: any;
|
|
9
|
-
}> | {
|
|
9
|
+
}> | ArrayLike<number> | {
|
|
10
10
|
[key: string]: any;
|
|
11
|
-
}> | {
|
|
11
|
+
}> | ArrayLike<number> | {
|
|
12
12
|
[key: string]: any;
|
|
13
|
-
}> | {
|
|
13
|
+
}> | ArrayLike<number> | {
|
|
14
14
|
[key: string]: any;
|
|
15
|
-
}> | {
|
|
15
|
+
}> | ArrayLike<number> | {
|
|
16
16
|
[key: string]: any;
|
|
17
|
-
}> | {
|
|
17
|
+
}> | ArrayLike<number> | {
|
|
18
18
|
[key: string]: any;
|
|
19
|
-
}> | {
|
|
19
|
+
}> | ArrayLike<number> | {
|
|
20
20
|
[key: string]: any;
|
|
21
|
-
}> | {
|
|
21
|
+
}> | ArrayLike<number> | {
|
|
22
22
|
[key: string]: any;
|
|
23
|
-
}> | {
|
|
23
|
+
}> | ArrayLike<number> | {
|
|
24
24
|
[key: string]: any;
|
|
25
|
-
}> | {
|
|
25
|
+
}> | ArrayLike<number> | {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}> | ArrayLike<number> | {
|
|
26
28
|
[key: string]: any;
|
|
27
29
|
}>;
|
|
28
30
|
SIZER_SIZE: number;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,wBAUC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const core_1 = require("@omegagrid/core");
|
|
4
|
-
exports.default = {
|
|
1
|
+
import { constants as coreConstants, ColorTypes } from '@omegagrid/core';
|
|
2
|
+
export default {
|
|
5
3
|
FORM_CONTROL_HEIGHT: 20,
|
|
6
4
|
BUTTON_CONFIG: new Map([
|
|
7
|
-
['save', { text: 'Save', color:
|
|
8
|
-
['reset', { text: 'Reset', color:
|
|
9
|
-
['validate', { text: 'Validate', color:
|
|
10
|
-
['storno', { text: 'Storno', color:
|
|
11
|
-
['close', { text: 'Close', color:
|
|
5
|
+
['save', { text: 'Save', color: ColorTypes.Accent, default: true }],
|
|
6
|
+
['reset', { text: 'Reset', color: ColorTypes.Gray }],
|
|
7
|
+
['validate', { text: 'Validate', color: ColorTypes.Gray }],
|
|
8
|
+
['storno', { text: 'Storno', color: ColorTypes.Gray }],
|
|
9
|
+
['close', { text: 'Close', color: ColorTypes.Gray }]
|
|
12
10
|
]),
|
|
13
|
-
...
|
|
11
|
+
...coreConstants
|
|
14
12
|
};
|
|
15
13
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGzE,eAAe;IACd,mBAAmB,EAAE,EAAE;IACvB,aAAa,EAAE,IAAI,GAAG,CAAmC;QACxD,CAAC,MAAM,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;QACjE,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAC,CAAC;QAClD,CAAC,UAAU,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAC,CAAC;QACxD,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAC,CAAC;QACpD,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAC,CAAC;KAClD,CAAC;IACF,GAAG,aAAa;CAChB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ui"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./model"), exports);
|
|
1
|
+
export * from './ui';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './model';
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const core_1 = require("@omegagrid/core");
|
|
6
|
-
class FormAdapter extends core_1.ComponentAdapter {
|
|
2
|
+
import { ComponentAdapter } from '@omegagrid/core';
|
|
3
|
+
export class FormAdapter extends ComponentAdapter {
|
|
7
4
|
getForms() {
|
|
8
5
|
return [{ key: 0 }];
|
|
9
6
|
}
|
|
@@ -21,5 +18,4 @@ class FormAdapter extends core_1.ComponentAdapter {
|
|
|
21
18
|
}
|
|
22
19
|
onAction(action) { }
|
|
23
20
|
}
|
|
24
|
-
exports.FormAdapter = FormAdapter;
|
|
25
21
|
//# sourceMappingURL=formAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formAdapter.js","sourceRoot":"","sources":["../../src/model/formAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formAdapter.js","sourceRoot":"","sources":["../../src/model/formAdapter.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKnD,MAAM,OAAgB,WAAY,SAAQ,gBAAsB;IAE/D,QAAQ;QACP,OAAO,CAAC,EAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,EAAiB;QACxB,OAAO,EAAE,CAAC;IACX,CAAC;IAED,UAAU,CAAC,EAAiB;QAC3B,OAAO,EAAE,CAAC;IACX,CAAC;IAID,IAAI,CAAC,MAAsC;QAC1C,OAAO,IAAI,CAAC;IACb,CAAC;IAED,UAAU;QACT,OAAO,EAAE,CAAC;IACX,CAAC;IAED,QAAQ,CAAC,MAAc,IAAI,CAAC;CAE5B"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormControlModel = void 0;
|
|
4
|
-
class FormControlModel {
|
|
1
|
+
export class FormControlModel {
|
|
5
2
|
constructor(props) {
|
|
6
3
|
this.props = props;
|
|
7
4
|
this.dependencies = [];
|
|
@@ -9,5 +6,4 @@ class FormControlModel {
|
|
|
9
6
|
}
|
|
10
7
|
get key() { return this.props.key; }
|
|
11
8
|
}
|
|
12
|
-
exports.FormControlModel = FormControlModel;
|
|
13
9
|
//# sourceMappingURL=formControlModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formControlModel.js","sourceRoot":"","sources":["../../src/model/formControlModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formControlModel.js","sourceRoot":"","sources":["../../src/model/formControlModel.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,gBAAgB;IAM5B,YAA4B,KAA4B;QAA5B,UAAK,GAAL,KAAK,CAAuB;QAJxC,iBAAY,GAAuB,EAAE,CAAC;QAE/C,WAAM,GAAa,EAAE,CAAC;IAE+B,CAAC;IAE7D,IAAI,GAAG,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA,CAAC,CAAC;CAEnC"}
|
package/dist/model/formModel.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FormModel = void 0;
|
|
4
|
-
const formControlModel_1 = require("./formControlModel");
|
|
5
|
-
class FormModel {
|
|
1
|
+
import { FormControlModel } from "./formControlModel";
|
|
2
|
+
export class FormModel {
|
|
6
3
|
get rowCount() { return this._rowCount; }
|
|
7
4
|
get colCount() { return this._colCount; }
|
|
8
5
|
get(key) { return this.controlMap.get(key); }
|
|
@@ -13,8 +10,7 @@ class FormModel {
|
|
|
13
10
|
this.populate(sourceData);
|
|
14
11
|
}
|
|
15
12
|
populate(sourceData) {
|
|
16
|
-
|
|
17
|
-
this.options = (_a = sourceData.options) !== null && _a !== void 0 ? _a : {};
|
|
13
|
+
this.options = sourceData.options ?? {};
|
|
18
14
|
this.controlMap.clear();
|
|
19
15
|
this.controls = [];
|
|
20
16
|
this.rows = sourceData.rows || [];
|
|
@@ -22,28 +18,25 @@ class FormModel {
|
|
|
22
18
|
this._rowCount = this.rows.length;
|
|
23
19
|
this._colCount = this.columns.length;
|
|
24
20
|
sourceData.controls.forEach(c => {
|
|
25
|
-
var _a;
|
|
26
21
|
this._rowCount = Math.max(this._rowCount, c.row + 1);
|
|
27
22
|
this._colCount = Math.max(this._colCount, c.col + 1);
|
|
28
23
|
if (this._rowCount > this.rows.length)
|
|
29
24
|
this.rows.push({});
|
|
30
25
|
if (this._colCount > this.columns.length)
|
|
31
26
|
this.columns.push({});
|
|
32
|
-
c.key =
|
|
33
|
-
this.controlMap.set(c.key, new
|
|
27
|
+
c.key = c.key ?? ((c.row * this._colCount) + c.col).toString();
|
|
28
|
+
this.controlMap.set(c.key, new FormControlModel(c));
|
|
34
29
|
});
|
|
35
30
|
this.controls = [...Array(this.rowCount)].map(() => Array(this.colCount));
|
|
36
31
|
this.controlMap.forEach(c => {
|
|
37
|
-
var _a;
|
|
38
32
|
this.controls[c.props.row][c.props.col] = c;
|
|
39
33
|
if (c.props.dependsOn) {
|
|
40
34
|
this.controlMap.get(c.props.dependsOn).dependencies.push(c);
|
|
41
35
|
}
|
|
42
|
-
if (c.props.for &&
|
|
36
|
+
if (c.props.for && this.controlMap.get(c.props.for)?.props.required) {
|
|
43
37
|
c.props.required = true;
|
|
44
38
|
}
|
|
45
39
|
});
|
|
46
40
|
}
|
|
47
41
|
}
|
|
48
|
-
exports.FormModel = FormModel;
|
|
49
42
|
//# sourceMappingURL=formModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formModel.js","sourceRoot":"","sources":["../../src/model/formModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formModel.js","sourceRoot":"","sources":["../../src/model/formModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,OAAO,SAAS;IAUrB,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAA,CAAC,CAAC;IACxC,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAA,CAAC,CAAC;IAIxC,GAAG,CAAC,GAAW,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC;IAEpD,YAAY,UAAwB;QAV5B,cAAS,GAAG,CAAC,CAAC;QACd,cAAS,GAAG,CAAC,CAAC;QAKN,eAAU,GAAG,IAAI,GAAG,EAA4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AQ,EAAE,CAAC;YAC/D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAC3C,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;gBACvB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC7D,CAAC;YAED,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACrE,CAAC,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;YACzB,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;CAED"}
|
package/dist/model/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./formAdapter"), exports);
|
|
18
|
-
__exportStar(require("./formModel"), exports);
|
|
19
|
-
__exportStar(require("./formControlModel"), exports);
|
|
1
|
+
export * from './formAdapter';
|
|
2
|
+
export * from './formModel';
|
|
3
|
+
export * from './formControlModel';
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
package/dist/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
package/dist/options.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initOptions = void 0;
|
|
4
|
-
const core_1 = require("@omegagrid/core");
|
|
1
|
+
import { initCommonOptions } from "@omegagrid/core";
|
|
5
2
|
const DEFAULT_OPTIONS = {
|
|
6
3
|
caption: null,
|
|
7
4
|
buttonsPosition: 'bottom',
|
|
@@ -9,13 +6,12 @@ const DEFAULT_OPTIONS = {
|
|
|
9
6
|
buttons: [],
|
|
10
7
|
closeAfterSave: true
|
|
11
8
|
};
|
|
12
|
-
function initOptions(options, origOptions = null) {
|
|
9
|
+
export function initOptions(options, origOptions = null) {
|
|
13
10
|
return {
|
|
14
|
-
...
|
|
11
|
+
...initCommonOptions(options, origOptions),
|
|
15
12
|
...DEFAULT_OPTIONS,
|
|
16
13
|
...origOptions,
|
|
17
14
|
...options,
|
|
18
15
|
};
|
|
19
16
|
}
|
|
20
|
-
exports.initOptions = initOptions;
|
|
21
17
|
//# sourceMappingURL=options.js.map
|
package/dist/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,eAAe,GAAkC;IACtD,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,QAAQ;IACxB,OAAO,EAAE,EAAE;IACX,cAAc,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,OAAuC,EAAE,cAAoC,IAAI;IAC5G,OAAO;QACN,GAAG,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC;QAC1C,GAAG,eAAe;QAClB,GAAG,WAAW;QACd,GAAG,OAAO;KACV,CAAC;AACH,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormControlType = void 0;
|
|
4
|
-
var FormControlType;
|
|
1
|
+
export var FormControlType;
|
|
5
2
|
(function (FormControlType) {
|
|
6
3
|
FormControlType["TextInput"] = "text";
|
|
7
4
|
FormControlType["Button"] = "button";
|
|
@@ -13,5 +10,5 @@ var FormControlType;
|
|
|
13
10
|
FormControlType["List"] = "list";
|
|
14
11
|
FormControlType["ColorInput"] = "color";
|
|
15
12
|
FormControlType["FileInput"] = "file";
|
|
16
|
-
})(FormControlType || (
|
|
13
|
+
})(FormControlType || (FormControlType = {}));
|
|
17
14
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IAC1B,qCAAkB,CAAA;IAClB,oCAAiB,CAAA;IACjB,0CAAuB,CAAA;IACvB,qCAAkB,CAAA;IAClB,iDAA8B,CAAA;IAC9B,wCAAqB,CAAA;IACrB,kCAAe,CAAA;IACf,gCAAa,CAAA;IACb,uCAAoB,CAAA;IACpB,qCAAkB,CAAA;AACnB,CAAC,EAXW,eAAe,KAAf,eAAe,QAW1B"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const decorators_js_1 = require("lit/decorators.js");
|
|
12
|
-
class ControlEvent extends Event {
|
|
7
|
+
import { css, LitElement } from 'lit';
|
|
8
|
+
import { property } from "lit/decorators.js";
|
|
9
|
+
export class ControlEvent extends Event {
|
|
13
10
|
constructor(type, model, value) {
|
|
14
11
|
super(type, { bubbles: true, cancelable: true, composed: true });
|
|
15
12
|
this.model = model;
|
|
16
13
|
this.value = value;
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
class BaseControl extends lit_1.LitElement {
|
|
16
|
+
export class BaseControl extends LitElement {
|
|
21
17
|
constructor() {
|
|
22
18
|
super(...arguments);
|
|
23
19
|
this.value = null;
|
|
@@ -53,8 +49,7 @@ class BaseControl extends lit_1.LitElement {
|
|
|
53
49
|
}
|
|
54
50
|
get isValid() { return this.model.errors.length == 0; }
|
|
55
51
|
}
|
|
56
|
-
|
|
57
|
-
BaseControl.styles = [(0, lit_1.css) `
|
|
52
|
+
BaseControl.styles = [css `
|
|
58
53
|
:host {
|
|
59
54
|
display: block;
|
|
60
55
|
}
|
|
@@ -68,18 +63,18 @@ BaseControl.styles = [(0, lit_1.css) `
|
|
|
68
63
|
}
|
|
69
64
|
`];
|
|
70
65
|
__decorate([
|
|
71
|
-
|
|
66
|
+
property({ type: Object })
|
|
72
67
|
], BaseControl.prototype, "model", void 0);
|
|
73
68
|
__decorate([
|
|
74
|
-
|
|
69
|
+
property({ type: Object })
|
|
75
70
|
], BaseControl.prototype, "formModel", void 0);
|
|
76
71
|
__decorate([
|
|
77
|
-
|
|
72
|
+
property({ type: Object })
|
|
78
73
|
], BaseControl.prototype, "adapter", void 0);
|
|
79
74
|
__decorate([
|
|
80
|
-
|
|
75
|
+
property({ type: Object })
|
|
81
76
|
], BaseControl.prototype, "value", void 0);
|
|
82
77
|
__decorate([
|
|
83
|
-
|
|
78
|
+
property({ type: Boolean, reflect: true })
|
|
84
79
|
], BaseControl.prototype, "required", void 0);
|
|
85
80
|
//# sourceMappingURL=baseControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseControl.js","sourceRoot":"","sources":["../../../src/ui/controls/baseControl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"baseControl.js","sourceRoot":"","sources":["../../../src/ui/controls/baseControl.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,E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ACpD,CAAC;IAED,QAAQ;QACP,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO;QACxB,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAChD,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QACxB,CAAC;IACF,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAA,CAAC,CAAC;;AA3D/C,kBAAM,GAAG,CAAC,GAAG,CAAA;;;;;;;;;;;;EAYnB,CAAC,AAZW,CAYV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CACD;AAGxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;8CACJ;AAGrB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACP;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CACJ;AAGrB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACxB"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const baseControl_1 = require("./baseControl");
|
|
14
|
-
let FormButton = class FormButton extends core_1.Button {
|
|
7
|
+
import { colorable, Button as CoreButton, utils } from "@omegagrid/core";
|
|
8
|
+
import { css } from "lit";
|
|
9
|
+
import { customElement, property } from "lit/decorators.js";
|
|
10
|
+
import { ControlEvent } from "./baseControl";
|
|
11
|
+
let FormButton = class FormButton extends CoreButton {
|
|
15
12
|
constructor() {
|
|
16
13
|
super();
|
|
17
14
|
this.value = null;
|
|
@@ -26,7 +23,7 @@ let FormButton = class FormButton extends core_1.Button {
|
|
|
26
23
|
this.value = value;
|
|
27
24
|
this.validate();
|
|
28
25
|
if (dispatchEvent) {
|
|
29
|
-
this.dispatchEvent(new
|
|
26
|
+
this.dispatchEvent(new ControlEvent('change', this.model, value));
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
willUpdate(props) {
|
|
@@ -40,7 +37,7 @@ let FormButton = class FormButton extends core_1.Button {
|
|
|
40
37
|
this.state = 'unchecked';
|
|
41
38
|
}
|
|
42
39
|
if (this.icon) {
|
|
43
|
-
if (
|
|
40
|
+
if (utils.isObject(this.icon)) {
|
|
44
41
|
this.buttonIcon = this.icon;
|
|
45
42
|
}
|
|
46
43
|
else if (this.icon) {
|
|
@@ -60,24 +57,24 @@ let FormButton = class FormButton extends core_1.Button {
|
|
|
60
57
|
}
|
|
61
58
|
get isValid() { return this.model.errors.length === 0; }
|
|
62
59
|
};
|
|
63
|
-
|
|
64
|
-
FormButton.styles = [...core_1.Button.styles, (0, lit_1.css) `
|
|
60
|
+
FormButton.styles = [...CoreButton.styles, css `
|
|
65
61
|
:host {
|
|
66
62
|
width: 100%;
|
|
67
63
|
text-align: center;
|
|
68
64
|
}
|
|
69
65
|
`];
|
|
70
66
|
__decorate([
|
|
71
|
-
|
|
67
|
+
property({ type: Object })
|
|
72
68
|
], FormButton.prototype, "model", void 0);
|
|
73
69
|
__decorate([
|
|
74
|
-
|
|
70
|
+
property({ type: Object })
|
|
75
71
|
], FormButton.prototype, "adapter", void 0);
|
|
76
72
|
__decorate([
|
|
77
|
-
|
|
73
|
+
property({ type: String })
|
|
78
74
|
], FormButton.prototype, "value", void 0);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
FormButton = __decorate([
|
|
76
|
+
customElement('og-form-button'),
|
|
77
|
+
colorable({ props: ['color', 'border', 'background'] })
|
|
82
78
|
], FormButton);
|
|
79
|
+
export { FormButton };
|
|
83
80
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/ui/controls/button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/ui/controls/button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,UAAU,EAAY,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAIhD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAkBzC;QACC,KAAK,EAAE,CAAC;QAHT,UAAK,GAAW,IAAI,CAAC;QAIpB,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACnC,+BAA+B;YAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;IAES,WAAW,CAAC,KAAa,EAAE,aAAa,GAAG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arDateInput.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/calendarDateInput.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAS,MAAM,EAAS,MAAM,iBAAiB,CAAC;AAGvD,qBACa,iBAAkB,SAAQ,WAAW,CAAC,IAAI,GAAC,MAAM,CAAC;IAE9D,MAAM,CAAC,MAAM,4BAA2B;IAExC,IAAI,cAAc,sBAUjB;IAED,SAAS,MAAO,MAAM,CAAC,WAAW,UAEjC;IAED,IAAI,IAAI,SASP;IAED,MAAM,6CAaJ;CAEF"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const localize_1 = require("@omegagrid/localize");
|
|
15
|
-
let CalendarDateInput = class CalendarDateInput extends baseControl_1.BaseControl {
|
|
7
|
+
import { html } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import { BaseControl } from "./baseControl";
|
|
10
|
+
import { dates, utils } from "@omegagrid/core";
|
|
11
|
+
import { getLocale } from "@omegagrid/localize";
|
|
12
|
+
let CalendarDateInput = class CalendarDateInput extends BaseControl {
|
|
16
13
|
constructor() {
|
|
17
14
|
super(...arguments);
|
|
18
15
|
this._onChange = (e) => {
|
|
19
16
|
this.updateValue(e.value);
|
|
20
17
|
};
|
|
21
|
-
this.render = () =>
|
|
18
|
+
this.render = () => html `
|
|
22
19
|
<og-calendar-dropdown
|
|
23
20
|
@change="${this._onChange}"
|
|
24
21
|
.options="${{
|
|
@@ -46,8 +43,8 @@ let CalendarDateInput = class CalendarDateInput extends baseControl_1.BaseContro
|
|
|
46
43
|
return [[this.value, 0, 1]];
|
|
47
44
|
}
|
|
48
45
|
get date() {
|
|
49
|
-
if (
|
|
50
|
-
|
|
46
|
+
if (utils.isString(this.value)) {
|
|
47
|
+
dates.parse(this.value, getLocale());
|
|
51
48
|
return new Date(this.value);
|
|
52
49
|
}
|
|
53
50
|
else if (this.value instanceof Date) {
|
|
@@ -58,9 +55,9 @@ let CalendarDateInput = class CalendarDateInput extends baseControl_1.BaseContro
|
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
57
|
};
|
|
61
|
-
|
|
62
|
-
CalendarDateInput
|
|
63
|
-
|
|
64
|
-
(0, decorators_js_1.customElement)('og-form-calendardateinput')
|
|
58
|
+
CalendarDateInput.styles = [...BaseControl.styles];
|
|
59
|
+
CalendarDateInput = __decorate([
|
|
60
|
+
customElement('og-form-calendardateinput')
|
|
65
61
|
], CalendarDateInput);
|
|
62
|
+
export { CalendarDateInput };
|
|
66
63
|
//# sourceMappingURL=calendarDateInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendarDateInput.js","sourceRoot":"","sources":["../../../src/ui/controls/calendarDateInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calendarDateInput.js","sourceRoot":"","sources":["../../../src/ui/controls/calendarDateInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,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EAAE,CAAC,EAAE,CAAC,CAAC,CAAsB,CAAC;IAClD,CAAC;IAMD,IAAI,IAAI;QACP,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAe,EAAE,SAAS,EAAE,CAAC,CAAC;YAC/C,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,YAAY,IAAI,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;aAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;;AA3BM,wBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,AAA1B,CAA2B;AAF5B,iBAAiB;IAD7B,aAAa,CAAC,2BAA2B,CAAC;GAC9B,iBAAiB,CA8C7B"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const baseControl_1 = require("./baseControl");
|
|
13
|
-
let FormCheckbox = class FormCheckbox extends baseControl_1.BaseControl {
|
|
7
|
+
import { html } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import { BaseControl } from "./baseControl";
|
|
10
|
+
let FormCheckbox = class FormCheckbox extends BaseControl {
|
|
14
11
|
get isValid() { return true; }
|
|
15
12
|
constructor() {
|
|
16
13
|
super();
|
|
17
|
-
this.render = () =>
|
|
14
|
+
this.render = () => html `
|
|
18
15
|
<og-checkbox .value="${this.value ? 'checked' : 'none'}"></og-checkbox>
|
|
19
16
|
`;
|
|
20
17
|
this.addEventListener('click', () => {
|
|
@@ -22,8 +19,8 @@ let FormCheckbox = class FormCheckbox extends baseControl_1.BaseControl {
|
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
21
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, decorators_js_1.customElement)('og-form-checkbox')
|
|
22
|
+
FormCheckbox = __decorate([
|
|
23
|
+
customElement('og-form-checkbox')
|
|
28
24
|
], FormCheckbox);
|
|
25
|
+
export { FormCheckbox };
|
|
29
26
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/ui/controls/checkbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/ui/controls/checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGrC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,WAAoB;IAErD,IAAI,OAAO,KAAK,OAAO,IAAI,CAAA,CAAC,CAAC;IAE7B;QACC,KAAK,EAAE,CAAC;QAMT,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;yBACK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;EACtD,CAAC;QAPD,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACnC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACJ,CAAC;CAMD,CAAA;AAfY,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CAexB"}
|