@icure/form 1.0.2 → 1.0.6

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 (126) hide show
  1. package/{lib/components → components}/index.d.ts +0 -0
  2. package/{lib/components → components}/index.js +0 -0
  3. package/{lib/components → components}/iqr-form/fields/datePicker.d.ts +0 -0
  4. package/{lib/components → components}/iqr-form/fields/datePicker.js +0 -0
  5. package/{lib/components → components}/iqr-form/fields/dateTimePicker.d.ts +0 -0
  6. package/{lib/components → components}/iqr-form/fields/dateTimePicker.js +0 -0
  7. package/{lib/components → components}/iqr-form/fields/measureField.d.ts +0 -0
  8. package/{lib/components → components}/iqr-form/fields/measureField.js +0 -0
  9. package/{lib/components → components}/iqr-form/fields/multipleChoice.d.ts +0 -0
  10. package/{lib/components → components}/iqr-form/fields/multipleChoice.js +0 -0
  11. package/{lib/components → components}/iqr-form/fields/numberField.d.ts +0 -0
  12. package/{lib/components → components}/iqr-form/fields/numberField.js +0 -0
  13. package/{lib/components → components}/iqr-form/fields/textfield.d.ts +0 -0
  14. package/{lib/components → components}/iqr-form/fields/textfield.js +0 -0
  15. package/{lib/components → components}/iqr-form/fields/timePicker.d.ts +0 -0
  16. package/{lib/components → components}/iqr-form/fields/timePicker.js +0 -0
  17. package/{lib/components → components}/iqr-form/index.d.ts +0 -0
  18. package/{lib/components → components}/iqr-form/index.js +59 -6
  19. package/{lib/components → components}/iqr-form/model/index.d.ts +0 -0
  20. package/{lib/components → components}/iqr-form/model/index.js +2 -2
  21. package/{lib/components → components}/iqr-form/renderer/cards.d.ts +0 -0
  22. package/{lib/components → components}/iqr-form/renderer/cards.js +2 -1
  23. package/{lib/components → components}/iqr-form/renderer/form.d.ts +0 -0
  24. package/{lib → components}/iqr-form/renderer/form.js +2 -1
  25. package/{lib/components → components}/iqr-form/renderer/index.d.ts +0 -0
  26. package/{lib/components → components}/iqr-form/renderer/index.js +0 -0
  27. package/{lib/components → components}/iqr-text-field/index.d.ts +0 -0
  28. package/{lib/components → components}/iqr-text-field/index.js +751 -7
  29. package/{lib/components → components}/iqr-text-field/plugin/caret-fix-plugin.d.ts +0 -0
  30. package/{lib → components}/iqr-text-field/plugin/caret-fix-plugin.js +2 -1
  31. package/{lib/components → components}/iqr-text-field/plugin/has-content-class-plugin.d.ts +0 -0
  32. package/{lib/components → components}/iqr-text-field/plugin/has-content-class-plugin.js +2 -1
  33. package/{lib/components → components}/iqr-text-field/plugin/mask-plugin.d.ts +0 -0
  34. package/{lib/components → components}/iqr-text-field/plugin/mask-plugin.js +2 -1
  35. package/{lib/components → components}/iqr-text-field/plugin/regexp-plugin.d.ts +0 -0
  36. package/{lib/components → components}/iqr-text-field/plugin/regexp-plugin.js +2 -1
  37. package/{lib/components → components}/iqr-text-field/prosemirror-commands.d.ts +0 -0
  38. package/{lib/components → components}/iqr-text-field/prosemirror-commands.js +0 -0
  39. package/{lib/components → components}/iqr-text-field/prosemirror-utils.d.ts +0 -0
  40. package/{lib/components → components}/iqr-text-field/prosemirror-utils.js +0 -0
  41. package/{lib/components → components}/iqr-text-field/schema/common-marks.d.ts +0 -0
  42. package/{lib/components → components}/iqr-text-field/schema/common-marks.js +0 -0
  43. package/{lib/components → components}/iqr-text-field/schema/date-time-schema.d.ts +0 -0
  44. package/{lib/components → components}/iqr-text-field/schema/date-time-schema.js +0 -0
  45. package/{lib/components → components}/iqr-text-field/schema/decimal-schema.d.ts +0 -0
  46. package/{lib/components → components}/iqr-text-field/schema/decimal-schema.js +0 -0
  47. package/{lib/components → components}/iqr-text-field/schema/index.d.ts +0 -0
  48. package/{lib/components → components}/iqr-text-field/schema/index.js +0 -0
  49. package/{lib/components → components}/iqr-text-field/schema/markdown-schema.d.ts +0 -0
  50. package/{lib/components → components}/iqr-text-field/schema/markdown-schema.js +0 -0
  51. package/{lib/components → components}/iqr-text-field/schema/measure-schema.d.ts +0 -0
  52. package/{lib/components → components}/iqr-text-field/schema/measure-schema.js +0 -0
  53. package/{lib/components → components}/iqr-text-field/schema/token-schema.d.ts +0 -0
  54. package/{lib/components → components}/iqr-text-field/schema/token-schema.js +0 -0
  55. package/{lib/components → components}/iqr-text-field/schema/utils.d.ts +0 -0
  56. package/{lib/components → components}/iqr-text-field/schema/utils.js +0 -0
  57. package/{lib/components → components}/iqr-text-field/selection-companion.d.ts +0 -0
  58. package/{lib/components → components}/iqr-text-field/selection-companion.js +0 -0
  59. package/{lib/components → components}/iqr-text-field/suggestion-palette.d.ts +0 -0
  60. package/{lib → components}/iqr-text-field/suggestion-palette.js +5 -5
  61. package/{lib/index.d.ts → index.d.ts} +0 -0
  62. package/{lib/index.js → index.js} +0 -0
  63. package/package.json +14 -47
  64. package/.idea/inspectionProfiles/Project_Default.xml +0 -73
  65. package/.idea/iqr-text-field.iml +0 -9
  66. package/.idea/misc.xml +0 -6
  67. package/.idea/modules.xml +0 -8
  68. package/.idea/vcs.xml +0 -6
  69. package/lib/components/iqr-form/renderer/form.js +0 -44
  70. package/lib/components/iqr-text-field/plugin/caret-fix-plugin.js +0 -23
  71. package/lib/components/iqr-text-field/suggestion-palette.js +0 -139
  72. package/lib/iqr-form/fields/datePicker.d.ts +0 -8
  73. package/lib/iqr-form/fields/datePicker.js +0 -42
  74. package/lib/iqr-form/fields/dateTimePicker.d.ts +0 -8
  75. package/lib/iqr-form/fields/dateTimePicker.js +0 -42
  76. package/lib/iqr-form/fields/measureField.d.ts +0 -8
  77. package/lib/iqr-form/fields/measureField.js +0 -42
  78. package/lib/iqr-form/fields/multipleChoice.d.ts +0 -8
  79. package/lib/iqr-form/fields/multipleChoice.js +0 -42
  80. package/lib/iqr-form/fields/numberField.d.ts +0 -8
  81. package/lib/iqr-form/fields/numberField.js +0 -42
  82. package/lib/iqr-form/fields/textfield.d.ts +0 -1
  83. package/lib/iqr-form/fields/textfield.js +0 -86
  84. package/lib/iqr-form/fields/timePicker.d.ts +0 -8
  85. package/lib/iqr-form/fields/timePicker.js +0 -42
  86. package/lib/iqr-form/index.d.ts +0 -7
  87. package/lib/iqr-form/index.js +0 -83
  88. package/lib/iqr-form/model/index.d.ts +0 -78
  89. package/lib/iqr-form/model/index.js +0 -114
  90. package/lib/iqr-form/renderer/cards.d.ts +0 -2
  91. package/lib/iqr-form/renderer/cards.js +0 -43
  92. package/lib/iqr-form/renderer/form.d.ts +0 -2
  93. package/lib/iqr-form/renderer/index.d.ts +0 -3
  94. package/lib/iqr-form/renderer/index.js +0 -2
  95. package/lib/iqr-text-field/index.d.ts +0 -2
  96. package/lib/iqr-text-field/index.js +0 -335
  97. package/lib/iqr-text-field/plugin/caret-fix-plugin.d.ts +0 -2
  98. package/lib/iqr-text-field/plugin/has-content-class-plugin.d.ts +0 -2
  99. package/lib/iqr-text-field/plugin/has-content-class-plugin.js +0 -18
  100. package/lib/iqr-text-field/plugin/mask-plugin.d.ts +0 -2
  101. package/lib/iqr-text-field/plugin/mask-plugin.js +0 -143
  102. package/lib/iqr-text-field/plugin/regexp-plugin.d.ts +0 -2
  103. package/lib/iqr-text-field/plugin/regexp-plugin.js +0 -46
  104. package/lib/iqr-text-field/prosemirror-commands.d.ts +0 -4
  105. package/lib/iqr-text-field/prosemirror-commands.js +0 -52
  106. package/lib/iqr-text-field/prosemirror-utils.d.ts +0 -5
  107. package/lib/iqr-text-field/prosemirror-utils.js +0 -15
  108. package/lib/iqr-text-field/schema/common-marks.d.ts +0 -10
  109. package/lib/iqr-text-field/schema/common-marks.js +0 -90
  110. package/lib/iqr-text-field/schema/date-time-schema.d.ts +0 -7
  111. package/lib/iqr-text-field/schema/date-time-schema.js +0 -88
  112. package/lib/iqr-text-field/schema/decimal-schema.d.ts +0 -3
  113. package/lib/iqr-text-field/schema/decimal-schema.js +0 -27
  114. package/lib/iqr-text-field/schema/index.d.ts +0 -11
  115. package/lib/iqr-text-field/schema/index.js +0 -18
  116. package/lib/iqr-text-field/schema/markdown-schema.d.ts +0 -8
  117. package/lib/iqr-text-field/schema/markdown-schema.js +0 -139
  118. package/lib/iqr-text-field/schema/measure-schema.d.ts +0 -3
  119. package/lib/iqr-text-field/schema/measure-schema.js +0 -35
  120. package/lib/iqr-text-field/schema/token-schema.d.ts +0 -6
  121. package/lib/iqr-text-field/schema/token-schema.js +0 -36
  122. package/lib/iqr-text-field/schema/utils.d.ts +0 -11
  123. package/lib/iqr-text-field/schema/utils.js +0 -11
  124. package/lib/iqr-text-field/selection-companion.d.ts +0 -11
  125. package/lib/iqr-text-field/selection-companion.js +0 -52
  126. package/lib/iqr-text-field/suggestion-palette.d.ts +0 -33
@@ -1,42 +0,0 @@
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);
@@ -1,8 +0,0 @@
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
- }
@@ -1,42 +0,0 @@
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);
@@ -1,8 +0,0 @@
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
- }
@@ -1,42 +0,0 @@
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);
@@ -1,8 +0,0 @@
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
- }
@@ -1,42 +0,0 @@
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);
@@ -1 +0,0 @@
1
- import '../../iqr-text-field';
@@ -1,86 +0,0 @@
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);
@@ -1,8 +0,0 @@
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
- }
@@ -1,42 +0,0 @@
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);
@@ -1,7 +0,0 @@
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';
@@ -1,83 +0,0 @@
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);
@@ -1,78 +0,0 @@
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 {};
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Form = exports.Section = exports.Group = exports.MultipleChoice = exports.DateTimePicker = exports.TimePicker = exports.DatePicker = exports.NumberField = exports.MeasureField = exports.TextField = exports.Field = void 0;
4
- class Field {
5
- constructor(type, label, shortLabel, rows, columns, grows, schema, tags, codifications, options) {
6
- this.field = label;
7
- this.type = type;
8
- this.shortLabel = shortLabel;
9
- this.rows = rows;
10
- this.columns = columns;
11
- this.grows = grows;
12
- this.schema = schema;
13
- this.tags = tags;
14
- this.codifications = codifications;
15
- this.options = options;
16
- }
17
- static parse(json) {
18
- switch (json.type) {
19
- case 'textfield':
20
- return new TextField(json.field, json.shortLabel, json.rows, json.grows, json.schema, json.tags, json.codifications, json.options);
21
- case 'measure-field':
22
- return new MeasureField(json.field, json.shortLabel, json.tags, json.codifications, json.options);
23
- case 'number-field':
24
- return new NumberField(json.field, json.shortLabel, json.tags, json.codifications, json.options);
25
- case 'date-picker':
26
- return new DatePicker(json.field, json.shortLabel, json.tags, json.codifications, json.options);
27
- case 'time-picker':
28
- return new TimePicker(json.field, json.shortLabel, json.tags, json.codifications, json.options);
29
- case 'date-time-picker':
30
- return new DateTimePicker(json.field, json.shortLabel, json.tags, json.codifications, json.options);
31
- case 'multiple-choice':
32
- return new MultipleChoice(json.field, json.shortLabel, json.rows, json.columns, json.tags, json.codifications, json.options);
33
- default:
34
- throw Error("Invalid field type " + json.type);
35
- }
36
- }
37
- }
38
- exports.Field = Field;
39
- class TextField extends Field {
40
- constructor(label, shortLabel, rows, grows, schema, tags, codifications, options) {
41
- super('textfield', label, shortLabel, rows, undefined, grows, schema || 'styled-text-with-codes', tags, codifications, options);
42
- }
43
- }
44
- exports.TextField = TextField;
45
- class MeasureField extends Field {
46
- constructor(label, shortLabel, tags, codifications, options) {
47
- super('measure-field', label, shortLabel, undefined, undefined, undefined, undefined, tags, codifications, options);
48
- }
49
- }
50
- exports.MeasureField = MeasureField;
51
- class NumberField extends Field {
52
- constructor(label, shortLabel, tags, codifications, options) {
53
- super('number-field', label, shortLabel, undefined, undefined, undefined, undefined, tags, codifications, options);
54
- }
55
- }
56
- exports.NumberField = NumberField;
57
- class DatePicker extends Field {
58
- constructor(label, shortLabel, tags, codifications, options) {
59
- super('date-picker', label, shortLabel, undefined, undefined, undefined, undefined, tags, codifications, options);
60
- }
61
- }
62
- exports.DatePicker = DatePicker;
63
- class TimePicker extends Field {
64
- constructor(label, shortLabel, tags, codifications, options) {
65
- super('time-picker', label, shortLabel, undefined, undefined, undefined, undefined, tags, codifications, options);
66
- }
67
- }
68
- exports.TimePicker = TimePicker;
69
- class DateTimePicker extends Field {
70
- constructor(label, shortLabel, tags, codifications, options) {
71
- super('date-time-picker', label, shortLabel, undefined, undefined, undefined, undefined, tags, codifications, options);
72
- }
73
- }
74
- exports.DateTimePicker = DateTimePicker;
75
- class MultipleChoice extends Field {
76
- constructor(label, shortLabel, rows, columns, tags, codifications, options) {
77
- super('multiple-choice', label, shortLabel, rows, columns, undefined, undefined, tags, codifications, options);
78
- }
79
- }
80
- exports.MultipleChoice = MultipleChoice;
81
- class Group {
82
- constructor(title, fields) {
83
- this.group = title;
84
- this.fields = fields;
85
- }
86
- static parse(json) {
87
- return new Group(json.group, json.fields.map((s) => s.group ? Group.parse(s) : Field.parse(s)));
88
- }
89
- }
90
- exports.Group = Group;
91
- class Section {
92
- constructor(title, fields, description, keywords) {
93
- this.section = title;
94
- this.fields = fields;
95
- this.description = description;
96
- this.keywords = keywords;
97
- }
98
- static parse(json) {
99
- return new Section(json.section, json.fields.map((s) => s.group ? Group.parse(s) : Field.parse(s)), json.description, json.keywords);
100
- }
101
- }
102
- exports.Section = Section;
103
- class Form {
104
- constructor(title, sections, description, keywords) {
105
- this.form = title;
106
- this.description = description;
107
- this.keywords = keywords;
108
- this.sections = sections;
109
- }
110
- static parse(json) {
111
- return new Form(json.form, json.sections.map((s) => Section.parse(s)), json.description, json.keywords);
112
- }
113
- }
114
- exports.Form = Form;
@@ -1,2 +0,0 @@
1
- import { Renderer } from "./index";
2
- export declare const render: Renderer;