@icure/form 1.0.0 → 1.0.4

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 (74) hide show
  1. package/lib/components/index.d.ts +2 -0
  2. package/lib/components/index.js +14 -0
  3. package/lib/components/iqr-form/fields/datePicker.d.ts +8 -0
  4. package/lib/components/iqr-form/fields/datePicker.js +42 -0
  5. package/lib/components/iqr-form/fields/dateTimePicker.d.ts +8 -0
  6. package/lib/components/iqr-form/fields/dateTimePicker.js +42 -0
  7. package/lib/components/iqr-form/fields/measureField.d.ts +8 -0
  8. package/lib/components/iqr-form/fields/measureField.js +42 -0
  9. package/lib/components/iqr-form/fields/multipleChoice.d.ts +8 -0
  10. package/lib/components/iqr-form/fields/multipleChoice.js +42 -0
  11. package/lib/components/iqr-form/fields/numberField.d.ts +8 -0
  12. package/lib/components/iqr-form/fields/numberField.js +42 -0
  13. package/lib/components/iqr-form/fields/textfield.d.ts +1 -0
  14. package/lib/components/iqr-form/fields/textfield.js +86 -0
  15. package/lib/components/iqr-form/fields/timePicker.d.ts +8 -0
  16. package/lib/components/iqr-form/fields/timePicker.js +42 -0
  17. package/lib/components/iqr-form/index.d.ts +7 -0
  18. package/lib/components/iqr-form/index.js +83 -0
  19. package/lib/components/iqr-form/model/index.d.ts +78 -0
  20. package/lib/components/iqr-form/model/index.js +114 -0
  21. package/lib/components/iqr-form/renderer/cards.d.ts +2 -0
  22. package/lib/components/iqr-form/renderer/cards.js +43 -0
  23. package/lib/components/iqr-form/renderer/form.d.ts +2 -0
  24. package/lib/components/iqr-form/renderer/form.js +44 -0
  25. package/lib/components/iqr-form/renderer/index.d.ts +3 -0
  26. package/lib/components/iqr-form/renderer/index.js +2 -0
  27. package/lib/components/iqr-text-field/index.d.ts +2 -0
  28. package/lib/components/iqr-text-field/index.js +335 -0
  29. package/lib/components/iqr-text-field/plugin/caret-fix-plugin.d.ts +2 -0
  30. package/lib/components/iqr-text-field/plugin/caret-fix-plugin.js +23 -0
  31. package/lib/components/iqr-text-field/plugin/has-content-class-plugin.d.ts +2 -0
  32. package/lib/components/iqr-text-field/plugin/has-content-class-plugin.js +18 -0
  33. package/lib/components/iqr-text-field/plugin/mask-plugin.d.ts +2 -0
  34. package/lib/components/iqr-text-field/plugin/mask-plugin.js +143 -0
  35. package/lib/components/iqr-text-field/plugin/regexp-plugin.d.ts +2 -0
  36. package/lib/components/iqr-text-field/plugin/regexp-plugin.js +46 -0
  37. package/lib/components/iqr-text-field/prosemirror-commands.d.ts +4 -0
  38. package/lib/components/iqr-text-field/prosemirror-commands.js +52 -0
  39. package/lib/components/iqr-text-field/prosemirror-utils.d.ts +5 -0
  40. package/lib/components/iqr-text-field/prosemirror-utils.js +15 -0
  41. package/lib/components/iqr-text-field/schema/common-marks.d.ts +10 -0
  42. package/lib/components/iqr-text-field/schema/common-marks.js +90 -0
  43. package/lib/components/iqr-text-field/schema/date-time-schema.d.ts +7 -0
  44. package/lib/components/iqr-text-field/schema/date-time-schema.js +88 -0
  45. package/lib/components/iqr-text-field/schema/decimal-schema.d.ts +3 -0
  46. package/lib/components/iqr-text-field/schema/decimal-schema.js +27 -0
  47. package/lib/components/iqr-text-field/schema/index.d.ts +11 -0
  48. package/lib/components/iqr-text-field/schema/index.js +18 -0
  49. package/lib/components/iqr-text-field/schema/markdown-schema.d.ts +8 -0
  50. package/lib/components/iqr-text-field/schema/markdown-schema.js +139 -0
  51. package/lib/components/iqr-text-field/schema/measure-schema.d.ts +3 -0
  52. package/lib/components/iqr-text-field/schema/measure-schema.js +35 -0
  53. package/lib/components/iqr-text-field/schema/token-schema.d.ts +6 -0
  54. package/lib/components/iqr-text-field/schema/token-schema.js +36 -0
  55. package/lib/components/iqr-text-field/schema/utils.d.ts +11 -0
  56. package/lib/components/iqr-text-field/schema/utils.js +11 -0
  57. package/lib/components/iqr-text-field/selection-companion.d.ts +11 -0
  58. package/lib/components/iqr-text-field/selection-companion.js +52 -0
  59. package/lib/components/iqr-text-field/suggestion-palette.d.ts +33 -0
  60. package/lib/components/iqr-text-field/suggestion-palette.js +139 -0
  61. package/lib/index.d.ts +1 -2
  62. package/lib/index.js +1 -2
  63. package/package.json +3 -3
  64. package/.editorconfig +0 -12
  65. package/.idea/inspectionProfiles/Project_Default.xml +0 -73
  66. package/.idea/iqr-text-field.iml +0 -9
  67. package/.idea/misc.xml +0 -6
  68. package/.idea/modules.xml +0 -8
  69. package/.idea/vcs.xml +0 -6
  70. package/.mocharc.json +0 -5
  71. package/app/demo-app.ts +0 -191
  72. package/test/form.yaml +0 -96
  73. package/test/simple/test.spec.ts +0 -303
  74. package/webpack.config.js +0 -41
@@ -0,0 +1,2 @@
1
+ export * from './iqr-form';
2
+ export * from './iqr-text-field';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./iqr-form"), exports);
14
+ __exportStar(require("./iqr-text-field"), exports);
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit-element';
2
+ import '../../iqr-text-field';
3
+ export declare class DatePicker extends LitElement {
4
+ label: string;
5
+ labelPosition?: string;
6
+ static get styles(): import("lit-element").CSSResult[];
7
+ render(): import("lit-element").TemplateResult;
8
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DatePicker = void 0;
13
+ const lit_element_1 = require("lit-element");
14
+ require("../../iqr-text-field");
15
+ class DatePicker extends lit_element_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.label = '';
19
+ this.labelPosition = undefined;
20
+ }
21
+ static get styles() {
22
+ return [lit_element_1.css `
23
+ :host {
24
+ display: block;
25
+ }
26
+ `];
27
+ }
28
+ render() {
29
+ return lit_element_1.html `
30
+ <iqr-text-field labelPosition=${this.labelPosition} label="${this.label}" schema="date" owner="Antoine Duchâteau" style="width: 100%"></iqr-text-field>`;
31
+ }
32
+ }
33
+ __decorate([
34
+ lit_element_1.property(),
35
+ __metadata("design:type", String)
36
+ ], DatePicker.prototype, "label", void 0);
37
+ __decorate([
38
+ lit_element_1.property(),
39
+ __metadata("design:type", String)
40
+ ], DatePicker.prototype, "labelPosition", void 0);
41
+ exports.DatePicker = DatePicker;
42
+ customElements.define('iqr-form-date-picker', DatePicker);
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit-element';
2
+ import '../../iqr-text-field';
3
+ export declare class DateTimePicker extends LitElement {
4
+ label: string;
5
+ labelPosition?: string;
6
+ static get styles(): import("lit-element").CSSResult[];
7
+ render(): import("lit-element").TemplateResult;
8
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DateTimePicker = void 0;
13
+ const lit_element_1 = require("lit-element");
14
+ require("../../iqr-text-field");
15
+ class DateTimePicker extends lit_element_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.label = '';
19
+ this.labelPosition = undefined;
20
+ }
21
+ static get styles() {
22
+ return [lit_element_1.css `
23
+ :host {
24
+ }
25
+ `];
26
+ }
27
+ render() {
28
+ return lit_element_1.html `
29
+ <iqr-text-field labelPosition=${this.labelPosition} label="${this.label}" schema="date-time"></iqr-text-field>
30
+ `;
31
+ }
32
+ }
33
+ __decorate([
34
+ lit_element_1.property(),
35
+ __metadata("design:type", String)
36
+ ], DateTimePicker.prototype, "label", void 0);
37
+ __decorate([
38
+ lit_element_1.property(),
39
+ __metadata("design:type", String)
40
+ ], DateTimePicker.prototype, "labelPosition", void 0);
41
+ exports.DateTimePicker = DateTimePicker;
42
+ customElements.define('iqr-form-date-time-picker', DateTimePicker);
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit-element';
2
+ import '../../iqr-text-field';
3
+ export declare class MeasureField extends LitElement {
4
+ label: string;
5
+ labelPosition?: string;
6
+ static get styles(): import("lit-element").CSSResult[];
7
+ render(): import("lit-element").TemplateResult;
8
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MeasureField = void 0;
13
+ const lit_element_1 = require("lit-element");
14
+ require("../../iqr-text-field");
15
+ class MeasureField extends lit_element_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.label = '';
19
+ this.labelPosition = undefined;
20
+ }
21
+ static get styles() {
22
+ return [lit_element_1.css `
23
+ :host {
24
+ }
25
+ `];
26
+ }
27
+ render() {
28
+ return lit_element_1.html `
29
+ <iqr-text-field labelPosition=${this.labelPosition} label="${this.label}" schema="measure"></iqr-text-field>
30
+ `;
31
+ }
32
+ }
33
+ __decorate([
34
+ lit_element_1.property(),
35
+ __metadata("design:type", String)
36
+ ], MeasureField.prototype, "label", void 0);
37
+ __decorate([
38
+ lit_element_1.property(),
39
+ __metadata("design:type", String)
40
+ ], MeasureField.prototype, "labelPosition", void 0);
41
+ exports.MeasureField = MeasureField;
42
+ customElements.define('iqr-form-measure-field', MeasureField);
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit-element';
2
+ import '../../iqr-text-field';
3
+ export declare class MultipleChoice extends LitElement {
4
+ label: string;
5
+ labelPosition?: string;
6
+ static get styles(): import("lit-element").CSSResult[];
7
+ render(): import("lit-element").TemplateResult;
8
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MultipleChoice = void 0;
13
+ const lit_element_1 = require("lit-element");
14
+ require("../../iqr-text-field");
15
+ class MultipleChoice extends lit_element_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.label = '';
19
+ this.labelPosition = undefined;
20
+ }
21
+ static get styles() {
22
+ return [lit_element_1.css `
23
+ :host {
24
+ }
25
+ `];
26
+ }
27
+ render() {
28
+ return lit_element_1.html `
29
+ <iqr-text-field labelPosition=${this.labelPosition} label="${this.label}"></iqr-text-field>
30
+ `;
31
+ }
32
+ }
33
+ __decorate([
34
+ lit_element_1.property(),
35
+ __metadata("design:type", String)
36
+ ], MultipleChoice.prototype, "label", void 0);
37
+ __decorate([
38
+ lit_element_1.property(),
39
+ __metadata("design:type", String)
40
+ ], MultipleChoice.prototype, "labelPosition", void 0);
41
+ exports.MultipleChoice = MultipleChoice;
42
+ customElements.define('iqr-form-multiple-choice', MultipleChoice);
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit-element';
2
+ import '../../iqr-text-field';
3
+ export declare class NumberField extends LitElement {
4
+ label: string;
5
+ labelPosition?: string;
6
+ static get styles(): import("lit-element").CSSResult[];
7
+ render(): import("lit-element").TemplateResult;
8
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NumberField = void 0;
13
+ const lit_element_1 = require("lit-element");
14
+ require("../../iqr-text-field");
15
+ class NumberField extends lit_element_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.label = '';
19
+ this.labelPosition = undefined;
20
+ }
21
+ static get styles() {
22
+ return [lit_element_1.css `
23
+ :host {
24
+ }
25
+ `];
26
+ }
27
+ render() {
28
+ return lit_element_1.html `
29
+ <iqr-text-field labelPosition=${this.labelPosition} label="${this.label}" schema="decimal"></iqr-text-field>
30
+ `;
31
+ }
32
+ }
33
+ __decorate([
34
+ lit_element_1.property(),
35
+ __metadata("design:type", String)
36
+ ], NumberField.prototype, "label", void 0);
37
+ __decorate([
38
+ lit_element_1.property(),
39
+ __metadata("design:type", String)
40
+ ], NumberField.prototype, "labelPosition", void 0);
41
+ exports.NumberField = NumberField;
42
+ customElements.define('iqr-form-number-field', NumberField);
@@ -0,0 +1 @@
1
+ import '../../iqr-text-field';
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const lit_element_1 = require("lit-element");
13
+ require("../../iqr-text-field");
14
+ class Textfield extends lit_element_1.LitElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.label = '';
18
+ this.multiline = false;
19
+ this.rows = 1;
20
+ this.grows = false;
21
+ this.labelPosition = undefined;
22
+ this.suggestionStopWords = new Set();
23
+ this.linksProvider = () => Promise.resolve(undefined);
24
+ this.suggestionProvider = () => [];
25
+ this.codeColorProvider = () => 'XI';
26
+ this.linkColorProvider = () => 'cat1';
27
+ this.codeContentProvider = (codes) => codes.map(c => c.code).join(',');
28
+ }
29
+ static get styles() {
30
+ return [lit_element_1.css `
31
+ :host {
32
+ }
33
+ `];
34
+ }
35
+ render() {
36
+ return lit_element_1.html `
37
+ <iqr-text-field labelPosition=${this.labelPosition} ?multiline="${this.multiline}" label="${this.label}" ?suggestions=${!!this.suggestionProvider} ?links=${!!this.linksProvider}
38
+ .linksProvider=${this.linksProvider} .suggestionProvider=${this.suggestionProvider} .codeColorProvider=${this.codeColorProvider} .linkColorProvider=${this.linkColorProvider} .codeContentProvider=${this.codeContentProvider}></iqr-text-field>
39
+ `;
40
+ }
41
+ }
42
+ __decorate([
43
+ lit_element_1.property(),
44
+ __metadata("design:type", String)
45
+ ], Textfield.prototype, "label", void 0);
46
+ __decorate([
47
+ lit_element_1.property(),
48
+ __metadata("design:type", Boolean)
49
+ ], Textfield.prototype, "multiline", void 0);
50
+ __decorate([
51
+ lit_element_1.property(),
52
+ __metadata("design:type", Number)
53
+ ], Textfield.prototype, "rows", void 0);
54
+ __decorate([
55
+ lit_element_1.property(),
56
+ __metadata("design:type", Boolean)
57
+ ], Textfield.prototype, "grows", void 0);
58
+ __decorate([
59
+ lit_element_1.property(),
60
+ __metadata("design:type", String)
61
+ ], Textfield.prototype, "labelPosition", void 0);
62
+ __decorate([
63
+ lit_element_1.property(),
64
+ __metadata("design:type", Set)
65
+ ], Textfield.prototype, "suggestionStopWords", void 0);
66
+ __decorate([
67
+ lit_element_1.property(),
68
+ __metadata("design:type", Function)
69
+ ], Textfield.prototype, "linksProvider", void 0);
70
+ __decorate([
71
+ lit_element_1.property(),
72
+ __metadata("design:type", Function)
73
+ ], Textfield.prototype, "suggestionProvider", void 0);
74
+ __decorate([
75
+ lit_element_1.property(),
76
+ __metadata("design:type", Function)
77
+ ], Textfield.prototype, "codeColorProvider", void 0);
78
+ __decorate([
79
+ lit_element_1.property(),
80
+ __metadata("design:type", Function)
81
+ ], Textfield.prototype, "linkColorProvider", void 0);
82
+ __decorate([
83
+ lit_element_1.property(),
84
+ __metadata("design:type", Function)
85
+ ], Textfield.prototype, "codeContentProvider", void 0);
86
+ customElements.define('iqr-form-textfield', Textfield);
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit-element';
2
+ import '../../iqr-text-field';
3
+ export declare class TimePicker extends LitElement {
4
+ label: string;
5
+ labelPosition?: string;
6
+ static get styles(): import("lit-element").CSSResult[];
7
+ render(): import("lit-element").TemplateResult;
8
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TimePicker = void 0;
13
+ const lit_element_1 = require("lit-element");
14
+ require("../../iqr-text-field");
15
+ class TimePicker extends lit_element_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.label = '';
19
+ this.labelPosition = undefined;
20
+ }
21
+ static get styles() {
22
+ return [lit_element_1.css `
23
+ :host {
24
+ }
25
+ `];
26
+ }
27
+ render() {
28
+ return lit_element_1.html `
29
+ <iqr-text-field labelPosition=${this.labelPosition} label="${this.label}" schema="time"></iqr-text-field>
30
+ `;
31
+ }
32
+ }
33
+ __decorate([
34
+ lit_element_1.property(),
35
+ __metadata("design:type", String)
36
+ ], TimePicker.prototype, "label", void 0);
37
+ __decorate([
38
+ lit_element_1.property(),
39
+ __metadata("design:type", String)
40
+ ], TimePicker.prototype, "labelPosition", void 0);
41
+ exports.TimePicker = TimePicker;
42
+ customElements.define('iqr-form-time-picker', TimePicker);
@@ -0,0 +1,7 @@
1
+ import './fields/textfield';
2
+ import './fields/measureField';
3
+ import './fields/numberField';
4
+ import './fields/datePicker';
5
+ import './fields/timePicker';
6
+ import './fields/dateTimePicker';
7
+ import './fields/multipleChoice';
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ // Import the LitElement base class and html helper function
16
+ const lit_element_1 = require("lit-element");
17
+ const model_1 = require("./model");
18
+ require("./fields/textfield");
19
+ require("./fields/measureField");
20
+ require("./fields/numberField");
21
+ require("./fields/datePicker");
22
+ require("./fields/timePicker");
23
+ require("./fields/dateTimePicker");
24
+ require("./fields/multipleChoice");
25
+ // @ts-ignore
26
+ const style_scss_1 = __importDefault(require("./styles/style.scss"));
27
+ // @ts-ignore
28
+ const kendo_scss_1 = __importDefault(require("./styles/kendo.scss"));
29
+ const cards_1 = require("./renderer/cards");
30
+ const form_1 = require("./renderer/form");
31
+ // Extend the LitElement base class
32
+ class IqrForm extends lit_element_1.LitElement {
33
+ constructor() {
34
+ super();
35
+ this.skin = "material";
36
+ this.theme = "default";
37
+ this.renderer = "form";
38
+ this.labelPosition = undefined;
39
+ this.state = {};
40
+ }
41
+ connectedCallback() {
42
+ super.connectedCallback();
43
+ }
44
+ disconnectedCallback() {
45
+ super.disconnectedCallback();
46
+ }
47
+ static get styles() {
48
+ return [style_scss_1.default, kendo_scss_1.default];
49
+ }
50
+ render() {
51
+ const renderer = this.renderer === 'form' ? form_1.render :
52
+ this.renderer === 'form' ? cards_1.render : undefined;
53
+ return (renderer && this.form ? renderer(this.form, { labelPosition: this.labelPosition }, this.state, (newState) => this.state = newState) : this.form ? lit_element_1.html `<p>unknown renderer</p>` : lit_element_1.html `<p>missing form</p>`);
54
+ }
55
+ firstUpdated() {
56
+ }
57
+ }
58
+ __decorate([
59
+ lit_element_1.property(),
60
+ __metadata("design:type", model_1.Form)
61
+ ], IqrForm.prototype, "form", void 0);
62
+ __decorate([
63
+ lit_element_1.property(),
64
+ __metadata("design:type", String)
65
+ ], IqrForm.prototype, "skin", void 0);
66
+ __decorate([
67
+ lit_element_1.property(),
68
+ __metadata("design:type", String)
69
+ ], IqrForm.prototype, "theme", void 0);
70
+ __decorate([
71
+ lit_element_1.property(),
72
+ __metadata("design:type", String)
73
+ ], IqrForm.prototype, "renderer", void 0);
74
+ __decorate([
75
+ lit_element_1.property(),
76
+ __metadata("design:type", String)
77
+ ], IqrForm.prototype, "labelPosition", void 0);
78
+ __decorate([
79
+ lit_element_1.property(),
80
+ __metadata("design:type", Object)
81
+ ], IqrForm.prototype, "state", void 0);
82
+ // Register the new element with the browser.
83
+ customElements.define('iqr-form', IqrForm);
@@ -0,0 +1,78 @@
1
+ import { IqrTextFieldSchema } from "../../iqr-text-field";
2
+ declare type FieldType = 'textfield' | 'measure-field' | 'number-field' | 'date-picker' | 'time-picker' | 'date-time-picker' | 'multiple-choice';
3
+ export declare abstract class Field {
4
+ field: string;
5
+ type: FieldType;
6
+ shortLabel?: string;
7
+ rows?: number;
8
+ columns?: number;
9
+ grows?: boolean;
10
+ schema?: IqrTextFieldSchema;
11
+ tags?: string[];
12
+ codifications?: string[];
13
+ options?: {
14
+ [key: string]: any;
15
+ };
16
+ protected constructor(type: FieldType, label: string, shortLabel?: string, rows?: number, columns?: number, grows?: boolean, schema?: IqrTextFieldSchema, tags?: string[], codifications?: string[], options?: {
17
+ [key: string]: any;
18
+ });
19
+ static parse(json: any): TextField | MeasureField | NumberField | DatePicker | TimePicker | DateTimePicker | MultipleChoice;
20
+ }
21
+ export declare class TextField extends Field {
22
+ constructor(label: string, shortLabel?: string, rows?: number, grows?: boolean, schema?: IqrTextFieldSchema, tags?: string[], codifications?: string[], options?: {
23
+ [key: string]: any;
24
+ });
25
+ }
26
+ export declare class MeasureField extends Field {
27
+ constructor(label: string, shortLabel?: string, tags?: string[], codifications?: string[], options?: {
28
+ [key: string]: any;
29
+ });
30
+ }
31
+ export declare class NumberField extends Field {
32
+ constructor(label: string, shortLabel?: string, tags?: string[], codifications?: string[], options?: {
33
+ [key: string]: any;
34
+ });
35
+ }
36
+ export declare class DatePicker extends Field {
37
+ constructor(label: string, shortLabel?: string, tags?: string[], codifications?: string[], options?: {
38
+ [key: string]: any;
39
+ });
40
+ }
41
+ export declare class TimePicker extends Field {
42
+ constructor(label: string, shortLabel?: string, tags?: string[], codifications?: string[], options?: {
43
+ [key: string]: any;
44
+ });
45
+ }
46
+ export declare class DateTimePicker extends Field {
47
+ constructor(label: string, shortLabel?: string, tags?: string[], codifications?: string[], options?: {
48
+ [key: string]: any;
49
+ });
50
+ }
51
+ export declare class MultipleChoice extends Field {
52
+ constructor(label: string, shortLabel?: string, rows?: number, columns?: number, tags?: string[], codifications?: string[], options?: {
53
+ [key: string]: any;
54
+ });
55
+ }
56
+ export declare class Group {
57
+ group: string;
58
+ fields?: Array<Field | Group>;
59
+ constructor(title: string, fields: Array<Field | Group>);
60
+ static parse(json: any): Group;
61
+ }
62
+ export declare class Section {
63
+ section: string;
64
+ fields: Array<Field | Group>;
65
+ description?: string;
66
+ keywords?: String[];
67
+ constructor(title: string, fields: Array<Field | Group>, description?: string, keywords?: String[]);
68
+ static parse(json: any): Section;
69
+ }
70
+ export declare class Form {
71
+ form: string;
72
+ sections: Section[];
73
+ description?: string;
74
+ keywords?: String[];
75
+ constructor(title: string, sections: Section[], description?: string, keywords?: String[]);
76
+ static parse(json: any): Form;
77
+ }
78
+ export {};