@startinblox/core 0.17.22 → 0.17.23
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/env.js +3 -0
- package/dist/_snowpack/pkg/autolinker.js +4281 -0
- package/dist/_snowpack/pkg/autolinker.js.map +1 -0
- package/dist/_snowpack/pkg/autolinker.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js +377 -0
- package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js.map +1 -0
- package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js +22 -0
- package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map +1 -0
- package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/common/decode-a4c334cf.js +216 -0
- package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map +1 -0
- package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/common/lit-html-babd44cd.js +1119 -0
- package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map +1 -0
- package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js +25677 -0
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +1 -0
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/dialog-polyfill.js +859 -0
- package/dist/_snowpack/pkg/dialog-polyfill.js.map +1 -0
- package/dist/_snowpack/pkg/dialog-polyfill.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/fusejs.js +1783 -0
- package/dist/_snowpack/pkg/fusejs.js.map +1 -0
- package/dist/_snowpack/pkg/fusejs.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/import-map.json +25 -0
- package/dist/_snowpack/pkg/jsonld-context-parser.js +804 -0
- package/dist/_snowpack/pkg/jsonld-context-parser.js.map +1 -0
- package/dist/_snowpack/pkg/jsonld-context-parser.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/leaflet/dist/leaflet.css +640 -0
- package/dist/_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js +10 -0
- package/dist/_snowpack/pkg/leaflet.js +14066 -0
- package/dist/_snowpack/pkg/leaflet.js.map +1 -0
- package/dist/_snowpack/pkg/leaflet.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css +60 -0
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +10 -0
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css +14 -0
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +10 -0
- package/dist/_snowpack/pkg/leaflet.markercluster.js +2697 -0
- package/dist/_snowpack/pkg/leaflet.markercluster.js.map +1 -0
- package/dist/_snowpack/pkg/leaflet.markercluster.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +40 -0
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +1 -0
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +46 -0
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +1 -0
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/lit-html/directives/until.js +88 -0
- package/dist/_snowpack/pkg/lit-html/directives/until.js.map +1 -0
- package/dist/_snowpack/pkg/lit-html/directives/until.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/lit-html.js +92 -0
- package/dist/_snowpack/pkg/lit-html.js.map +1 -0
- package/dist/_snowpack/pkg/lit-html.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/markdown-it.js +11860 -0
- package/dist/_snowpack/pkg/markdown-it.js.map +1 -0
- package/dist/_snowpack/pkg/markdown-it.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/quill/dist/quill.snow.css +945 -0
- package/dist/_snowpack/pkg/quill/dist/quill.snow.css.proxy.js +10 -0
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js +1029 -0
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +1 -0
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/quill.js +13382 -0
- package/dist/_snowpack/pkg/quill.js.map +1 -0
- package/dist/_snowpack/pkg/quill.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/slim-select.js +4 -0
- package/dist/_snowpack/pkg/slim-select.js.map +1 -0
- package/dist/_snowpack/pkg/slim-select.js.map.proxy.js +1 -0
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +1164 -0
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +10 -0
- package/dist/_snowpack/pkg/tui-calendar.js +42285 -0
- package/dist/_snowpack/pkg/tui-calendar.js.map +1 -0
- package/dist/_snowpack/pkg/tui-calendar.js.map.proxy.js +1 -0
- package/dist/components/solid-ac-checker.js +58 -0
- package/dist/components/solid-ac-checker.js.map +1 -0
- package/dist/components/solid-calendar.js +87 -0
- package/dist/components/solid-calendar.js.map +1 -0
- package/dist/components/solid-delete.js +111 -0
- package/dist/components/solid-delete.js.map +1 -0
- package/dist/components/solid-display.js +194 -0
- package/dist/components/solid-display.js.map +1 -0
- package/dist/components/solid-form-search.js +226 -0
- package/dist/components/solid-form-search.js.map +1 -0
- package/dist/components/solid-form.js +354 -0
- package/dist/components/solid-form.js.map +1 -0
- package/dist/components/solid-lang.js +46 -0
- package/dist/components/solid-lang.js.map +1 -0
- package/dist/components/solid-map.js +242 -0
- package/dist/components/solid-map.js.map +1 -0
- package/dist/components/solid-table.js +263 -0
- package/dist/components/solid-table.js.map +1 -0
- package/dist/components/solid-widget.js +94 -0
- package/dist/components/solid-widget.js.map +1 -0
- package/dist/import.css +4 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/libs/Component.js +19 -0
- package/dist/libs/Component.js.map +1 -0
- package/dist/libs/ComponentFactory.js +196 -0
- package/dist/libs/ComponentFactory.js.map +1 -0
- package/dist/libs/Compositor.js +103 -0
- package/dist/libs/Compositor.js.map +1 -0
- package/dist/libs/Sib.js +58 -0
- package/dist/libs/Sib.js.map +1 -0
- package/dist/libs/helpers.js +219 -0
- package/dist/libs/helpers.js.map +1 -0
- package/dist/libs/interfaces.js +6 -0
- package/dist/libs/interfaces.js.map +1 -0
- package/dist/libs/lit-helpers.js +169 -0
- package/dist/libs/lit-helpers.js.map +1 -0
- package/dist/libs/polyfills.js +40 -0
- package/dist/libs/polyfills.js.map +1 -0
- package/dist/libs/store/store.js +802 -0
- package/dist/libs/store/store.js.map +1 -0
- package/dist/locales/en.json +10 -0
- package/dist/locales/en.json.proxy.js +2 -0
- package/dist/locales/fr.json +10 -0
- package/dist/locales/fr.json.proxy.js +2 -0
- package/dist/mixins/attributeBinderMixin.js +124 -0
- package/dist/mixins/attributeBinderMixin.js.map +1 -0
- package/dist/mixins/contextMixin.js +28 -0
- package/dist/mixins/contextMixin.js.map +1 -0
- package/dist/mixins/counterMixin.js +75 -0
- package/dist/mixins/counterMixin.js.map +1 -0
- package/dist/mixins/federationMixin.js +63 -0
- package/dist/mixins/federationMixin.js.map +1 -0
- package/dist/mixins/filterMixin.js +195 -0
- package/dist/mixins/filterMixin.js.map +1 -0
- package/dist/mixins/grouperMixin.js +80 -0
- package/dist/mixins/grouperMixin.js.map +1 -0
- package/dist/mixins/highlighterMixin.js +42 -0
- package/dist/mixins/highlighterMixin.js.map +1 -0
- package/dist/mixins/interfaces.js +8 -0
- package/dist/mixins/interfaces.js.map +1 -0
- package/dist/mixins/listMixin.js +136 -0
- package/dist/mixins/listMixin.js.map +1 -0
- package/dist/mixins/nextMixin.js +26 -0
- package/dist/mixins/nextMixin.js.map +1 -0
- package/dist/mixins/paginateMixin.js +110 -0
- package/dist/mixins/paginateMixin.js.map +1 -0
- package/dist/mixins/requiredMixin.js +34 -0
- package/dist/mixins/requiredMixin.js.map +1 -0
- package/dist/mixins/sorterMixin.js +149 -0
- package/dist/mixins/sorterMixin.js.map +1 -0
- package/dist/mixins/storeMixin.js +102 -0
- package/dist/mixins/storeMixin.js.map +1 -0
- package/dist/mixins/translationMixin.js +68 -0
- package/dist/mixins/translationMixin.js.map +1 -0
- package/dist/mixins/validationMixin.js +113 -0
- package/dist/mixins/validationMixin.js.map +1 -0
- package/dist/mixins/widgetMixin.js +447 -0
- package/dist/mixins/widgetMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/actionMixin.js +14 -0
- package/dist/new-widgets/attributeMixins/actionMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/blankMixin.js +10 -0
- package/dist/new-widgets/attributeMixins/blankMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/booleanMixin.js +10 -0
- package/dist/new-widgets/attributeMixins/booleanMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/index.js +20 -0
- package/dist/new-widgets/attributeMixins/index.js.map +1 -0
- package/dist/new-widgets/attributeMixins/mailtoMixin.js +10 -0
- package/dist/new-widgets/attributeMixins/mailtoMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/multipleMixin.js +28 -0
- package/dist/new-widgets/attributeMixins/multipleMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/numberMixin.js +10 -0
- package/dist/new-widgets/attributeMixins/numberMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/placeholderMixin.js +19 -0
- package/dist/new-widgets/attributeMixins/placeholderMixin.js.map +1 -0
- package/dist/new-widgets/attributeMixins/telMixin.js +10 -0
- package/dist/new-widgets/attributeMixins/telMixin.js.map +1 -0
- package/dist/new-widgets/baseWidgetMixin.js +122 -0
- package/dist/new-widgets/baseWidgetMixin.js.map +1 -0
- package/dist/new-widgets/callbackMixins/autocompletionMixin.js +104 -0
- package/dist/new-widgets/callbackMixins/autocompletionMixin.js.map +1 -0
- package/dist/new-widgets/callbackMixins/index.js +8 -0
- package/dist/new-widgets/callbackMixins/index.js.map +1 -0
- package/dist/new-widgets/callbackMixins/richtextMixin.js +42 -0
- package/dist/new-widgets/callbackMixins/richtextMixin.js.map +1 -0
- package/dist/new-widgets/callbackMixins/slimselect.css +2 -0
- package/dist/new-widgets/callbackMixins/slimselect.css.proxy.js +10 -0
- package/dist/new-widgets/new-widget-factory.js +96 -0
- package/dist/new-widgets/new-widget-factory.js.map +1 -0
- package/dist/new-widgets/templateAdditionMixins/addableMixin.js +41 -0
- package/dist/new-widgets/templateAdditionMixins/addableMixin.js.map +1 -0
- package/dist/new-widgets/templateAdditionMixins/index.js +14 -0
- package/dist/new-widgets/templateAdditionMixins/index.js.map +1 -0
- package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +29 -0
- package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js.map +1 -0
- package/dist/new-widgets/templateAdditionMixins/labelMixin.js +31 -0
- package/dist/new-widgets/templateAdditionMixins/labelMixin.js.map +1 -0
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js +35 -0
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js.map +1 -0
- package/dist/new-widgets/templates/displayTemplatesDirectory.js +89 -0
- package/dist/new-widgets/templates/displayTemplatesDirectory.js.map +1 -0
- package/dist/new-widgets/templates/formTemplatesDirectory.js +397 -0
- package/dist/new-widgets/templates/formTemplatesDirectory.js.map +1 -0
- package/dist/new-widgets/templates/groupTemplatesDirectory.js +21 -0
- package/dist/new-widgets/templates/groupTemplatesDirectory.js.map +1 -0
- package/dist/new-widgets/templates/index.js +7 -0
- package/dist/new-widgets/templates/index.js.map +1 -0
- package/dist/new-widgets/templates/setTemplatesDirectory.js +49 -0
- package/dist/new-widgets/templates/setTemplatesDirectory.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/altMixin.js +13 -0
- package/dist/new-widgets/templatesDependencies/altMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/editableMixin.js +77 -0
- package/dist/new-widgets/templatesDependencies/editableMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +38 -0
- package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +14 -0
- package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +51 -0
- package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +66 -0
- package/dist/new-widgets/templatesDependencies/formDropdownMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formFileMixin.js +81 -0
- package/dist/new-widgets/templatesDependencies/formFileMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formLengthMixin.js +19 -0
- package/dist/new-widgets/templatesDependencies/formLengthMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +19 -0
- package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formMixin.js +66 -0
- package/dist/new-widgets/templatesDependencies/formMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formNumberMixin.js +14 -0
- package/dist/new-widgets/templatesDependencies/formNumberMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formRadioMixin.js +16 -0
- package/dist/new-widgets/templatesDependencies/formRadioMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/formStepMixin.js +13 -0
- package/dist/new-widgets/templatesDependencies/formStepMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +107 -0
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +74 -0
- package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/patternMixin.js +19 -0
- package/dist/new-widgets/templatesDependencies/patternMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/rangeMixin.js +110 -0
- package/dist/new-widgets/templatesDependencies/rangeMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/setMixin.js +12 -0
- package/dist/new-widgets/templatesDependencies/setMixin.js.map +1 -0
- package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +12 -0
- package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js.map +1 -0
- package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +18 -0
- package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js.map +1 -0
- package/dist/new-widgets/valueTransformationMixins/dateMixin.js +35 -0
- package/dist/new-widgets/valueTransformationMixins/dateMixin.js.map +1 -0
- package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +16 -0
- package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js.map +1 -0
- package/dist/new-widgets/valueTransformationMixins/index.js +16 -0
- package/dist/new-widgets/valueTransformationMixins/index.js.map +1 -0
- package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +25 -0
- package/dist/new-widgets/valueTransformationMixins/markdownMixin.js.map +1 -0
- package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +17 -0
- package/dist/new-widgets/valueTransformationMixins/multilineMixin.js.map +1 -0
- package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +27 -0
- package/dist/new-widgets/valueTransformationMixins/oembedMixin.js.map +1 -0
- package/dist/solid-template-element.js +164 -0
- package/dist/solid-template-element.js.map +1 -0
- package/dist/style/default-theme.css +24 -0
- package/dist/style/default-theme.css.proxy.js +10 -0
- package/dist/widgets/baseWidget.js +332 -0
- package/dist/widgets/baseWidget.js.map +1 -0
- package/dist/widgets/widget-factory.js +24 -0
- package/dist/widgets/widget-factory.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["formNumberMixin.ts"],"names":["FormNumberMixin","name","getValueFromElement","element","value","Number","type"],"mappings":"AAAA,MAAMA,eAAe,GAAG;AACtBC,EAAAA,IAAI,EAAE,mBADgB;;AAEtBC,EAAAA,mBAAmB,CAACC,OAAD,EAAe;AAChC,WAAOA,OAAO,CAACC,KAAR,GAAgBC,MAAM,CAACF,OAAO,CAACC,KAAT,CAAtB,GAAwC,EAA/C;AACD,GAJqB;;AAKtB,MAAIE,IAAJ,GAAY;AACV,WAAO,QAAP;AACD;;AAPqB,CAAxB;AAUA,SACEN,eADF","sourcesContent":["const FormNumberMixin = {\n name: 'form-number-mixin',\n getValueFromElement(element: any) {\n return element.value ? Number(element.value) : '';\n },\n get type () {\n return 'number'\n },\n}\n\nexport {\n FormNumberMixin\n}"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { uniqID } from '../../libs/helpers.js';
|
|
2
|
+
const FormRadioMixin = {
|
|
3
|
+
name: 'form-radio-mixin',
|
|
4
|
+
|
|
5
|
+
created() {
|
|
6
|
+
this.listAttributes['id'] = uniqID();
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
getValue() {
|
|
10
|
+
const checkedElement = this.element.querySelector('input[type=radio]:checked');
|
|
11
|
+
return checkedElement ? checkedElement.value : '';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
};
|
|
15
|
+
export { FormRadioMixin };
|
|
16
|
+
//# sourceMappingURL=formRadioMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["formRadioMixin.ts"],"names":["uniqID","FormRadioMixin","name","created","listAttributes","getValue","checkedElement","element","querySelector","value"],"mappings":"AAAA,SAASA,MAAT,QAAuB,oBAAvB;AAEA,MAAMC,cAAc,GAAG;AACrBC,EAAAA,IAAI,EAAE,kBADe;;AAErBC,EAAAA,OAAO,GAAG;AACR,SAAKC,cAAL,CAAoB,IAApB,IAA4BJ,MAAM,EAAlC;AACD,GAJoB;;AAKrBK,EAAAA,QAAQ,GAAG;AACT,UAAMC,cAAc,GAAG,KAAKC,OAAL,CAAaC,aAAb,CAA2B,2BAA3B,CAAvB;AACA,WAAOF,cAAc,GAAGA,cAAc,CAACG,KAAlB,GAA0B,EAA/C;AACD;;AARoB,CAAvB;AAWA,SACER,cADF","sourcesContent":["import { uniqID } from '../../libs/helpers';\n\nconst FormRadioMixin = {\n name: 'form-radio-mixin',\n created() {\n this.listAttributes['id'] = uniqID();\n },\n getValue() {\n const checkedElement = this.element.querySelector('input[type=radio]:checked') as HTMLInputElement;\n return checkedElement ? checkedElement.value : '';\n },\n}\n\nexport {\n FormRadioMixin\n}"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const FormStepMixin = {
|
|
2
|
+
name: 'form-time-mixin',
|
|
3
|
+
attributes: {
|
|
4
|
+
step: {
|
|
5
|
+
type: Number,
|
|
6
|
+
callback: function (newValue) {
|
|
7
|
+
this.addToAttributes(newValue, 'step');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export { FormStepMixin };
|
|
13
|
+
//# sourceMappingURL=formStepMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["formStepMixin.ts"],"names":["FormStepMixin","name","attributes","step","type","Number","callback","newValue","addToAttributes"],"mappings":"AAAA,MAAMA,aAAa,GAAG;AACpBC,EAAAA,IAAI,EAAE,iBADc;AAEpBC,EAAAA,UAAU,EAAG;AACXC,IAAAA,IAAI,EAAG;AACLC,MAAAA,IAAI,EAAEC,MADD;AAELC,MAAAA,QAAQ,EAAE,UAAUC,QAAV,EAA4B;AACpC,aAAKC,eAAL,CAAqBD,QAArB,EAA+B,MAA/B;AACD;AAJI;AADI;AAFO,CAAtB;AAYA,SACEP,aADF","sourcesContent":["const FormStepMixin = {\n name: 'form-time-mixin',\n attributes : {\n step : {\n type: Number,\n callback: function (newValue: number) {\n this.addToAttributes(newValue, 'step');\n }\n },\n },\n}\n\nexport {\n FormStepMixin\n}"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { StoreMixin } from '../../mixins/storeMixin.js';
|
|
2
|
+
const MultipleFormMixin = {
|
|
3
|
+
name: 'multiple-form-mixin',
|
|
4
|
+
use: [StoreMixin],
|
|
5
|
+
attributes: {
|
|
6
|
+
widget: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: 'solid-form-text'
|
|
9
|
+
},
|
|
10
|
+
addLabel: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '+',
|
|
13
|
+
callback: function (value) {
|
|
14
|
+
if (value !== this.listAttributes['addLabel']) this.listAttributes['addLabel'] = value;
|
|
15
|
+
this.planRender();
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
removeLabel: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '×',
|
|
21
|
+
callback: function (value) {
|
|
22
|
+
if (value !== this.listAttributes['removeLabel']) this.listAttributes['removeLabel'] = value;
|
|
23
|
+
this.planRender();
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
range: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ''
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
created() {
|
|
33
|
+
this.listValueTransformations.push(this.setDataSrc.bind(this));
|
|
34
|
+
this.listAttributes['children'] = [];
|
|
35
|
+
this.listAttributes['addLabel'] = this.addLabel;
|
|
36
|
+
this.listAttributes['removeLabel'] = this.removeLabel;
|
|
37
|
+
|
|
38
|
+
this.listAttributes['addItem'] = () => {
|
|
39
|
+
this.insertWidget();
|
|
40
|
+
this.planRender();
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
this.listAttributes['removeItem'] = index => {
|
|
44
|
+
this.element.querySelector("[data-index=\"".concat(this.name + index, "\"]")).remove();
|
|
45
|
+
this.element.dispatchEvent(new Event('change', {
|
|
46
|
+
bubbles: true
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
setDataSrc(value, listValueTransformations) {
|
|
52
|
+
if (value && value !== this.dataSrc) this.dataSrc = value;
|
|
53
|
+
const nextProcessor = listValueTransformations.shift();
|
|
54
|
+
if (nextProcessor) nextProcessor(value, listValueTransformations);
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
populate() {
|
|
58
|
+
if (!this.resource || !this.resource['ldp:contains']) return;
|
|
59
|
+
this.listAttributes['children'] = []; // reset list
|
|
60
|
+
// set value in form
|
|
61
|
+
|
|
62
|
+
for (let resource of this.resource['ldp:contains']) {
|
|
63
|
+
// for each resource
|
|
64
|
+
this.insertWidget(resource['@id']); // create a widget
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
this.planRender();
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
insertWidget(value = '') {
|
|
71
|
+
if (!this.widget) return;
|
|
72
|
+
const widget = document.createElement(this.widget);
|
|
73
|
+
const attributes = {
|
|
74
|
+
'data-holder': true,
|
|
75
|
+
'name': this.name,
|
|
76
|
+
'value': value,
|
|
77
|
+
'range': this.range
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
for (let name of Object.keys(attributes)) {
|
|
81
|
+
if (typeof attributes[name] === "boolean") widget.toggleAttribute(name, attributes[name]);else widget.setAttribute(name, attributes[name]);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.listAttributes['children'].push(widget);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
empty() {
|
|
88
|
+
this.listAttributes['children'] = [];
|
|
89
|
+
this.planRender();
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
getValue() {
|
|
93
|
+
if (!this.dataHolder) return [];
|
|
94
|
+
return Array.from(this.dataHolder).map(element => this.getValueFromElement(element));
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
get type() {
|
|
98
|
+
return 'resource';
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
get multiple() {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
};
|
|
106
|
+
export { MultipleFormMixin };
|
|
107
|
+
//# sourceMappingURL=multipleFormMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["multipleFormMixin.ts"],"names":["StoreMixin","MultipleFormMixin","name","use","attributes","widget","type","String","default","addLabel","callback","value","listAttributes","planRender","removeLabel","range","created","listValueTransformations","push","setDataSrc","bind","insertWidget","index","element","querySelector","remove","dispatchEvent","Event","bubbles","dataSrc","nextProcessor","shift","populate","resource","document","createElement","Object","keys","toggleAttribute","setAttribute","empty","getValue","dataHolder","Array","from","map","getValueFromElement","multiple"],"mappings":"AAAA,SAASA,UAAT,QAA2B,yBAA3B;AAEA,MAAMC,iBAAiB,GAAG;AACxBC,EAAAA,IAAI,EAAE,qBADkB;AAExBC,EAAAA,GAAG,EAAE,CAAEH,UAAF,CAFmB;AAGxBI,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAEC,MADA;AAENC,MAAAA,OAAO,EAAE;AAFH,KADE;AAKVC,IAAAA,QAAQ,EAAE;AACRH,MAAAA,IAAI,EAAEC,MADE;AAERC,MAAAA,OAAO,EAAE,GAFD;AAGRE,MAAAA,QAAQ,EAAE,UAASC,KAAT,EAAgB;AACxB,YAAIA,KAAK,KAAK,KAAKC,cAAL,CAAoB,UAApB,CAAd,EAA+C,KAAKA,cAAL,CAAoB,UAApB,IAAkCD,KAAlC;AAC/C,aAAKE,UAAL;AACD;AANO,KALA;AAaVC,IAAAA,WAAW,EAAE;AACXR,MAAAA,IAAI,EAAEC,MADK;AAEXC,MAAAA,OAAO,EAAE,GAFE;AAGXE,MAAAA,QAAQ,EAAE,UAASC,KA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CAAW,KAAKF,UAAhB,EAA4BG,GAA5B,CAAiCtB,OAAD,IAAkB,KAAKuB,mBAAL,CAAyBvB,OAAzB,CAAlD,CAAP;AACD,GAlFuB;;AAmFxB,MAAIjB,IAAJ,GAAW;AACT,WAAO,UAAP;AACD,GArFuB;;AAsFxB,MAAIyC,QAAJ,GAAe;AACb,WAAO,IAAP;AACD;;AAxFuB,CAA1B;AA4FA,SACE9C,iBADF","sourcesContent":["import { StoreMixin } from '../../mixins/storeMixin';\n\nconst MultipleFormMixin = {\n name: 'multiple-form-mixin',\n use: [ StoreMixin ],\n attributes: {\n widget: {\n type: String,\n default: 'solid-form-text'\n },\n addLabel: {\n type: String,\n default: '+',\n callback: function(value) {\n if (value !== this.listAttributes['addLabel']) this.listAttributes['addLabel'] = value;\n this.planRender();\n }\n },\n removeLabel: {\n type: String,\n default: '×',\n callback: function(value) {\n if (value !== this.listAttributes['removeLabel']) this.listAttributes['removeLabel'] = value;\n this.planRender();\n }\n },\n range: {\n type: String,\n default: '',\n }\n },\n created() {\n this.listValueTransformations.push(this.setDataSrc.bind(this));\n\n this.listAttributes['children'] = [];\n this.listAttributes['addLabel'] = this.addLabel;\n this.listAttributes['removeLabel'] = this.removeLabel;\n this.listAttributes['addItem'] = () => {\n this.insertWidget();\n this.planRender();\n };\n this.listAttributes['removeItem'] = (index) => {\n this.element.querySelector(`[data-index=\"${this.name + index}\"]`).remove();\n this.element.dispatchEvent(new Event('change', {bubbles: true}));\n };\n },\n setDataSrc(value: string, listValueTransformations: Function[]) {\n if (value && value !== this.dataSrc) this.dataSrc = value;\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(value, listValueTransformations);\n },\n populate() {\n if (!this.resource || !this.resource['ldp:contains']) return;\n\n this.listAttributes['children'] = []; // reset list\n\n // set value in form\n for (let resource of this.resource['ldp:contains']) { // for each resource\n this.insertWidget(resource['@id']); // create a widget\n }\n this.planRender();\n },\n insertWidget(value: string = '') {\n if (!this.widget) return;\n const widget = document.createElement(this.widget);\n const attributes = {\n 'data-holder': true,\n 'name': this.name,\n 'value': value,\n 'range': this.range\n };\n for (let name of Object.keys(attributes)) {\n if (typeof attributes[name] === \"boolean\") widget.toggleAttribute(name, attributes[name]);\n else widget.setAttribute(name, attributes[name]);\n }\n this.listAttributes['children'].push(widget);\n },\n empty() {\n this.listAttributes['children'] = [];\n this.planRender();\n },\n getValue() {\n if (!this.dataHolder) return [];\n return Array.from(this.dataHolder).map((element: any) => this.getValueFromElement(element));\n },\n get type() {\n return 'resource';\n },\n get multiple() {\n return true;\n }\n\n}\n\nexport {\n MultipleFormMixin\n}"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { StoreMixin } from '../../mixins/storeMixin.js';
|
|
2
|
+
const MultipleselectFormMixin = {
|
|
3
|
+
name: 'multipleselect-form-mixin',
|
|
4
|
+
use: [StoreMixin],
|
|
5
|
+
attributes: {
|
|
6
|
+
range: {
|
|
7
|
+
// range attribute is passed to the solid-dropdown
|
|
8
|
+
type: String,
|
|
9
|
+
default: '',
|
|
10
|
+
callback: function (value) {
|
|
11
|
+
if (value && value !== this.listAttributes['range']) this.listAttributes['range'] = value;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
enum: {
|
|
15
|
+
// enum attribute is passed to the solid-dropdown
|
|
16
|
+
type: String,
|
|
17
|
+
default: '',
|
|
18
|
+
callback: function (value) {
|
|
19
|
+
if (value && value !== this.listAttributes['enum']) this.listAttributes['enum'] = value;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
orderAsc: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'name',
|
|
25
|
+
callback: function (newValue) {
|
|
26
|
+
this.addToAttributes(newValue, 'orderAsc');
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
orderDesc: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'name',
|
|
32
|
+
callback: function (newValue) {
|
|
33
|
+
this.addToAttributes(newValue, 'orderDesc');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
created() {
|
|
39
|
+
this.listValueTransformations.push(this.setDataSrc.bind(this));
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
setDataSrc(value, listValueTransformations) {
|
|
43
|
+
if (value && value !== this.dataSrc) this.dataSrc = value;
|
|
44
|
+
const nextProcessor = listValueTransformations.shift();
|
|
45
|
+
if (nextProcessor) nextProcessor(value, listValueTransformations);
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
populate() {
|
|
49
|
+
if (!this.resource || !this.resource['ldp:contains']) return;
|
|
50
|
+
this.setValue(this.resource['ldp:contains']);
|
|
51
|
+
this.planRender();
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
setValue(values) {
|
|
55
|
+
// set the values to the dropdown
|
|
56
|
+
this.listAttributes['values'] = JSON.stringify(values.map(r => r['@id']));
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
empty() {
|
|
60
|
+
this.listAttributes['values'] = [];
|
|
61
|
+
this.planRender();
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
get type() {
|
|
65
|
+
return this.enum === '' ? 'resource' : 'string';
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
get multiple() {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
};
|
|
73
|
+
export { MultipleselectFormMixin };
|
|
74
|
+
//# sourceMappingURL=multipleselectFormMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["multipleselectFormMixin.ts"],"names":["StoreMixin","MultipleselectFormMixin","name","use","attributes","range","type","String","default","callback","value","listAttributes","enum","orderAsc","newValue","addToAttributes","orderDesc","created","listValueTransformations","push","setDataSrc","bind","dataSrc","nextProcessor","shift","populate","resource","setValue","planRender","values","JSON","stringify","map","r","empty","multiple"],"mappings":"AAAA,SAASA,UAAT,QAA2B,yBAA3B;AAEA,MAAMC,uBAAuB,G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BD,EAAAA,UAAU,CAACV,KAAD,EAAgBQ,wBAAhB,EAAsD;AAC9D,QAAIR,KAAK,IAAIA,KAAK,KAAK,KAAKY,OAA5B,EAAqC,KAAKA,OAAL,GAAeZ,KAAf;AAErC,UAAMa,aAAa,GAAGL,wBAAwB,CAACM,KAAzB,EAAtB;AACA,QAAGD,aAAH,EAAkBA,aAAa,CAACb,KAAD,EAAQQ,wBAAR,CAAb;AACnB,GAzC6B;;AA0C9BO,EAAAA,QAAQ,GAAG;AACT,QAAI,CAAC,KAAKC,QAAN,IAAkB,CAAC,KAAKA,QAAL,CAAc,cAAd,CAAvB,EAAsD;AACtD,SAAKC,QAAL,CAAc,KAAKD,QAAL,CAAc,cAAd,CAAd;AACA,SAAKE,UAAL;AACD,GA9C6B;;AA+C9BD,EAAAA,QAAQ,CAACE,MAAD,EAAmB;AAAE;AAC3B,SAAKlB,cAAL,CAAoB,QAApB,IAAgCmB,IAAI,CAACC,SAAL,CAAeF,MAAM,CAACG,GAAP,CAAWC,CAAC,IAAIA,CAAC,CAAC,KAAD,CAAjB,CAAf,CAAhC;AACD,GAjD6B;;AAkD9BC,EAAAA,KAAK,GAAG;AACN,SAAKvB,cAAL,CAAoB,QAApB,IAAgC,EAAhC;AACA,SAAKiB,UAAL;AACD,GArD6B;;AAsD9B,MAAItB,IAAJ,GAAW;AACT,WAAO,KAAKM,IAAL,KAAc,EAAd,GAAmB,UAAnB,GAAgC,QAAvC;AACD,GAxD6B;;AAyD9B,MAAIuB,QAAJ,GAAe;AACb,WAAO,IAAP;AACD;;AA3D6B,CAAhC;AA8DA,SACElC,uBADF","sourcesContent":["import { StoreMixin } from '../../mixins/storeMixin';\n\nconst MultipleselectFormMixin = {\n name: 'multipleselect-form-mixin',\n use: [ StoreMixin ],\n attributes: {\n range: { // range attribute is passed to the solid-dropdown\n type: String,\n default: '',\n callback: function(value) {\n if (value && value !== this.listAttributes['range']) this.listAttributes['range'] = value;\n }\n },\n enum: { // enum attribute is passed to the solid-dropdown\n type: String,\n default: '',\n callback: function (value) {\n if (value && value !== this.listAttributes['enum']) this.listAttributes['enum'] = value;\n }\n },\n orderAsc: {\n type: String,\n default: 'name',\n callback: function (newValue: string) {\n this.addToAttributes(newValue, 'orderAsc');\n }\n },\n orderDesc: {\n type: String,\n default: 'name',\n callback: function (newValue: string) {\n this.addToAttributes(newValue, 'orderDesc');\n }\n }\n },\n created() {\n this.listValueTransformations.push(this.setDataSrc.bind(this));\n },\n setDataSrc(value: string, listValueTransformations: Function[]) {\n if (value && value !== this.dataSrc) this.dataSrc = value;\n\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(value, listValueTransformations);\n },\n populate() {\n if (!this.resource || !this.resource['ldp:contains']) return;\n this.setValue(this.resource['ldp:contains']);\n this.planRender();\n },\n setValue(values: string[]) { // set the values to the dropdown\n this.listAttributes['values'] = JSON.stringify(values.map(r => r['@id']));\n },\n empty() {\n this.listAttributes['values'] = [];\n this.planRender();\n },\n get type() {\n return this.enum === '' ? 'resource' : 'string';\n },\n get multiple() {\n return true;\n },\n}\n\nexport {\n MultipleselectFormMixin\n}"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const PatternMixin = {
|
|
2
|
+
name: 'pattern-mixin',
|
|
3
|
+
attributes: {
|
|
4
|
+
pattern: {
|
|
5
|
+
type: String,
|
|
6
|
+
callback: function (newValue) {
|
|
7
|
+
this.addToAttributes(newValue, 'pattern');
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
title: {
|
|
11
|
+
type: String,
|
|
12
|
+
callback: function (newValue) {
|
|
13
|
+
this.addToAttributes(newValue, 'title');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export { PatternMixin };
|
|
19
|
+
//# sourceMappingURL=patternMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["patternMixin.ts"],"names":["PatternMixin","name","attributes","pattern","type","String","callback","newValue","addToAttributes","title"],"mappings":"AAAA,MAAMA,YAAY,GAAG;AACnBC,EAAAA,IAAI,EAAE,eADa;AAEnBC,EAAAA,UAAU,EAAG;AACXC,IAAAA,OAAO,EAAG;AACRC,MAAAA,IAAI,EAAEC,MADE;AAERC,MAAAA,QAAQ,EAAE,UAAUC,QAAV,EAA4B;AACpC,aAAKC,eAAL,CAAqBD,QAArB,EAA+B,SAA/B;AACD;AAJO,KADC;AAOXE,IAAAA,KAAK,EAAG;AACNL,MAAAA,IAAI,EAAEC,MADA;AAENC,MAAAA,QAAQ,EAAE,UAAUC,QAAV,EAA4B;AACpC,aAAKC,eAAL,CAAqBD,QAArB,EAA+B,OAA/B;AACD;AAJK;AAPG;AAFM,CAArB;AAkBA,SACEP,YADF","sourcesContent":["const PatternMixin = {\n name: 'pattern-mixin',\n attributes : {\n pattern : {\n type: String,\n callback: function (newValue: string) {\n this.addToAttributes(newValue, 'pattern')\n }\n },\n title : {\n type: String,\n callback: function (newValue: string) {\n this.addToAttributes(newValue, 'title');\n }\n },\n },\n}\n\nexport {\n PatternMixin\n}"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { StoreMixin } from '../../mixins/storeMixin.js';
|
|
2
|
+
import { SorterMixin } from '../../mixins/sorterMixin.js';
|
|
3
|
+
import { FederationMixin } from '../../mixins/federationMixin.js';
|
|
4
|
+
const RangeMixin = {
|
|
5
|
+
name: 'range-mixin',
|
|
6
|
+
use: [StoreMixin, SorterMixin, FederationMixin],
|
|
7
|
+
attributes: {
|
|
8
|
+
range: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: '',
|
|
11
|
+
callback: function (value) {
|
|
12
|
+
if (value !== this.dataSrc) this.dataSrc = value;
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
enum: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '',
|
|
18
|
+
callback: function (value) {
|
|
19
|
+
if (value !== null) {
|
|
20
|
+
const optional = value.trim().split(",");
|
|
21
|
+
let key;
|
|
22
|
+
let keyValue;
|
|
23
|
+
const list = {};
|
|
24
|
+
optional.forEach(element => {
|
|
25
|
+
if (element.includes("=")) {
|
|
26
|
+
const option = element.trim().split("=");
|
|
27
|
+
key = option[1].trim();
|
|
28
|
+
keyValue = option[0].trim();
|
|
29
|
+
list[key] = keyValue;
|
|
30
|
+
} else {
|
|
31
|
+
const elem = element.trim();
|
|
32
|
+
list[elem] = elem;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
this.addToAttributes(list, 'enum');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
optionLabel: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'name',
|
|
44
|
+
callback: function (newValue) {
|
|
45
|
+
this.addToAttributes(newValue, 'optionLabel');
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
optionValue: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: '@id',
|
|
51
|
+
callback: function (newValue) {
|
|
52
|
+
this.addToAttributes(newValue, 'optionValue');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
initialState: {
|
|
57
|
+
listPostProcessors: []
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
created() {
|
|
61
|
+
this.listPostProcessors = [];
|
|
62
|
+
this.listAttributes['optionLabel'] = this.optionLabel;
|
|
63
|
+
this.listAttributes['optionValue'] = this.optionValue;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
async populate() {
|
|
67
|
+
const resources = this.resource ? this.resource['ldp:contains'] : [];
|
|
68
|
+
const listPostProcessors = [...this.listPostProcessors];
|
|
69
|
+
listPostProcessors.push(this.setRangeAttribute.bind(this));
|
|
70
|
+
const nextProcessor = listPostProcessors.shift();
|
|
71
|
+
await nextProcessor(resources, listPostProcessors, null, this.dataSrc);
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
async setRangeAttribute(resources) {
|
|
75
|
+
if (resources) {
|
|
76
|
+
// process resources to create the template
|
|
77
|
+
const getRangeValue = async resource => {
|
|
78
|
+
const selectedValue = await resource[this.optionValue]; // value used for selected options
|
|
79
|
+
|
|
80
|
+
const value = this.optionValue.includes('@id') || selectedValue['@id'] ? // value of the option
|
|
81
|
+
"{\"@id\": \"".concat(selectedValue, "\"}") : // resource
|
|
82
|
+
selectedValue; // literal
|
|
83
|
+
|
|
84
|
+
const label = await resource[this.optionLabel]; // label of the option
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
value,
|
|
88
|
+
label,
|
|
89
|
+
selectedValue
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
this.listAttributes['range'] = await Promise.all(resources.filter(el => el !== null).map(r => getRangeValue(r)));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this.planRender();
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
empty() {
|
|
100
|
+
this.listAttributes['range'] = [];
|
|
101
|
+
this.planRender();
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
get type() {
|
|
105
|
+
return this.enum === '' ? 'resource' : 'string';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
};
|
|
109
|
+
export { RangeMixin };
|
|
110
|
+
//# sourceMappingURL=rangeMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["rangeMixin.ts"],"names":["StoreMixin","SorterMixin","FederationMixin","RangeMixin","name","use","attributes","range","type","String","default","callback","value","dataSrc","enum","optional","trim","split","key","keyValue","list","forEach","element","includes","option","elem","addToAttributes","optionLabel","newValue","optionValue","initialState","listPostProcessors","created","listAttributes","populate","resources","resource","push","setRangeAttribute","bind","nextProcessor","shift","getRangeValue","selectedValue","label","Promise","all","filter","el","map","r","planRender","empty"],"mappings":"AAAA,SAASA,UAAT,QAA2B,yBAA3B;AACA,SAASC,WAAT,QAA4B,0BAA5B;AACA,SAASC,eAAT,QAAgC,8BAAhC;AA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QAAIA,SAAJ,EAAe;AACb;AACA,YAAMO,aAAa,GAAG,MAAON,QAAP,IAA8B;AAClD,cAAMO,aAAa,GAAG,MAAMP,QAAQ,CAAC,KAAKP,WAAN,CAApC,CADkD,CACM;;AACxD,cAAMjB,KAAK,GAAI,KAAKiB,WAAL,CAAiBN,QAAjB,CAA0B,KAA1B,KAAoCoB,aAAa,CAAC,KAAD,CAAlD,GAA6D;AAA7D,8BACAA,aADA,WACoB;AAChCA,QAAAA,aAFF,CAFkD,CAIjC;;AACjB,cAAMC,KAAK,GAAG,MAAMR,QAAQ,CAAC,KAAKT,WAAN,CAA5B,CALkD,CAKF;;AAEhD,eAAO;AAAEf,UAAAA,KAAF;AAASgC,UAAAA,KAAT;AAAgBD,UAAAA;AAAhB,SAAP;AACD,OARD;;AAUA,WAAKV,cAAL,CAAoB,OAApB,IAA+B,MAAMY,OAAO,CAACC,GAAR,CACnCX,SAAS,CAACY,MAAV,CAAiBC,EAAE,IAAIA,EAAE,KAAK,IAA9B,EAAoCC,GAApC,CAAwCC,CAAC,IAAIR,aAAa,CAACQ,CAAD,CAA1D,CADmC,CAArC;AAGD;;AAED,SAAKC,UAAL;AACD,GAjGgB;;AAkGjBC,EAAAA,KAAK,GAAG;AACN,SAAKnB,cAAL,CAAoB,OAApB,IAA+B,EAA/B;AACA,SAAKkB,UAAL;AACD,GArGgB;;AAsGjB,MAAI3C,IAAJ,GAAW;AACT,WAAQ,KAAKM,IAAL,KAAc,EAAd,GAAkB,UAAlB,GAA+B,QAAvC;AACD;;AAxGgB,CAAnB;AA2GA,SACEX,UADF","sourcesContent":["import { StoreMixin } from '../../mixins/storeMixin';\nimport { SorterMixin } from '../../mixins/sorterMixin';\nimport { FederationMixin } from '../../mixins/federationMixin';\nimport type { Resource } from '../../mixins/interfaces';\n\nconst RangeMixin = {\n name: 'range-mixin',\n use: [\n StoreMixin,\n SorterMixin,\n FederationMixin\n ],\n attributes: {\n range: {\n type: String,\n default: '',\n callback: function (value: string) {\n if (value !== this.dataSrc) this.dataSrc = value;\n }\n },\n enum: {\n type: String,\n default: '',\n callback: function (value: string) {\n if (value !== null) {\n const optional = value.trim().split(\",\");\n let key;\n let keyValue;\n const list = {};\n\n optional.forEach(element => {\n if (element.includes(\"=\")) {\n const option = element.trim().split(\"=\");\n key = option[1].trim();\n keyValue = option[0].trim();\n list[key] = keyValue;\n } else {\n const elem = element.trim();\n list[elem] = elem;\n }\n });\n this.addToAttributes(list, 'enum');\n };\n }\n },\n optionLabel: {\n type: String,\n default: 'name',\n callback: function (newValue: string) {\n this.addToAttributes(newValue, 'optionLabel');\n }\n },\n optionValue: {\n type: String,\n default: '@id',\n callback: function (newValue: string) {\n this.addToAttributes(newValue, 'optionValue');\n }\n }\n },\n initialState: {\n listPostProcessors: [],\n },\n created() {\n this.listPostProcessors = [];\n this.listAttributes['optionLabel'] = this.optionLabel;\n this.listAttributes['optionValue'] = this.optionValue;\n },\n async populate() {\n const resources = this.resource ? this.resource['ldp:contains'] : [];\n const listPostProcessors = [...this.listPostProcessors];\n listPostProcessors.push(this.setRangeAttribute.bind(this));\n\n const nextProcessor = listPostProcessors.shift();\n await nextProcessor(\n resources,\n listPostProcessors,\n null,\n this.dataSrc,\n );\n },\n async setRangeAttribute(\n resources: Resource[]\n ) {\n if (resources) {\n // process resources to create the template\n const getRangeValue = async (resource: Resource) => {\n const selectedValue = await resource[this.optionValue]; // value used for selected options\n const value = (this.optionValue.includes('@id') || selectedValue['@id']) ? // value of the option\n `{\"@id\": \"${selectedValue}\"}` : // resource\n selectedValue; // literal\n const label = await resource[this.optionLabel]; // label of the option\n\n return { value, label, selectedValue }\n }\n\n this.listAttributes['range'] = await Promise.all(\n resources.filter(el => el !== null).map(r => getRangeValue(r))\n );\n }\n\n this.planRender();\n },\n empty() {\n this.listAttributes['range'] = [];\n this.planRender();\n },\n get type() {\n return this.enum === ''? 'resource' : 'string';\n }\n}\n\nexport {\n RangeMixin\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["setMixin.ts"],"names":["SetMixin","name","planRender"],"mappings":"AAAA,MAAMA,QAAQ,GAAG;AACfC,EAAAA,IAAI,EAAE,WADS;;AAEf;AACF;AACA;AACA;AACEC,EAAAA,UAAU,GAAG,CAAG;;AAND,CAAjB;AASA,SACEF,QADF","sourcesContent":["const SetMixin = {\n name: 'set-mixin',\n /**\n * For sets and group widgets, remove auto rendering\n * function to allow only manual renders\n */\n planRender() { },\n}\n\nexport {\n SetMixin\n}"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import qdtm from '../../_snowpack/pkg/quill-delta-to-markdown.js';
|
|
2
|
+
const ValueRichtextMixin = {
|
|
3
|
+
name: 'valuerichtext-mixin',
|
|
4
|
+
|
|
5
|
+
getValue() {
|
|
6
|
+
const markdown = qdtm.deltaToMarkdown(this.quill.getContents().ops);
|
|
7
|
+
return markdown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
};
|
|
11
|
+
export { ValueRichtextMixin };
|
|
12
|
+
//# sourceMappingURL=valueRichtextMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["valueRichtextMixin.ts"],"names":["qdtm","ValueRichtextMixin","name","getValue","markdown","deltaToMarkdown","quill","getContents","ops"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,yBAAjB;AACA,MAAMC,kBAAkB,GAAG;AACzBC,EAAAA,IAAI,EAAE,qBADmB;;AAGzBC,EAAAA,QAAQ,GAAG;AACT,UAAMC,QAAQ,GAAGJ,IAAI,CAACK,eAAL,CAAqB,KAAKC,KAAL,CAAWC,WAAX,GAAyBC,GAA9C,CAAjB;AACA,WAAOJ,QAAP;AACD;;AANwB,CAA3B;AASA,SACEH,kBADF","sourcesContent":["import qdtm from 'quill-delta-to-markdown';\nconst ValueRichtextMixin = {\n name: 'valuerichtext-mixin',\n \n getValue() {\n const markdown = qdtm.deltaToMarkdown(this.quill.getContents().ops);\n return markdown;\n },\n}\n\nexport {\n ValueRichtextMixin\n}"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Autolinker } from '../../_snowpack/pkg/autolinker.js';
|
|
2
|
+
const AutolinkMixin = {
|
|
3
|
+
name: 'autolink-mixin',
|
|
4
|
+
|
|
5
|
+
created() {
|
|
6
|
+
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
transformValue(value, listValueTransformations) {
|
|
10
|
+
const template = document.createElement('template');
|
|
11
|
+
template.innerHTML = Autolinker.link(value);
|
|
12
|
+
const nextProcessor = listValueTransformations.shift();
|
|
13
|
+
if (nextProcessor) nextProcessor(template.content, listValueTransformations);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
};
|
|
17
|
+
export { AutolinkMixin };
|
|
18
|
+
//# sourceMappingURL=autolinkMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["autolinkMixin.ts"],"names":["Autolinker","AutolinkMixin","name","created","listValueTransformations","push","transformValue","bind","value","template","document","createElement","innerHTML","link","nextProcessor","shift","content"],"mappings":"AAAA,SAAQA,UAAR,QAAyB,YAAzB;AAEA,MAAMC,aAAa,GAAG;AACpBC,EAAAA,IAAI,EAAE,gBADc;;AAEpBC,EAAAA,OAAO,GAAG;AACR,SAAKC,wBAAL,CAA8BC,IAA9B,CAAmC,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAAnC;AACD,GAJmB;;AAKpBD,EAAAA,cAAc,CAACE,KAAD,EAAgBJ,wBAAhB,EAAsD;AAClE,UAAMK,QAAQ,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAAjB;AACAF,IAAAA,QAAQ,CAACG,SAAT,GAAsBZ,UAAU,CAACa,IAAX,CAAgBL,KAAhB,CAAtB;AAEA,UAAMM,aAAa,GAAGV,wBAAwB,CAACW,KAAzB,EAAtB;AACA,QAAID,aAAJ,EAAmBA,aAAa,CAACL,QAAQ,CAACO,OAAV,EAAmBZ,wBAAnB,CAAb;AACpB;;AAXmB,CAAtB;AAcA,SAASH,aAAT","sourcesContent":["import {Autolinker} from 'autolinker';\n\nconst AutolinkMixin = {\n name: 'autolink-mixin',\n created() {\n this.listValueTransformations.push(this.transformValue.bind(this));\n },\n transformValue(value: string, listValueTransformations: Function[]) {\n const template = document.createElement('template');\n template.innerHTML = Autolinker.link(value);\n\n const nextProcessor = listValueTransformations.shift();\n if (nextProcessor) nextProcessor(template.content, listValueTransformations);\n },\n};\n\nexport { AutolinkMixin };\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const DateMixin = {
|
|
2
|
+
name: 'date-mixin',
|
|
3
|
+
|
|
4
|
+
created() {
|
|
5
|
+
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
transformValue(value, listValueTransformations) {
|
|
9
|
+
try {
|
|
10
|
+
// workaround for giving a specific-formatted value to the form widget
|
|
11
|
+
this.listAttributes['originalValue'] = this.formatDateForInput(value);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
console.warn('Invalid date format for widget', this.name);
|
|
14
|
+
this.listAttributes['originalValue'] = '';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const newValue = value ? new Date(value).toLocaleDateString() : value;
|
|
18
|
+
const nextProcessor = listValueTransformations.shift();
|
|
19
|
+
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
formatDateForInput(date) {
|
|
23
|
+
let d = new Date(date);
|
|
24
|
+
if (isNaN(d.getTime())) throw new Error('Invalid date');
|
|
25
|
+
let month = "".concat(d.getMonth() + 1);
|
|
26
|
+
let day = "".concat(d.getDate());
|
|
27
|
+
let year = d.getFullYear();
|
|
28
|
+
if (month.length < 2) month = "0".concat(month);
|
|
29
|
+
if (day.length < 2) day = "0".concat(day);
|
|
30
|
+
return [year, month, day].join('-');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
};
|
|
34
|
+
export { DateMixin };
|
|
35
|
+
//# sourceMappingURL=dateMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["dateMixin.ts"],"names":["DateMixin","name","created","listValueTransformations","push","transformValue","bind","value","listAttributes","formatDateForInput","e","console","warn","newValue","Date","toLocaleDateString","nextProcessor","shift","date","d","isNaN","getTime","Error","month","getMonth","day","getDate","year","getFullYear","length","join"],"mappings":"AAAA,MAAMA,SAAS,GAAG;AAChBC,EAAAA,IAAI,EAAE,YADU;;AAEhBC,EAAAA,OAAO,GAAG;AACR,SAAKC,wBAAL,CAA8BC,IAA9B,CAAmC,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAAnC;AACD,GAJe;;AAKhBD,EAAAA,cAAc,CAACE,KAAD,EAAgBJ,wBAAhB,EAAsD;AAClE,QAAI;AACF;AACA,WAAKK,cAAL,CAAoB,eAApB,IAAuC,KAAKC,kBAAL,CAAwBF,KAAxB,CAAvC;AACD,KAHD,CAGE,OAAOG,CAAP,EAAU;AACVC,MAAAA,OAAO,CAACC,IAAR,CAAa,gCAAb,EAA+C,KAAKX,IAApD;AACA,WAAKO,cAAL,CAAoB,eAApB,IAAuC,EAAvC;AACD;;AACD,UAAMK,QAAQ,GAAGN,KAAK,GAAG,IAAIO,IAAJ,CAASP,KAAT,EAAgBQ,kBAAhB,EAAH,GAA0CR,KAAhE;AAEA,UAAMS,aAAa,GAAGb,wBAAwB,CAACc,KAAzB,EAAtB;AACA,QAAGD,aAAH,EAAkBA,aAAa,CAACH,QAAD,EAAWV,wBAAX,CAAb;AACnB,GAjBe;;AAkBhBM,EAAAA,kBAAkB,CAACS,IAAD,EAAe;AAC/B,QAAIC,CAAC,GAAG,IAAIL,IAAJ,CAASI,IAAT,CAAR;AACA,QAAIE,KAAK,CAACD,CAAC,CAACE,OAAF,EAAD,CAAT,EAAwB,MAAM,IAAIC,KAAJ,CAAU,cAAV,CAAN;AACxB,QAAIC,KAAK,aAAMJ,CAAC,CAACK,QAAF,KAAe,CAArB,CAAT;AACA,QAAIC,GAAG,aAAMN,CAAC,CAACO,OAAF,EAAN,CAAP;AACA,QAAIC,IAAI,GAAGR,CAAC,CAACS,WAAF,EAAX;AAEA,QAAIL,KAAK,CAACM,MAAN,GAAe,CAAnB,EAAsBN,KAAK,cAAOA,KAAP,CAAL;AACtB,QAAIE,GAAG,CAACI,MAAJ,GAAa,CAAjB,EAAoBJ,GAAG,cAAOA,GAAP,CAAH;AAEpB,WAAO,CAACE,IAAD,EAAOJ,KAAP,EAAcE,GAAd,EAAmBK,IAAnB,CAAwB,GAAxB,CAAP;AACD;;AA7Be,CAAlB;AAgCA,SACE9B,SADF","sourcesContent":["const DateMixin = {\n name: 'date-mixin',\n created() {\n this.listValueTransformations.push(this.transformValue.bind(this));\n },\n transformValue(value: string, listValueTransformations: Function[]) {\n try {\n // workaround for giving a specific-formatted value to the form widget\n this.listAttributes['originalValue'] = this.formatDateForInput(value);\n } catch (e) {\n console.warn('Invalid date format for widget', this.name);\n this.listAttributes['originalValue'] = '';\n }\n const newValue = value ? new Date(value).toLocaleDateString() : value;\n\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(newValue, listValueTransformations);\n },\n formatDateForInput(date: string) {\n let d = new Date(date);\n if (isNaN(d.getTime())) throw new Error('Invalid date');\n let month = `${d.getMonth() + 1}`;\n let day = `${d.getDate()}`;\n let year = d.getFullYear();\n\n if (month.length < 2) month = `0${month}`;\n if (day.length < 2) day = `0${day}`;\n\n return [year, month, day].join('-');\n }\n}\n\nexport {\n DateMixin\n}"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const DateTimeMixin = {
|
|
2
|
+
name: 'date-time-mixin',
|
|
3
|
+
|
|
4
|
+
created() {
|
|
5
|
+
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
transformValue(value, listValueTransformations) {
|
|
9
|
+
const newValue = value ? new Date(value).toLocaleString() : value;
|
|
10
|
+
const nextProcessor = listValueTransformations.shift();
|
|
11
|
+
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
};
|
|
15
|
+
export { DateTimeMixin };
|
|
16
|
+
//# sourceMappingURL=dateTimeMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["dateTimeMixin.ts"],"names":["DateTimeMixin","name","created","listValueTransformations","push","transformValue","bind","value","newValue","Date","toLocaleString","nextProcessor","shift"],"mappings":"AAAA,MAAMA,aAAa,GAAG;AACpBC,EAAAA,IAAI,EAAE,iBADc;;AAEpBC,EAAAA,OAAO,GAAG;AACR,SAAKC,wBAAL,CAA8BC,IAA9B,CAAmC,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAAnC;AACD,GAJmB;;AAKpBD,EAAAA,cAAc,CAACE,KAAD,EAAgBJ,wBAAhB,EAAsD;AAClE,UAAMK,QAAQ,GAAGD,KAAK,GAAG,IAAIE,IAAJ,CAASF,KAAT,EAAgBG,cAAhB,EAAH,GAAsCH,KAA5D;AAEA,UAAMI,aAAa,GAAGR,wBAAwB,CAACS,KAAzB,EAAtB;AACA,QAAGD,aAAH,EAAkBA,aAAa,CAACH,QAAD,EAAWL,wBAAX,CAAb;AACnB;;AAVmB,CAAtB;AAaA,SACEH,aADF","sourcesContent":["const DateTimeMixin = {\n name: 'date-time-mixin',\n created() {\n this.listValueTransformations.push(this.transformValue.bind(this));\n },\n transformValue(value: string, listValueTransformations: Function[]) {\n const newValue = value ? new Date(value).toLocaleString() : value;\n\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(newValue, listValueTransformations);\n }\n}\n\nexport {\n DateTimeMixin\n}"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DateMixin } from './dateMixin.js';
|
|
2
|
+
import { DateTimeMixin } from './dateTimeMixin.js';
|
|
3
|
+
import { MultilineMixin } from './multilineMixin.js';
|
|
4
|
+
import { MarkdownMixin } from './markdownMixin.js';
|
|
5
|
+
import { OembedMixin } from './oembedMixin.js';
|
|
6
|
+
import { AutolinkMixin } from './autolinkMixin.js';
|
|
7
|
+
const valueTransformationDirectory = {
|
|
8
|
+
date: DateMixin,
|
|
9
|
+
datetime: DateTimeMixin,
|
|
10
|
+
multiline: MultilineMixin,
|
|
11
|
+
markdown: MarkdownMixin,
|
|
12
|
+
oembed: OembedMixin,
|
|
13
|
+
autolink: AutolinkMixin
|
|
14
|
+
};
|
|
15
|
+
export { valueTransformationDirectory, DateMixin, DateTimeMixin, MultilineMixin, MarkdownMixin, OembedMixin, AutolinkMixin };
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["DateMixin","DateTimeMixin","MultilineMixin","MarkdownMixin","OembedMixin","AutolinkMixin","valueTransformationDirectory","date","datetime","multiline","markdown","oembed","autolink"],"mappings":"AAAA,SAASA,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,cAAT,QAA+B,kBAA/B;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,MAAMC,4BAA4B,GAAG;AACnCC,EAAAA,IAAI,EAAEP,SAD6B;AAEnCQ,EAAAA,QAAQ,EAAEP,aAFyB;AAGnCQ,EAAAA,SAAS,EAAEP,cAHwB;AAInCQ,EAAAA,QAAQ,EAAEP,aAJyB;AAKnCQ,EAAAA,MAAM,EAAEP,WAL2B;AAMnCQ,EAAAA,QAAQ,EAAEP;AANyB,CAArC;AASA,SACEC,4BADF,EAEEN,SAFF,EAGEC,aAHF,EAIEC,cAJF,EAKEC,aALF,EAMEC,WANF,EAOEC,aAPF","sourcesContent":["import { DateMixin } from './dateMixin';\nimport { DateTimeMixin } from './dateTimeMixin';\nimport { MultilineMixin } from './multilineMixin';\nimport { MarkdownMixin } from './markdownMixin.js';\nimport { OembedMixin } from './oembedMixin';\nimport { AutolinkMixin } from './autolinkMixin';\n\nconst valueTransformationDirectory = {\n date: DateMixin,\n datetime: DateTimeMixin,\n multiline: MultilineMixin,\n markdown: MarkdownMixin,\n oembed: OembedMixin,\n autolink: AutolinkMixin\n}\n\nexport {\n valueTransformationDirectory,\n DateMixin,\n DateTimeMixin,\n MultilineMixin,\n MarkdownMixin,\n OembedMixin,\n AutolinkMixin\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { unsafeHTML } from '../../_snowpack/pkg/lit-html/directives/unsafe-html.js';
|
|
2
|
+
import markdownit from '../../_snowpack/pkg/markdown-it.js';
|
|
3
|
+
const MarkdownMixin = {
|
|
4
|
+
name: 'markdown-mixin',
|
|
5
|
+
|
|
6
|
+
created() {
|
|
7
|
+
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
transformValue(value, listValueTransformations) {
|
|
11
|
+
let newValue = '';
|
|
12
|
+
|
|
13
|
+
if (value) {
|
|
14
|
+
const md = markdownit();
|
|
15
|
+
const html = md.render(value);
|
|
16
|
+
newValue = unsafeHTML(html);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const nextProcessor = listValueTransformations.shift();
|
|
20
|
+
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
};
|
|
24
|
+
export { MarkdownMixin };
|
|
25
|
+
//# sourceMappingURL=markdownMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["markdownMixin.ts"],"names":["unsafeHTML","markdownit","MarkdownMixin","name","created","listValueTransformations","push","transformValue","bind","value","newValue","md","html","render","nextProcessor","shift"],"mappings":"AAAA,SAASA,UAAT,QAA2B,iCAA3B;AAEA,OAAOC,UAAP,MAAuB,aAAvB;AAEA,MAAMC,aAAa,GAAG;AACpBC,EAAAA,IAAI,EAAE,gBADc;;AAEpBC,EAAAA,OAAO,GAAG;AACR,SAAKC,wBAAL,CAA8BC,IAA9B,CAAmC,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAAnC;AACD,GAJmB;;AAKpBD,EAAAA,cAAc,CAACE,KAAD,EAAgBJ,wBAAhB,EAAsD;AAClE,QAAIK,QAAa,GAAG,EAApB;;AACA,QAAID,KAAJ,EAAW;AACT,YAAME,EAAE,GAAGV,UAAU,EAArB;AACA,YAAMW,IAAI,GAAGD,EAAE,CAACE,MAAH,CAAUJ,KAAV,CAAb;AACAC,MAAAA,QAAQ,GAAGV,UAAU,CAACY,IAAD,CAArB;AACD;;AAED,UAAME,aAAa,GAAGT,wBAAwB,CAACU,KAAzB,EAAtB;AACA,QAAGD,aAAH,EAAkBA,aAAa,CAACJ,QAAD,EAAWL,wBAAX,CAAb;AACnB;;AAfmB,CAAtB;AAkBA,SACEH,aADF","sourcesContent":["import { unsafeHTML } from 'lit-html/directives/unsafe-html';\n\nimport markdownit from 'markdown-it';\n\nconst MarkdownMixin = {\n name: 'markdown-mixin',\n created() {\n this.listValueTransformations.push(this.transformValue.bind(this));\n },\n transformValue(value: string, listValueTransformations: Function[]) {\n let newValue: any = '';\n if (value) {\n const md = markdownit();\n const html = md.render(value);\n newValue = unsafeHTML(html);\n }\n\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(newValue, listValueTransformations);\n }\n}\n\nexport {\n MarkdownMixin\n}"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { unsafeHTML } from '../../_snowpack/pkg/lit-html/directives/unsafe-html.js';
|
|
2
|
+
const MultilineMixin = {
|
|
3
|
+
name: 'multiline-mixin',
|
|
4
|
+
|
|
5
|
+
created() {
|
|
6
|
+
this.listValueTransformations.push(this.transformValue.bind(this));
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
transformValue(value, listValueTransformations) {
|
|
10
|
+
const newValue = value ? unsafeHTML(value.replace(/\n/g, "<br/>")) : value;
|
|
11
|
+
const nextProcessor = listValueTransformations.shift();
|
|
12
|
+
if (nextProcessor) nextProcessor(newValue, listValueTransformations);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
};
|
|
16
|
+
export { MultilineMixin };
|
|
17
|
+
//# sourceMappingURL=multilineMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["multilineMixin.ts"],"names":["unsafeHTML","MultilineMixin","name","created","listValueTransformations","push","transformValue","bind","value","newValue","replace","nextProcessor","shift"],"mappings":"AAAA,SAASA,UAAT,QAA2B,iCAA3B;AAEA,MAAMC,cAAc,GAAG;AACrBC,EAAAA,IAAI,EAAE,iBADe;;AAErBC,EAAAA,OAAO,GAAG;AACR,SAAKC,wBAAL,CAA8BC,IAA9B,CAAmC,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAAnC;AACD,GAJoB;;AAKrBD,EAAAA,cAAc,CAACE,KAAD,EAAgBJ,wBAAhB,EAAsD;AAClE,UAAMK,QAAQ,GAAGD,KAAK,GAAGR,UAAU,CAACQ,KAAK,CAACE,OAAN,CAAc,KAAd,EAAqB,OAArB,CAAD,CAAb,GAA+CF,KAArE;AAEA,UAAMG,aAAa,GAAGP,wBAAwB,CAACQ,KAAzB,EAAtB;AACA,QAAGD,aAAH,EAAkBA,aAAa,CAACF,QAAD,EAAWL,wBAAX,CAAb;AACnB;;AAVoB,CAAvB;AAaA,SACEH,cADF","sourcesContent":["import { unsafeHTML } from 'lit-html/directives/unsafe-html';\n\nconst MultilineMixin = {\n name: 'multiline-mixin',\n created() {\n this.listValueTransformations.push(this.transformValue.bind(this));\n },\n transformValue(value: string, listValueTransformations: Function[]) {\n const newValue = value ? unsafeHTML(value.replace(/\\n/g, \"<br/>\")) : value;\n\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(newValue, listValueTransformations);\n }\n}\n\nexport {\n MultilineMixin\n}"]}
|