@omegagrid/form 0.5.19 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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
|
@@ -1,26 +1,23 @@
|
|
|
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 core_1 = require("@omegagrid/core");
|
|
15
|
-
let FormColorInput = class FormColorInput extends baseControl_1.BaseControl {
|
|
7
|
+
import { html } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import { BaseControl } from "./baseControl";
|
|
10
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
11
|
+
import { utils } from "@omegagrid/core";
|
|
12
|
+
let FormColorInput = class FormColorInput extends BaseControl {
|
|
16
13
|
constructor() {
|
|
17
14
|
super(...arguments);
|
|
18
15
|
this._onSelect = (e) => {
|
|
19
|
-
this.updateValue(
|
|
16
|
+
this.updateValue(utils.trim(e.color, '#'));
|
|
20
17
|
};
|
|
21
|
-
this.render = () =>
|
|
18
|
+
this.render = () => html `
|
|
22
19
|
<og-dropdown>
|
|
23
|
-
<div slot="label" style="${
|
|
20
|
+
<div slot="label" style="${styleMap({ backgroundColor: this.value ? `#${this.value}` : 'transparent', marginRight: '4px' })}">
|
|
24
21
|
<og-fa-icon icon="fill"></og-fa-icon>
|
|
25
22
|
</div>
|
|
26
23
|
|
|
@@ -34,9 +31,9 @@ let FormColorInput = class FormColorInput extends baseControl_1.BaseControl {
|
|
|
34
31
|
`;
|
|
35
32
|
}
|
|
36
33
|
};
|
|
37
|
-
|
|
38
|
-
FormColorInput
|
|
39
|
-
|
|
40
|
-
(0, decorators_js_1.customElement)('og-form-colorinput')
|
|
34
|
+
FormColorInput.styles = [...BaseControl.styles];
|
|
35
|
+
FormColorInput = __decorate([
|
|
36
|
+
customElement('og-form-colorinput')
|
|
41
37
|
], FormColorInput);
|
|
38
|
+
export { FormColorInput };
|
|
42
39
|
//# sourceMappingURL=colorInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorInput.js","sourceRoot":"","sources":["../../../src/ui/controls/colorInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colorInput.js","sourceRoot":"","sources":["../../../src/ui/controls/colorInput.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;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAoB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGnD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAmB;IAAhD;;QAIN,cAAS,GAAG,CAAC,CAAmB,EAAE,EAAE;YACnC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAA;QAED,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;;8BAEU,QAAQ,CAAC,EAAC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,KAAK,EAAC,CAAC;;;;;;cAM9G,IAAI,CAAC,KAAK;eACT,IAAI,CAAC,SAAS;kBACX,CAAC,CAAa,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE;;;EAGtD,CAAC;IAEH,CAAC;;AArBO,qBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,AAA1B,CAA2B;AAF5B,cAAc;IAD1B,aAAa,CAAC,oBAAoB,CAAC;GACvB,cAAc,CAuB1B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
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);
|
|
@@ -17,15 +16,13 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
17
16
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
18
17
|
};
|
|
19
18
|
var _FormDateInput_adapter;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const localize_1 = require("@omegagrid/localize");
|
|
28
|
-
let FormDateInput = class FormDateInput extends baseControl_1.BaseControl {
|
|
19
|
+
import { html } from "lit";
|
|
20
|
+
import { customElement } from "lit/decorators.js";
|
|
21
|
+
import { BaseControl } from "./baseControl";
|
|
22
|
+
import { DateTreeAdapter } from "@omegagrid/tree";
|
|
23
|
+
import { dates } from "@omegagrid/core";
|
|
24
|
+
import { getLocale } from "@omegagrid/localize";
|
|
25
|
+
let FormDateInput = class FormDateInput extends BaseControl {
|
|
29
26
|
constructor() {
|
|
30
27
|
super(...arguments);
|
|
31
28
|
_FormDateInput_adapter.set(this, void 0);
|
|
@@ -35,7 +32,7 @@ let FormDateInput = class FormDateInput extends baseControl_1.BaseControl {
|
|
|
35
32
|
const strDate = e.node.key;
|
|
36
33
|
this.updateValue(new Date(parseInt(strDate.substring(0, 4)), parseInt(strDate.substring(4, 6)) - 1, parseInt(strDate.substring(6, 8)), 0, 0, 0));
|
|
37
34
|
};
|
|
38
|
-
this.render = () =>
|
|
35
|
+
this.render = () => html `
|
|
39
36
|
<og-tree-dropdown
|
|
40
37
|
@change="${this._onChange}"
|
|
41
38
|
.adapter="${this.dateAdapter}"
|
|
@@ -51,7 +48,7 @@ let FormDateInput = class FormDateInput extends baseControl_1.BaseControl {
|
|
|
51
48
|
</og-tree-dropdown>
|
|
52
49
|
`;
|
|
53
50
|
}
|
|
54
|
-
get dateAdapter() {
|
|
51
|
+
get dateAdapter() { return __classPrivateFieldGet(this, _FormDateInput_adapter, "f") ?? (__classPrivateFieldSet(this, _FormDateInput_adapter, new DateTreeAdapter(this.model.props.options), "f")); }
|
|
55
52
|
get treeValue() {
|
|
56
53
|
if (!this.value)
|
|
57
54
|
return null;
|
|
@@ -65,15 +62,15 @@ let FormDateInput = class FormDateInput extends baseControl_1.BaseControl {
|
|
|
65
62
|
].join('-');
|
|
66
63
|
}
|
|
67
64
|
else {
|
|
68
|
-
date =
|
|
65
|
+
date = dates.parse(this.value, getLocale());
|
|
69
66
|
}
|
|
70
|
-
return [[this.value, 0, 1, { value:
|
|
67
|
+
return [[this.value, 0, 1, { value: dates.getDateFormatter(getLocale())(date) }]];
|
|
71
68
|
}
|
|
72
69
|
};
|
|
73
|
-
exports.FormDateInput = FormDateInput;
|
|
74
70
|
_FormDateInput_adapter = new WeakMap();
|
|
75
|
-
FormDateInput.styles = [...
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
FormDateInput.styles = [...BaseControl.styles];
|
|
72
|
+
FormDateInput = __decorate([
|
|
73
|
+
customElement('og-form-dateinput')
|
|
78
74
|
], FormDateInput);
|
|
75
|
+
export { FormDateInput };
|
|
79
76
|
//# sourceMappingURL=dateInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateInput.js","sourceRoot":"","sources":["../../../src/ui/controls/dateInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dateInput.js","sourceRoot":"","sources":["../../../src/ui/controls/dateInput.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;AAC5C,OAAO,EAAE,eAAe,EAA8B,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGzC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAwB;IAApD;;QAIN,yCAA0B;QAoB1B,cAAS,GAAG,CAAC,CAAY,EAAE,EAAE;YAC5B,IAAI,CAAC,CAAC,CAAC,IAAI;gBAAE,OAAO;YACpB,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YAC3B,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CACxB,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EACjC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EACrC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAA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M,CAAC;YACP,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAe,EAAE,SAAS,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,EAAC,CAAC,CAAsB,CAAC;IACtG,CAAC;;;AApBM,oBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,AAA1B,CAA2B;AAF5B,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAmDzB"}
|
|
@@ -1,31 +1,28 @@
|
|
|
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 FormFileInput = class FormFileInput extends baseControl_1.BaseControl {
|
|
7
|
+
import { css, html } from "lit";
|
|
8
|
+
import { customElement } from "lit/decorators.js";
|
|
9
|
+
import { BaseControl } from "./baseControl";
|
|
10
|
+
let FormFileInput = class FormFileInput extends BaseControl {
|
|
14
11
|
constructor() {
|
|
15
12
|
super(...arguments);
|
|
16
|
-
this.render = () =>
|
|
13
|
+
this.render = () => html `
|
|
17
14
|
<og-fileinput @change="${(e) => this.updateValue(e.value)}"></og-fileinput>
|
|
18
15
|
`;
|
|
19
16
|
}
|
|
20
17
|
};
|
|
21
|
-
|
|
22
|
-
FormFileInput.styles = [...baseControl_1.BaseControl.styles, (0, lit_1.css) `
|
|
18
|
+
FormFileInput.styles = [...BaseControl.styles, css `
|
|
23
19
|
og-fileinput {
|
|
24
20
|
border-color: var(--og-accent-color);
|
|
25
21
|
width: 100%;
|
|
26
22
|
}
|
|
27
23
|
`];
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
FormFileInput = __decorate([
|
|
25
|
+
customElement('og-form-fileinput')
|
|
30
26
|
], FormFileInput);
|
|
27
|
+
export { FormFileInput };
|
|
31
28
|
//# sourceMappingURL=fileInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileInput.js","sourceRoot":"","sources":["../../../src/ui/controls/fileInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fileInput.js","sourceRoot":"","sources":["../../../src/ui/controls/fileInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIrC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAiB;IAA7C;;QASN,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;2BACO,CAAC,CAAqB,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;EAC7E,CAAC;IAEH,CAAC;;AAXO,oBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;EAK1C,CAAC,AALW,CAKV;AAPS,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAazB"}
|
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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("./textInput"), exports);
|
|
18
|
-
__exportStar(require("./colorInput"), exports);
|
|
19
|
-
__exportStar(require("./dateInput"), exports);
|
|
20
|
-
__exportStar(require("./calendarDateInput"), exports);
|
|
21
|
-
__exportStar(require("./numericInput"), exports);
|
|
22
|
-
__exportStar(require("./fileInput"), exports);
|
|
23
|
-
__exportStar(require("./checkbox"), exports);
|
|
24
|
-
__exportStar(require("./label"), exports);
|
|
25
|
-
__exportStar(require("./list"), exports);
|
|
26
|
-
__exportStar(require("./button"), exports);
|
|
1
|
+
export * from './textInput';
|
|
2
|
+
export * from './colorInput';
|
|
3
|
+
export * from './dateInput';
|
|
4
|
+
export * from './calendarDateInput';
|
|
5
|
+
export * from './numericInput';
|
|
6
|
+
export * from './fileInput';
|
|
7
|
+
export * from './checkbox';
|
|
8
|
+
export * from './label';
|
|
9
|
+
export * from './list';
|
|
10
|
+
export * from './button';
|
|
27
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/controls/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/controls/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -1,30 +1,26 @@
|
|
|
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 FormLabel = class FormLabel extends baseControl_1.BaseControl {
|
|
7
|
+
import { css, html } from "lit";
|
|
8
|
+
import { classMap } from "lit-html/directives/class-map.js";
|
|
9
|
+
import { customElement } from "lit/decorators.js";
|
|
10
|
+
import { BaseControl } from "./baseControl";
|
|
11
|
+
let FormLabel = class FormLabel extends BaseControl {
|
|
15
12
|
constructor() {
|
|
16
13
|
super(...arguments);
|
|
17
|
-
this.render = () =>
|
|
14
|
+
this.render = () => html `
|
|
18
15
|
<label
|
|
19
16
|
for="${this.model.props.for}"
|
|
20
|
-
class="${
|
|
17
|
+
class="${classMap({ required: this.model.props.required })}">
|
|
21
18
|
${this.value}
|
|
22
19
|
</label>
|
|
23
20
|
`;
|
|
24
21
|
}
|
|
25
22
|
};
|
|
26
|
-
|
|
27
|
-
FormLabel.styles = [...baseControl_1.BaseControl.styles, (0, lit_1.css) `
|
|
23
|
+
FormLabel.styles = [...BaseControl.styles, css `
|
|
28
24
|
:host {
|
|
29
25
|
width: 100%;
|
|
30
26
|
border: none !important;
|
|
@@ -48,7 +44,8 @@ FormLabel.styles = [...baseControl_1.BaseControl.styles, (0, lit_1.css) `
|
|
|
48
44
|
*/
|
|
49
45
|
|
|
50
46
|
`];
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
FormLabel = __decorate([
|
|
48
|
+
customElement('og-form-label')
|
|
53
49
|
], FormLabel);
|
|
50
|
+
export { FormLabel };
|
|
54
51
|
//# sourceMappingURL=label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/ui/controls/label.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/ui/controls/label.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGrC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAmB;IAA3C;;QA2BN,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;;UAEV,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG;YAClB,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAC,CAAC;KACtD,IAAI,CAAC,KAAK;;EAEb,CAAC;IAEH,CAAC;;AAjCO,gBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;EAuB1C,CAAC,AAvBW,CAuBV;AAzBS,SAAS;IADrB,aAAa,CAAC,eAAe,CAAC;GAClB,SAAS,CAmCrB"}
|
package/dist/ui/controls/list.js
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
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 tree_1 = require("@omegagrid/tree");
|
|
14
|
-
let FormList = class FormList extends baseControl_1.BaseControl {
|
|
7
|
+
import { html } from "lit";
|
|
8
|
+
import { customElement, query } from "lit/decorators.js";
|
|
9
|
+
import { BaseControl } from "./baseControl";
|
|
10
|
+
import { SelectMode } from "@omegagrid/tree";
|
|
11
|
+
let FormList = class FormList extends BaseControl {
|
|
15
12
|
constructor() {
|
|
16
13
|
super(...arguments);
|
|
17
14
|
this._firstOpen = true;
|
|
18
15
|
this._onChange = (e) => {
|
|
19
16
|
const values = e.component.selection.serialize();
|
|
20
|
-
if (this.dropdown.tree.options.selectMode ==
|
|
17
|
+
if (this.dropdown.tree.options.selectMode == SelectMode.Single)
|
|
21
18
|
this.updateValue(values.length > 0 ? values[0][0] : null, true);
|
|
22
19
|
else
|
|
23
20
|
this.updateValue(values, true);
|
|
24
21
|
};
|
|
25
22
|
this._onDropdownOpen = () => {
|
|
26
|
-
var _a;
|
|
27
23
|
if (this._firstOpen)
|
|
28
24
|
this._firstOpen = false;
|
|
29
25
|
else
|
|
30
|
-
|
|
26
|
+
this.adapter?.attach(this.dropdown.tree);
|
|
31
27
|
};
|
|
32
|
-
this.render = () =>
|
|
28
|
+
this.render = () => html `
|
|
33
29
|
<og-tree-dropdown
|
|
34
30
|
@change="${this._onChange}"
|
|
35
31
|
@dropdown.open="${this._onDropdownOpen}"
|
|
@@ -53,15 +49,14 @@ let FormList = class FormList extends baseControl_1.BaseControl {
|
|
|
53
49
|
}
|
|
54
50
|
}
|
|
55
51
|
getAdapter() {
|
|
56
|
-
|
|
57
|
-
return (_a = this.adapter) !== null && _a !== void 0 ? _a : (_b = this.formModel.options) === null || _b === void 0 ? void 0 : _b.treeAdapter;
|
|
52
|
+
return this.adapter ?? this.formModel.options?.treeAdapter;
|
|
58
53
|
}
|
|
59
54
|
async willUpdate() {
|
|
60
55
|
if (this.value) {
|
|
61
56
|
const adapter = this.getAdapter();
|
|
62
57
|
if (adapter) {
|
|
63
58
|
const [options] = await Promise.all([adapter.getOptions()]);
|
|
64
|
-
if (options && options.selectMode ==
|
|
59
|
+
if (options && options.selectMode == SelectMode.Single)
|
|
65
60
|
this.updateValue(Array.isArray(this.value) && this.value.length > 0 ? this.value[0][0] : this.value);
|
|
66
61
|
}
|
|
67
62
|
}
|
|
@@ -73,11 +68,11 @@ let FormList = class FormList extends baseControl_1.BaseControl {
|
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
70
|
};
|
|
76
|
-
exports.FormList = FormList;
|
|
77
71
|
__decorate([
|
|
78
|
-
|
|
72
|
+
query('og-tree-dropdown')
|
|
79
73
|
], FormList.prototype, "dropdown", void 0);
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
FormList = __decorate([
|
|
75
|
+
customElement('og-form-list')
|
|
82
76
|
], FormList);
|
|
77
|
+
export { FormList };
|
|
83
78
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/ui/controls/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/ui/controls/list.ts"],"names":[],"mappings":";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,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvG,CAAC;QACF,CAAC;IACF,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAmD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAyD,CAAC;YAC3I,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAClE,CAAC;IACF,CAAC;CAcD,CAAA;AAjEA;IADC,KAAK,CAAC,kBAAkB,CAAC;0CACH;AAHX,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CAoEpB"}
|
|
@@ -1,20 +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 constants_1 = __importDefault(require("../../constants"));
|
|
14
|
-
const lit_1 = require("lit");
|
|
15
|
-
const decorators_js_1 = require("lit/decorators.js");
|
|
16
|
-
const baseControl_1 = require("./baseControl");
|
|
17
|
-
let FormNumericInput = class FormNumericInput extends baseControl_1.BaseControl {
|
|
7
|
+
import constants from "../../constants";
|
|
8
|
+
import { css, html } from "lit";
|
|
9
|
+
import { customElement, property } from "lit/decorators.js";
|
|
10
|
+
import { BaseControl } from "./baseControl";
|
|
11
|
+
let FormNumericInput = class FormNumericInput extends BaseControl {
|
|
18
12
|
validate() {
|
|
19
13
|
super.validate();
|
|
20
14
|
}
|
|
@@ -35,22 +29,19 @@ let FormNumericInput = class FormNumericInput extends baseControl_1.BaseControl
|
|
|
35
29
|
this._onChange = (e) => {
|
|
36
30
|
this.updateValue(parseFloat(e.target.value));
|
|
37
31
|
};
|
|
38
|
-
this.up = () =>
|
|
39
|
-
this.down = () =>
|
|
40
|
-
this.render = () =>
|
|
41
|
-
var _a;
|
|
42
|
-
return (0, lit_1.html) `
|
|
32
|
+
this.up = () => this.updateValue((this.value ?? -1) + 1);
|
|
33
|
+
this.down = () => this.updateValue((this.value ?? 1) - 1);
|
|
34
|
+
this.render = () => html `
|
|
43
35
|
<input
|
|
44
36
|
type="text"
|
|
45
37
|
.value="${this.value == null ? '' : this.value.toString()}"
|
|
46
|
-
placeholder="${
|
|
38
|
+
placeholder="${this.model?.props.placeholder}"
|
|
47
39
|
@change="${this._onChange}" />
|
|
48
40
|
<div class="buttons">
|
|
49
41
|
<div id="btnUp" @click="${() => this.up()}"><og-fa-icon icon="caret-up"></og-fa-icon></div>
|
|
50
42
|
<div id="btnDown" @click="${() => this.down()}"><og-fa-icon icon="caret-down"></og-fa-icon></div>
|
|
51
43
|
</div>
|
|
52
44
|
`;
|
|
53
|
-
};
|
|
54
45
|
this.addEventListener('keydown', this._onKeydown);
|
|
55
46
|
}
|
|
56
47
|
updateValue(value) {
|
|
@@ -61,15 +52,14 @@ let FormNumericInput = class FormNumericInput extends baseControl_1.BaseControl
|
|
|
61
52
|
super.updateValue(value);
|
|
62
53
|
}
|
|
63
54
|
};
|
|
64
|
-
|
|
65
|
-
FormNumericInput.styles = [...baseControl_1.BaseControl.styles, (0, lit_1.css) `
|
|
55
|
+
FormNumericInput.styles = [...BaseControl.styles, css `
|
|
66
56
|
input {
|
|
67
57
|
border: 1px solid var(--og-accent-color);
|
|
68
58
|
background-color: var(--og-form-background-color);
|
|
69
59
|
color: var(--og-text-color);
|
|
70
60
|
font-size: var(--og-font-size);
|
|
71
|
-
height: ${
|
|
72
|
-
line-height: ${
|
|
61
|
+
height: ${constants.FORM_CONTROL_HEIGHT}px;
|
|
62
|
+
line-height: ${constants.FORM_CONTROL_HEIGHT}px;
|
|
73
63
|
outline: none;
|
|
74
64
|
width: 100%;
|
|
75
65
|
position: relative;
|
|
@@ -124,12 +114,13 @@ FormNumericInput.styles = [...baseControl_1.BaseControl.styles, (0, lit_1.css) `
|
|
|
124
114
|
}
|
|
125
115
|
`];
|
|
126
116
|
__decorate([
|
|
127
|
-
|
|
117
|
+
property({ type: Number })
|
|
128
118
|
], FormNumericInput.prototype, "min", void 0);
|
|
129
119
|
__decorate([
|
|
130
|
-
|
|
120
|
+
property({ type: Number })
|
|
131
121
|
], FormNumericInput.prototype, "max", void 0);
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
FormNumericInput = __decorate([
|
|
123
|
+
customElement('og-form-numericinput')
|
|
134
124
|
], FormNumericInput);
|
|
125
|
+
export { FormNumericInput };
|
|
135
126
|
//# sourceMappingURL=numericInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numericInput.js","sourceRoot":"","sources":["../../../src/ui/controls/numericInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"numericInput.js","sourceRoot":"","sources":["../../../src/ui/controls/numericInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;A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EAAE,CAAC,IAAI,CAAC,IAAI,EAAE;;EAE9C,CAAC;QAzCD,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAmBD,WAAW,CAAC,KAAa;QACxB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC5D,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7D,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;;AApGM,uBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;aAM/B,SAAS,CAAC,mBAAmB;kBACxB,SAAS,CAAC,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqD7C,CAAC,AA5DW,CA4DV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACb;AAGZ;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACb;AApEA,gBAAgB;IAD5B,aAAa,CAAC,sBAAsB,CAAC;GACzB,gBAAgB,CAuH5B"}
|
|
@@ -1,20 +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 constants_1 = __importDefault(require("../../constants"));
|
|
14
|
-
const lit_1 = require("lit");
|
|
15
|
-
const decorators_js_1 = require("lit/decorators.js");
|
|
16
|
-
const baseControl_1 = require("./baseControl");
|
|
17
|
-
let FormTextInput = class FormTextInput extends baseControl_1.BaseControl {
|
|
7
|
+
import constants from "../../constants";
|
|
8
|
+
import { css, html } from "lit";
|
|
9
|
+
import { customElement } from "lit/decorators.js";
|
|
10
|
+
import { BaseControl } from "./baseControl";
|
|
11
|
+
let FormTextInput = class FormTextInput extends BaseControl {
|
|
18
12
|
constructor() {
|
|
19
13
|
super(...arguments);
|
|
20
14
|
this._onChange = (e) => {
|
|
@@ -25,43 +19,39 @@ let FormTextInput = class FormTextInput extends baseControl_1.BaseControl {
|
|
|
25
19
|
this.updateValue(e.target.value);
|
|
26
20
|
}
|
|
27
21
|
};
|
|
28
|
-
this.render = () =>
|
|
29
|
-
var _a, _b;
|
|
30
|
-
return (0, lit_1.html) `
|
|
22
|
+
this.render = () => html `
|
|
31
23
|
<input
|
|
32
24
|
type="text"
|
|
33
25
|
.value="${this.value == null ? '' : this.value}"
|
|
34
|
-
placeholder="${
|
|
26
|
+
placeholder="${this.model?.props.placeholder ?? ''}"
|
|
35
27
|
@change="${this._onChange}"
|
|
36
28
|
@keydown="${this._onKeyDown}"
|
|
37
29
|
>
|
|
38
30
|
`;
|
|
39
|
-
};
|
|
40
31
|
}
|
|
41
32
|
validate() {
|
|
42
|
-
var _a;
|
|
43
33
|
super.validate();
|
|
44
34
|
if (!this.model)
|
|
45
35
|
return;
|
|
46
|
-
if (this.model.props.pattern && !this.model.props.pattern.test(
|
|
36
|
+
if (this.model.props.pattern && !this.model.props.pattern.test(this.value ?? "")) {
|
|
47
37
|
this.model.errors.push('invalid value');
|
|
48
38
|
}
|
|
49
39
|
}
|
|
50
40
|
};
|
|
51
|
-
|
|
52
|
-
FormTextInput.styles = [...baseControl_1.BaseControl.styles, (0, lit_1.css) `
|
|
41
|
+
FormTextInput.styles = [...BaseControl.styles, css `
|
|
53
42
|
input {
|
|
54
43
|
border: 1px solid var(--og-accent-color);
|
|
55
44
|
background-color: var(--og-form-background-color);
|
|
56
45
|
color: var(--og-text-color);
|
|
57
46
|
font-size: var(--og-font-size);
|
|
58
|
-
height: ${
|
|
59
|
-
line-height: ${
|
|
47
|
+
height: ${constants.FORM_CONTROL_HEIGHT}px;
|
|
48
|
+
line-height: ${constants.FORM_CONTROL_HEIGHT}px;
|
|
60
49
|
outline: none;
|
|
61
50
|
width: 100%;
|
|
62
51
|
}
|
|
63
52
|
`];
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
FormTextInput = __decorate([
|
|
54
|
+
customElement('og-form-textinput')
|
|
66
55
|
], FormTextInput);
|
|
56
|
+
export { FormTextInput };
|
|
67
57
|
//# sourceMappingURL=textInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textInput.js","sourceRoot":"","sources":["../../../src/ui/controls/textInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textInput.js","sourceRoot":"","sources":["../../../src/ui/controls/textInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGrC,IAAM,aAAa,GAAnB,MAAM,aAAc,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