@startinblox/core 0.17.31 → 0.18.0-beta.2
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/autolinker.js +3515 -3367
- package/dist/_snowpack/pkg/autolinker.js.map +1 -1
- package/dist/_snowpack/pkg/common/{_baseUnary-217dffb2.js → _baseUnary-c1edb653.js} +16 -40
- package/dist/_snowpack/pkg/common/{_baseUnary-217dffb2.js.map → _baseUnary-c1edb653.js.map} +1 -1
- package/dist/_snowpack/pkg/common/{_commonjsHelpers-8c19dec8.js → _commonjsHelpers-37fa8da4.js} +6 -2
- package/dist/_snowpack/pkg/common/_commonjsHelpers-37fa8da4.js.map +1 -0
- package/dist/_snowpack/pkg/common/{decode-a4c334cf.js → decode-26fbf385.js} +38 -69
- package/dist/_snowpack/pkg/common/decode-26fbf385.js.map +1 -0
- package/dist/_snowpack/pkg/common/lit-html-3647afce.js +1104 -0
- package/dist/_snowpack/pkg/common/lit-html-3647afce.js.map +1 -0
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js +4767 -4246
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +1 -1
- package/dist/_snowpack/pkg/dialog-polyfill.js +107 -139
- package/dist/_snowpack/pkg/dialog-polyfill.js.map +1 -1
- package/dist/_snowpack/pkg/fusejs.js +411 -601
- package/dist/_snowpack/pkg/fusejs.js.map +1 -1
- package/dist/_snowpack/pkg/jsonld-context-parser.js +718 -686
- package/dist/_snowpack/pkg/jsonld-context-parser.js.map +1 -1
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css +59 -59
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +1 -1
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css +14 -14
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +1 -1
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +13 -14
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +1 -1
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +17 -15
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +1 -1
- package/dist/_snowpack/pkg/lit-html/directives/until.js +45 -46
- package/dist/_snowpack/pkg/lit-html/directives/until.js.map +1 -1
- package/dist/_snowpack/pkg/lit-html.js +37 -35
- package/dist/_snowpack/pkg/lit-html.js.map +1 -1
- package/dist/_snowpack/pkg/markdown-it-link-attributes.js +1 -20
- package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map +1 -1
- package/dist/_snowpack/pkg/markdown-it.js +1731 -2284
- package/dist/_snowpack/pkg/markdown-it.js.map +1 -1
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js +236 -294
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +1 -1
- package/dist/_snowpack/pkg/quill.js +12077 -11017
- package/dist/_snowpack/pkg/quill.js.map +1 -1
- package/dist/_snowpack/pkg/slim-select.js +711 -1
- package/dist/_snowpack/pkg/slim-select.js.map +1 -1
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +1 -16
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +1 -1
- package/dist/_snowpack/pkg/tui-calendar.js +44297 -40075
- package/dist/_snowpack/pkg/tui-calendar.js.map +1 -1
- package/dist/components/solid-ac-checker.js +4 -17
- package/dist/components/solid-calendar.js +5 -26
- package/dist/components/solid-delete.js +9 -24
- package/dist/components/solid-display.js +15 -59
- package/dist/components/solid-form-search.js +27 -79
- package/dist/components/solid-form.js +48 -143
- package/dist/components/solid-lang.js +8 -19
- package/dist/components/solid-map.js +26 -64
- package/dist/components/solid-table.js +51 -133
- package/dist/components/solid-widget.js +2 -24
- package/dist/index.js +17 -11
- package/dist/libs/Component.js +4 -10
- package/dist/libs/ComponentFactory.js +6 -34
- package/dist/libs/Compositor.js +8 -15
- package/dist/libs/Sib.js +7 -21
- package/dist/libs/filter.js +184 -0
- package/dist/libs/helpers.js +19 -47
- package/dist/libs/interfaces.js +1 -1
- package/dist/libs/lit-helpers.js +7 -34
- package/dist/libs/polyfills.js +7 -10
- package/dist/libs/store/server-pagination.js +22 -0
- package/dist/libs/store/server-search.js +35 -0
- package/dist/libs/store/store.js +243 -234
- package/dist/mixins/attributeBinderMixin.js +17 -25
- package/dist/mixins/contextMixin.js +5 -7
- package/dist/mixins/counterMixin.js +2 -23
- package/dist/mixins/federationMixin.js +2 -14
- package/dist/mixins/filterMixin.js +60 -100
- package/dist/mixins/grouperMixin.js +11 -18
- package/dist/mixins/highlighterMixin.js +2 -8
- package/dist/mixins/interfaces.js +3 -5
- package/dist/mixins/listMixin.js +12 -43
- package/dist/mixins/nextMixin.js +1 -4
- package/dist/mixins/paginateMixin.js +17 -30
- package/dist/mixins/requiredMixin.js +1 -9
- package/dist/mixins/serverPaginationMixin.js +122 -0
- package/dist/mixins/sorterMixin.js +26 -44
- package/dist/mixins/storeMixin.js +28 -21
- package/dist/mixins/translationMixin.js +2 -12
- package/dist/mixins/validationMixin.js +28 -46
- package/dist/mixins/widgetMixin.js +58 -154
- package/dist/new-widgets/attributeMixins/actionMixin.js +1 -2
- package/dist/new-widgets/attributeMixins/blankMixin.js +1 -4
- package/dist/new-widgets/attributeMixins/booleanMixin.js +1 -4
- package/dist/new-widgets/attributeMixins/index.js +1 -2
- package/dist/new-widgets/attributeMixins/mailtoMixin.js +1 -4
- package/dist/new-widgets/attributeMixins/multipleMixin.js +1 -2
- package/dist/new-widgets/attributeMixins/numberMixin.js +1 -4
- package/dist/new-widgets/attributeMixins/placeholderMixin.js +1 -4
- package/dist/new-widgets/attributeMixins/telMixin.js +1 -4
- package/dist/new-widgets/baseWidgetMixin.js +5 -18
- package/dist/new-widgets/callbackMixins/autocompletionMixin.js +3 -11
- package/dist/new-widgets/callbackMixins/index.js +1 -2
- package/dist/new-widgets/callbackMixins/richtextMixin.js +1 -6
- package/dist/new-widgets/interfaces.js +1 -0
- package/dist/new-widgets/new-widget-factory.js +14 -19
- package/dist/new-widgets/templateAdditionMixins/addableMixin.js +6 -21
- package/dist/new-widgets/templateAdditionMixins/index.js +2 -3
- package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +5 -18
- package/dist/new-widgets/templateAdditionMixins/labelMixin.js +5 -18
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js +21 -27
- package/dist/new-widgets/templates/displayTemplatesDirectory.js +35 -70
- package/dist/new-widgets/templates/formTemplatesDirectory.js +350 -315
- package/dist/new-widgets/templates/groupTemplatesDirectory.js +5 -15
- package/dist/new-widgets/templates/index.js +1 -2
- package/dist/new-widgets/templates/setTemplatesDirectory.js +4 -37
- package/dist/new-widgets/templatesDependencies/altMixin.js +1 -2
- package/dist/new-widgets/templatesDependencies/editableMixin.js +9 -26
- package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +3 -7
- package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +1 -5
- package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +1 -11
- package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +3 -13
- package/dist/new-widgets/templatesDependencies/formFileMixin.js +1 -13
- package/dist/new-widgets/templatesDependencies/formLengthMixin.js +1 -2
- package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +1 -2
- package/dist/new-widgets/templatesDependencies/formMixin.js +4 -14
- package/dist/new-widgets/templatesDependencies/formNumberMixin.js +1 -5
- package/dist/new-widgets/templatesDependencies/formRadioMixin.js +1 -5
- package/dist/new-widgets/templatesDependencies/formStepMixin.js +1 -2
- package/dist/new-widgets/templatesDependencies/linkTextMixin.js +13 -0
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +23 -18
- package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +1 -10
- package/dist/new-widgets/templatesDependencies/patternMixin.js +1 -2
- package/dist/new-widgets/templatesDependencies/rangeMixin.js +5 -15
- package/dist/new-widgets/templatesDependencies/setMixin.js +1 -4
- package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +1 -4
- package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +1 -5
- package/dist/new-widgets/valueTransformationMixins/dateMixin.js +5 -11
- package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +1 -5
- package/dist/new-widgets/valueTransformationMixins/index.js +1 -2
- package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +1 -7
- package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +1 -5
- package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +1 -7
- package/dist/solid-template-element.js +24 -44
- package/dist/widgets/baseWidget.js +21 -85
- package/dist/widgets/widget-factory.js +4 -6
- package/package.json +8 -6
- package/dist/_snowpack/env.js +0 -3
- package/dist/_snowpack/pkg/autolinker.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map +0 -1
- package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map +0 -1
- package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/common/lit-html-babd44cd.js +0 -1119
- package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map +0 -1
- package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/dialog-polyfill.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/fusejs.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/jsonld-context-parser.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/lit-html/directives/until.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/lit-html.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/markdown-it.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/quill.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/slim-select.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tui-calendar.js.map.proxy.js +0 -1
- package/dist/components/solid-ac-checker.js.map +0 -1
- package/dist/components/solid-calendar.js.map +0 -1
- package/dist/components/solid-delete.js.map +0 -1
- package/dist/components/solid-display.js.map +0 -1
- package/dist/components/solid-form-search.js.map +0 -1
- package/dist/components/solid-form.js.map +0 -1
- package/dist/components/solid-lang.js.map +0 -1
- package/dist/components/solid-map.js.map +0 -1
- package/dist/components/solid-table.js.map +0 -1
- package/dist/components/solid-widget.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/libs/Component.js.map +0 -1
- package/dist/libs/ComponentFactory.js.map +0 -1
- package/dist/libs/Compositor.js.map +0 -1
- package/dist/libs/Sib.js.map +0 -1
- package/dist/libs/helpers.js.map +0 -1
- package/dist/libs/interfaces.js.map +0 -1
- package/dist/libs/lit-helpers.js.map +0 -1
- package/dist/libs/polyfills.js.map +0 -1
- package/dist/libs/store/store.js.map +0 -1
- package/dist/mixins/attributeBinderMixin.js.map +0 -1
- package/dist/mixins/contextMixin.js.map +0 -1
- package/dist/mixins/counterMixin.js.map +0 -1
- package/dist/mixins/federationMixin.js.map +0 -1
- package/dist/mixins/filterMixin.js.map +0 -1
- package/dist/mixins/grouperMixin.js.map +0 -1
- package/dist/mixins/highlighterMixin.js.map +0 -1
- package/dist/mixins/interfaces.js.map +0 -1
- package/dist/mixins/listMixin.js.map +0 -1
- package/dist/mixins/nextMixin.js.map +0 -1
- package/dist/mixins/paginateMixin.js.map +0 -1
- package/dist/mixins/requiredMixin.js.map +0 -1
- package/dist/mixins/sorterMixin.js.map +0 -1
- package/dist/mixins/storeMixin.js.map +0 -1
- package/dist/mixins/translationMixin.js.map +0 -1
- package/dist/mixins/validationMixin.js.map +0 -1
- package/dist/mixins/widgetMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/actionMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/blankMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/booleanMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/index.js.map +0 -1
- package/dist/new-widgets/attributeMixins/mailtoMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/multipleMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/numberMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/placeholderMixin.js.map +0 -1
- package/dist/new-widgets/attributeMixins/telMixin.js.map +0 -1
- package/dist/new-widgets/baseWidgetMixin.js.map +0 -1
- package/dist/new-widgets/callbackMixins/autocompletionMixin.js.map +0 -1
- package/dist/new-widgets/callbackMixins/index.js.map +0 -1
- package/dist/new-widgets/callbackMixins/richtextMixin.js.map +0 -1
- package/dist/new-widgets/new-widget-factory.js.map +0 -1
- package/dist/new-widgets/templateAdditionMixins/addableMixin.js.map +0 -1
- package/dist/new-widgets/templateAdditionMixins/index.js.map +0 -1
- package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js.map +0 -1
- package/dist/new-widgets/templateAdditionMixins/labelMixin.js.map +0 -1
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js.map +0 -1
- package/dist/new-widgets/templates/displayTemplatesDirectory.js.map +0 -1
- package/dist/new-widgets/templates/formTemplatesDirectory.js.map +0 -1
- package/dist/new-widgets/templates/groupTemplatesDirectory.js.map +0 -1
- package/dist/new-widgets/templates/index.js.map +0 -1
- package/dist/new-widgets/templates/setTemplatesDirectory.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/altMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/editableMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formDropdownMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formFileMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formLengthMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formNumberMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formRadioMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/formStepMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/patternMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/rangeMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/setMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js.map +0 -1
- package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js.map +0 -1
- package/dist/new-widgets/valueTransformationMixins/dateMixin.js.map +0 -1
- package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js.map +0 -1
- package/dist/new-widgets/valueTransformationMixins/index.js.map +0 -1
- package/dist/new-widgets/valueTransformationMixins/markdownMixin.js.map +0 -1
- package/dist/new-widgets/valueTransformationMixins/multilineMixin.js.map +0 -1
- package/dist/new-widgets/valueTransformationMixins/oembedMixin.js.map +0 -1
- package/dist/solid-template-element.js.map +0 -1
- package/dist/widgets/baseWidget.js.map +0 -1
- package/dist/widgets/widget-factory.js.map +0 -1
|
@@ -1,95 +1,3 @@
|
|
|
1
|
-
function _templateObject9() {
|
|
2
|
-
const data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
3
|
-
|
|
4
|
-
_templateObject9 = function () {
|
|
5
|
-
return data;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function _templateObject8() {
|
|
12
|
-
const data = _taggedTemplateLiteral(["<input type=\"reset\" />"]);
|
|
13
|
-
|
|
14
|
-
_templateObject8 = function () {
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function _templateObject7() {
|
|
22
|
-
const data = _taggedTemplateLiteral(["\n <form\n @submit=", "\n @reset=", "\n >\n ", "\n ", "\n ", "\n </form>\n "]);
|
|
23
|
-
|
|
24
|
-
_templateObject7 = function () {
|
|
25
|
-
return data;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return data;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function _templateObject6() {
|
|
32
|
-
const data = _taggedTemplateLiteral(["\n <div data-id=\"error\"></div>\n ", "\n ", "\n "]);
|
|
33
|
-
|
|
34
|
-
_templateObject6 = function () {
|
|
35
|
-
return data;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function _templateObject5() {
|
|
42
|
-
const data = _taggedTemplateLiteral(["\n <input type=\"submit\" value=", ">\n "]);
|
|
43
|
-
|
|
44
|
-
_templateObject5 = function () {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
return data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function _templateObject4() {
|
|
52
|
-
const data = _taggedTemplateLiteral(["\n <button type=\"submit\">", "</button>\n "]);
|
|
53
|
-
|
|
54
|
-
_templateObject4 = function () {
|
|
55
|
-
return data;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return data;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function _templateObject3() {
|
|
62
|
-
const data = _taggedTemplateLiteral(["\n <div class=", ">\n ", "\n </div>\n "]);
|
|
63
|
-
|
|
64
|
-
_templateObject3 = function () {
|
|
65
|
-
return data;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
return data;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function _templateObject2() {
|
|
72
|
-
const data = _taggedTemplateLiteral(["\n <li>", "</li>\n "]);
|
|
73
|
-
|
|
74
|
-
_templateObject2 = function () {
|
|
75
|
-
return data;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
return data;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function _templateObject() {
|
|
82
|
-
const data = _taggedTemplateLiteral(["\n <p>A validation error occurred.</p>\n <ul>\n ", "\n </ul>\n "]);
|
|
83
|
-
|
|
84
|
-
_templateObject = function () {
|
|
85
|
-
return data;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
return data;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
92
|
-
|
|
93
1
|
import { Sib } from '../libs/Sib.js';
|
|
94
2
|
import { WidgetMixin } from '../mixins/widgetMixin.js';
|
|
95
3
|
import { StoreMixin } from '../mixins/storeMixin.js';
|
|
@@ -138,75 +46,63 @@ export const SolidForm = {
|
|
|
138
46
|
initialState: {
|
|
139
47
|
error: ''
|
|
140
48
|
},
|
|
141
|
-
|
|
142
49
|
get defaultMultipleWidget() {
|
|
143
50
|
return 'solid-multiple-form';
|
|
144
51
|
},
|
|
145
|
-
|
|
146
52
|
get defaultSetWidget() {
|
|
147
53
|
return 'solid-set-default';
|
|
148
54
|
},
|
|
149
|
-
|
|
150
55
|
get value() {
|
|
151
56
|
const values = {};
|
|
152
57
|
this.widgets.forEach(widget => {
|
|
153
58
|
const name = (widget.component || widget).name;
|
|
154
59
|
if (name == null) return;
|
|
155
60
|
let value = widget.component ? widget.component.getValue() : widget.value;
|
|
156
|
-
|
|
157
61
|
try {
|
|
158
62
|
value = JSON.parse(value);
|
|
159
63
|
} catch (e) {}
|
|
160
|
-
|
|
161
64
|
setDeepProperty(values, name.split('.'), value);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
if (this.resource && !this.resource.isContainer()) values['@id'] = this.resourceId;
|
|
65
|
+
});
|
|
66
|
+
// add @id if edition
|
|
67
|
+
if (this.resource && !this.resource.isContainer?.()) values['@id'] = this.resourceId;
|
|
165
68
|
return values;
|
|
166
69
|
},
|
|
167
|
-
|
|
168
70
|
get isNaked() {
|
|
169
71
|
return this.element.hasAttribute('naked');
|
|
170
72
|
},
|
|
171
|
-
|
|
172
73
|
get isSavingAutomatically() {
|
|
173
74
|
return this.autosave !== null;
|
|
174
75
|
},
|
|
175
|
-
|
|
176
76
|
isCreationForm(formValue) {
|
|
177
77
|
return !('@id' in formValue);
|
|
178
78
|
},
|
|
179
|
-
|
|
180
79
|
async getFormValue() {
|
|
181
80
|
let value = this.value;
|
|
182
|
-
|
|
183
|
-
if (this.resource && !this.resource.isContainer()) {
|
|
81
|
+
if (this.resource && !this.resource.isContainer?.()) {
|
|
184
82
|
for (let predicate of Object.keys(this.value)) {
|
|
185
83
|
// add @id for nested resources
|
|
186
84
|
const object = await this.resource[predicate];
|
|
187
85
|
if (object && object['@id'] && !value[predicate]['@id']) value[predicate]['@id'] = object['@id'];
|
|
188
86
|
}
|
|
189
87
|
}
|
|
190
|
-
|
|
191
88
|
return transformArrayToContainer(value);
|
|
192
89
|
},
|
|
193
|
-
|
|
194
|
-
|
|
90
|
+
getWidget(field) {
|
|
91
|
+
let isSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
195
92
|
let tagName = '';
|
|
196
|
-
const widgetAttribute = this.element.getAttribute('widget-' + field);
|
|
93
|
+
const widgetAttribute = this.element.getAttribute('widget-' + field);
|
|
197
94
|
|
|
95
|
+
// Choose widget
|
|
198
96
|
if (!widgetAttribute && this.element.hasAttribute('upload-url-' + field)) {
|
|
199
97
|
tagName = 'solid-form-file';
|
|
200
98
|
} else if (!widgetAttribute && (this.element.hasAttribute('range-' + field) || this.element.hasAttribute('enum-' + field))) {
|
|
201
99
|
tagName = 'solid-form-dropdown';
|
|
202
100
|
} else {
|
|
203
101
|
tagName = widgetAttribute || (!isSet ? this.defaultWidget : this.defaultSetWidget);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
102
|
+
}
|
|
103
|
+
// Create widget
|
|
207
104
|
return this.widgetFromTagName(tagName);
|
|
208
105
|
},
|
|
209
|
-
|
|
210
106
|
change(resource) {
|
|
211
107
|
this.element.dispatchEvent(new CustomEvent('formChange', {
|
|
212
108
|
bubbles: true,
|
|
@@ -215,14 +111,12 @@ export const SolidForm = {
|
|
|
215
111
|
}
|
|
216
112
|
}));
|
|
217
113
|
},
|
|
218
|
-
|
|
219
114
|
async save() {
|
|
220
115
|
this.toggleLoaderHidden(false);
|
|
221
116
|
this.hideError();
|
|
222
117
|
const resource = await this.getFormValue();
|
|
223
118
|
resource['@context'] = this.context;
|
|
224
119
|
let saved;
|
|
225
|
-
|
|
226
120
|
try {
|
|
227
121
|
if (this.partial == null) {
|
|
228
122
|
saved = resource['@id'] ? await store.put(resource, this.resourceId) : await store.post(resource, this.resourceId);
|
|
@@ -231,13 +125,11 @@ export const SolidForm = {
|
|
|
231
125
|
}
|
|
232
126
|
} catch (e) {
|
|
233
127
|
this.toggleLoaderHidden(true);
|
|
234
|
-
|
|
235
128
|
if (e) {
|
|
236
129
|
// if server error
|
|
237
130
|
e.json().then(error => this.showError(error));
|
|
238
131
|
throw e;
|
|
239
132
|
} // else, ldpframework error, we continue
|
|
240
|
-
|
|
241
133
|
}
|
|
242
134
|
|
|
243
135
|
this.element.dispatchEvent(new CustomEvent('save', {
|
|
@@ -250,38 +142,33 @@ export const SolidForm = {
|
|
|
250
142
|
this.toggleLoaderHidden(true);
|
|
251
143
|
return saved;
|
|
252
144
|
},
|
|
253
|
-
|
|
254
145
|
async submitForm() {
|
|
255
146
|
let id;
|
|
256
|
-
|
|
257
147
|
try {
|
|
258
148
|
id = (await this.save()) || this.getFormValue()['@id'];
|
|
259
149
|
} catch (e) {
|
|
260
150
|
return;
|
|
261
151
|
}
|
|
262
|
-
|
|
263
152
|
this.reset();
|
|
264
153
|
this.goToNext({
|
|
265
154
|
'@id': id
|
|
266
155
|
});
|
|
267
156
|
},
|
|
268
|
-
|
|
269
157
|
async onInput() {
|
|
270
158
|
const formValue = await this.getFormValue();
|
|
271
159
|
this.change(formValue);
|
|
272
160
|
},
|
|
273
|
-
|
|
274
161
|
async onChange() {
|
|
275
162
|
const formValue = await this.getFormValue();
|
|
276
163
|
if (!this.isCreationForm(formValue) && this.isSavingAutomatically) this.submitForm(); // if autosave, submitForm
|
|
277
164
|
},
|
|
278
165
|
|
|
279
|
-
findErrorMessage(errors
|
|
166
|
+
findErrorMessage(errors) {
|
|
167
|
+
let errorFullName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
280
168
|
let errorsArray = [];
|
|
281
169
|
errors.forEach(member => {
|
|
282
170
|
let errorNextName = Object.values(member)[0];
|
|
283
171
|
let errorAddName = errorFullName === "" ? errorNextName : errorFullName.concat(' - ', errorNextName);
|
|
284
|
-
|
|
285
172
|
if (Array.isArray(Object.values(member)[1]) === true) {
|
|
286
173
|
let errorMessage = Object.values(member)[1];
|
|
287
174
|
let errorGlobal = errorAddName.concat(': ', errorMessage.join(', '));
|
|
@@ -294,29 +181,32 @@ export const SolidForm = {
|
|
|
294
181
|
});
|
|
295
182
|
return errorsArray;
|
|
296
183
|
},
|
|
297
|
-
|
|
298
184
|
empty() {},
|
|
299
|
-
|
|
300
185
|
showError(e) {
|
|
301
186
|
let errors = Object.entries(e).filter(field => !field[0].startsWith('@context'));
|
|
302
|
-
const errorTemplate = html
|
|
187
|
+
const errorTemplate = html`
|
|
188
|
+
<p>A validation error occurred.</p>
|
|
189
|
+
<ul>
|
|
190
|
+
${this.findErrorMessage(errors).map(field => html`
|
|
191
|
+
<li>${field}</li>
|
|
192
|
+
`)}
|
|
193
|
+
</ul>
|
|
194
|
+
`;
|
|
195
|
+
// If field exists pick its label (unsure if that's easily possible)
|
|
303
196
|
// In this.getFields() map with each field and get label
|
|
304
197
|
// If it does not just add a notice as we do that it's missing that field
|
|
305
|
-
// Validation message in english ?
|
|
306
198
|
|
|
199
|
+
// Validation message in english ?
|
|
307
200
|
const parentElement = this.element.querySelector('[data-id=error]');
|
|
308
201
|
if (parentElement) render(errorTemplate, parentElement);
|
|
309
202
|
},
|
|
310
|
-
|
|
311
203
|
hideError() {
|
|
312
204
|
const parentElement = this.element.querySelector('[data-id=error]');
|
|
313
205
|
if (parentElement) render('', parentElement);
|
|
314
206
|
},
|
|
315
|
-
|
|
316
207
|
reset() {
|
|
317
208
|
if (!this.isNaked) this.element.querySelector('form').reset();
|
|
318
209
|
},
|
|
319
|
-
|
|
320
210
|
onSubmit(event) {
|
|
321
211
|
if (!this.isNaked) {
|
|
322
212
|
event.preventDefault();
|
|
@@ -328,27 +218,42 @@ export const SolidForm = {
|
|
|
328
218
|
//send method to validationMixin, used by the dialog modal and performAction method
|
|
329
219
|
return this.submitForm();
|
|
330
220
|
},
|
|
331
|
-
|
|
332
221
|
onReset() {
|
|
333
222
|
if (!this.isNaked) setTimeout(() => this.onInput());
|
|
334
223
|
},
|
|
335
|
-
|
|
336
224
|
getSubmitTemplate() {
|
|
337
|
-
return html
|
|
225
|
+
return html`
|
|
226
|
+
<div class=${ifDefined(this.classSubmitButton)}>
|
|
227
|
+
${this.submitWidget === 'button' ? html`
|
|
228
|
+
<button type="submit">${this.submitButton || this.t("solid-form.submit-button")}</button>
|
|
229
|
+
` : html`
|
|
230
|
+
<input type="submit" value=${this.submitButton || this.t("solid-form.submit-button")}>
|
|
231
|
+
`}
|
|
232
|
+
</div>
|
|
233
|
+
`;
|
|
338
234
|
},
|
|
339
|
-
|
|
340
235
|
async populate() {
|
|
341
236
|
this.element.oninput = () => this.onInput(); // prevent from firing change multiple times
|
|
342
|
-
|
|
343
|
-
|
|
344
237
|
this.element.onchange = () => this.onChange();
|
|
345
|
-
|
|
346
238
|
const fields = await this.getFields();
|
|
347
239
|
const widgetTemplates = await Promise.all(fields.map(field => this.createWidgetTemplate(field)));
|
|
348
|
-
const template = html
|
|
240
|
+
const template = html`
|
|
241
|
+
<div data-id="error"></div>
|
|
242
|
+
${!this.isNaked ? html`
|
|
243
|
+
<form
|
|
244
|
+
@submit=${this.onSubmit.bind(this)}
|
|
245
|
+
@reset=${this.onReset.bind(this)}
|
|
246
|
+
>
|
|
247
|
+
${widgetTemplates}
|
|
248
|
+
${!this.isSavingAutomatically ? this.getSubmitTemplate() : ''}
|
|
249
|
+
${this.element.hasAttribute('reset') ? html`<input type="reset" />` : ''}
|
|
250
|
+
</form>
|
|
251
|
+
` : html`
|
|
252
|
+
${widgetTemplates}
|
|
253
|
+
`}
|
|
254
|
+
${this.getModalDialog()}
|
|
255
|
+
`;
|
|
349
256
|
render(template, this.element);
|
|
350
257
|
}
|
|
351
|
-
|
|
352
258
|
};
|
|
353
|
-
Sib.register(SolidForm);
|
|
354
|
-
//# sourceMappingURL=solid-form.js.map
|
|
259
|
+
Sib.register(SolidForm);
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _templateObject() {
|
|
2
|
-
const data = _taggedTemplateLiteral(["\n <button\n @click=", "\n >\n ", "\n </button>\n "]);
|
|
3
|
-
|
|
4
|
-
_templateObject = function () {
|
|
5
|
-
return data;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
-
|
|
13
1
|
import { Sib } from '../libs/Sib.js';
|
|
14
2
|
import { store } from '../libs/store/store.js';
|
|
15
3
|
import { html, render } from '../_snowpack/pkg/lit-html.js';
|
|
@@ -26,21 +14,22 @@ export const SolidLang = {
|
|
|
26
14
|
default: null
|
|
27
15
|
}
|
|
28
16
|
},
|
|
29
|
-
|
|
30
17
|
created() {
|
|
31
18
|
this.render();
|
|
32
19
|
},
|
|
33
|
-
|
|
34
20
|
languageLoader() {
|
|
35
21
|
store.selectLanguage(this.lang);
|
|
36
22
|
location.reload();
|
|
37
23
|
},
|
|
38
|
-
|
|
39
24
|
render() {
|
|
40
|
-
let template = html
|
|
25
|
+
let template = html`
|
|
26
|
+
<button
|
|
27
|
+
@click=${this.languageLoader.bind(this)}
|
|
28
|
+
>
|
|
29
|
+
${this.dataLabel}
|
|
30
|
+
</button>
|
|
31
|
+
`;
|
|
41
32
|
render(template, this.element);
|
|
42
33
|
}
|
|
43
|
-
|
|
44
34
|
};
|
|
45
|
-
Sib.register(SolidLang);
|
|
46
|
-
//# sourceMappingURL=solid-lang.js.map
|
|
35
|
+
Sib.register(SolidLang);
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
function _templateObject2() {
|
|
2
|
-
const data = _taggedTemplateLiteral(["\n <solid-display\n fields=\"", "\"\n data-src=\"", "\"\n ...=", "\n ></solid-display>\n "]);
|
|
3
|
-
|
|
4
|
-
_templateObject2 = function () {
|
|
5
|
-
return data;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function _templateObject() {
|
|
12
|
-
const data = _taggedTemplateLiteral(["\n <div id=", " style=\"width:100%;height:100%;\"></div>\n "]);
|
|
13
|
-
|
|
14
|
-
_templateObject = function () {
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
22
|
-
|
|
23
1
|
import { Sib } from '../libs/Sib.js';
|
|
24
2
|
import { ListMixin } from '../mixins/listMixin.js';
|
|
25
3
|
import { StoreMixin } from '../mixins/storeMixin.js';
|
|
@@ -31,11 +9,11 @@ import { GrouperMixin } from '../mixins/grouperMixin.js';
|
|
|
31
9
|
import { NextMixin } from '../mixins/nextMixin.js';
|
|
32
10
|
import { store } from '../libs/store/store.js';
|
|
33
11
|
import { uniqID } from '../libs/helpers.js';
|
|
34
|
-
import { spread } from '../libs/lit-helpers.js';
|
|
35
|
-
|
|
36
|
-
import L from 'https://cdn.skypack.dev/leaflet@1.7.1'; // TODO : revert to "leaflet" when apps up to date
|
|
12
|
+
import { spread } from '../libs/lit-helpers.js';
|
|
37
13
|
|
|
38
|
-
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
import L from 'https://cdn.skypack.dev/leaflet'; // TODO : revert to "leaflet" when apps up to date
|
|
16
|
+
import 'https://cdn.skypack.dev/leaflet.markercluster'; // TODO : revert to "leaflet.markercluster" when apps up to date
|
|
39
17
|
|
|
40
18
|
import { html, render } from '../_snowpack/pkg/lit-html.js';
|
|
41
19
|
import { ifDefined } from '../_snowpack/pkg/lit-html/directives/if-defined.js';
|
|
@@ -56,45 +34,42 @@ export const SolidMap = {
|
|
|
56
34
|
resetPlanned: false,
|
|
57
35
|
hasBeenResetOnce: false
|
|
58
36
|
},
|
|
59
|
-
|
|
60
37
|
created() {
|
|
61
38
|
//@ts-ignore
|
|
62
|
-
import("../_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js");
|
|
63
|
-
|
|
64
|
-
import("../style/default-theme.css.proxy.js");
|
|
65
|
-
|
|
66
|
-
import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js");
|
|
67
|
-
|
|
68
|
-
import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js");
|
|
39
|
+
import("../_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js");
|
|
40
|
+
//@ts-ignore
|
|
41
|
+
import("../style/default-theme.css.proxy.js");
|
|
42
|
+
//@ts-ignore
|
|
43
|
+
import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js");
|
|
44
|
+
//@ts-ignore
|
|
45
|
+
import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js");
|
|
69
46
|
|
|
47
|
+
// reset when it becomes visible to prevent bug https://git.startinblox.com/framework/sib-core/issues/661
|
|
70
48
|
document.body.addEventListener('navigate', () => setTimeout(() => this.isVisible && !this.hasBeenResetOnce && this.reset()));
|
|
71
49
|
this.markers = [];
|
|
72
50
|
this.subscriptions = new Map();
|
|
73
51
|
},
|
|
74
|
-
|
|
75
52
|
get isVisible() {
|
|
76
53
|
return this.element.offsetParent !== null;
|
|
77
54
|
},
|
|
78
|
-
|
|
79
55
|
attached() {
|
|
80
56
|
const id = uniqID();
|
|
81
|
-
const template = html
|
|
57
|
+
const template = html`
|
|
58
|
+
<div id=${id} style="width:100%;height:100%;"></div>
|
|
59
|
+
`;
|
|
82
60
|
render(template, this.element);
|
|
83
|
-
const div = this.element.querySelector(
|
|
61
|
+
const div = this.element.querySelector(`#${id}`);
|
|
84
62
|
this.map = L.map(div);
|
|
85
63
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png').addTo(this.map);
|
|
86
|
-
|
|
87
64
|
if (this.clustering !== null) {
|
|
88
65
|
this.markersCluster = L.markerClusterGroup();
|
|
89
66
|
this.map.addLayer(this.markersCluster);
|
|
90
67
|
}
|
|
91
68
|
},
|
|
92
|
-
|
|
93
69
|
reset() {
|
|
94
70
|
if (this.isVisible) {
|
|
95
71
|
// reset only if visible
|
|
96
72
|
this.map.invalidateSize();
|
|
97
|
-
|
|
98
73
|
if (this.markers.length) {
|
|
99
74
|
this.map.fitBounds(L.featureGroup(this.markers).getBounds()); // Center map on markers if some available
|
|
100
75
|
} else {
|
|
@@ -104,7 +79,6 @@ export const SolidMap = {
|
|
|
104
79
|
this.hasBeenResetOnce = true;
|
|
105
80
|
}
|
|
106
81
|
},
|
|
107
|
-
|
|
108
82
|
/**
|
|
109
83
|
* Execute a reset only if none is planned already
|
|
110
84
|
*/
|
|
@@ -117,7 +91,6 @@ export const SolidMap = {
|
|
|
117
91
|
});
|
|
118
92
|
}
|
|
119
93
|
},
|
|
120
|
-
|
|
121
94
|
dispatchSelect(event) {
|
|
122
95
|
const target = event.target;
|
|
123
96
|
const resource = target['options'].resource;
|
|
@@ -128,7 +101,6 @@ export const SolidMap = {
|
|
|
128
101
|
}));
|
|
129
102
|
this.goToNext(resource);
|
|
130
103
|
},
|
|
131
|
-
|
|
132
104
|
/**
|
|
133
105
|
* Override listMixin method: initialize a marker on the map
|
|
134
106
|
* @param resourceId: id of the resource to display
|
|
@@ -136,15 +108,12 @@ export const SolidMap = {
|
|
|
136
108
|
*/
|
|
137
109
|
async appendChildElt(resourceId, groupClass) {
|
|
138
110
|
const resource = await store.getData(resourceId, this.context);
|
|
139
|
-
|
|
140
111
|
if (!this.subscriptions.get(resourceId)) {
|
|
141
112
|
this.subscriptions.set(resourceId, PubSub.subscribe(resourceId, () => this.updateDOM()));
|
|
142
113
|
}
|
|
143
|
-
|
|
144
114
|
if (!resource) return;
|
|
145
115
|
const lat = await resource['lat'];
|
|
146
116
|
const lng = await resource['lng'];
|
|
147
|
-
|
|
148
117
|
if (lat && lng) {
|
|
149
118
|
const icon = L.divIcon({
|
|
150
119
|
// create the icon, doc here: https://leafletjs.com/reference-1.6.0.html#icon
|
|
@@ -153,15 +122,15 @@ export const SolidMap = {
|
|
|
153
122
|
iconSize: [8, 8],
|
|
154
123
|
iconAnchor: [12, 34],
|
|
155
124
|
popupAnchor: [0, -34]
|
|
156
|
-
});
|
|
125
|
+
});
|
|
157
126
|
|
|
127
|
+
// create a marker, doc here: https://leafletjs.com/reference-1.6.0.html#marker
|
|
158
128
|
const marker = L.marker([lat.toString(), lng.toString()], {
|
|
159
129
|
resource,
|
|
160
130
|
icon
|
|
161
131
|
});
|
|
162
132
|
if (this.clustering === null) marker.addTo(this.map);else this.markersCluster.addLayer(marker);
|
|
163
133
|
marker.on('click', this.dispatchSelect.bind(this));
|
|
164
|
-
|
|
165
134
|
if (this.fields !== null) {
|
|
166
135
|
// show popups only if fields attribute
|
|
167
136
|
marker.bindPopup(() => this.getPopupContent(resourceId), {
|
|
@@ -172,43 +141,41 @@ export const SolidMap = {
|
|
|
172
141
|
this.markers.push(marker);
|
|
173
142
|
}
|
|
174
143
|
},
|
|
175
|
-
|
|
176
144
|
/**
|
|
177
145
|
* Generate the solid-display of the popup
|
|
178
146
|
* @param resourceId: id of the popup clicked
|
|
179
147
|
*/
|
|
180
148
|
getPopupContent(resourceId) {
|
|
181
149
|
const attributes = {};
|
|
182
|
-
|
|
183
150
|
for (let attr of this.element.attributes) {
|
|
184
151
|
//copy widget and value attributes
|
|
185
152
|
if (attr.name.startsWith('value-') || attr.name.startsWith('label-') || attr.name.startsWith('widget-') || attr.name.startsWith('class-') || attr.name.startsWith('multiple-') || attr.name.startsWith('editable-') || attr.name.startsWith('action-') || attr.name.startsWith('default-') || attr.name == 'extra-context') attributes[attr.name] = attr.value;
|
|
186
153
|
if (attr.name.startsWith('child-')) attributes[attr.name.replace(/^child-/, '')] = attr.value;
|
|
187
154
|
}
|
|
188
|
-
|
|
189
155
|
const div = document.createElement('div');
|
|
190
|
-
const template = html
|
|
156
|
+
const template = html`
|
|
157
|
+
<solid-display
|
|
158
|
+
fields="${ifDefined(this.fields)}"
|
|
159
|
+
data-src="${resourceId}"
|
|
160
|
+
...=${spread(attributes)}
|
|
161
|
+
></solid-display>
|
|
162
|
+
`;
|
|
191
163
|
render(template, div);
|
|
192
164
|
return div.querySelector('solid-display');
|
|
193
165
|
},
|
|
194
|
-
|
|
195
166
|
/**
|
|
196
167
|
* Override widgetMixin method: empty the map
|
|
197
168
|
*/
|
|
198
169
|
empty() {
|
|
199
170
|
if (!this.map) return;
|
|
200
171
|
if (this.markersCluster) this.map.removeLayer(this.markersCluster);
|
|
201
|
-
|
|
202
172
|
for (let marker of this.markers) this.map.removeLayer(marker);
|
|
203
|
-
|
|
204
173
|
if (this.clustering !== null) {
|
|
205
174
|
this.markersCluster = L.markerClusterGroup();
|
|
206
175
|
this.map.addLayer(this.markersCluster);
|
|
207
176
|
}
|
|
208
|
-
|
|
209
177
|
this.markers = [];
|
|
210
178
|
},
|
|
211
|
-
|
|
212
179
|
/**
|
|
213
180
|
* Override groupMixin method
|
|
214
181
|
* @param groupName: value of the group
|
|
@@ -216,11 +183,9 @@ export const SolidMap = {
|
|
|
216
183
|
renderGroup(groupName) {
|
|
217
184
|
const sanitizedGroupName = encodeURIComponent(groupName.toLowerCase()).replace(/%[0-9A-F]{2}/gi, '');
|
|
218
185
|
const div = document.createElement('div'); // used to pass group info to renderDOM
|
|
219
|
-
|
|
220
186
|
div.dataset.groupClass = 'group-' + sanitizedGroupName;
|
|
221
187
|
return div;
|
|
222
188
|
},
|
|
223
|
-
|
|
224
189
|
/**
|
|
225
190
|
* Override listMixin method: display all the resources
|
|
226
191
|
* @param resources
|
|
@@ -230,13 +195,10 @@ export const SolidMap = {
|
|
|
230
195
|
*/
|
|
231
196
|
async renderDOM(resources, listPostProcessors, div, context) {
|
|
232
197
|
const groupClass = div.dataset.groupClass || ''; // get the group class from the useless div element
|
|
233
|
-
|
|
234
198
|
await Promise.all(resources.map(resource => this.appendChildElt(resource['@id'], groupClass)));
|
|
235
199
|
this.planReset();
|
|
236
200
|
const nextProcessor = listPostProcessors.shift();
|
|
237
201
|
if (nextProcessor) await nextProcessor(resources, listPostProcessors, div, context);
|
|
238
202
|
}
|
|
239
|
-
|
|
240
203
|
};
|
|
241
|
-
Sib.register(SolidMap);
|
|
242
|
-
//# sourceMappingURL=solid-map.js.map
|
|
204
|
+
Sib.register(SolidMap);
|