@startinblox/core 0.19.0-beta.2 → 0.19.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css → assets/MarkerCluster-614dea0a.css} +0 -0
- package/dist/{_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css → assets/MarkerCluster.Default-61258232.css} +0 -0
- package/dist/assets/en-e53105c5.js +14 -0
- package/dist/assets/en-e53105c5.js.map +1 -0
- package/dist/assets/fr-a7fcdb64.js +14 -0
- package/dist/assets/fr-a7fcdb64.js.map +1 -0
- package/dist/{_snowpack/pkg/fusejs.js → assets/helpers-411e08e4.js} +499 -454
- package/dist/assets/helpers-411e08e4.js.map +1 -0
- package/dist/{_snowpack/pkg/leaflet/dist/leaflet.css → assets/leaflet-3c081932.css} +3 -3
- package/dist/helpers.js +22 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.js +54873 -48
- package/dist/index.js.map +1 -0
- package/package.json +7 -22
- package/dist/_snowpack/pkg/autolinker.js +0 -4429
- package/dist/_snowpack/pkg/autolinker.js.map +0 -1
- package/dist/_snowpack/pkg/common/_baseUnary-d2677655.js +0 -353
- package/dist/_snowpack/pkg/common/_baseUnary-d2677655.js.map +0 -1
- package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js +0 -26
- package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js.map +0 -1
- package/dist/_snowpack/pkg/common/decode-26fbf385.js +0 -185
- package/dist/_snowpack/pkg/common/decode-26fbf385.js.map +0 -1
- package/dist/_snowpack/pkg/common/lit-html-3647afce.js +0 -1104
- package/dist/_snowpack/pkg/common/lit-html-3647afce.js.map +0 -1
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js +0 -26198
- package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +0 -1
- package/dist/_snowpack/pkg/dialog-polyfill.js +0 -826
- package/dist/_snowpack/pkg/dialog-polyfill.js.map +0 -1
- package/dist/_snowpack/pkg/fusejs.js.map +0 -1
- package/dist/_snowpack/pkg/import-map.json +0 -25
- package/dist/_snowpack/pkg/jsonld-context-parser.js +0 -836
- package/dist/_snowpack/pkg/jsonld-context-parser.js.map +0 -1
- package/dist/_snowpack/pkg/jsonld.js +0 -11760
- package/dist/_snowpack/pkg/jsonld.js.map +0 -1
- package/dist/_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +0 -39
- package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +0 -1
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +0 -48
- package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +0 -1
- package/dist/_snowpack/pkg/lit-html/directives/until.js +0 -87
- package/dist/_snowpack/pkg/lit-html/directives/until.js.map +0 -1
- package/dist/_snowpack/pkg/lit-html.js +0 -94
- package/dist/_snowpack/pkg/lit-html.js.map +0 -1
- package/dist/_snowpack/pkg/markdown-it-link-attributes.js +0 -68
- package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map +0 -1
- package/dist/_snowpack/pkg/markdown-it.js +0 -11307
- package/dist/_snowpack/pkg/markdown-it.js.map +0 -1
- package/dist/_snowpack/pkg/quill/dist/quill.snow.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js +0 -971
- package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +0 -1
- package/dist/_snowpack/pkg/quill.js +0 -14441
- package/dist/_snowpack/pkg/quill.js.map +0 -1
- package/dist/_snowpack/pkg/slim-select.js +0 -714
- package/dist/_snowpack/pkg/slim-select.js.map +0 -1
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +0 -1149
- package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +0 -10
- package/dist/_snowpack/pkg/tui-calendar.js +0 -46503
- package/dist/_snowpack/pkg/tui-calendar.js.map +0 -1
- package/dist/components/solid-ac-checker.js +0 -45
- package/dist/components/solid-calendar.js +0 -66
- package/dist/components/solid-delete.js +0 -96
- package/dist/components/solid-display.js +0 -150
- package/dist/components/solid-form-search.js +0 -173
- package/dist/components/solid-form.js +0 -257
- package/dist/components/solid-lang.js +0 -35
- package/dist/components/solid-map.js +0 -204
- package/dist/components/solid-table.js +0 -181
- package/dist/components/solid-widget.js +0 -72
- package/dist/import.css +0 -4
- package/dist/libs/Component.js +0 -13
- package/dist/libs/ComponentFactory.js +0 -165
- package/dist/libs/Compositor.js +0 -96
- package/dist/libs/Sib.js +0 -44
- package/dist/libs/filter.js +0 -184
- package/dist/libs/helpers.js +0 -185
- package/dist/libs/interfaces.js +0 -6
- package/dist/libs/lit-helpers.js +0 -139
- package/dist/libs/polyfills.js +0 -35
- package/dist/libs/store/custom-getter.js +0 -313
- package/dist/libs/store/server-pagination.js +0 -19
- package/dist/libs/store/server-search.js +0 -32
- package/dist/libs/store/store.js +0 -560
- package/dist/locales/en.json +0 -10
- package/dist/locales/en.json.proxy.js +0 -2
- package/dist/locales/fr.json +0 -10
- package/dist/locales/fr.json.proxy.js +0 -2
- package/dist/mixins/attributeBinderMixin.js +0 -113
- package/dist/mixins/contextMixin.js +0 -26
- package/dist/mixins/counterMixin.js +0 -54
- package/dist/mixins/federationMixin.js +0 -57
- package/dist/mixins/filterMixin.js +0 -152
- package/dist/mixins/grouperMixin.js +0 -73
- package/dist/mixins/highlighterMixin.js +0 -36
- package/dist/mixins/interfaces.js +0 -6
- package/dist/mixins/listMixin.js +0 -116
- package/dist/mixins/nextMixin.js +0 -23
- package/dist/mixins/paginateMixin.js +0 -97
- package/dist/mixins/requiredMixin.js +0 -38
- package/dist/mixins/serverPaginationMixin.js +0 -122
- package/dist/mixins/sorterMixin.js +0 -131
- package/dist/mixins/storeMixin.js +0 -139
- package/dist/mixins/translationMixin.js +0 -58
- package/dist/mixins/validationMixin.js +0 -95
- package/dist/mixins/widgetMixin.js +0 -364
- package/dist/new-widgets/attributeMixins/actionMixin.js +0 -13
- package/dist/new-widgets/attributeMixins/blankMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/booleanMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/index.js +0 -19
- package/dist/new-widgets/attributeMixins/mailtoMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/multipleMixin.js +0 -27
- package/dist/new-widgets/attributeMixins/numberMixin.js +0 -7
- package/dist/new-widgets/attributeMixins/placeholderMixin.js +0 -16
- package/dist/new-widgets/attributeMixins/telMixin.js +0 -7
- package/dist/new-widgets/baseWidgetMixin.js +0 -109
- package/dist/new-widgets/callbackMixins/autocompletionMixin.js +0 -96
- package/dist/new-widgets/callbackMixins/index.js +0 -7
- package/dist/new-widgets/callbackMixins/richtextMixin.js +0 -37
- package/dist/new-widgets/callbackMixins/slimselect.css.proxy.js +0 -10
- package/dist/new-widgets/interfaces.js +0 -1
- package/dist/new-widgets/new-widget-factory.js +0 -91
- package/dist/new-widgets/templateAdditionMixins/addableMixin.js +0 -26
- package/dist/new-widgets/templateAdditionMixins/index.js +0 -13
- package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +0 -16
- package/dist/new-widgets/templateAdditionMixins/labelMixin.js +0 -18
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js +0 -29
- package/dist/new-widgets/templates/displayTemplatesDirectory.js +0 -54
- package/dist/new-widgets/templates/formTemplatesDirectory.js +0 -423
- package/dist/new-widgets/templates/groupTemplatesDirectory.js +0 -11
- package/dist/new-widgets/templates/index.js +0 -6
- package/dist/new-widgets/templates/setTemplatesDirectory.js +0 -16
- package/dist/new-widgets/templatesDependencies/altMixin.js +0 -12
- package/dist/new-widgets/templatesDependencies/editableMixin.js +0 -60
- package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +0 -34
- package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +0 -10
- package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +0 -41
- package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +0 -59
- package/dist/new-widgets/templatesDependencies/formFileMixin.js +0 -82
- package/dist/new-widgets/templatesDependencies/formLengthMixin.js +0 -18
- package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +0 -18
- package/dist/new-widgets/templatesDependencies/formMixin.js +0 -56
- package/dist/new-widgets/templatesDependencies/formNumberMixin.js +0 -10
- package/dist/new-widgets/templatesDependencies/formRadioMixin.js +0 -12
- package/dist/new-widgets/templatesDependencies/formStepMixin.js +0 -12
- package/dist/new-widgets/templatesDependencies/linkTextMixin.js +0 -13
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +0 -125
- package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +0 -74
- package/dist/new-widgets/templatesDependencies/patternMixin.js +0 -18
- package/dist/new-widgets/templatesDependencies/rangeMixin.js +0 -100
- package/dist/new-widgets/templatesDependencies/setMixin.js +0 -9
- package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +0 -9
- package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +0 -14
- package/dist/new-widgets/valueTransformationMixins/dateMixin.js +0 -29
- package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +0 -12
- package/dist/new-widgets/valueTransformationMixins/index.js +0 -15
- package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +0 -30
- package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +0 -13
- package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +0 -21
- package/dist/solid-template-element.js +0 -144
- package/dist/style/default-theme.css.proxy.js +0 -10
- package/dist/widgets/baseWidget.js +0 -267
- package/dist/widgets/widget-factory.js +0 -20
- /package/dist/{style/default-theme.css → assets/default-theme-d0f20a8a.css} +0 -0
- /package/dist/{_snowpack/pkg/quill/dist/quill.snow.css → assets/quill.snow-8f222e44.css} +0 -0
- /package/dist/{new-widgets/callbackMixins/slimselect.css → assets/slimselect-43e3ebc8.css} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AutocompletionMixin } from './autocompletionMixin.js';
|
|
2
|
-
import { RichtextMixin } from './richtextMixin.js';
|
|
3
|
-
const callbackDirectory = {
|
|
4
|
-
autocompletion: AutocompletionMixin,
|
|
5
|
-
richtext: RichtextMixin
|
|
6
|
-
};
|
|
7
|
-
export { callbackDirectory, AutocompletionMixin, RichtextMixin };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import Quill from '../../_snowpack/pkg/quill.js';
|
|
2
|
-
import deltaMd from '../../_snowpack/pkg/delta-markdown-for-quill.js';
|
|
3
|
-
const RichtextMixin = {
|
|
4
|
-
name: 'richtext-mixin',
|
|
5
|
-
initialState: {
|
|
6
|
-
quill: null
|
|
7
|
-
},
|
|
8
|
-
created() {
|
|
9
|
-
//@ts-ignore
|
|
10
|
-
import("../../_snowpack/pkg/quill/dist/quill.snow.css.proxy.js");
|
|
11
|
-
this.quill = null;
|
|
12
|
-
this.listCallbacks.push(this.addCallback.bind(this));
|
|
13
|
-
},
|
|
14
|
-
addCallback(value, listCallbacks) {
|
|
15
|
-
if (this.quill == null) {
|
|
16
|
-
var toolbarOptions = [['bold', 'italic'], ['blockquote'], [{
|
|
17
|
-
'header': [1, 2, 3, 4, 5, 6, false]
|
|
18
|
-
}], [{
|
|
19
|
-
'list': 'ordered'
|
|
20
|
-
}, {
|
|
21
|
-
'list': 'bullet'
|
|
22
|
-
}], ['link'], ['clean']];
|
|
23
|
-
const richtext = this.element.querySelector('[data-richtext]');
|
|
24
|
-
this.quill = new Quill(richtext, {
|
|
25
|
-
modules: {
|
|
26
|
-
toolbar: toolbarOptions
|
|
27
|
-
},
|
|
28
|
-
theme: 'snow'
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
const ops = deltaMd.toDelta(this.value);
|
|
32
|
-
this.quill.setContents(ops);
|
|
33
|
-
const nextProcessor = listCallbacks.shift();
|
|
34
|
-
if (nextProcessor) nextProcessor(value, listCallbacks);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
export { RichtextMixin };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// [snowpack] add styles to the page (skip if no document exists)
|
|
2
|
-
if (typeof document !== 'undefined') {
|
|
3
|
-
const code = ".ss-main{position:relative;display:inline-block;user-select:none;color:#666;width:100%}.ss-main .ss-single-selected{display:flex;cursor:pointer;width:100%;height:30px;padding:6px;border:1px solid #dcdee2;border-radius:4px;background-color:#fff;outline:0;box-sizing:border-box;transition:background-color .2s}.ss-main .ss-single-selected.ss-disabled{background-color:#dcdee2;cursor:not-allowed}.ss-main .ss-single-selected.ss-open-above{border-top-left-radius:0px;border-top-right-radius:0px}.ss-main .ss-single-selected.ss-open-below{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.ss-main .ss-single-selected .placeholder{display:flex;flex:1 1 100%;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;width:calc(100% - 30px);line-height:1em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ss-main .ss-single-selected .placeholder *{display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:auto}.ss-main .ss-single-selected .placeholder .ss-disabled{color:#dedede}.ss-main .ss-single-selected .ss-deselect{display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;margin:0 6px 0 6px;font-weight:bold}.ss-main .ss-single-selected .ss-deselect.ss-hide{display:none}.ss-main .ss-single-selected .ss-arrow{display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;margin:0 6px 0 6px}.ss-main .ss-single-selected .ss-arrow span{border:solid #666;border-width:0 2px 2px 0;display:inline-block;padding:3px;transition:transform .2s, margin .2s}.ss-main .ss-single-selected .ss-arrow span.arrow-up{transform:rotate(-135deg);margin:3px 0 0 0}.ss-main .ss-single-selected .ss-arrow span.arrow-down{transform:rotate(45deg);margin:-3px 0 0 0}.ss-main .ss-multi-selected{display:flex;flex-direction:row;cursor:pointer;min-height:30px;width:100%;padding:0 0 0 3px;border:1px solid #dcdee2;border-radius:4px;background-color:#fff;outline:0;box-sizing:border-box;transition:background-color .2s}.ss-main .ss-multi-selected.ss-disabled{background-color:#dcdee2;cursor:not-allowed}.ss-main .ss-multi-selected.ss-disabled .ss-values .ss-disabled{color:#666}.ss-main .ss-multi-selected.ss-disabled .ss-values .ss-value .ss-value-delete{cursor:not-allowed}.ss-main .ss-multi-selected.ss-open-above{border-top-left-radius:0px;border-top-right-radius:0px}.ss-main .ss-multi-selected.ss-open-below{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.ss-main .ss-multi-selected .ss-values{display:flex;flex-wrap:wrap;justify-content:flex-start;flex:1 1 100%;width:calc(100% - 30px)}.ss-main .ss-multi-selected .ss-values .ss-disabled{display:flex;padding:4px 5px;margin:2px 0px;line-height:1em;align-items:center;width:100%;color:#dedede;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes scaleIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes scaleOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.ss-main .ss-multi-selected .ss-values .ss-value{display:flex;user-select:none;align-items:center;font-size:12px;padding:3px 5px;margin:3px 5px 3px 0px;color:#fff;background-color:#5897fb;border-radius:4px;animation-name:scaleIn;animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:both}.ss-main .ss-multi-selected .ss-values .ss-value.ss-out{animation-name:scaleOut;animation-duration:.2s;animation-timing-function:ease-out}.ss-main .ss-multi-selected .ss-values .ss-value .ss-value-delete{margin:0 0 0 5px;cursor:pointer}.ss-main .ss-multi-selected .ss-add{display:flex;flex:0 1 3px;margin:9px 12px 0 5px}.ss-main .ss-multi-selected .ss-add .ss-plus{display:flex;justify-content:center;align-items:center;background:#666;position:relative;height:10px;width:2px;transition:transform .2s}.ss-main .ss-multi-selected .ss-add .ss-plus:after{background:#666;content:\"\";position:absolute;height:2px;width:10px;left:-4px;top:4px}.ss-main .ss-multi-selected .ss-add .ss-plus.ss-cross{transform:rotate(45deg)}.ss-content{position:absolute;width:100%;margin:-1px 0 0 0;box-sizing:border-box;border:solid 1px #dcdee2;z-index:1010;background-color:#fff;transform-origin:center top;transition:transform .2s, opacity .2s;opacity:0;transform:scaleY(0)}.ss-content.ss-open{display:block;opacity:1;transform:scaleY(1)}.ss-content .ss-search{display:flex;flex-direction:row;padding:8px 8px 6px 8px}.ss-content .ss-search.ss-hide{height:0px;opacity:0;padding:0px 0px 0px 0px;margin:0px 0px 0px 0px}.ss-content .ss-search.ss-hide input{height:0px;opacity:0;padding:0px 0px 0px 0px;margin:0px 0px 0px 0px}.ss-content .ss-search input{display:inline-flex;font-size:inherit;line-height:inherit;flex:1 1 auto;width:100%;min-width:0px;height:30px;padding:6px 8px;margin:0;border:1px solid #dcdee2;border-radius:4px;background-color:#fff;outline:0;text-align:left;box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-appearance:textfield}.ss-content .ss-search input::placeholder{color:#8a8a8a;vertical-align:middle}.ss-content .ss-search input:focus{box-shadow:0 0 5px #5897fb}.ss-content .ss-search .ss-addable{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;font-size:22px;font-weight:bold;flex:0 0 30px;height:30px;margin:0 0 0 8px;border:1px solid #dcdee2;border-radius:4px;box-sizing:border-box}.ss-content .ss-addable{padding-top:0px}.ss-content .ss-list{max-height:200px;overflow-x:hidden;overflow-y:auto;text-align:left}.ss-content .ss-list .ss-optgroup .ss-optgroup-label{padding:6px 10px 6px 10px;font-weight:bold}.ss-content .ss-list .ss-optgroup .ss-option{padding:6px 6px 6px 25px}.ss-content .ss-list .ss-optgroup-label-selectable{cursor:pointer}.ss-content .ss-list .ss-optgroup-label-selectable:hover{color:#fff;background-color:#5897fb}.ss-content .ss-list .ss-option{padding:6px 10px 6px 10px;cursor:pointer;user-select:none}.ss-content .ss-list .ss-option *{display:inline-block}.ss-content .ss-list .ss-option:hover,.ss-content .ss-list .ss-option.ss-highlighted{color:#fff;background-color:#5897fb}.ss-content .ss-list .ss-option.ss-disabled{cursor:not-allowed;color:#dedede;background-color:#fff}.ss-content .ss-list .ss-option:not(.ss-disabled).ss-option-selected{color:#666;background-color:rgba(88,151,251,0.1)}.ss-content .ss-list .ss-option.ss-hide{display:none}.ss-content .ss-list .ss-option .ss-search-highlight{background-color:#fffb8c}\n\n";
|
|
4
|
-
|
|
5
|
-
const styleEl = document.createElement("style");
|
|
6
|
-
const codeEl = document.createTextNode(code);
|
|
7
|
-
styleEl.type = 'text/css';
|
|
8
|
-
styleEl.appendChild(codeEl);
|
|
9
|
-
document.head.appendChild(styleEl);
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Sib } from '../libs/Sib.js';
|
|
2
|
-
import { BaseWidgetMixin } from './baseWidgetMixin.js';
|
|
3
|
-
import { defaultTemplates, displayTemplates, formTemplates, setTemplates, groupTemplates } from './templates/index.js';
|
|
4
|
-
import { valueTransformationDirectory } from './valueTransformationMixins/index.js';
|
|
5
|
-
import { templateAdditionDirectory } from './templateAdditionMixins/index.js';
|
|
6
|
-
import { attributeDirectory } from './attributeMixins/index.js';
|
|
7
|
-
import { callbackDirectory } from './callbackMixins/index.js';
|
|
8
|
-
const valueTransformationKeys = Object.keys(valueTransformationDirectory);
|
|
9
|
-
const attributeKeys = Object.keys(attributeDirectory);
|
|
10
|
-
const templateAdditionKeys = Object.keys(templateAdditionDirectory);
|
|
11
|
-
const callbackKeys = Object.keys(callbackDirectory);
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Create and register a widget based on its tagName
|
|
15
|
-
* @param tagName - string
|
|
16
|
-
*/
|
|
17
|
-
export const newWidgetFactory = tagName => {
|
|
18
|
-
let widgetMixins;
|
|
19
|
-
try {
|
|
20
|
-
widgetMixins = getWidgetMixins(tagName);
|
|
21
|
-
} // get mixins and template
|
|
22
|
-
catch (e) {
|
|
23
|
-
console.error(e);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const newWidget = {
|
|
27
|
-
// compose widget
|
|
28
|
-
name: tagName,
|
|
29
|
-
use: [...widgetMixins.mixins, BaseWidgetMixin // at the end so created() is called first
|
|
30
|
-
],
|
|
31
|
-
|
|
32
|
-
get template() {
|
|
33
|
-
return widgetMixins.templateMixin.template;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
Sib.register(newWidget); // and register component
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Returns mixins and the template of a widget, depending of its tagName
|
|
41
|
-
* @param tagName - string
|
|
42
|
-
*/
|
|
43
|
-
function getWidgetMixins(tagName) {
|
|
44
|
-
const valueTransformations = [];
|
|
45
|
-
const attributes = [];
|
|
46
|
-
const templateAdditions = [];
|
|
47
|
-
const callbacks = [];
|
|
48
|
-
let template = null;
|
|
49
|
-
|
|
50
|
-
// decompose widget name
|
|
51
|
-
const mixinNames = tagName.split('-').filter(t => t !== 'solid');
|
|
52
|
-
|
|
53
|
-
// choose widget type (default or set)
|
|
54
|
-
let widgetType = defaultTemplates;
|
|
55
|
-
if (mixinNames.includes('display')) widgetType = displayTemplates;else if (mixinNames.includes('form')) widgetType = formTemplates;else if (mixinNames.includes('set')) widgetType = setTemplates;else if (mixinNames.includes('group')) widgetType = groupTemplates;
|
|
56
|
-
const templateKeys = Object.keys(widgetType);
|
|
57
|
-
|
|
58
|
-
// build mixins array
|
|
59
|
-
for (const mixin of mixinNames) {
|
|
60
|
-
// features
|
|
61
|
-
if (valueTransformationKeys.includes(mixin)) {
|
|
62
|
-
valueTransformations.push(valueTransformationDirectory[mixin]);
|
|
63
|
-
}
|
|
64
|
-
if (attributeKeys.includes(mixin)) {
|
|
65
|
-
attributes.push(attributeDirectory[mixin]);
|
|
66
|
-
}
|
|
67
|
-
if (templateAdditionKeys.includes(mixin)) {
|
|
68
|
-
templateAdditions.push(templateAdditionDirectory[mixin]);
|
|
69
|
-
}
|
|
70
|
-
if (callbackKeys.includes(mixin)) {
|
|
71
|
-
callbacks.push(callbackDirectory[mixin]);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// template
|
|
75
|
-
if (templateKeys.includes(mixin)) {
|
|
76
|
-
template = widgetType[mixin];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (!template) throw `No template found for widget "${tagName}"`;
|
|
80
|
-
return {
|
|
81
|
-
templateMixin: template,
|
|
82
|
-
mixins: [...valueTransformations, ...attributes, ...templateAdditions, ...(template.dependencies || []), ...callbacks]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// create default widgets
|
|
87
|
-
newWidgetFactory('solid-form-dropdown');
|
|
88
|
-
newWidgetFactory('solid-form-multicheckbox');
|
|
89
|
-
newWidgetFactory('solid-form-file-label');
|
|
90
|
-
newWidgetFactory('solid-action');
|
|
91
|
-
newWidgetFactory('solid-group-default');
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { spread } from '../../libs/lit-helpers.js';
|
|
2
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
3
|
-
const AddableMixin = {
|
|
4
|
-
name: 'addable-mixin',
|
|
5
|
-
created() {
|
|
6
|
-
this.listTemplateAdditions.push(this.addableValue.bind(this));
|
|
7
|
-
},
|
|
8
|
-
getAddableAttributes() {
|
|
9
|
-
const addableAttr = Array.from(this.element.attributes).filter(a => a.name.startsWith('addable-'));
|
|
10
|
-
const cleanAddableAttr = {};
|
|
11
|
-
for (let attr of addableAttr) cleanAddableAttr[attr.name.replace('addable-', '')] = attr.value;
|
|
12
|
-
if (!cleanAddableAttr.hasOwnProperty('data-src')) cleanAddableAttr['data-src'] = this.range;
|
|
13
|
-
return cleanAddableAttr;
|
|
14
|
-
},
|
|
15
|
-
addableValue(template, listTemplateAdditions, attributes) {
|
|
16
|
-
const addables = this.getAddableAttributes(attributes);
|
|
17
|
-
const newTemplate = html`
|
|
18
|
-
${template}
|
|
19
|
-
<solid-form ...=${spread(addables)}>
|
|
20
|
-
</solid-form>
|
|
21
|
-
`;
|
|
22
|
-
const nextProcessor = listTemplateAdditions.shift();
|
|
23
|
-
if (nextProcessor) nextProcessor(newTemplate, listTemplateAdditions);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
export { AddableMixin };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LabelMixin } from './labelMixin.js';
|
|
2
|
-
import { LabelLastMixin } from './labelLastMixin.js';
|
|
3
|
-
import { AddableMixin } from './addableMixin.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* DOM Additions
|
|
7
|
-
*/
|
|
8
|
-
const templateAdditionDirectory = {
|
|
9
|
-
label: LabelMixin,
|
|
10
|
-
labellast: LabelLastMixin,
|
|
11
|
-
addable: AddableMixin
|
|
12
|
-
};
|
|
13
|
-
export { templateAdditionDirectory, LabelMixin, LabelLastMixin, AddableMixin };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
2
|
-
const LabelLastMixin = {
|
|
3
|
-
name: 'label-last-mixin',
|
|
4
|
-
created() {
|
|
5
|
-
this.listTemplateAdditions.push(this.addLabelLast.bind(this));
|
|
6
|
-
},
|
|
7
|
-
addLabelLast(template, listTemplateAdditions) {
|
|
8
|
-
const newTemplate = html`
|
|
9
|
-
${template}
|
|
10
|
-
<label>${this.label || this.name}</label>
|
|
11
|
-
`;
|
|
12
|
-
const nextProcessor = listTemplateAdditions.shift();
|
|
13
|
-
if (nextProcessor) nextProcessor(newTemplate, listTemplateAdditions);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
export { LabelLastMixin };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
2
|
-
import { uniqID } from '../../libs/helpers.js';
|
|
3
|
-
const LabelMixin = {
|
|
4
|
-
name: 'label-mixin',
|
|
5
|
-
created() {
|
|
6
|
-
this.listAttributes['id'] = uniqID();
|
|
7
|
-
this.listTemplateAdditions.push(this.addLabel.bind(this));
|
|
8
|
-
},
|
|
9
|
-
addLabel(template, listTemplateAdditions) {
|
|
10
|
-
const newTemplate = html`
|
|
11
|
-
<label for="${this.listAttributes['id']}">${this.label || this.name}</label>
|
|
12
|
-
${template}
|
|
13
|
-
`;
|
|
14
|
-
const nextProcessor = listTemplateAdditions.shift();
|
|
15
|
-
if (nextProcessor) nextProcessor(newTemplate, listTemplateAdditions);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export { LabelMixin };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
2
|
-
import { ifDefined } from '../../_snowpack/pkg/lit-html/directives/if-defined.js';
|
|
3
|
-
import { LinkTextMixin } from '../templatesDependencies/linkTextMixin.js';
|
|
4
|
-
export const defaultTemplates = {
|
|
5
|
-
action: {
|
|
6
|
-
template: (value, attributes) => html`
|
|
7
|
-
<solid-link
|
|
8
|
-
data-src=${ifDefined(attributes.src)}
|
|
9
|
-
next=${ifDefined(value)}
|
|
10
|
-
id=${ifDefined(attributes.id)}
|
|
11
|
-
link-text=${ifDefined(attributes.linkText)}
|
|
12
|
-
>
|
|
13
|
-
${attributes.linkText == null ? attributes.name || '' : attributes.linkText}
|
|
14
|
-
</solid-link>
|
|
15
|
-
`,
|
|
16
|
-
dependencies: [LinkTextMixin]
|
|
17
|
-
},
|
|
18
|
-
multiple: {
|
|
19
|
-
template: (value, attributes) => html`
|
|
20
|
-
<solid-display
|
|
21
|
-
data-src=${value || ''}
|
|
22
|
-
fields=${ifDefined(attributes.fields)}
|
|
23
|
-
next=${ifDefined(attributes.next)}
|
|
24
|
-
empty-widget=${ifDefined(attributes.emptyWidget)}
|
|
25
|
-
></solid-display>
|
|
26
|
-
`,
|
|
27
|
-
dependencies: []
|
|
28
|
-
}
|
|
29
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { EditableMixin } from '../templatesDependencies/editableMixin.js';
|
|
2
|
-
import { AltMixin } from '../templatesDependencies/altMixin.js';
|
|
3
|
-
import { LinkTextMixin } from '../templatesDependencies/linkTextMixin.js';
|
|
4
|
-
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
5
|
-
import { ifDefined } from '../../_snowpack/pkg/lit-html/directives/if-defined.js';
|
|
6
|
-
export const displayTemplates = {
|
|
7
|
-
value: {
|
|
8
|
-
template: value => html`${value}`,
|
|
9
|
-
dependencies: []
|
|
10
|
-
},
|
|
11
|
-
div: {
|
|
12
|
-
template: (value, attributes) => html`
|
|
13
|
-
<div
|
|
14
|
-
name=${ifDefined(attributes.name)}
|
|
15
|
-
?data-editable=${attributes.editable}
|
|
16
|
-
>
|
|
17
|
-
${value}
|
|
18
|
-
</div>
|
|
19
|
-
`,
|
|
20
|
-
dependencies: [EditableMixin]
|
|
21
|
-
},
|
|
22
|
-
link: {
|
|
23
|
-
template: (value, attributes) => html`
|
|
24
|
-
<a
|
|
25
|
-
name=${ifDefined(attributes.name)}
|
|
26
|
-
href=${(attributes.mailto || attributes.tel || '') + (value || '#')}
|
|
27
|
-
target=${ifDefined(attributes.target)}
|
|
28
|
-
?data-editable=${attributes.editable}
|
|
29
|
-
id=${ifDefined(attributes.id)}
|
|
30
|
-
link-text=${ifDefined(attributes.linkText)}
|
|
31
|
-
>
|
|
32
|
-
${attributes.linkText || value || ''}
|
|
33
|
-
</a>
|
|
34
|
-
`,
|
|
35
|
-
dependencies: [EditableMixin, LinkTextMixin]
|
|
36
|
-
},
|
|
37
|
-
img: {
|
|
38
|
-
template: (value, attributes) => html`
|
|
39
|
-
<img
|
|
40
|
-
name=${ifDefined(attributes.name)}
|
|
41
|
-
src=${ifDefined(value)}
|
|
42
|
-
alt=${ifDefined(attributes.alt)}
|
|
43
|
-
style="max-width: 100%; max-height: 100%;"
|
|
44
|
-
/>
|
|
45
|
-
`,
|
|
46
|
-
dependencies: [AltMixin]
|
|
47
|
-
},
|
|
48
|
-
boolean: {
|
|
49
|
-
template: (value, attributes) => html`
|
|
50
|
-
${value === 'true' ? html`<label>${attributes.label || attributes.name || ''}</label>` : ''}
|
|
51
|
-
`,
|
|
52
|
-
dependencies: []
|
|
53
|
-
}
|
|
54
|
-
};
|