minor: Implement core 0.10

This commit is contained in:
Jean-Baptiste Pasquier
2020-06-18 20:02:54 +02:00
parent 772c65dfe1
commit 2ae8db7429
61 changed files with 439 additions and 534 deletions

View File

@ -0,0 +1,39 @@
import { store } from 'https://unpkg.com/@startinblox/core@0.10';
import { Sib } from "https://unpkg.com/@startinblox/core@0.10/dist/libs/Sib.js";
import { StoreMixin } from "https://unpkg.com/@startinblox/core@0.10/dist/mixins/storeMixin.js";
export const HublReactivity = {
name: 'hubl-reactivity',
use: [StoreMixin],
attributes: {
targetSrc: {
type: String,
default: '',
callback: function () {
this.subscribe();
}
},
dataSrc: {
type: String,
default: '',
callback: async function (value) {
this.resourceId = null;
if (this.nestedField) {
const resource = store.get(value) || await store.getData(value, this.context);
const nestedResource = await resource[this.nestedField]
this.resourceId = nestedResource ? nestedResource['@id'] : null;
} else {
this.resourceId = value;
}
this.subscribe();
}
},
},
subscribe() {
if (this.resourceId && this.targetSrc) {
store.subscribeVirtualContainerTo(this.resourceId, this.targetSrc);
}
}
}
Sib.register(HublReactivity);

View File

@ -1,4 +1,4 @@
import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.9/dist/widgets/widget-factory.js';
import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.10/dist/widgets/widget-factory.js';
const HublSearchUsers = widgetFactory(
'hubl-search-users',

View File

@ -1,5 +1,5 @@
import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.9/dist/widgets/widget-factory.js';
import { importCSS } from 'https://unpkg.com/@startinblox/core@0.9/dist/libs/helpers.js';
import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.10/dist/widgets/widget-factory.js';
import { importCSS } from 'https://unpkg.com/@startinblox/core@0.10/dist/libs/helpers.js';
import SlimSelect from 'https://dev.jspm.io/slim-select@1.23';
const HublStatus = widgetFactory(