@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
|
@@ -34,7 +34,6 @@ const RangeMixin = {
|
|
|
34
34
|
});
|
|
35
35
|
this.addToAttributes(list, 'enum');
|
|
36
36
|
}
|
|
37
|
-
|
|
38
37
|
;
|
|
39
38
|
}
|
|
40
39
|
},
|
|
@@ -56,13 +55,11 @@ const RangeMixin = {
|
|
|
56
55
|
initialState: {
|
|
57
56
|
listPostProcessors: []
|
|
58
57
|
},
|
|
59
|
-
|
|
60
58
|
created() {
|
|
61
59
|
this.listPostProcessors = [];
|
|
62
60
|
this.listAttributes['optionLabel'] = this.optionLabel;
|
|
63
61
|
this.listAttributes['optionValue'] = this.optionValue;
|
|
64
62
|
},
|
|
65
|
-
|
|
66
63
|
async populate() {
|
|
67
64
|
const resources = this.resource ? this.resource['ldp:contains'] : [];
|
|
68
65
|
const listPostProcessors = [...this.listPostProcessors];
|
|
@@ -70,17 +67,16 @@ const RangeMixin = {
|
|
|
70
67
|
const nextProcessor = listPostProcessors.shift();
|
|
71
68
|
await nextProcessor(resources, listPostProcessors, null, this.dataSrc);
|
|
72
69
|
},
|
|
73
|
-
|
|
74
70
|
async setRangeAttribute(resources) {
|
|
75
71
|
if (resources) {
|
|
76
72
|
// process resources to create the template
|
|
77
73
|
const getRangeValue = async resource => {
|
|
78
74
|
const selectedValue = await resource[this.optionValue]; // value used for selected options
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
const value = this.optionValue.includes('@id') || selectedValue['@id'] ?
|
|
76
|
+
// value of the option
|
|
77
|
+
`{"@id": "${selectedValue}"}` :
|
|
78
|
+
// resource
|
|
82
79
|
selectedValue; // literal
|
|
83
|
-
|
|
84
80
|
const label = await resource[this.optionLabel]; // label of the option
|
|
85
81
|
|
|
86
82
|
return {
|
|
@@ -89,22 +85,16 @@ const RangeMixin = {
|
|
|
89
85
|
selectedValue
|
|
90
86
|
};
|
|
91
87
|
};
|
|
92
|
-
|
|
93
88
|
this.listAttributes['range'] = await Promise.all(resources.filter(el => el !== null).map(r => getRangeValue(r)));
|
|
94
89
|
}
|
|
95
|
-
|
|
96
90
|
this.planRender();
|
|
97
91
|
},
|
|
98
|
-
|
|
99
92
|
empty() {
|
|
100
93
|
this.listAttributes['range'] = [];
|
|
101
94
|
this.planRender();
|
|
102
95
|
},
|
|
103
|
-
|
|
104
96
|
get type() {
|
|
105
97
|
return this.enum === '' ? 'resource' : 'string';
|
|
106
98
|
}
|
|
107
|
-
|
|
108
99
|
};
|
|
109
|
-
export { RangeMixin };
|
|
110
|
-
//# sourceMappingURL=rangeMixin.js.map
|
|
100
|
+
export { RangeMixin };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
const SetMixin = {
|
|
2
2
|
name: 'set-mixin',
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* For sets and group widgets, remove auto rendering
|
|
6
5
|
* function to allow only manual renders
|
|
7
6
|
*/
|
|
8
7
|
planRender() {}
|
|
9
|
-
|
|
10
8
|
};
|
|
11
|
-
export { SetMixin };
|
|
12
|
-
//# sourceMappingURL=setMixin.js.map
|
|
9
|
+
export { SetMixin };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import qdtm from '../../_snowpack/pkg/quill-delta-to-markdown.js';
|
|
2
2
|
const ValueRichtextMixin = {
|
|
3
3
|
name: 'valuerichtext-mixin',
|
|
4
|
-
|
|
5
4
|
getValue() {
|
|
6
5
|
const markdown = qdtm.deltaToMarkdown(this.quill.getContents().ops);
|
|
7
6
|
return markdown;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
};
|
|
11
|
-
export { ValueRichtextMixin };
|
|
12
|
-
//# sourceMappingURL=valueRichtextMixin.js.map
|
|
9
|
+
export { ValueRichtextMixin };
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { Autolinker } from '../../_snowpack/pkg/autolinker.js';
|
|
2
2
|
const AutolinkMixin = {
|
|
3
3
|
name: 'autolink-mixin',
|
|
4
|
-
|
|
5
4
|
created() {
|
|
6
5
|
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
7
6
|
},
|
|
8
|
-
|
|
9
7
|
transformValue(value, listValueTransformations) {
|
|
10
8
|
const template = document.createElement('template');
|
|
11
9
|
template.innerHTML = Autolinker.link(value);
|
|
12
10
|
const nextProcessor = listValueTransformations.shift();
|
|
13
11
|
if (nextProcessor) nextProcessor(template.content, listValueTransformations);
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
};
|
|
17
|
-
export { AutolinkMixin };
|
|
18
|
-
//# sourceMappingURL=autolinkMixin.js.map
|
|
14
|
+
export { AutolinkMixin };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
const DateMixin = {
|
|
2
2
|
name: 'date-mixin',
|
|
3
|
-
|
|
4
3
|
created() {
|
|
5
4
|
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
6
5
|
},
|
|
7
|
-
|
|
8
6
|
transformValue(value, listValueTransformations) {
|
|
9
7
|
try {
|
|
10
8
|
// workaround for giving a specific-formatted value to the form widget
|
|
@@ -13,23 +11,19 @@ const DateMixin = {
|
|
|
13
11
|
console.warn('Invalid date format for widget', this.name);
|
|
14
12
|
this.listAttributes['originalValue'] = '';
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
const newValue = value ? new Date(value).toLocaleDateString() : value;
|
|
18
15
|
const nextProcessor = listValueTransformations.shift();
|
|
19
16
|
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
20
17
|
},
|
|
21
|
-
|
|
22
18
|
formatDateForInput(date) {
|
|
23
19
|
let d = new Date(date);
|
|
24
20
|
if (isNaN(d.getTime())) throw new Error('Invalid date');
|
|
25
|
-
let month =
|
|
26
|
-
let day =
|
|
21
|
+
let month = `${d.getMonth() + 1}`;
|
|
22
|
+
let day = `${d.getDate()}`;
|
|
27
23
|
let year = d.getFullYear();
|
|
28
|
-
if (month.length < 2) month =
|
|
29
|
-
if (day.length < 2) day =
|
|
24
|
+
if (month.length < 2) month = `0${month}`;
|
|
25
|
+
if (day.length < 2) day = `0${day}`;
|
|
30
26
|
return [year, month, day].join('-');
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
};
|
|
34
|
-
export { DateMixin };
|
|
35
|
-
//# sourceMappingURL=dateMixin.js.map
|
|
29
|
+
export { DateMixin };
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
const DateTimeMixin = {
|
|
2
2
|
name: 'date-time-mixin',
|
|
3
|
-
|
|
4
3
|
created() {
|
|
5
4
|
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
6
5
|
},
|
|
7
|
-
|
|
8
6
|
transformValue(value, listValueTransformations) {
|
|
9
7
|
const newValue = value ? new Date(value).toLocaleString() : value;
|
|
10
8
|
const nextProcessor = listValueTransformations.shift();
|
|
11
9
|
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
};
|
|
15
|
-
export { DateTimeMixin };
|
|
16
|
-
//# sourceMappingURL=dateTimeMixin.js.map
|
|
12
|
+
export { DateTimeMixin };
|
|
@@ -12,5 +12,4 @@ const valueTransformationDirectory = {
|
|
|
12
12
|
oembed: OembedMixin,
|
|
13
13
|
autolink: AutolinkMixin
|
|
14
14
|
};
|
|
15
|
-
export { valueTransformationDirectory, DateMixin, DateTimeMixin, MultilineMixin, MarkdownMixin, OembedMixin, AutolinkMixin };
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
15
|
+
export { valueTransformationDirectory, DateMixin, DateTimeMixin, MultilineMixin, MarkdownMixin, OembedMixin, AutolinkMixin };
|
|
@@ -3,14 +3,11 @@ import markdownit from '../../_snowpack/pkg/markdown-it.js';
|
|
|
3
3
|
import mila from '../../_snowpack/pkg/markdown-it-link-attributes.js';
|
|
4
4
|
const MarkdownMixin = {
|
|
5
5
|
name: 'markdown-mixin',
|
|
6
|
-
|
|
7
6
|
created() {
|
|
8
7
|
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
9
8
|
},
|
|
10
|
-
|
|
11
9
|
transformValue(value, listValueTransformations) {
|
|
12
10
|
let newValue = '';
|
|
13
|
-
|
|
14
11
|
if (value) {
|
|
15
12
|
const md = markdownit({
|
|
16
13
|
breaks: true,
|
|
@@ -26,11 +23,8 @@ const MarkdownMixin = {
|
|
|
26
23
|
const html = md.render(value);
|
|
27
24
|
newValue = unsafeHTML(html);
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
const nextProcessor = listValueTransformations.shift();
|
|
31
27
|
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
};
|
|
35
|
-
export { MarkdownMixin };
|
|
36
|
-
//# sourceMappingURL=markdownMixin.js.map
|
|
30
|
+
export { MarkdownMixin };
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { unsafeHTML } from '../../_snowpack/pkg/lit-html/directives/unsafe-html.js';
|
|
2
2
|
const MultilineMixin = {
|
|
3
3
|
name: 'multiline-mixin',
|
|
4
|
-
|
|
5
4
|
created() {
|
|
6
5
|
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
7
6
|
},
|
|
8
|
-
|
|
9
7
|
transformValue(value, listValueTransformations) {
|
|
10
8
|
const newValue = value ? unsafeHTML(value.replace(/\n/g, "<br/>")) : value;
|
|
11
9
|
const nextProcessor = listValueTransformations.shift();
|
|
12
10
|
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
};
|
|
16
|
-
export { MultilineMixin };
|
|
17
|
-
//# sourceMappingURL=multilineMixin.js.map
|
|
13
|
+
export { MultilineMixin };
|
|
@@ -4,24 +4,18 @@ const OembedMixin = {
|
|
|
4
4
|
initialState: {
|
|
5
5
|
existingOembed: null
|
|
6
6
|
},
|
|
7
|
-
|
|
8
7
|
created() {
|
|
9
8
|
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
10
9
|
},
|
|
11
|
-
|
|
12
10
|
async transformValue(value, listValueTransformations) {
|
|
13
11
|
if (!value) return;
|
|
14
|
-
|
|
15
12
|
if (this.existingOembed == null) {
|
|
16
13
|
const response = await fetch(this.value);
|
|
17
14
|
this.existingOembed = await response.json();
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
const newValue = unsafeHTML(this.existingOembed.html);
|
|
21
17
|
const nextProcessor = listValueTransformations.shift();
|
|
22
18
|
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
};
|
|
26
|
-
export { OembedMixin };
|
|
27
|
-
//# sourceMappingURL=oembedMixin.js.map
|
|
21
|
+
export { OembedMixin };
|
|
@@ -1,45 +1,36 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
///@ts-nocheck
|
|
5
|
+
|
|
4
6
|
export default class SolidTemplateElement extends HTMLElement {
|
|
5
7
|
constructor() {
|
|
6
8
|
super();
|
|
7
|
-
|
|
8
9
|
_defineProperty(this, "renderPlanned", false);
|
|
9
|
-
|
|
10
10
|
_defineProperty(this, "strings", {});
|
|
11
|
-
|
|
12
11
|
_defineProperty(this, "translationsPath", null);
|
|
13
|
-
|
|
14
12
|
_defineProperty(this, "translationsFetched", false);
|
|
15
|
-
|
|
16
13
|
_defineProperty(this, "props", {});
|
|
17
|
-
|
|
18
14
|
this.initProps();
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
static get observedAttributes() {
|
|
22
17
|
return Object.values(this.propsDefinition);
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
static get propsDefinition() {
|
|
26
20
|
return {};
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
initProps() {
|
|
30
23
|
this.props = {};
|
|
31
|
-
|
|
32
24
|
for (let key in this.constructor.propsDefinition) {
|
|
33
25
|
this.props[key] = undefined;
|
|
34
26
|
}
|
|
35
27
|
}
|
|
36
|
-
|
|
37
28
|
updateProps() {
|
|
38
|
-
const declaredAttributes = [];
|
|
29
|
+
const declaredAttributes = [];
|
|
39
30
|
|
|
31
|
+
// Get props values
|
|
40
32
|
for (let key in this.constructor.propsDefinition) {
|
|
41
33
|
const def = this.constructor.propsDefinition[key];
|
|
42
|
-
|
|
43
34
|
if (typeof def === "string") {
|
|
44
35
|
this.props[key] = this.hasAttribute(def) ? this.getAttribute(def) : undefined;
|
|
45
36
|
declaredAttributes.push(def);
|
|
@@ -47,9 +38,9 @@ export default class SolidTemplateElement extends HTMLElement {
|
|
|
47
38
|
this.props[key] = this.hasAttribute(def.attribute) ? this.getAttribute(def.attribute) : def.default || undefined;
|
|
48
39
|
declaredAttributes.push(def.attribute);
|
|
49
40
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
41
|
+
}
|
|
52
42
|
|
|
43
|
+
// Add attributes to props
|
|
53
44
|
for (let attr of this.attributes) {
|
|
54
45
|
if (!declaredAttributes.includes(attr.name)) {
|
|
55
46
|
// if attribute not in propsDefinition
|
|
@@ -57,81 +48,76 @@ export default class SolidTemplateElement extends HTMLElement {
|
|
|
57
48
|
}
|
|
58
49
|
}
|
|
59
50
|
}
|
|
51
|
+
|
|
60
52
|
/**
|
|
61
53
|
* Define the path folder of translations files
|
|
62
54
|
* @param path
|
|
63
55
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
56
|
setTranslationsPath(path) {
|
|
67
57
|
this.translationsPath = path;
|
|
68
58
|
}
|
|
59
|
+
|
|
69
60
|
/**
|
|
70
61
|
* Fetch all localized strings
|
|
71
62
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
63
|
async fetchLocaleStrings() {
|
|
75
64
|
if (this.translationsFetched) return;
|
|
76
65
|
const filesToFetch = [];
|
|
77
|
-
if (this.translationsPath)
|
|
66
|
+
if (this.translationsPath)
|
|
67
|
+
// fetch component translations
|
|
78
68
|
filesToFetch.push(this.fetchTranslationFile(this.translationsPath));
|
|
79
69
|
const extraTranslationsPath = this.getAttribute('extra-translations-path');
|
|
80
|
-
if (extraTranslationsPath)
|
|
81
|
-
|
|
70
|
+
if (extraTranslationsPath)
|
|
71
|
+
// fetch developer translations
|
|
72
|
+
filesToFetch.push(this.fetchTranslationFile(extraTranslationsPath));
|
|
82
73
|
|
|
74
|
+
// merge all translations
|
|
83
75
|
return Promise.all(filesToFetch).then(res => {
|
|
84
76
|
this.translationsFetched = true;
|
|
85
77
|
this.strings = Object.assign({}, ...res);
|
|
86
78
|
});
|
|
87
79
|
}
|
|
80
|
+
|
|
88
81
|
/**
|
|
89
82
|
* Fetch the translation file from [path]
|
|
90
83
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
84
|
async fetchTranslationFile(path) {
|
|
94
85
|
const ln = this.getLocale();
|
|
95
|
-
const fullPath =
|
|
86
|
+
const fullPath = `${path}/${ln}.json`;
|
|
96
87
|
return fetch(fullPath).then(result => {
|
|
97
88
|
if (result.ok) {
|
|
98
89
|
return result.json() // parse content
|
|
99
|
-
.catch(e => console.error(
|
|
90
|
+
.catch(e => console.error(`Error while parsing the translation file: ${fullPath}`));
|
|
100
91
|
}
|
|
101
|
-
}).catch(e => console.error(
|
|
92
|
+
}).catch(e => console.error(`Error while retrieving the translation file: ${fullPath}`));
|
|
102
93
|
}
|
|
94
|
+
|
|
103
95
|
/**
|
|
104
96
|
* Returns current locale of app
|
|
105
97
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
98
|
getLocale() {
|
|
109
99
|
return localStorage.getItem('language') || window.navigator.language.slice(0, 2);
|
|
110
100
|
}
|
|
101
|
+
|
|
111
102
|
/**
|
|
112
103
|
* Return localized string for [key]
|
|
113
104
|
* @param key
|
|
114
105
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
106
|
localize(key) {
|
|
118
107
|
return this.strings[key] || key;
|
|
119
108
|
}
|
|
120
|
-
|
|
121
109
|
attributeChangedCallback() {
|
|
122
110
|
this.updateProps();
|
|
123
111
|
this.planRender();
|
|
124
112
|
}
|
|
125
|
-
|
|
126
113
|
connectedCallback() {
|
|
127
114
|
this.updateProps();
|
|
128
115
|
this.planRender();
|
|
129
116
|
}
|
|
117
|
+
|
|
130
118
|
/**
|
|
131
119
|
* Plan a render if none is already waiting to prevent multi re-renders
|
|
132
120
|
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
121
|
planRender() {
|
|
136
122
|
if (!this.renderPlanned) {
|
|
137
123
|
this.renderPlanned = true;
|
|
@@ -141,9 +127,7 @@ export default class SolidTemplateElement extends HTMLElement {
|
|
|
141
127
|
});
|
|
142
128
|
}
|
|
143
129
|
}
|
|
144
|
-
|
|
145
130
|
renderCallback() {}
|
|
146
|
-
|
|
147
131
|
render() {
|
|
148
132
|
this.fetchLocaleStrings().finally(() => {
|
|
149
133
|
// render even if some errors occurred
|
|
@@ -151,14 +135,10 @@ export default class SolidTemplateElement extends HTMLElement {
|
|
|
151
135
|
this.renderCallback();
|
|
152
136
|
});
|
|
153
137
|
}
|
|
154
|
-
|
|
155
138
|
template() {
|
|
156
139
|
return '';
|
|
157
140
|
}
|
|
158
|
-
|
|
159
141
|
_camelize(str) {
|
|
160
142
|
return str.replace(/\W+(.)/g, (match, chr) => chr.toUpperCase());
|
|
161
143
|
}
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
//# sourceMappingURL=solid-template-element.js.map
|
|
144
|
+
}
|