@icure/form 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +12 -0
- package/.idea/inspectionProfiles/Project_Default.xml +73 -0
- package/.idea/iqr-text-field.iml +9 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.mocharc.json +5 -0
- package/app/demo-app.ts +191 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +14 -0
- package/lib/iqr-form/fields/datePicker.d.ts +8 -0
- package/lib/iqr-form/fields/datePicker.js +42 -0
- package/lib/iqr-form/fields/dateTimePicker.d.ts +8 -0
- package/lib/iqr-form/fields/dateTimePicker.js +42 -0
- package/lib/iqr-form/fields/measureField.d.ts +8 -0
- package/lib/iqr-form/fields/measureField.js +42 -0
- package/lib/iqr-form/fields/multipleChoice.d.ts +8 -0
- package/lib/iqr-form/fields/multipleChoice.js +42 -0
- package/lib/iqr-form/fields/numberField.d.ts +8 -0
- package/lib/iqr-form/fields/numberField.js +42 -0
- package/lib/iqr-form/fields/textfield.d.ts +1 -0
- package/lib/iqr-form/fields/textfield.js +86 -0
- package/lib/iqr-form/fields/timePicker.d.ts +8 -0
- package/lib/iqr-form/fields/timePicker.js +42 -0
- package/lib/iqr-form/index.d.ts +7 -0
- package/lib/iqr-form/index.js +83 -0
- package/lib/iqr-form/model/index.d.ts +78 -0
- package/lib/iqr-form/model/index.js +114 -0
- package/lib/iqr-form/renderer/cards.d.ts +2 -0
- package/lib/iqr-form/renderer/cards.js +43 -0
- package/lib/iqr-form/renderer/form.d.ts +2 -0
- package/lib/iqr-form/renderer/form.js +44 -0
- package/lib/iqr-form/renderer/index.d.ts +3 -0
- package/lib/iqr-form/renderer/index.js +2 -0
- package/lib/iqr-text-field/index.d.ts +2 -0
- package/lib/iqr-text-field/index.js +335 -0
- package/lib/iqr-text-field/plugin/caret-fix-plugin.d.ts +2 -0
- package/lib/iqr-text-field/plugin/caret-fix-plugin.js +23 -0
- package/lib/iqr-text-field/plugin/has-content-class-plugin.d.ts +2 -0
- package/lib/iqr-text-field/plugin/has-content-class-plugin.js +18 -0
- package/lib/iqr-text-field/plugin/mask-plugin.d.ts +2 -0
- package/lib/iqr-text-field/plugin/mask-plugin.js +143 -0
- package/lib/iqr-text-field/plugin/regexp-plugin.d.ts +2 -0
- package/lib/iqr-text-field/plugin/regexp-plugin.js +46 -0
- package/lib/iqr-text-field/prosemirror-commands.d.ts +4 -0
- package/lib/iqr-text-field/prosemirror-commands.js +52 -0
- package/lib/iqr-text-field/prosemirror-utils.d.ts +5 -0
- package/lib/iqr-text-field/prosemirror-utils.js +15 -0
- package/lib/iqr-text-field/schema/common-marks.d.ts +10 -0
- package/lib/iqr-text-field/schema/common-marks.js +90 -0
- package/lib/iqr-text-field/schema/date-time-schema.d.ts +7 -0
- package/lib/iqr-text-field/schema/date-time-schema.js +88 -0
- package/lib/iqr-text-field/schema/decimal-schema.d.ts +3 -0
- package/lib/iqr-text-field/schema/decimal-schema.js +27 -0
- package/lib/iqr-text-field/schema/index.d.ts +11 -0
- package/lib/iqr-text-field/schema/index.js +18 -0
- package/lib/iqr-text-field/schema/markdown-schema.d.ts +8 -0
- package/lib/iqr-text-field/schema/markdown-schema.js +139 -0
- package/lib/iqr-text-field/schema/measure-schema.d.ts +3 -0
- package/lib/iqr-text-field/schema/measure-schema.js +35 -0
- package/lib/iqr-text-field/schema/token-schema.d.ts +6 -0
- package/lib/iqr-text-field/schema/token-schema.js +36 -0
- package/lib/iqr-text-field/schema/utils.d.ts +11 -0
- package/lib/iqr-text-field/schema/utils.js +11 -0
- package/lib/iqr-text-field/selection-companion.d.ts +11 -0
- package/lib/iqr-text-field/selection-companion.js +52 -0
- package/lib/iqr-text-field/suggestion-palette.d.ts +33 -0
- package/lib/iqr-text-field/suggestion-palette.js +139 -0
- package/package.json +60 -0
- package/test/form.yaml +96 -0
- package/test/simple/test.spec.ts +303 -0
- package/webpack.config.js +41 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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>
|
|
@@ -0,0 +1,9 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
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
ADDED
package/.mocharc.json
ADDED
package/app/demo-app.ts
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import {css, html, LitElement} from 'lit-element';
|
|
2
|
+
import {getRowsUsingPagination, IccCodeXApi} from '@icure/api';
|
|
3
|
+
|
|
4
|
+
console.log("initialized")
|
|
5
|
+
|
|
6
|
+
import '../src/components/iqr-text-field';
|
|
7
|
+
import '../src/components/iqr-form';
|
|
8
|
+
import MiniSearch from 'minisearch'
|
|
9
|
+
import {
|
|
10
|
+
DatePicker,
|
|
11
|
+
DateTimePicker,
|
|
12
|
+
Form, Group,
|
|
13
|
+
MeasureField, MultipleChoice,
|
|
14
|
+
NumberField,
|
|
15
|
+
Section,
|
|
16
|
+
TextField,
|
|
17
|
+
TimePicker
|
|
18
|
+
} from "../src/components/iqr-form/model";
|
|
19
|
+
|
|
20
|
+
const icd10 = [
|
|
21
|
+
['I', new RegExp('^[AB][0–9]')],
|
|
22
|
+
['II', new RegExp('^C[0-9]–D[0-4]')],
|
|
23
|
+
['III', new RegExp('^D[5–9]')],
|
|
24
|
+
['IV', new RegExp('^E[0–9]')],
|
|
25
|
+
['V', new RegExp('^F[0–9]')],
|
|
26
|
+
['VI', new RegExp('^G[0–9]')],
|
|
27
|
+
['VII', new RegExp('^H[0–5]')],
|
|
28
|
+
['VIII', new RegExp('^H[6–9]')],
|
|
29
|
+
['IX', new RegExp('^I[0–9]')],
|
|
30
|
+
['X', new RegExp('^J[0–9]')],
|
|
31
|
+
['XI', new RegExp('^K[0–9]')],
|
|
32
|
+
['XII', new RegExp('^L[0–9]')],
|
|
33
|
+
['XIII', new RegExp('^M[0–9]')],
|
|
34
|
+
['XIV', new RegExp('^N[0–9]')],
|
|
35
|
+
['XV', new RegExp('^O[0–9]')],
|
|
36
|
+
['XVI', new RegExp('^P[0–9]')],
|
|
37
|
+
['XVII', new RegExp('^Q[0–9]')],
|
|
38
|
+
['XVIII', new RegExp('^R[0–9]')],
|
|
39
|
+
['XIX', new RegExp('^[ST][0–9]')],
|
|
40
|
+
['XX', new RegExp('^[VY][0–9]')],
|
|
41
|
+
['XXI', new RegExp('^Z[0–9]')],
|
|
42
|
+
['XXII', new RegExp('^U[0–9]')]
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
const icpc2 = {
|
|
46
|
+
'B': 'XX',
|
|
47
|
+
'D': 'XI',
|
|
48
|
+
'F': 'VI',
|
|
49
|
+
'H': 'VII',
|
|
50
|
+
'K': 'IX',
|
|
51
|
+
'L': 'XIII',
|
|
52
|
+
'N': 'VI',
|
|
53
|
+
'P': 'V',
|
|
54
|
+
'R': 'X',
|
|
55
|
+
'S': 'XII',
|
|
56
|
+
'T': 'VI',
|
|
57
|
+
'U': 'XIV',
|
|
58
|
+
'W': 'XV',
|
|
59
|
+
'X': 'XVI',
|
|
60
|
+
'Y': 'XVIII',
|
|
61
|
+
'Z': 'XXI'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const stopWords = new Set(['du','au','le','les','un','la','des','sur','de'])
|
|
65
|
+
|
|
66
|
+
class DemoApp extends LitElement {
|
|
67
|
+
private api: IccCodeXApi = new IccCodeXApi("https://kraken.svc.icure.cloud/rest/v1",{ Authorization: 'Basic YWJkZW1vQGljdXJlLmNsb3VkOmtuYWxvdQ=='})
|
|
68
|
+
|
|
69
|
+
private miniSearch: MiniSearch = new MiniSearch({
|
|
70
|
+
fields: ['text'], // fields to index for full-text search
|
|
71
|
+
storeFields: ['code', 'text', 'links'], // fields to return with search results
|
|
72
|
+
processTerm: (term, _fieldName) =>
|
|
73
|
+
term.length === 1 || stopWords.has(term) ?
|
|
74
|
+
null : term.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase()
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
static get styles() {
|
|
78
|
+
return css`
|
|
79
|
+
iqr-text-field {
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
h2 {
|
|
83
|
+
width: 100%;
|
|
84
|
+
font-size: 2em;
|
|
85
|
+
margin-top: 1em;
|
|
86
|
+
margin-bottom: 0;
|
|
87
|
+
font-family: 'Roboto', Helvetica, sans-serif;
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async firstUpdated() {
|
|
93
|
+
const codes = await getRowsUsingPagination<any>((key, docId, limit) => {
|
|
94
|
+
return this.api.findPaginatedCodes('be', 'BE-THESAURUS', undefined, undefined, key, docId || undefined, 10000).then(x => ({
|
|
95
|
+
rows: (x.rows || []).map(x => ({id: x.id, code: x.code, text: x.label?.fr, links:x.links})),
|
|
96
|
+
nextKey: x.nextKeyPair?.startKey && JSON.stringify(x.nextKeyPair?.startKey),
|
|
97
|
+
nextDocId: x.nextKeyPair?.startKeyDocId,
|
|
98
|
+
done: (x.rows || []).length < 10000
|
|
99
|
+
}))
|
|
100
|
+
})
|
|
101
|
+
codes && this.miniSearch.addAll(codes)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
codeColorProvider(type: string, code: string) {
|
|
105
|
+
return type === 'ICD' ? (icd10.find(x => code.match(x[1])) || [])[0] || 'XXII' : icpc2[code.substring(0,1)] || 'XXII'
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
suggestionProvider(terms: string[]) {
|
|
109
|
+
let normalisedTerms = terms.map(x => x.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase());
|
|
110
|
+
const res: any[] = []
|
|
111
|
+
if (this.miniSearch) {
|
|
112
|
+
while(normalisedTerms.length && res.length<20) {
|
|
113
|
+
res.push(...this.miniSearch.search(normalisedTerms.join(' '))
|
|
114
|
+
.filter(x => {
|
|
115
|
+
return normalisedTerms.every(t => x.terms.includes(t))
|
|
116
|
+
})
|
|
117
|
+
.map(s => Object.assign(s, {terms}))
|
|
118
|
+
.filter(t => !res.some(x => x.text === t.text)))
|
|
119
|
+
res.length<20 && res.push(...this.miniSearch.search(normalisedTerms.join(' '), {prefix: true})
|
|
120
|
+
.filter(x => normalisedTerms.every(t => x.terms.some(mt => mt.startsWith(t))))
|
|
121
|
+
.map(s => Object.assign(s, {terms})).filter(t => !res.some(x => x.text === t.text)))
|
|
122
|
+
normalisedTerms = normalisedTerms.slice(1)
|
|
123
|
+
terms = terms.slice(1)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return res
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async linksProvider(sug: { id: string, code: string, text: string, terms: string[], links: string[] }) {
|
|
130
|
+
const links = (await Promise.all((sug.links || []).map(id => this.api.getCode(id)))).map(c => ({id:c.id, code:c.code, text:c.label?.fr, type:c.type}))
|
|
131
|
+
.concat([Object.assign({type: sug.id.split('|')[0]}, sug)])
|
|
132
|
+
return {href: links.map(c => `c-${c.type}://${c.code}`).join(','), title: links.map(c => c.text).join('; ')}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
render() {
|
|
137
|
+
//@ts-ignore
|
|
138
|
+
const form = new Form("Waiting room GP", [
|
|
139
|
+
new Section("All fields", [
|
|
140
|
+
new TextField("This field is a TextField", "TextField"),
|
|
141
|
+
new NumberField("This field is a NumberField", "NumberField"),
|
|
142
|
+
new MeasureField("This field is a MeasureField", "MeasureField"),
|
|
143
|
+
new DatePicker("This field is a DatePicker", "DatePicker"),
|
|
144
|
+
new TimePicker("This field is a TimePicker", "TimePicker"),
|
|
145
|
+
new DateTimePicker("This field is a DateTimePicker", "DateTimePicker"),
|
|
146
|
+
new MultipleChoice("This field is a MultipleChoice", "MultipleChoice"),
|
|
147
|
+
]),
|
|
148
|
+
new Section("Grouped fields", [
|
|
149
|
+
new Group("You can group fields together", [
|
|
150
|
+
new TextField("This field is a TextField", "TextField"),
|
|
151
|
+
new NumberField("This field is a NumberField", "NumberField"),
|
|
152
|
+
new MeasureField("This field is a MeasureField", "MeasureField"),
|
|
153
|
+
new DatePicker("This field is a DatePicker", "DatePicker"),
|
|
154
|
+
new TimePicker("This field is a TimePicker", "TimePicker"),
|
|
155
|
+
new DateTimePicker("This field is a DateTimePicker", "DateTimePicker"),
|
|
156
|
+
new MultipleChoice("This field is a MultipleChoice", "MultipleChoice"),
|
|
157
|
+
]),
|
|
158
|
+
new Group("And you can add tags and codes", [
|
|
159
|
+
new TextField("This field is a TextField", "TextField", 3, true, "text-document", ['CD-ITEM|diagnosis|1'], ['BE-THESAURUS','ICD10'], {option: "blink"}),
|
|
160
|
+
new NumberField("This field is a NumberField", "NumberField", ['CD-ITEM|parameter|1', 'CD-PARAMETER|bmi|1'], [], {option: "bang"}),
|
|
161
|
+
new MeasureField("This field is a MeasureField", "MeasureField", ['CD-ITEM|parameter|1', 'CD-PARAMETER|heartbeat|1'], [], {unit: "bpm"}),
|
|
162
|
+
new MultipleChoice("This field is a MultipleChoice", "MultipleChoice", 4, 4, [], ['KATZ'], {many:"no"}),
|
|
163
|
+
])
|
|
164
|
+
]),
|
|
165
|
+
], "Fill in the patient information inside the waiting room")
|
|
166
|
+
|
|
167
|
+
//@ts-ignore
|
|
168
|
+
const shortForm = new Form("Semantic example", [
|
|
169
|
+
new Section("Dates & Time", [
|
|
170
|
+
new DatePicker("This field is a DatePicker", "DatePicker"),
|
|
171
|
+
new TimePicker("This field is a TimePicker", "DatePicker"),
|
|
172
|
+
new DateTimePicker("This field is a DateTimePicker", "DateTimePicker"),
|
|
173
|
+
]),
|
|
174
|
+
new Section("Completion & Links", [
|
|
175
|
+
new TextField("This field is a TextField", "TextField", 3, true, "text-document", ['CD-ITEM|diagnosis|1'], [], {
|
|
176
|
+
codeColorProvider : this.codeColorProvider,
|
|
177
|
+
suggestionStopWords : this.codeColorProvider,
|
|
178
|
+
linksProvider : this.codeColorProvider,
|
|
179
|
+
suggestionProvider : this.codeColorProvider
|
|
180
|
+
})
|
|
181
|
+
]),
|
|
182
|
+
], "Fill in the patient information inside the waiting room")
|
|
183
|
+
|
|
184
|
+
return html`
|
|
185
|
+
<iqr-text-field .codeColorProvider="${this.codeColorProvider}" .suggestionStopWords="${stopWords}" .linksProvider="${this.linksProvider.bind(this)}" .suggestionProvider="${this.suggestionProvider.bind(this)}" value="[Céphalée de tension](c-ICPC://N01,c-ICD://G05.8,i-he://1234) persistante avec [migraine ophtalmique](c-ICPC://N02) associée. [Grosse fatigue](c-ICPC://K56). A suivi un [protocole de relaxation](x-doc://5678)" owner="M. Mennechet"></iqr-text-field>
|
|
186
|
+
<iqr-form .form="${shortForm}" labelPosition="above" skin="kendo" theme="gray" renderer="form"></iqr-form>
|
|
187
|
+
`
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
customElements.define('demo-app', DemoApp);
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -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';
|