j-Dashboard
- Wsparcie urządzeń mobilnych
- Wsparcie dotykowe
- ruchomych
- Zdradza
- Odtwarzacze
Składnik oczekuje Array przedmiotów.
Konfiguracja:
axisX {Number}wielkość siatki osi X (default:12)axisY {Number}wielkość siatki osi Y (default:144)padding {Number}wskaźnik między widgetami (default:10)delay {Number}Opóźnienie w pracy (default)200)serviceinterval {Number}- czas trwania obsługi (default:5000)- Ścieżka
ondrop {String}do metodyfunction(meta) {}jest wykonywana, jeśli ktoś wkłada jakiś element do obszarumeta.xX pozycja siecimeta.yi pozycja siecimeta.elelementy wyciągniętemeta.pageXmeta.pageYmeta.offsetXmeta.offsetYmeta.targetmeta.dw trybie wyświetlaniaxs,sm,mdlublg
noemitresizewyklucza wykonywanie metodyresizewe wszystkich składnikach (default:false)parent {String}to rodzinny pojemnik, który ustala minimalną wysokość (default:null)margin {Number}jest górną/główną marżą dla opcjiparent(default:0)minsizexs {Number}- minimalny rozmiar kolumny/rowy dla dodatkowych małych wyświetlaczy (default:2)minsizesm {Number}- minimalny rozmiar kolumny/rowy dla małych wyświetlaczy (default:2)minsizemd {Number}- minimalny rozmiar kolumny/rowy dla wyświetlaczy mediun (default:1)minsizelg {Number}- minimalny rozmiar kolumny / rury dla dużych wyświetlaczy (default:1)- Ikony
iconsettings {String} iconremove {String}usuwa ikonęchange {String}jest ścieżką do metodyfunction(type, id)(wykonany, jeśli płyta wykrywa zmianęmovelubremove)- Styl animacji
animation {Number}:1nieprawidłowość2Skala od dużej do normalnej3Skala od małej do normalnej (default)- Rotacja
4Z - Zmiana poziomu
5 - Zmiana poziomu
6
grid {Boolean}Render Grid (default:false)- NEW:
reanimate {Boolean}umożliwia animację do zmiany widgetów (default:false)
// Component declaration
var component = {
// Component ID
id: 'COMPONENT_ID',
// Positioning
// You can define specific display size and if the display size is not specified then the component tries to find a size for larger display
offset: {
xs: { x: 1, y: 1, width: 6, height: 6 }, // Number means the position in the grid, so e.g. width "2" takes "2" columns in X axis
lg: { x: 1, y: 1, width: 6, height: 6 }
},
html: 'THE CONTENT OF COMPONENT', // or can be raw HTMLElement
// Default settings
actions: { move: true, remove: true, resize: true, resizeX: true, resizeY: true, resizeP: false, settings: true },
// resizeP means: resize "proportionally"
// Can disable header (default: true)
header: true,
// Can delay displaying (in "ms", default: config.delay)
delay: 0,
// A component title
title: 'Title for the component',
// Custom properties which will be assigned to the instance
template: Object,
config: Object,
// reset: true, // NEW: reloads the component again
// class: String // adds a class to the item
make: function(exports, config, el) {
// @exports {Object}
// @config {Object}
// @el {jQuery} a content of the component
// Handlers (optional):
exports.destroy = function() {
// @el {jQuery} a content of the component
// @this {Instance}
// is executed when the component is destroyed
};
exports.data = function(data, el) {
// @data {Object}
// @this {Instance}
// @el {jQuery} a content element of the component
// It can be executed via SETTER('dashboard/send', ....)
};
exports.service = function(counter, el) {
// @counter {Number} count of calls
// @el {jQuery} a content of the component
// @this {Instance}
// dashboard will execute this handler each 5 seconds
};
exports.focus = function() {
// Optional, when the "window" is focused the delegate will be executed
};
exports.resize = function(width, height, el, display) {
// @width {Number}
// @height {Number}
// @el {jQuery} a content of the component
// @display {String} a current display size "xs", "sm", "md" or "lg"
// @this {Instance}
// is executed when the component is resized
// @this {Instance}
};
exports.settings = function(config, el, elbtn) {
// @config {Object}
// @el {jQuery} a content element of the component
// @elbtn {jQuery} button element
// is executed when the users clicks on the settings icon
};
exports.remove = function(remove) {
// remove {Function} removes that widget
remove();
};
exports.configure = function() {
// is executed when the configuration is changed
};
// this.meta {Object} a reference to component object
// this.element {jQuery} a content element of the component
// this.container {jQuery} a main content element of the component
// this.main {Object} a reference to Dashboard component
// this.width {Number} a width of "this.element"
// this.height {Number} a height of "this.element"
// this.display {String} a current display size "xs", "sm", "md" or "lg"
// is executed when the component is making
}
};
PUSH('components', component);Metody:
SETTER('dashboard/send', id, body)wysyła dane do wszystkich widgetów zawierających delegatdataid {String}nullwysyła się do wszystkich składników@componentwysyła się do konkretnych składników według nazwy składnikastringwysyła się do określonego składnika według identyfikatorów
SETTER('dashboard/call', method_name, [a], [b], [c], [d])wykonuje metodę w każdym widgetieRETURN('dashboard/pixel')zwraca rozmiar piksela (square)RETURN('dashboard/display')zwraca aktualną szerokość wyświetlacza
Dobrze wiedzieć:
- Zestaw dodaje klasy do ciała składnika:
d_colNUMBERokreśla liczbę pobranych kolumn np.d_col2d_rowNUMBERokreśla liczbę podanych kolejek np.d_row3d_square- składnik ma taką samą szerokość / wysokośćd_verticalelement ma tylko 1 krok szerokości i więcej niż 1 stopień wysokościd_horizontalelement ma tylko 1 stopień wysokości i więcej niż 1 krok szerokości
Użyj go z <ui-component name="dashboard">Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu DEF.fallback (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.
<ui-component name="dashboard" path="components"></ui-component>
<script>
var components = [];
components.push({
id: 'A',
offset: { lg: { x: 0, y: 0, width: 4, height: 4 }},
title: 'A',
html: '<div class="padding">Lorem ipsum dolor sit amet.</div>',
actions: { settings: true, remove: true, move: true, resize: true },
make: function(exports, config, el) {
// If you change some action "exports.actions" then execute:
// exports.refresh();
exports.data = function(data) {
};
exports.configure = function() {
};
}
});
components.push({
id: 'B',
offset: { lg: { x: 4, y: 0, width: 4, height: 4 }},
title: 'B',
html: '<div class="padding">Lorem ipsum dolor sit amet.</div>',
actions: { settings: true, remove: true, move: true, resize: true }
});
</script>