@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.
- package/{lib/components → components}/index.d.ts +0 -0
- package/{lib/components → components}/index.js +0 -0
- package/{lib/components → components}/iqr-form/fields/datePicker.d.ts +0 -0
- package/{lib/components → components}/iqr-form/fields/datePicker.js +0 -0
- package/{lib/components → components}/iqr-form/fields/dateTimePicker.d.ts +0 -0
- package/{lib/components → components}/iqr-form/fields/dateTimePicker.js +0 -0
- package/{lib/components → components}/iqr-form/fields/measureField.d.ts +0 -0
- package/{lib/components → components}/iqr-form/fields/measureField.js +0 -0
- package/{lib/components → components}/iqr-form/fields/multipleChoice.d.ts +0 -0
- package/{lib/components → components}/iqr-form/fields/multipleChoice.js +0 -0
- package/{lib/components → components}/iqr-form/fields/numberField.d.ts +0 -0
- package/{lib/components → components}/iqr-form/fields/numberField.js +0 -0
- package/{lib/components → components}/iqr-form/fields/textfield.d.ts +0 -0
- package/{lib/components → components}/iqr-form/fields/textfield.js +0 -0
- package/{lib/components → components}/iqr-form/fields/timePicker.d.ts +0 -0
- package/{lib/components → components}/iqr-form/fields/timePicker.js +0 -0
- package/{lib/components → components}/iqr-form/index.d.ts +0 -0
- package/{lib/components → components}/iqr-form/index.js +59 -6
- package/{lib/components → components}/iqr-form/model/index.d.ts +0 -0
- package/{lib/components → components}/iqr-form/model/index.js +2 -2
- package/{lib/components → components}/iqr-form/renderer/cards.d.ts +0 -0
- package/{lib/components → components}/iqr-form/renderer/cards.js +2 -1
- package/{lib/components → components}/iqr-form/renderer/form.d.ts +0 -0
- package/{lib → components}/iqr-form/renderer/form.js +2 -1
- package/{lib/components → components}/iqr-form/renderer/index.d.ts +0 -0
- package/{lib/components → components}/iqr-form/renderer/index.js +0 -0
- package/{lib/components → components}/iqr-text-field/index.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/index.js +751 -7
- package/{lib/components → components}/iqr-text-field/plugin/caret-fix-plugin.d.ts +0 -0
- package/{lib → components}/iqr-text-field/plugin/caret-fix-plugin.js +2 -1
- package/{lib/components → components}/iqr-text-field/plugin/has-content-class-plugin.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/plugin/has-content-class-plugin.js +2 -1
- package/{lib/components → components}/iqr-text-field/plugin/mask-plugin.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/plugin/mask-plugin.js +2 -1
- package/{lib/components → components}/iqr-text-field/plugin/regexp-plugin.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/plugin/regexp-plugin.js +2 -1
- package/{lib/components → components}/iqr-text-field/prosemirror-commands.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/prosemirror-commands.js +0 -0
- package/{lib/components → components}/iqr-text-field/prosemirror-utils.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/prosemirror-utils.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/common-marks.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/common-marks.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/date-time-schema.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/date-time-schema.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/decimal-schema.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/decimal-schema.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/index.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/index.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/markdown-schema.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/markdown-schema.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/measure-schema.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/measure-schema.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/token-schema.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/token-schema.js +0 -0
- package/{lib/components → components}/iqr-text-field/schema/utils.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/schema/utils.js +0 -0
- package/{lib/components → components}/iqr-text-field/selection-companion.d.ts +0 -0
- package/{lib/components → components}/iqr-text-field/selection-companion.js +0 -0
- package/{lib/components → components}/iqr-text-field/suggestion-palette.d.ts +0 -0
- package/{lib → components}/iqr-text-field/suggestion-palette.js +5 -5
- package/{lib/index.d.ts → index.d.ts} +0 -0
- package/{lib/index.js → index.js} +0 -0
- package/package.json +14 -47
- package/.idea/inspectionProfiles/Project_Default.xml +0 -73
- package/.idea/iqr-text-field.iml +0 -9
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/lib/components/iqr-form/renderer/form.js +0 -44
- package/lib/components/iqr-text-field/plugin/caret-fix-plugin.js +0 -23
- package/lib/components/iqr-text-field/suggestion-palette.js +0 -139
- package/lib/iqr-form/fields/datePicker.d.ts +0 -8
- package/lib/iqr-form/fields/datePicker.js +0 -42
- package/lib/iqr-form/fields/dateTimePicker.d.ts +0 -8
- package/lib/iqr-form/fields/dateTimePicker.js +0 -42
- package/lib/iqr-form/fields/measureField.d.ts +0 -8
- package/lib/iqr-form/fields/measureField.js +0 -42
- package/lib/iqr-form/fields/multipleChoice.d.ts +0 -8
- package/lib/iqr-form/fields/multipleChoice.js +0 -42
- package/lib/iqr-form/fields/numberField.d.ts +0 -8
- package/lib/iqr-form/fields/numberField.js +0 -42
- package/lib/iqr-form/fields/textfield.d.ts +0 -1
- package/lib/iqr-form/fields/textfield.js +0 -86
- package/lib/iqr-form/fields/timePicker.d.ts +0 -8
- package/lib/iqr-form/fields/timePicker.js +0 -42
- package/lib/iqr-form/index.d.ts +0 -7
- package/lib/iqr-form/index.js +0 -83
- package/lib/iqr-form/model/index.d.ts +0 -78
- package/lib/iqr-form/model/index.js +0 -114
- package/lib/iqr-form/renderer/cards.d.ts +0 -2
- package/lib/iqr-form/renderer/cards.js +0 -43
- package/lib/iqr-form/renderer/form.d.ts +0 -2
- package/lib/iqr-form/renderer/index.d.ts +0 -3
- package/lib/iqr-form/renderer/index.js +0 -2
- package/lib/iqr-text-field/index.d.ts +0 -2
- package/lib/iqr-text-field/index.js +0 -335
- package/lib/iqr-text-field/plugin/caret-fix-plugin.d.ts +0 -2
- package/lib/iqr-text-field/plugin/has-content-class-plugin.d.ts +0 -2
- package/lib/iqr-text-field/plugin/has-content-class-plugin.js +0 -18
- package/lib/iqr-text-field/plugin/mask-plugin.d.ts +0 -2
- package/lib/iqr-text-field/plugin/mask-plugin.js +0 -143
- package/lib/iqr-text-field/plugin/regexp-plugin.d.ts +0 -2
- package/lib/iqr-text-field/plugin/regexp-plugin.js +0 -46
- package/lib/iqr-text-field/prosemirror-commands.d.ts +0 -4
- package/lib/iqr-text-field/prosemirror-commands.js +0 -52
- package/lib/iqr-text-field/prosemirror-utils.d.ts +0 -5
- package/lib/iqr-text-field/prosemirror-utils.js +0 -15
- package/lib/iqr-text-field/schema/common-marks.d.ts +0 -10
- package/lib/iqr-text-field/schema/common-marks.js +0 -90
- package/lib/iqr-text-field/schema/date-time-schema.d.ts +0 -7
- package/lib/iqr-text-field/schema/date-time-schema.js +0 -88
- package/lib/iqr-text-field/schema/decimal-schema.d.ts +0 -3
- package/lib/iqr-text-field/schema/decimal-schema.js +0 -27
- package/lib/iqr-text-field/schema/index.d.ts +0 -11
- package/lib/iqr-text-field/schema/index.js +0 -18
- package/lib/iqr-text-field/schema/markdown-schema.d.ts +0 -8
- package/lib/iqr-text-field/schema/markdown-schema.js +0 -139
- package/lib/iqr-text-field/schema/measure-schema.d.ts +0 -3
- package/lib/iqr-text-field/schema/measure-schema.js +0 -35
- package/lib/iqr-text-field/schema/token-schema.d.ts +0 -6
- package/lib/iqr-text-field/schema/token-schema.js +0 -36
- package/lib/iqr-text-field/schema/utils.d.ts +0 -11
- package/lib/iqr-text-field/schema/utils.js +0 -11
- package/lib/iqr-text-field/selection-companion.d.ts +0 -11
- package/lib/iqr-text-field/selection-companion.js +0 -52
- package/lib/iqr-text-field/suggestion-palette.d.ts +0 -33
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.caretFixPlugin = void 0;
|
|
4
4
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
5
|
-
|
|
5
|
+
const caretFixPlugin = () => {
|
|
6
6
|
let focusing = false;
|
|
7
7
|
return new prosemirror_state_1.Plugin({
|
|
8
8
|
props: {
|
|
@@ -21,3 +21,4 @@ exports.caretFixPlugin = () => {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
exports.caretFixPlugin = caretFixPlugin;
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hasContentClassPlugin = void 0;
|
|
4
4
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
5
|
-
|
|
5
|
+
const hasContentClassPlugin = (root) => {
|
|
6
6
|
return new prosemirror_state_1.Plugin({
|
|
7
7
|
view: (v) => {
|
|
8
8
|
var _a, _b;
|
|
@@ -16,3 +16,4 @@ exports.hasContentClassPlugin = (root) => {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
+
exports.hasContentClassPlugin = hasContentClassPlugin;
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.maskPlugin = void 0;
|
|
4
4
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
5
5
|
const prosemirror_view_1 = require("prosemirror-view");
|
|
6
|
-
|
|
6
|
+
const maskPlugin = () => {
|
|
7
7
|
const maskText = ($pos, text, mask, tr, setSelection = true) => {
|
|
8
8
|
const textFromBeginning = $pos.parent.textBetween(0, $pos.parentOffset) + text;
|
|
9
9
|
const trailingText = $pos.parent.textBetween($pos.parentOffset, $pos.parent.content.size);
|
|
@@ -141,3 +141,4 @@ exports.maskPlugin = () => {
|
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
};
|
|
144
|
+
exports.maskPlugin = maskPlugin;
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.regexpPlugin = void 0;
|
|
4
4
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
5
|
-
|
|
5
|
+
const regexpPlugin = () => {
|
|
6
6
|
return new prosemirror_state_1.Plugin({
|
|
7
7
|
props: {
|
|
8
8
|
handleTextInput: (view, from, to, text) => {
|
|
@@ -44,3 +44,4 @@ exports.regexpPlugin = () => {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
+
exports.regexpPlugin = regexpPlugin;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -92,7 +92,7 @@ class SuggestionPalette {
|
|
|
92
92
|
this.palette.style.display = "none";
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
const text = state.doc.textBetween($pos.pos ? $pos.before() + 1 : 0, $pos.pos);
|
|
95
|
+
const text = state.doc.textBetween($pos.pos && $pos.depth ? $pos.before() + 1 : 0, $pos.pos);
|
|
96
96
|
const words = text.split(/\s+/);
|
|
97
97
|
const terms = words.filter(x => x.length > 2 && !this.suggestionStopWordsProvider().has(x));
|
|
98
98
|
const lastTerms = terms.length > 3 ? terms.slice(length - 3) : terms;
|
|
@@ -109,7 +109,8 @@ class SuggestionPalette {
|
|
|
109
109
|
this.palette.innerHTML = `<ul>${res.map(x => `<li id="${x.id}" data-code="${x.code}">${x.text}<div class="icn-container"><svg class="tab-icn" viewBox="0 0 24 24"><path d="M12.29 8.12L15.17 11H2c-.55 0-1 .45-1 1s.45 1 1 1h13.17l-2.88 2.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L13.7 6.7c-.39-.39-1.02-.39-1.41 0-.38.39-.39 1.03 0 1.42zM20 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z"/></svg><svg class="return-icn" viewBox="0 0 24 24"><path d="M19 8v3H5.83l2.88-2.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L2.71 11.3c-.39.39-.39 1.02 0 1.41L7.3 17.3c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L5.83 13H20c.55 0 1-.45 1-1V8c0-.55-.45-1-1-1s-1 .45-1 1z"/></svg></div></li>`).join('\n')}</ul>`;
|
|
110
110
|
// These are in screen coordinates
|
|
111
111
|
const end = view.coordsAtPos(to);
|
|
112
|
-
|
|
112
|
+
const start = view.coordsAtPos(Math.max(0, to - terms[terms.length - 1].length));
|
|
113
|
+
this.display((start.left > end.left) ? end : start, (this.lastTime = +new Date()));
|
|
113
114
|
}
|
|
114
115
|
else {
|
|
115
116
|
this.palette.style.display = "none";
|
|
@@ -129,9 +130,8 @@ class SuggestionPalette {
|
|
|
129
130
|
const box = (_a = this.palette.offsetParent) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
130
131
|
const palBox = this.palette.getBoundingClientRect();
|
|
131
132
|
if (box) {
|
|
132
|
-
|
|
133
|
-
this.palette.style.
|
|
134
|
-
this.palette.style.top = (pos.top + box.top) + "px";
|
|
133
|
+
this.palette.style.left = Math.max(0, Math.min(pos.left - box.left - 12, box.width - palBox.width)) + 'px';
|
|
134
|
+
this.palette.style.top = (pos.bottom - box.top + 2) + "px";
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
destroy() { this.palette.remove(); }
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,60 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icure/form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
-
"
|
|
7
|
-
"start": "webpack-dev-server --env.mode development",
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"dist": "webpack --env.mode production",
|
|
10
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [],
|
|
13
|
-
"author": "",
|
|
14
|
-
"license": "ISC",
|
|
6
|
+
"types": null,
|
|
15
7
|
"dependencies": {
|
|
16
|
-
"@icure/api": "^4.0.
|
|
17
|
-
"@webcomponents/webcomponentsjs": "^2.
|
|
8
|
+
"@icure/api": "^4.0.36",
|
|
9
|
+
"@webcomponents/webcomponentsjs": "^2.5.0",
|
|
18
10
|
"fast-deep-equal": "^3.1.3",
|
|
19
|
-
"lit-element": "^2.
|
|
20
|
-
"prosemirror-commands": "^1.1.
|
|
11
|
+
"lit-element": "^2.5.0",
|
|
12
|
+
"prosemirror-commands": "^1.1.7",
|
|
21
13
|
"prosemirror-history": "^1.1.3",
|
|
22
14
|
"prosemirror-keymap": "^1.1.4",
|
|
23
|
-
"prosemirror-markdown": "^1.5.
|
|
24
|
-
"prosemirror-model": "^1.
|
|
15
|
+
"prosemirror-markdown": "^1.5.1",
|
|
16
|
+
"prosemirror-model": "^1.14.1",
|
|
25
17
|
"prosemirror-schema-basic": "^1.1.2",
|
|
26
18
|
"prosemirror-schema-list": "^1.1.4",
|
|
27
19
|
"prosemirror-state": "^1.3.4",
|
|
28
|
-
"prosemirror-view": "^1.
|
|
29
|
-
"yaml": "^1.10.
|
|
20
|
+
"prosemirror-view": "^1.18.4",
|
|
21
|
+
"yaml": "^1.10.2"
|
|
30
22
|
},
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@types/prosemirror-keymap": "^1.0.3",
|
|
36
|
-
"@types/prosemirror-markdown": "^1.0.3",
|
|
37
|
-
"@types/prosemirror-schema-basic": "^1.0.1",
|
|
38
|
-
"@types/prosemirror-schema-list": "^1.0.1",
|
|
39
|
-
"@types/prosemirror-state": "^1.2.6",
|
|
40
|
-
"@types/prosemirror-view": "^1.15.1",
|
|
41
|
-
"assert": "^2.0.0",
|
|
42
|
-
"babel": "^6.23.0",
|
|
43
|
-
"babel-preset-es2017": "^6.24.1",
|
|
44
|
-
"copy-webpack-plugin": "^6.2.0",
|
|
45
|
-
"css-loader": "^5.0.1",
|
|
46
|
-
"extract-loader": "^5.1.0",
|
|
47
|
-
"html-webpack-plugin": "^4.5.0",
|
|
48
|
-
"lit-scss-loader": "^1.0.1",
|
|
49
|
-
"minisearch": "^3.0.2",
|
|
50
|
-
"mocha": "^8.2.1",
|
|
51
|
-
"sass": "^1.32.2",
|
|
52
|
-
"sass-loader": "^10.1.1",
|
|
53
|
-
"ts-loader": "^8.0.4",
|
|
54
|
-
"ts-node": "^9.1.1",
|
|
55
|
-
"typescript": "^4.0.3",
|
|
56
|
-
"webpack": "^4.44.2",
|
|
57
|
-
"webpack-cli": "^3.3.12",
|
|
58
|
-
"webpack-dev-server": "^3.11.0"
|
|
59
|
-
}
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"bugs": null,
|
|
26
|
+
"homepage": null
|
|
60
27
|
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<component name="InspectionProjectProfileManager">
|
|
2
|
-
<profile version="1.0">
|
|
3
|
-
<option name="myName" value="Project Default" />
|
|
4
|
-
<inspection_tool class="CssUnknownProperty" enabled="true" level="WARNING" enabled_by_default="true">
|
|
5
|
-
<option name="myCustomPropertiesEnabled" value="true" />
|
|
6
|
-
<option name="myIgnoreVendorSpecificProperties" value="false" />
|
|
7
|
-
<option name="myCustomPropertiesList">
|
|
8
|
-
<value>
|
|
9
|
-
<list size="1">
|
|
10
|
-
<item index="0" class="java.lang.String" itemvalue="user-select" />
|
|
11
|
-
</list>
|
|
12
|
-
</value>
|
|
13
|
-
</option>
|
|
14
|
-
</inspection_tool>
|
|
15
|
-
<inspection_tool class="ES6ConvertVarToLetConst" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
16
|
-
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
|
|
17
|
-
<option name="myValues">
|
|
18
|
-
<value>
|
|
19
|
-
<list size="13">
|
|
20
|
-
<item index="0" class="java.lang.String" itemvalue="on-change" />
|
|
21
|
-
<item index="1" class="java.lang.String" itemvalue="if" />
|
|
22
|
-
<item index="2" class="java.lang.String" itemvalue="on-mousemove" />
|
|
23
|
-
<item index="3" class="java.lang.String" itemvalue="class$" />
|
|
24
|
-
<item index="4" class="java.lang.String" itemvalue="as" />
|
|
25
|
-
<item index="5" class="java.lang.String" itemvalue="items" />
|
|
26
|
-
<item index="6" class="java.lang.String" itemvalue="hidden$" />
|
|
27
|
-
<item index="7" class="java.lang.String" itemvalue="sort" />
|
|
28
|
-
<item index="8" class="java.lang.String" itemvalue="filter" />
|
|
29
|
-
<item index="9" class="java.lang.String" itemvalue="on-click" />
|
|
30
|
-
<item index="10" class="java.lang.String" itemvalue="on-scroll" />
|
|
31
|
-
<item index="11" class="java.lang.String" itemvalue="src$" />
|
|
32
|
-
<item index="12" class="java.lang.String" itemvalue="include" />
|
|
33
|
-
</list>
|
|
34
|
-
</value>
|
|
35
|
-
</option>
|
|
36
|
-
<option name="myCustomValuesEnabled" value="true" />
|
|
37
|
-
</inspection_tool>
|
|
38
|
-
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
|
39
|
-
<option name="myValues">
|
|
40
|
-
<value>
|
|
41
|
-
<list size="25">
|
|
42
|
-
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
|
43
|
-
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
|
44
|
-
<item index="2" class="java.lang.String" itemvalue="comment" />
|
|
45
|
-
<item index="3" class="java.lang.String" itemvalue="noscript" />
|
|
46
|
-
<item index="4" class="java.lang.String" itemvalue="embed" />
|
|
47
|
-
<item index="5" class="java.lang.String" itemvalue="script" />
|
|
48
|
-
<item index="6" class="java.lang.String" itemvalue="paper-input-container" />
|
|
49
|
-
<item index="7" class="java.lang.String" itemvalue="paper-dialog" />
|
|
50
|
-
<item index="8" class="java.lang.String" itemvalue="dom-module" />
|
|
51
|
-
<item index="9" class="java.lang.String" itemvalue="paper-button" />
|
|
52
|
-
<item index="10" class="java.lang.String" itemvalue="paper-input" />
|
|
53
|
-
<item index="11" class="java.lang.String" itemvalue="entity-selector" />
|
|
54
|
-
<item index="12" class="java.lang.String" itemvalue="tk-token-field" />
|
|
55
|
-
<item index="13" class="java.lang.String" itemvalue="ht-pat-admin-card" />
|
|
56
|
-
<item index="14" class="java.lang.String" itemvalue="ht-pat-detail-ctc-detail-panel" />
|
|
57
|
-
<item index="15" class="java.lang.String" itemvalue="paper-toast" />
|
|
58
|
-
<item index="16" class="java.lang.String" itemvalue="iron-icon" />
|
|
59
|
-
<item index="17" class="java.lang.String" itemvalue="paper-listbox" />
|
|
60
|
-
<item index="18" class="java.lang.String" itemvalue="paper-material" />
|
|
61
|
-
<item index="19" class="java.lang.String" itemvalue="paper-icon-button" />
|
|
62
|
-
<item index="20" class="java.lang.String" itemvalue="paper-item" />
|
|
63
|
-
<item index="21" class="java.lang.String" itemvalue="filter-panel" />
|
|
64
|
-
<item index="22" class="java.lang.String" itemvalue="collapse-button" />
|
|
65
|
-
<item index="23" class="java.lang.String" itemvalue="paper-tooltip" />
|
|
66
|
-
<item index="24" class="java.lang.String" itemvalue="paper-fab" />
|
|
67
|
-
</list>
|
|
68
|
-
</value>
|
|
69
|
-
</option>
|
|
70
|
-
<option name="myCustomValuesEnabled" value="true" />
|
|
71
|
-
</inspection_tool>
|
|
72
|
-
</profile>
|
|
73
|
-
</component>
|
package/.idea/iqr-text-field.iml
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|
package/.idea/misc.xml
DELETED
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/iqr-text-field.iml" filepath="$PROJECT_DIR$/.idea/iqr-text-field.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.render = void 0;
|
|
4
|
-
const lit_element_1 = require("lit-element");
|
|
5
|
-
const model_1 = require("../model");
|
|
6
|
-
exports.render = (form, props, state, setState) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const h = function (level, content) {
|
|
9
|
-
return level === 1 ? lit_element_1.html `<h1>${content}</h1>` :
|
|
10
|
-
level === 2 ? lit_element_1.html `<h2>${content}</h2>` :
|
|
11
|
-
level === 3 ? lit_element_1.html `<h3>${content}</h3>` :
|
|
12
|
-
level === 4 ? lit_element_1.html `<h4>${content}</h4>` :
|
|
13
|
-
level === 5 ? lit_element_1.html `<h5>${content}</h5>` :
|
|
14
|
-
lit_element_1.html `<h6>${content}</h6>`;
|
|
15
|
-
};
|
|
16
|
-
const renderFieldOrGroup = function (fg, level) {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f;
|
|
18
|
-
return fg instanceof model_1.Group ? lit_element_1.html `
|
|
19
|
-
<div class="group">
|
|
20
|
-
${h(level, lit_element_1.html `${fg.group}`)}
|
|
21
|
-
${(_a = fg.fields) === null || _a === void 0 ? void 0 : _a.map(f => renderFieldOrGroup(f, level + 1))}` :
|
|
22
|
-
lit_element_1.html `${fg.type === 'textfield' ? lit_element_1.html `<iqr-form-textfield labelPosition=${props.labelPosition} label="${fg.field}" multiline="${(fg.rows || 0) > 1 || fg.grows}" rows="${fg.rows || 1}" grows="${fg.grows || false}"
|
|
23
|
-
.linksProvider=${(_b = fg.options) === null || _b === void 0 ? void 0 : _b.linksProvider} .suggestionProvider=${(_c = fg.options) === null || _c === void 0 ? void 0 : _c.suggestionProvider} .codeColorProvider=${(_d = fg.options) === null || _d === void 0 ? void 0 : _d.codeColorProvider} .linkColorProvider=${(_e = fg.options) === null || _e === void 0 ? void 0 : _e.linkColorProvider} .codeContentProvider=${(_f = fg.options) === null || _f === void 0 ? void 0 : _f.codeContentProvider}></iqr-form-textfield>` :
|
|
24
|
-
fg.type === 'measure-field' ? lit_element_1.html `<iqr-form-measure-field labelPosition=${props.labelPosition} label="${fg.field}"></iqr-form-measure-field>` :
|
|
25
|
-
fg.type === 'number-field' ? lit_element_1.html `<iqr-form-number-field labelPosition=${props.labelPosition} label="${fg.field}"></iqr-form-number-field>` :
|
|
26
|
-
fg.type === 'date-picker' ? lit_element_1.html `<iqr-form-date-picker labelPosition=${props.labelPosition} label="${fg.field}"></iqr-form-date-picker>` :
|
|
27
|
-
fg.type === 'time-picker' ? lit_element_1.html `<iqr-form-time-picker labelPosition=${props.labelPosition} label="${fg.field}"></iqr-form-time-picker>` :
|
|
28
|
-
fg.type === 'date-time-picker' ? lit_element_1.html `<iqr-form-date-time-picker labelPosition=${props.labelPosition} label="${fg.field}"></iqr-form-date-time-picker>` :
|
|
29
|
-
fg.type === 'multiple-choice' ? lit_element_1.html `<iqr-form-multiple-choice labelPosition=${props.labelPosition} label="${fg.field}"></iqr-form-multiple-choice>` : ''}
|
|
30
|
-
</div>`;
|
|
31
|
-
};
|
|
32
|
-
return lit_element_1.html `
|
|
33
|
-
<div class="iqr-form">
|
|
34
|
-
${(_a = form === null || form === void 0 ? void 0 : form.sections) === null || _a === void 0 ? void 0 : _a.map(s => {
|
|
35
|
-
var _a;
|
|
36
|
-
return lit_element_1.html `
|
|
37
|
-
<h2>${s.section}</h2>
|
|
38
|
-
${s.description ? lit_element_1.html `<p>${s.description}</p>` : ''}
|
|
39
|
-
${(_a = s.fields) === null || _a === void 0 ? void 0 : _a.map(f => renderFieldOrGroup(f, 3))}
|
|
40
|
-
`;
|
|
41
|
-
})}
|
|
42
|
-
</div>
|
|
43
|
-
`;
|
|
44
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.caretFixPlugin = void 0;
|
|
4
|
-
const prosemirror_state_1 = require("prosemirror-state");
|
|
5
|
-
exports.caretFixPlugin = () => {
|
|
6
|
-
let focusing = false;
|
|
7
|
-
return new prosemirror_state_1.Plugin({
|
|
8
|
-
props: {
|
|
9
|
-
handleDOMEvents: {
|
|
10
|
-
focus: view => {
|
|
11
|
-
if (focusing) {
|
|
12
|
-
focusing = false;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
focusing = true;
|
|
16
|
-
setTimeout(() => { view.dom.blur(); view.dom.focus(); }, 0);
|
|
17
|
-
}
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SuggestionPalette = void 0;
|
|
7
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
-
class SuggestionPalette {
|
|
9
|
-
constructor(view, suggestionProvider, suggestionStopWordsProvider, delay) {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
this.delay = () => false;
|
|
12
|
-
this.lastTime = 0;
|
|
13
|
-
this.hasFocus = false;
|
|
14
|
-
this.suggestions = [];
|
|
15
|
-
this.suggestionStopWordsProvider = suggestionStopWordsProvider;
|
|
16
|
-
this.suggestionProvider = suggestionProvider;
|
|
17
|
-
this.palette = document.createElement("div");
|
|
18
|
-
this.palette.className = "suggestion-palette";
|
|
19
|
-
(_b = (_a = view.dom) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.appendChild(this.palette);
|
|
20
|
-
delay && (this.delay = delay);
|
|
21
|
-
this.update(view, undefined);
|
|
22
|
-
}
|
|
23
|
-
focusItem(idx) {
|
|
24
|
-
const ul = this.palette.getElementsByTagName('ul')[0];
|
|
25
|
-
if (ul) {
|
|
26
|
-
ul.classList.add('focused');
|
|
27
|
-
const lis = ul.getElementsByTagName('li');
|
|
28
|
-
this.currentFocus !== undefined && lis[this.currentFocus].classList.remove('focused');
|
|
29
|
-
idx !== undefined && lis[idx].classList.add('focused');
|
|
30
|
-
this.currentFocus = idx;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
focus() {
|
|
34
|
-
if (this.palette.style.display === "none")
|
|
35
|
-
return false;
|
|
36
|
-
this.hasFocus = true;
|
|
37
|
-
this.focusItem(0);
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
focusOrInsert(view, transactionProvider) {
|
|
41
|
-
if (this.palette.style.display === "none")
|
|
42
|
-
return false;
|
|
43
|
-
return this.hasFocus ? this.insert(view, transactionProvider) : this.focus();
|
|
44
|
-
}
|
|
45
|
-
insert(view, transactionProvider) {
|
|
46
|
-
if (this.palette.style.display === "none" || !this.hasFocus || this.currentFocus === undefined)
|
|
47
|
-
return false;
|
|
48
|
-
const sug = this.suggestions[this.currentFocus];
|
|
49
|
-
if (sug) {
|
|
50
|
-
const sel = view.state.selection;
|
|
51
|
-
const stopWords = this.suggestionStopWordsProvider();
|
|
52
|
-
let length = sug.terms.join(' ').length - 1;
|
|
53
|
-
while (sel.to - length >= 0 && !fast_deep_equal_1.default(view.state.doc.textBetween(sel.to - length, sel.to).split(/\s+/).filter(x => !stopWords.has(x)), sug.terms)) {
|
|
54
|
-
length++;
|
|
55
|
-
}
|
|
56
|
-
if (length > sel.to) {
|
|
57
|
-
length = sug.terms.join(' ').length;
|
|
58
|
-
while (sel.to - length >= 0 && !view.state.doc.textBetween(sel.to - length, sel.to).startsWith(sug.terms[0])) {
|
|
59
|
-
length++;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (length <= sel.to) {
|
|
63
|
-
transactionProvider(sel.to - length, sel.to, sug).then(tr => tr && view.dispatch(tr.scrollIntoView()));
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
arrowUp() {
|
|
70
|
-
if (!this.hasFocus)
|
|
71
|
-
return false;
|
|
72
|
-
this.currentFocus && this.focusItem(this.currentFocus - 1);
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
arrowDown() {
|
|
76
|
-
if (!this.hasFocus)
|
|
77
|
-
return false;
|
|
78
|
-
this.currentFocus !== undefined && this.currentFocus < this.palette.getElementsByTagName('ul')[0].childElementCount - 1 && this.focusItem(this.currentFocus + 1);
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
update(view, lastState) {
|
|
82
|
-
let state = view.state;
|
|
83
|
-
// Hide the palette if the selection is not empty
|
|
84
|
-
this.focusItem(undefined);
|
|
85
|
-
this.hasFocus = false;
|
|
86
|
-
if (!state.selection.empty) {
|
|
87
|
-
this.palette.style.display = "none";
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
let $pos = state.selection.$head;
|
|
91
|
-
if ((lastState === null || lastState === void 0 ? void 0 : lastState.doc.textContent) === state.doc.textContent) {
|
|
92
|
-
this.palette.style.display = "none";
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const text = state.doc.textBetween($pos.pos ? $pos.before() + 1 : 0, $pos.pos);
|
|
96
|
-
const words = text.split(/\s+/);
|
|
97
|
-
const terms = words.filter(x => x.length > 2 && !this.suggestionStopWordsProvider().has(x));
|
|
98
|
-
const lastTerms = terms.length > 3 ? terms.slice(length - 3) : terms;
|
|
99
|
-
const fingerprint = lastTerms.join(' ');
|
|
100
|
-
const { to } = state.selection;
|
|
101
|
-
if (this.previousFingerprint !== fingerprint) {
|
|
102
|
-
this.previousFingerprint = fingerprint;
|
|
103
|
-
setTimeout(() => {
|
|
104
|
-
if (this.previousFingerprint !== fingerprint)
|
|
105
|
-
return;
|
|
106
|
-
const res = this.suggestionProvider(lastTerms);
|
|
107
|
-
this.suggestions = res;
|
|
108
|
-
if (res.length) {
|
|
109
|
-
this.palette.innerHTML = `<ul>${res.map(x => `<li id="${x.id}" data-code="${x.code}">${x.text}<div class="icn-container"><svg class="tab-icn" viewBox="0 0 24 24"><path d="M12.29 8.12L15.17 11H2c-.55 0-1 .45-1 1s.45 1 1 1h13.17l-2.88 2.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L13.7 6.7c-.39-.39-1.02-.39-1.41 0-.38.39-.39 1.03 0 1.42zM20 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z"/></svg><svg class="return-icn" viewBox="0 0 24 24"><path d="M19 8v3H5.83l2.88-2.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L2.71 11.3c-.39.39-.39 1.02 0 1.41L7.3 17.3c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L5.83 13H20c.55 0 1-.45 1-1V8c0-.55-.45-1-1-1s-1 .45-1 1z"/></svg></div></li>`).join('\n')}</ul>`;
|
|
110
|
-
// These are in screen coordinates
|
|
111
|
-
const end = view.coordsAtPos(to);
|
|
112
|
-
this.display(end, (this.lastTime = +new Date()));
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
this.palette.style.display = "none";
|
|
116
|
-
}
|
|
117
|
-
}, 30);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
display(pos, time) {
|
|
121
|
-
var _a;
|
|
122
|
-
if (time !== this.lastTime)
|
|
123
|
-
return;
|
|
124
|
-
if (this.delay()) {
|
|
125
|
-
setTimeout(() => this.display(pos, time), 100);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
this.palette.style.display = "";
|
|
129
|
-
const box = (_a = this.palette.offsetParent) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
130
|
-
const palBox = this.palette.getBoundingClientRect();
|
|
131
|
-
if (box) {
|
|
132
|
-
const l = (box.left + pos.left);
|
|
133
|
-
this.palette.style.left = Math.max(box.left, l - palBox.width) + 'px';
|
|
134
|
-
this.palette.style.top = (pos.top + box.top) + "px";
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
destroy() { this.palette.remove(); }
|
|
138
|
-
}
|
|
139
|
-
exports.SuggestionPalette = SuggestionPalette;
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -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.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);
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|