@startinblox/core 0.18.1 → 0.19.0-beta.10

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