@slickgrid-universal/binding 2.5.0 → 2.6.0

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.
@@ -1,43 +0,0 @@
1
- import { Binding, BoundedEventWithListener, ElementBinding, ElementBindingWithListener } from './interfaces';
2
- /**
3
- * Create 2 way Bindings for any variable that are primitive or object types, when it's an object type it will watch for property changes
4
- * The following 2 articles helped in building this service:
5
- * 1- https://blog.jeremylikness.com/blog/client-side-javascript-databinding-without-a-framework/
6
- * 2- https://www.wintellect.com/data-binding-pure-javascript/
7
- */
8
- export declare class BindingService {
9
- protected _value: any;
10
- protected _binding: Binding;
11
- protected _property: string;
12
- protected _boundedEventWithListeners: BoundedEventWithListener[];
13
- protected _elementBindings: Array<ElementBinding | ElementBindingWithListener>;
14
- constructor(binding: Binding);
15
- get boundedEventWithListeners(): BoundedEventWithListener[];
16
- get elementBindings(): Array<ElementBinding | ElementBindingWithListener>;
17
- get property(): string;
18
- dispose(): void;
19
- valueGetter(): any;
20
- valueSetter<T extends Element = Element>(val: any): void;
21
- /**
22
- * Add binding to 1 or more DOM Element by an object attribute and optionally on an event, we can do it in couple ways
23
- * 1- if there's no event provided, it will simply replace the DOM elemnt (by an attribute), for example an innerHTML
24
- * 2- when an event is provided, we will replace the DOM element (by an attribute) every time an event is triggered
25
- * 2.1- we could also provide an extra callback method to execute when the event gets triggered
26
- */
27
- bind<T extends Element = Element>(elements: T | NodeListOf<T> | null, attribute: string, eventName?: string, eventCallback?: (val: any) => any): this;
28
- /** Unbind (remove) an element event listener */
29
- unbind(element: Element | null, eventName: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions, eventUid?: string): void;
30
- /** Unbind All (remove) bounded elements with listeners */
31
- unbindAll(): void;
32
- /**
33
- * Add binding to a single element by an object attribute and optionally on an event, we can do it in couple ways
34
- * 1- if there's no event provided, it will simply replace the DOM element (by an attribute), for example an innerHTML
35
- * 2- when an event is provided, we will replace the DOM element (by an attribute) every time an event is triggered
36
- * 2.1- we could also provide an extra callback method to execute when the event gets triggered
37
- */
38
- protected bindSingleElement<T extends Element = Element>(element: T | null, attribute: string, eventName?: string, eventCallback?: (val: any) => any): void;
39
- /** Generate a UUID version 4 RFC compliant */
40
- protected generateUuidV4(): string;
41
- protected hasData(value: any): boolean;
42
- protected sanitizeText(dirtyText: string): string;
43
- }
@@ -1,3 +0,0 @@
1
- export * from './binding.helper';
2
- export * from './binding.service';
3
- export * from './interfaces';
@@ -1,18 +0,0 @@
1
- export interface Binding {
2
- variable: any;
3
- property: string;
4
- }
5
- export interface ElementBinding<T extends Element = Element> {
6
- element: T | null;
7
- attribute: string;
8
- }
9
- export interface ElementBindingWithListener<T extends Element = Element> extends ElementBinding<T> {
10
- event: string;
11
- listener: (val: any) => any;
12
- }
13
- export interface BoundedEventWithListener<T extends Element = Element> {
14
- element: T;
15
- eventName: string;
16
- listener: EventListenerOrEventListenerObject;
17
- uid: string;
18
- }
@@ -1,18 +0,0 @@
1
- import { BindingService } from './binding.service';
2
- export declare class BindingHelper {
3
- private _observers;
4
- private _querySelectorPrefix;
5
- get querySelectorPrefix(): string;
6
- set querySelectorPrefix(prefix: string);
7
- get observers(): BindingService[];
8
- constructor();
9
- dispose(): void;
10
- addElementBinding<T extends Element = Element>(variable: any, property: string, selector: string, attribute: string, events?: string | string[], callback?: (val: any) => void): void;
11
- /** From a DOM element selector, which could be zero or multiple elements, add an event listener */
12
- bindEventHandler<T extends Element = Element>(selector: string, eventName: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
13
- /**
14
- * From a DOM element selector, which could be zero or multiple elements, set the value on a given attribute name
15
- * For example ('div.hello', 'textContent', 'world') => would set the textContent equal to 'world' on a div element having the class 'hello'
16
- */
17
- setElementAttributeValue<T extends Element = Element>(selector: string, attribute: string, value: any): void;
18
- }