@startinblox/core 0.19.0-beta.2 → 0.19.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css → assets/MarkerCluster-614dea0a.css} +0 -0
- package/dist/{_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css → assets/MarkerCluster.Default-61258232.css} +0 -0
- package/dist/assets/en-e53105c5.js +14 -0
- package/dist/assets/en-e53105c5.js.map +1 -0
- package/dist/assets/fr-a7fcdb64.js +14 -0
- package/dist/assets/fr-a7fcdb64.js.map +1 -0
- package/dist/{_snowpack/pkg/fusejs.js → assets/helpers-411e08e4.js} +499 -454
- package/dist/assets/helpers-411e08e4.js.map +1 -0
- package/dist/{_snowpack/pkg/leaflet/dist/leaflet.css → assets/leaflet-3c081932.css} +3 -3
- package/dist/helpers.js +22 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.js +54873 -48
- package/dist/index.js.map +1 -0
- package/package.json +7 -22
- package/dist/_snowpack/pkg/autolinker.js +0 -4429
- package/dist/_snowpack/pkg/autolinker.js.map +0 -1
- package/dist/_snowpack/pkg/common/_baseUnary-d2677655.js +0 -353
- package/dist/_snowpack/pkg/common/_baseUnary-d2677655.js.map +0 -1
- package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js +0 -26
- package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js.map +0 -1
- package/dist/_snowpack/pkg/common/decode-26fbf385.js +0 -185
- package/dist/_snowpack/pkg/common/decode-26fbf385.js.map +0 -1
- package/dist/_snowpack/pkg/common/lit-html-3647afce.js +0 -1104
- package/dist/_snowpack/pkg/common/lit-html-3647afce.js.map +0 -1
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js +0 -26198
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +0 -1
- package/dist/_snowpack/pkg/dialog-polyfill.js +0 -826
- package/dist/_snowpack/pkg/dialog-polyfill.js.map +0 -1
- package/dist/_snowpack/pkg/fusejs.js.map +0 -1
- package/dist/_snowpack/pkg/import-map.json +0 -25
- package/dist/_snowpack/pkg/jsonld-context-parser.js +0 -836
- package/dist/_snowpack/pkg/jsonld-context-parser.js.map +0 -1
- package/dist/_snowpack/pkg/jsonld.js +0 -11760
- package/dist/_snowpack/pkg/jsonld.js.map +0 -1
- package/dist/_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +0 -39
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +0 -1
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +0 -48
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +0 -1
- package/dist/_snowpack/pkg/lit-html/directives/until.js +0 -87
- package/dist/_snowpack/pkg/lit-html/directives/until.js.map +0 -1
- package/dist/_snowpack/pkg/lit-html.js +0 -94
- package/dist/_snowpack/pkg/lit-html.js.map +0 -1
- package/dist/_snowpack/pkg/markdown-it-link-attributes.js +0 -68
- package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map +0 -1
- package/dist/_snowpack/pkg/markdown-it.js +0 -11307
- package/dist/_snowpack/pkg/markdown-it.js.map +0 -1
- package/dist/_snowpack/pkg/quill/dist/quill.snow.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js +0 -971
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +0 -1
- package/dist/_snowpack/pkg/quill.js +0 -14441
- package/dist/_snowpack/pkg/quill.js.map +0 -1
- package/dist/_snowpack/pkg/slim-select.js +0 -714
- package/dist/_snowpack/pkg/slim-select.js.map +0 -1
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +0 -1149
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/tui-calendar.js +0 -46503
- package/dist/_snowpack/pkg/tui-calendar.js.map +0 -1
- package/dist/components/solid-ac-checker.js +0 -45
- package/dist/components/solid-calendar.js +0 -66
- package/dist/components/solid-delete.js +0 -96
- package/dist/components/solid-display.js +0 -150
- package/dist/components/solid-form-search.js +0 -173
- package/dist/components/solid-form.js +0 -257
- package/dist/components/solid-lang.js +0 -35
- package/dist/components/solid-map.js +0 -204
- package/dist/components/solid-table.js +0 -181
- package/dist/components/solid-widget.js +0 -72
- package/dist/import.css +0 -4
- package/dist/libs/Component.js +0 -13
- package/dist/libs/ComponentFactory.js +0 -165
- package/dist/libs/Compositor.js +0 -96
- package/dist/libs/Sib.js +0 -44
- package/dist/libs/filter.js +0 -184
- package/dist/libs/helpers.js +0 -185
- package/dist/libs/interfaces.js +0 -6
- package/dist/libs/lit-helpers.js +0 -139
- package/dist/libs/polyfills.js +0 -35
- package/dist/libs/store/custom-getter.js +0 -313
- package/dist/libs/store/server-pagination.js +0 -19
- package/dist/libs/store/server-search.js +0 -32
- package/dist/libs/store/store.js +0 -560
- package/dist/locales/en.json +0 -10
- package/dist/locales/en.json.proxy.js +0 -2
- package/dist/locales/fr.json +0 -10
- package/dist/locales/fr.json.proxy.js +0 -2
- package/dist/mixins/attributeBinderMixin.js +0 -113
- package/dist/mixins/contextMixin.js +0 -26
- package/dist/mixins/counterMixin.js +0 -54
- package/dist/mixins/federationMixin.js +0 -57
- package/dist/mixins/filterMixin.js +0 -152
- package/dist/mixins/grouperMixin.js +0 -73
- package/dist/mixins/highlighterMixin.js +0 -36
- package/dist/mixins/interfaces.js +0 -6
- package/dist/mixins/listMixin.js +0 -116
- package/dist/mixins/nextMixin.js +0 -23
- package/dist/mixins/paginateMixin.js +0 -97
- package/dist/mixins/requiredMixin.js +0 -38
- package/dist/mixins/serverPaginationMixin.js +0 -122
- package/dist/mixins/sorterMixin.js +0 -131
- package/dist/mixins/storeMixin.js +0 -139
- package/dist/mixins/translationMixin.js +0 -58
- package/dist/mixins/validationMixin.js +0 -95
- package/dist/mixins/widgetMixin.js +0 -364
- package/dist/new-widgets/attributeMixins/actionMixin.js +0 -13
- package/dist/new-widgets/attributeMixins/blankMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/booleanMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/index.js +0 -19
- package/dist/new-widgets/attributeMixins/mailtoMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/multipleMixin.js +0 -27
- package/dist/new-widgets/attributeMixins/numberMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/placeholderMixin.js +0 -16
- package/dist/new-widgets/attributeMixins/telMixin.js +0 -7
- package/dist/new-widgets/baseWidgetMixin.js +0 -109
- package/dist/new-widgets/callbackMixins/autocompletionMixin.js +0 -96
- package/dist/new-widgets/callbackMixins/index.js +0 -7
- package/dist/new-widgets/callbackMixins/richtextMixin.js +0 -37
- package/dist/new-widgets/callbackMixins/slimselect.css.proxy.js +0 -10
- package/dist/new-widgets/interfaces.js +0 -1
- package/dist/new-widgets/new-widget-factory.js +0 -91
- package/dist/new-widgets/templateAdditionMixins/addableMixin.js +0 -26
- package/dist/new-widgets/templateAdditionMixins/index.js +0 -13
- package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +0 -16
- package/dist/new-widgets/templateAdditionMixins/labelMixin.js +0 -18
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js +0 -29
- package/dist/new-widgets/templates/displayTemplatesDirectory.js +0 -54
- package/dist/new-widgets/templates/formTemplatesDirectory.js +0 -423
- package/dist/new-widgets/templates/groupTemplatesDirectory.js +0 -11
- package/dist/new-widgets/templates/index.js +0 -6
- package/dist/new-widgets/templates/setTemplatesDirectory.js +0 -16
- package/dist/new-widgets/templatesDependencies/altMixin.js +0 -12
- package/dist/new-widgets/templatesDependencies/editableMixin.js +0 -60
- package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +0 -34
- package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +0 -10
- package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +0 -41
- package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +0 -59
- package/dist/new-widgets/templatesDependencies/formFileMixin.js +0 -82
- package/dist/new-widgets/templatesDependencies/formLengthMixin.js +0 -18
- package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +0 -18
- package/dist/new-widgets/templatesDependencies/formMixin.js +0 -56
- package/dist/new-widgets/templatesDependencies/formNumberMixin.js +0 -10
- package/dist/new-widgets/templatesDependencies/formRadioMixin.js +0 -12
- package/dist/new-widgets/templatesDependencies/formStepMixin.js +0 -12
- package/dist/new-widgets/templatesDependencies/linkTextMixin.js +0 -13
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +0 -125
- package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +0 -74
- package/dist/new-widgets/templatesDependencies/patternMixin.js +0 -18
- package/dist/new-widgets/templatesDependencies/rangeMixin.js +0 -100
- package/dist/new-widgets/templatesDependencies/setMixin.js +0 -9
- package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +0 -9
- package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +0 -14
- package/dist/new-widgets/valueTransformationMixins/dateMixin.js +0 -29
- package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +0 -12
- package/dist/new-widgets/valueTransformationMixins/index.js +0 -15
- package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +0 -30
- package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +0 -13
- package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +0 -21
- package/dist/solid-template-element.js +0 -144
- package/dist/style/default-theme.css.proxy.js +0 -10
- package/dist/widgets/baseWidget.js +0 -267
- package/dist/widgets/widget-factory.js +0 -20
- /package/dist/{style/default-theme.css → assets/default-theme-d0f20a8a.css} +0 -0
- /package/dist/{_snowpack/pkg/quill/dist/quill.snow.css → assets/quill.snow-8f222e44.css} +0 -0
- /package/dist/{new-widgets/callbackMixins/slimselect.css → assets/slimselect-43e3ebc8.css} +0 -0
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import { FormMixin } from '../templatesDependencies/formMixin.js';
|
|
2
|
-
import { FormCheckboxMixin } from '../templatesDependencies/formCheckboxMixin.js';
|
|
3
|
-
import { FormMinMaxMixin } from '../templatesDependencies/formMinMaxMixin.js';
|
|
4
|
-
import { FormNumberMixin } from '../templatesDependencies/formNumberMixin.js';
|
|
5
|
-
import { FormDropdownMixin } from '../templatesDependencies/formDropdownMixin.js';
|
|
6
|
-
import { FormCheckboxesMixin } from '../templatesDependencies/formCheckboxesMixin.js';
|
|
7
|
-
import { FormRadioMixin } from '../templatesDependencies/formRadioMixin.js';
|
|
8
|
-
import { FormFileMixin } from '../templatesDependencies/formFileMixin.js';
|
|
9
|
-
import { MultipleFormMixin } from '../templatesDependencies/multipleFormMixin.js';
|
|
10
|
-
import { MultipleselectFormMixin } from '../templatesDependencies/multipleselectFormMixin.js';
|
|
11
|
-
import { RangeMixin } from '../templatesDependencies/rangeMixin.js';
|
|
12
|
-
import { FilterRangeFormMixin } from '../templatesDependencies/filterRangeFormMixin.js';
|
|
13
|
-
import { ValueRichtextMixin } from '../templatesDependencies/valueRichtextMixin.js';
|
|
14
|
-
import { PatternMixin } from '../templatesDependencies/patternMixin.js';
|
|
15
|
-
import { FormStepMixin } from '../templatesDependencies/formStepMixin.js';
|
|
16
|
-
import { FormLengthMixin } from '../templatesDependencies/formLengthMixin.js';
|
|
17
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
18
|
-
import { ifDefined } from '../../_snowpack/pkg/lit-html/directives/if-defined.js';
|
|
19
|
-
export const formTemplates = {
|
|
20
|
-
text: {
|
|
21
|
-
template: (value, attributes) => html`
|
|
22
|
-
<input
|
|
23
|
-
type="text"
|
|
24
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
25
|
-
name=${ifDefined(attributes.name)}
|
|
26
|
-
id=${ifDefined(attributes.id)}
|
|
27
|
-
value=${value || ''}
|
|
28
|
-
pattern=${ifDefined(attributes.pattern)}
|
|
29
|
-
title=${ifDefined(attributes.title)}
|
|
30
|
-
?required=${attributes.required}
|
|
31
|
-
autocomplete=${ifDefined(attributes.autocomplete)}
|
|
32
|
-
data-holder
|
|
33
|
-
maxlength=${ifDefined(attributes.maxlength)}
|
|
34
|
-
minlength=${ifDefined(attributes.minlength)}
|
|
35
|
-
@change=${attributes.onChange}
|
|
36
|
-
/>
|
|
37
|
-
`,
|
|
38
|
-
dependencies: [FormMixin, PatternMixin, FormLengthMixin]
|
|
39
|
-
},
|
|
40
|
-
textarea: {
|
|
41
|
-
template: (value, attributes) => html`
|
|
42
|
-
<textarea
|
|
43
|
-
name=${ifDefined(attributes.name)}
|
|
44
|
-
id=${ifDefined(attributes.id)}
|
|
45
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
46
|
-
data-holder
|
|
47
|
-
?required=${attributes.required}
|
|
48
|
-
autocomplete=${ifDefined(attributes.autocomplete)}
|
|
49
|
-
maxlength=${ifDefined(attributes.maxlength)}
|
|
50
|
-
minlength=${ifDefined(attributes.minlength)}
|
|
51
|
-
@change=${attributes.onChange}
|
|
52
|
-
>${value}</textarea>
|
|
53
|
-
`,
|
|
54
|
-
dependencies: [FormMixin, FormLengthMixin]
|
|
55
|
-
},
|
|
56
|
-
checkbox: {
|
|
57
|
-
template: (value, attributes) => html`
|
|
58
|
-
<label>
|
|
59
|
-
<input
|
|
60
|
-
data-holder
|
|
61
|
-
type="checkbox"
|
|
62
|
-
name=${ifDefined(attributes.name)}
|
|
63
|
-
?required=${attributes.required}
|
|
64
|
-
?checked=${value === 'true'}
|
|
65
|
-
@change=${attributes.onChange}
|
|
66
|
-
>
|
|
67
|
-
<div>${attributes.label || attributes.name}</div>
|
|
68
|
-
</label>
|
|
69
|
-
`,
|
|
70
|
-
dependencies: [FormCheckboxMixin, FormMixin]
|
|
71
|
-
},
|
|
72
|
-
date: {
|
|
73
|
-
template: (_value, attributes) => html`
|
|
74
|
-
<input
|
|
75
|
-
type="date"
|
|
76
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
77
|
-
name=${ifDefined(attributes.name)}
|
|
78
|
-
id=${ifDefined(attributes.id)}
|
|
79
|
-
?required=${attributes.required}
|
|
80
|
-
value=${ifDefined(attributes.originalValue)}
|
|
81
|
-
data-holder
|
|
82
|
-
@change=${attributes.onChange}
|
|
83
|
-
/>
|
|
84
|
-
`,
|
|
85
|
-
dependencies: [FormMixin]
|
|
86
|
-
},
|
|
87
|
-
rangedate: {
|
|
88
|
-
template: (_value, attributes) => html`
|
|
89
|
-
<input
|
|
90
|
-
data-holder
|
|
91
|
-
type="date"
|
|
92
|
-
name="${attributes.name || ''}-start"
|
|
93
|
-
@change=${attributes.onChange}
|
|
94
|
-
value=${ifDefined(attributes.startValue)}
|
|
95
|
-
/>
|
|
96
|
-
<input
|
|
97
|
-
data-holder
|
|
98
|
-
type="date"
|
|
99
|
-
name="${attributes.name || ''}-end"
|
|
100
|
-
@change=${attributes.onChange}
|
|
101
|
-
value=${ifDefined(attributes.endValue)}
|
|
102
|
-
/>
|
|
103
|
-
`,
|
|
104
|
-
dependencies: [FilterRangeFormMixin, FormMixin]
|
|
105
|
-
},
|
|
106
|
-
number: {
|
|
107
|
-
template: (value, attributes) => html`
|
|
108
|
-
<input
|
|
109
|
-
type="number"
|
|
110
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
111
|
-
name=${ifDefined(attributes.name)}
|
|
112
|
-
id=${ifDefined(attributes.id)}
|
|
113
|
-
value=${value}
|
|
114
|
-
min=${ifDefined(attributes.min)}
|
|
115
|
-
max=${ifDefined(attributes.max)}
|
|
116
|
-
step=${ifDefined(attributes.step)}
|
|
117
|
-
?required=${attributes.required}
|
|
118
|
-
data-holder
|
|
119
|
-
@change=${attributes.onChange}
|
|
120
|
-
/>
|
|
121
|
-
`,
|
|
122
|
-
dependencies: [FormNumberMixin, FormMinMaxMixin, FormMixin, FormStepMixin]
|
|
123
|
-
},
|
|
124
|
-
rangenumber: {
|
|
125
|
-
template: (_value, attributes) => html`
|
|
126
|
-
<input
|
|
127
|
-
data-holder
|
|
128
|
-
type="number"
|
|
129
|
-
name="${attributes.name || ''}-start"
|
|
130
|
-
@change=${attributes.onChange}
|
|
131
|
-
value=${ifDefined(attributes.startValue)}
|
|
132
|
-
/>
|
|
133
|
-
<input
|
|
134
|
-
data-holder
|
|
135
|
-
type="number"
|
|
136
|
-
name="${attributes.name || ''}-end"
|
|
137
|
-
@change=${attributes.onChange}
|
|
138
|
-
value=${ifDefined(attributes.endValue)}
|
|
139
|
-
/>
|
|
140
|
-
`,
|
|
141
|
-
dependencies: [FilterRangeFormMixin, FormNumberMixin, FormMixin]
|
|
142
|
-
},
|
|
143
|
-
hidden: {
|
|
144
|
-
template: (value, attributes) => html`
|
|
145
|
-
<input
|
|
146
|
-
type="hidden"
|
|
147
|
-
name=${ifDefined(attributes.name)}
|
|
148
|
-
value=${value}
|
|
149
|
-
data-holder
|
|
150
|
-
@change=${attributes.onChange}
|
|
151
|
-
/>
|
|
152
|
-
`,
|
|
153
|
-
dependencies: [FormMixin]
|
|
154
|
-
},
|
|
155
|
-
dropdown: {
|
|
156
|
-
template: (value, attributes) => html`
|
|
157
|
-
<select
|
|
158
|
-
name=${ifDefined(attributes.name)}
|
|
159
|
-
id=${ifDefined(attributes.id)}
|
|
160
|
-
data-holder
|
|
161
|
-
?required=${attributes.required}
|
|
162
|
-
?multiple=${attributes.multiple}
|
|
163
|
-
autocomplete=${ifDefined(attributes.autocomplete)}
|
|
164
|
-
@change=${attributes.onChange}
|
|
165
|
-
>
|
|
166
|
-
${!(attributes.multiple || attributes.autocomplete) ? html`
|
|
167
|
-
<option value="" ?selected=${value === ""}>
|
|
168
|
-
${attributes.placeholder || '-'}
|
|
169
|
-
</option>
|
|
170
|
-
` : ''}
|
|
171
|
-
${(attributes.range || []).map(el => html`
|
|
172
|
-
<option
|
|
173
|
-
value=${el.value}
|
|
174
|
-
?selected=${!attributes.multiple ? value === el.selectedValue : attributes.values.includes(el.selectedValue)}
|
|
175
|
-
>
|
|
176
|
-
${el.label}
|
|
177
|
-
</option>
|
|
178
|
-
`)}
|
|
179
|
-
${Object.entries(attributes.enum || []).map(([key, val]) => html`
|
|
180
|
-
<option
|
|
181
|
-
value="${key}"
|
|
182
|
-
?selected=${!attributes.multiple ? value === key : attributes.values.includes(key)}
|
|
183
|
-
>
|
|
184
|
-
${val}
|
|
185
|
-
</option>
|
|
186
|
-
`)}
|
|
187
|
-
</select>
|
|
188
|
-
`,
|
|
189
|
-
dependencies: [FormDropdownMixin, FormMixin, RangeMixin]
|
|
190
|
-
},
|
|
191
|
-
radio: {
|
|
192
|
-
template: (value, attributes) => html`
|
|
193
|
-
<div
|
|
194
|
-
name=${ifDefined(attributes.name)}
|
|
195
|
-
>
|
|
196
|
-
${(attributes.range || []).map(el => html`
|
|
197
|
-
<label>
|
|
198
|
-
<input
|
|
199
|
-
type="radio"
|
|
200
|
-
name=${ifDefined(attributes.id)}
|
|
201
|
-
value=${el.value}
|
|
202
|
-
?required=${attributes.required}
|
|
203
|
-
?checked=${value === el.selectedValue}
|
|
204
|
-
> <span>${el.label}</span>
|
|
205
|
-
</label>
|
|
206
|
-
`)}
|
|
207
|
-
${Object.entries(attributes.enum || []).map(([key, val]) => html`
|
|
208
|
-
<label>
|
|
209
|
-
<input
|
|
210
|
-
type="radio"
|
|
211
|
-
value="${key}"
|
|
212
|
-
name=${ifDefined(attributes.id)}
|
|
213
|
-
?required=${attributes.required}
|
|
214
|
-
?checked=${value === key}
|
|
215
|
-
> <span>${val}</span>
|
|
216
|
-
</label>
|
|
217
|
-
`)}
|
|
218
|
-
`,
|
|
219
|
-
dependencies: [FormRadioMixin, FormMixin, RangeMixin]
|
|
220
|
-
},
|
|
221
|
-
multicheckbox: {
|
|
222
|
-
template: (_value, attributes) => html`
|
|
223
|
-
<div
|
|
224
|
-
name=${ifDefined(attributes.name)}
|
|
225
|
-
>
|
|
226
|
-
${(attributes.range || []).map(el => html`
|
|
227
|
-
<label>
|
|
228
|
-
<input
|
|
229
|
-
type="checkbox"
|
|
230
|
-
value=${el.value}
|
|
231
|
-
?checked=${attributes.values.includes(el.selectedValue)}
|
|
232
|
-
/> <span>${el.label}</span>
|
|
233
|
-
</label>
|
|
234
|
-
`)}
|
|
235
|
-
${Object.entries(attributes.enum || []).map(([key, val]) => html`
|
|
236
|
-
<label>
|
|
237
|
-
<input type="checkbox"
|
|
238
|
-
value="${key}"
|
|
239
|
-
/> <span>${val}</span>
|
|
240
|
-
</label>
|
|
241
|
-
`)}
|
|
242
|
-
</select>
|
|
243
|
-
`,
|
|
244
|
-
dependencies: [FormCheckboxesMixin, FormMixin, RangeMixin]
|
|
245
|
-
},
|
|
246
|
-
checkboxes: {
|
|
247
|
-
template: (_value, attributes) => html`
|
|
248
|
-
<solid-form-multicheckbox
|
|
249
|
-
data-holder
|
|
250
|
-
name=${ifDefined(attributes.name)}
|
|
251
|
-
range=${ifDefined(attributes.range)}
|
|
252
|
-
enum=${ifDefined(attributes.enum)}
|
|
253
|
-
values=${ifDefined(attributes.values)}
|
|
254
|
-
order-asc=${ifDefined(attributes.orderAsc)}
|
|
255
|
-
order-desc=${ifDefined(attributes.orderDesc)}
|
|
256
|
-
?required=${attributes.required}
|
|
257
|
-
></solid-form-multicheckbox>
|
|
258
|
-
`,
|
|
259
|
-
dependencies: [MultipleselectFormMixin, FormMixin]
|
|
260
|
-
},
|
|
261
|
-
multiple: {
|
|
262
|
-
template: (_value, attributes) => html`
|
|
263
|
-
${(attributes.children || []).map((child, index) => html`
|
|
264
|
-
<div data-index=${attributes.name + index}>
|
|
265
|
-
${child}
|
|
266
|
-
<button type="button" class=${ifDefined(attributes.removeClass)} @click=${() => attributes.removeItem(index)}>${attributes.removeLabel}</button>
|
|
267
|
-
</div>
|
|
268
|
-
`)}
|
|
269
|
-
<button type="button" class=${ifDefined(attributes.addClass)} @click=${attributes.addItem}>${attributes.addLabel}</button>
|
|
270
|
-
`,
|
|
271
|
-
dependencies: [MultipleFormMixin, FormMixin]
|
|
272
|
-
},
|
|
273
|
-
multipleselect: {
|
|
274
|
-
template: (_value, attributes) => html`
|
|
275
|
-
<solid-form-dropdown
|
|
276
|
-
data-holder
|
|
277
|
-
name=${ifDefined(attributes.name)}
|
|
278
|
-
data-id=${ifDefined(attributes.id)}
|
|
279
|
-
range=${ifDefined(attributes.range)}
|
|
280
|
-
values=${ifDefined(attributes.values)}
|
|
281
|
-
order-asc=${ifDefined(attributes.orderAsc)}
|
|
282
|
-
order-desc=${ifDefined(attributes.orderDesc)}
|
|
283
|
-
?required=${attributes.required}
|
|
284
|
-
multiple
|
|
285
|
-
></solid-form-dropdown>
|
|
286
|
-
`,
|
|
287
|
-
dependencies: [MultipleselectFormMixin, FormMixin]
|
|
288
|
-
},
|
|
289
|
-
file: {
|
|
290
|
-
template: (value, attributes) => html`
|
|
291
|
-
<div>
|
|
292
|
-
<input
|
|
293
|
-
data-holder
|
|
294
|
-
type="text"
|
|
295
|
-
?required=${attributes.required}
|
|
296
|
-
name=${ifDefined(attributes.name)}
|
|
297
|
-
value=${value || ''}
|
|
298
|
-
>
|
|
299
|
-
<input
|
|
300
|
-
type="file"
|
|
301
|
-
id=${ifDefined(attributes.id)}
|
|
302
|
-
value=${ifDefined(attributes.fileValue)}
|
|
303
|
-
@change=${attributes.selectFile}
|
|
304
|
-
/>
|
|
305
|
-
<button
|
|
306
|
-
?hidden=${attributes.resetButtonHidden}
|
|
307
|
-
@click=${attributes.resetFile}
|
|
308
|
-
>×</button>
|
|
309
|
-
<span>${attributes.output}</span>
|
|
310
|
-
</div>
|
|
311
|
-
`,
|
|
312
|
-
dependencies: [FormFileMixin, FormMixin]
|
|
313
|
-
},
|
|
314
|
-
image: {
|
|
315
|
-
template: (value, attributes) => html`
|
|
316
|
-
<div>
|
|
317
|
-
<input
|
|
318
|
-
data-holder
|
|
319
|
-
type="text"
|
|
320
|
-
name=${ifDefined(attributes.name)}
|
|
321
|
-
value=${value || ''}
|
|
322
|
-
?required=${attributes.required}
|
|
323
|
-
>
|
|
324
|
-
<input
|
|
325
|
-
type="file"
|
|
326
|
-
accept="image/*"
|
|
327
|
-
id=${ifDefined(attributes.id)}
|
|
328
|
-
value=${ifDefined(attributes.fileValue)}
|
|
329
|
-
@change=${attributes.selectFile}
|
|
330
|
-
/>
|
|
331
|
-
<img
|
|
332
|
-
src=${value || ''}
|
|
333
|
-
?hidden=${value === ''}
|
|
334
|
-
/>
|
|
335
|
-
<button
|
|
336
|
-
?hidden=${attributes.resetButtonHidden}
|
|
337
|
-
@click=${attributes.resetFile}
|
|
338
|
-
>×</button>
|
|
339
|
-
<span>${attributes.output}</span>
|
|
340
|
-
</div>
|
|
341
|
-
`,
|
|
342
|
-
dependencies: [FormFileMixin, FormMixin]
|
|
343
|
-
},
|
|
344
|
-
richtext: {
|
|
345
|
-
template: (_value, attributes) => html`
|
|
346
|
-
<div
|
|
347
|
-
data-richtext
|
|
348
|
-
name=${ifDefined(attributes.name)}
|
|
349
|
-
data-holder
|
|
350
|
-
></div>
|
|
351
|
-
`,
|
|
352
|
-
dependencies: [ValueRichtextMixin, FormMixin]
|
|
353
|
-
},
|
|
354
|
-
color: {
|
|
355
|
-
template: (_value, attributes) => html`
|
|
356
|
-
<input
|
|
357
|
-
type="color"
|
|
358
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
359
|
-
id=${ifDefined(attributes.id)}
|
|
360
|
-
name=${ifDefined(attributes.name)}
|
|
361
|
-
?required=${attributes.required}
|
|
362
|
-
value=${ifDefined(attributes.originalValue)}
|
|
363
|
-
data-holder
|
|
364
|
-
@change=${attributes.onChange}
|
|
365
|
-
/>
|
|
366
|
-
`,
|
|
367
|
-
dependencies: [FormMixin]
|
|
368
|
-
},
|
|
369
|
-
email: {
|
|
370
|
-
template: (value, attributes) => html`
|
|
371
|
-
<input
|
|
372
|
-
type="email"
|
|
373
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
374
|
-
id=${ifDefined(attributes.id)}
|
|
375
|
-
name=${ifDefined(attributes.name)}
|
|
376
|
-
value=${value || ''}
|
|
377
|
-
?required=${attributes.required}
|
|
378
|
-
data-holder
|
|
379
|
-
maxlength=${ifDefined(attributes.maxlength)}
|
|
380
|
-
minlength=${ifDefined(attributes.minlength)}
|
|
381
|
-
@change=${attributes.onChange}
|
|
382
|
-
/>
|
|
383
|
-
`,
|
|
384
|
-
dependencies: [FormMixin, FormLengthMixin]
|
|
385
|
-
},
|
|
386
|
-
password: {
|
|
387
|
-
template: (value, attributes) => html`
|
|
388
|
-
<input
|
|
389
|
-
type="password"
|
|
390
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
391
|
-
id=${ifDefined(attributes.id)}
|
|
392
|
-
name=${ifDefined(attributes.name)}
|
|
393
|
-
value=${value || ''}
|
|
394
|
-
?required=${attributes.required}
|
|
395
|
-
pattern=${ifDefined(attributes.pattern)}
|
|
396
|
-
title=${ifDefined(attributes.title)}
|
|
397
|
-
data-holder
|
|
398
|
-
maxlength=${ifDefined(attributes.maxlength)}
|
|
399
|
-
minlength=${ifDefined(attributes.minlength)}
|
|
400
|
-
@change=${attributes.onChange}
|
|
401
|
-
/>
|
|
402
|
-
`,
|
|
403
|
-
dependencies: [FormMixin, PatternMixin, FormLengthMixin]
|
|
404
|
-
},
|
|
405
|
-
time: {
|
|
406
|
-
template: (value, attributes) => html`
|
|
407
|
-
<input
|
|
408
|
-
type="time"
|
|
409
|
-
placeholder=${ifDefined(attributes.placeholder)}
|
|
410
|
-
name=${ifDefined(attributes.name)}
|
|
411
|
-
id=${ifDefined(attributes.id)}
|
|
412
|
-
value=${value || ''}
|
|
413
|
-
min=${ifDefined(attributes.min)}
|
|
414
|
-
max=${ifDefined(attributes.max)}
|
|
415
|
-
step=${ifDefined(attributes.step)}
|
|
416
|
-
?required=${attributes.required}
|
|
417
|
-
data-holder
|
|
418
|
-
@change=${attributes.onChange}
|
|
419
|
-
/>
|
|
420
|
-
`,
|
|
421
|
-
dependencies: [FormMixin, FormMinMaxMixin, FormStepMixin]
|
|
422
|
-
}
|
|
423
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
2
|
-
import { SetMixin } from '../templatesDependencies/setMixin.js';
|
|
3
|
-
export const groupTemplates = {
|
|
4
|
-
default: {
|
|
5
|
-
template: value => html`
|
|
6
|
-
<span>${value}</span>
|
|
7
|
-
<div data-content></div>
|
|
8
|
-
`,
|
|
9
|
-
dependencies: [SetMixin]
|
|
10
|
-
}
|
|
11
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { defaultTemplates } from './defaultTemplatesDirectory.js';
|
|
2
|
-
import { displayTemplates } from './displayTemplatesDirectory.js';
|
|
3
|
-
import { formTemplates } from './formTemplatesDirectory.js';
|
|
4
|
-
import { setTemplates } from './setTemplatesDirectory.js';
|
|
5
|
-
import { groupTemplates } from './groupTemplatesDirectory.js';
|
|
6
|
-
export { defaultTemplates, displayTemplates, formTemplates, setTemplates, groupTemplates };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
2
|
-
import { SetMixin } from '../templatesDependencies/setMixin.js';
|
|
3
|
-
export const setTemplates = {
|
|
4
|
-
default: {
|
|
5
|
-
template: () => html``,
|
|
6
|
-
dependencies: [SetMixin]
|
|
7
|
-
},
|
|
8
|
-
div: {
|
|
9
|
-
template: () => html`<div data-content></div>`,
|
|
10
|
-
dependencies: [SetMixin]
|
|
11
|
-
},
|
|
12
|
-
ul: {
|
|
13
|
-
template: () => html`<ul data-content></ul>`,
|
|
14
|
-
dependencies: [SetMixin]
|
|
15
|
-
}
|
|
16
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { StoreMixin } from '../../mixins/storeMixin.js';
|
|
2
|
-
import { store } from '../../libs/store/store.js';
|
|
3
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
4
|
-
const EditableMixin = {
|
|
5
|
-
name: 'editable-mixin',
|
|
6
|
-
use: [StoreMixin],
|
|
7
|
-
// used to get context
|
|
8
|
-
attributes: {
|
|
9
|
-
editable: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
default: null,
|
|
12
|
-
callback: function (newValue) {
|
|
13
|
-
if (newValue !== null) this.listAttributes['editable'] = true;
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
valueId: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: ''
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
created() {
|
|
22
|
-
this.listTemplateAdditions.push(this.addEditButton.bind(this));
|
|
23
|
-
},
|
|
24
|
-
addEditButton(template, listTemplateAdditions) {
|
|
25
|
-
let newTemplate = null;
|
|
26
|
-
if (this.editable !== null) {
|
|
27
|
-
newTemplate = html`
|
|
28
|
-
${template}
|
|
29
|
-
<button @click=${this.activateEditableField.bind(this)}>Modifier</button>
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
const nextProcessor = listTemplateAdditions.shift();
|
|
33
|
-
if (nextProcessor) nextProcessor(newTemplate || template, listTemplateAdditions);
|
|
34
|
-
},
|
|
35
|
-
activateEditableField(e) {
|
|
36
|
-
const editableField = this.element.querySelector('[data-editable]');
|
|
37
|
-
const editButton = e.target;
|
|
38
|
-
|
|
39
|
-
// Set attributes
|
|
40
|
-
editableField.toggleAttribute('contenteditable', true);
|
|
41
|
-
editableField.focus();
|
|
42
|
-
editButton.toggleAttribute('disabled', true);
|
|
43
|
-
|
|
44
|
-
// Save on focusout
|
|
45
|
-
editableField.addEventListener('focusout', () => this.save(editableField, editButton));
|
|
46
|
-
},
|
|
47
|
-
save(editableField, editButton) {
|
|
48
|
-
editableField.toggleAttribute('contenteditable', false);
|
|
49
|
-
editButton.removeAttribute('disabled');
|
|
50
|
-
if (!this.name || !this.valueId) {
|
|
51
|
-
console.warn('Some attributes are missing to perform the update');
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const resource = {};
|
|
55
|
-
resource[this.name] = editableField.innerText;
|
|
56
|
-
resource['@context'] = this.context;
|
|
57
|
-
store.patch(resource, this.valueId);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
export { EditableMixin };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const FilterRangeFormMixin = {
|
|
2
|
-
name: 'filter-range-form-mixin',
|
|
3
|
-
attributes: {
|
|
4
|
-
startValue: {
|
|
5
|
-
type: String,
|
|
6
|
-
default: '',
|
|
7
|
-
callback: function (value) {
|
|
8
|
-
this.addToAttributes(this.getDefaultValue(value), "startValue");
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
endValue: {
|
|
12
|
-
type: String,
|
|
13
|
-
default: '',
|
|
14
|
-
callback: function (value) {
|
|
15
|
-
this.addToAttributes(this.getDefaultValue(value), "endValue");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
getDefaultValue(value) {
|
|
20
|
-
if (value == "today") return new Date().toISOString().split("T")[0];
|
|
21
|
-
return value;
|
|
22
|
-
},
|
|
23
|
-
getValue() {
|
|
24
|
-
if (!this.dataHolder) return [];
|
|
25
|
-
if (this.dataHolder.length !== 2) this.showDataHolderError(2, this.dataHolder.length);
|
|
26
|
-
return [
|
|
27
|
-
// we expect 2 values, one min and one max
|
|
28
|
-
this.getValueFromElement(this.dataHolder[0]), this.getValueFromElement(this.dataHolder[1])];
|
|
29
|
-
},
|
|
30
|
-
get type() {
|
|
31
|
-
return 'range';
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
export { FilterRangeFormMixin };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const FormCheckboxesMixin = {
|
|
2
|
-
name: 'form-checkboxes-mixin',
|
|
3
|
-
attributes: {
|
|
4
|
-
values: {
|
|
5
|
-
type: String,
|
|
6
|
-
default: '',
|
|
7
|
-
callback: function (value) {
|
|
8
|
-
if (!value) return;
|
|
9
|
-
try {
|
|
10
|
-
this.listAttributes['values'] = JSON.parse(value);
|
|
11
|
-
} catch (e) {
|
|
12
|
-
console.error(e);
|
|
13
|
-
this.listAttributes['values'] = [];
|
|
14
|
-
}
|
|
15
|
-
this.render();
|
|
16
|
-
this.element.dispatchEvent(new Event('change'));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
created() {
|
|
21
|
-
this.listAttributes['values'] = [];
|
|
22
|
-
},
|
|
23
|
-
getValue() {
|
|
24
|
-
const options = Array.from(this.element.querySelectorAll('input'));
|
|
25
|
-
return options.filter(el => el.checked).map(el => {
|
|
26
|
-
if (!el.value) return null;
|
|
27
|
-
let value = el.value;
|
|
28
|
-
try {
|
|
29
|
-
value = JSON.parse(el.value);
|
|
30
|
-
} catch (e) {}
|
|
31
|
-
return value;
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
get type() {
|
|
35
|
-
return this.enum === '' ? 'resource' : 'string';
|
|
36
|
-
},
|
|
37
|
-
get multiple() {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
export { FormCheckboxesMixin };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const FormDropdownMixin = {
|
|
2
|
-
name: 'form-dropdown-mixin',
|
|
3
|
-
attributes: {
|
|
4
|
-
values: {
|
|
5
|
-
// used to set more than 1 value, for multiple select
|
|
6
|
-
type: String,
|
|
7
|
-
default: '',
|
|
8
|
-
callback: function (value) {
|
|
9
|
-
if (value) {
|
|
10
|
-
try {
|
|
11
|
-
this.listAttributes['values'] = JSON.parse(value);
|
|
12
|
-
} catch (e) {
|
|
13
|
-
console.error(e);
|
|
14
|
-
this.listAttributes['values'] = [];
|
|
15
|
-
}
|
|
16
|
-
this.render(); // use render to make sure the dispatch always happen after
|
|
17
|
-
this.dispatchChange();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
dataId: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: '',
|
|
24
|
-
callback: function (newValue) {
|
|
25
|
-
this.addToAttributes(newValue, 'id');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
created() {
|
|
30
|
-
this.listAttributes['values'] = [];
|
|
31
|
-
if (this.listAttributes['value'] && !JSON.parse(this.listAttributes['value']['@id']) && Array.isArray(JSON.parse(this.listAttributes['value']))) {
|
|
32
|
-
this.listAttributes['values'] = this.listAttributes['value'];
|
|
33
|
-
}
|
|
34
|
-
if (this.multiple) this.listAttributes['multiple'] = true;
|
|
35
|
-
},
|
|
36
|
-
dispatchChange() {
|
|
37
|
-
if (!this.element.querySelector('select')) return;
|
|
38
|
-
this.element.querySelector('select').dispatchEvent(new Event('change'));
|
|
39
|
-
},
|
|
40
|
-
getValue() {
|
|
41
|
-
if (!this.dataHolder) return ''; // no value
|
|
42
|
-
if (!this.multiple) {
|
|
43
|
-
// simple select
|
|
44
|
-
if (this.dataHolder.length > 1) this.showDataHolderError(1, this.dataHolder.length);
|
|
45
|
-
return this.getValueFromElement(this.dataHolder[0]);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// multiple select
|
|
49
|
-
const options = Array.from(this.element.querySelectorAll('option'));
|
|
50
|
-
return options.filter(el => el.selected).map(el => el.value ? JSON.parse(el.value) : null);
|
|
51
|
-
},
|
|
52
|
-
get type() {
|
|
53
|
-
return this.enum === '' ? 'resource' : 'string';
|
|
54
|
-
},
|
|
55
|
-
get multiple() {
|
|
56
|
-
return this.element.hasAttribute('multiple');
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
export { FormDropdownMixin };
|