MCPcopy
hub / github.com/pqina/filepond / createView

Function createView

src/js/app/frame/createView.js:13–326  ·  view source on GitHub ↗
({
        // element definition
        tag = 'div',
        name = null,
        attributes = {},

        // view interaction
        read = () => {},
        write = () => {},
        create = () => {},
        destroy = () => {},

        // hooks
        filterFrameActionsForChild = (child, actions) => actions,
        didCreateView = () => {},
        didWriteView = () => {},

        // rect related
        ignoreRect = false,
        ignoreRectUpdate = false,

        // mixins
        mixins = []
    } = {})

Source from the content-addressed store, hash-verified

11export const createView =
12 // default view definition
13 ({
14 // element definition
15 tag = 'div',
16 name = null,
17 attributes = {},
18
19 // view interaction
20 read = () => {},
21 write = () => {},
22 create = () => {},
23 destroy = () => {},
24
25 // hooks
26 filterFrameActionsForChild = (child, actions) => actions,
27 didCreateView = () => {},
28 didWriteView = () => {},
29
30 // rect related
31 ignoreRect = false,
32 ignoreRectUpdate = false,
33
34 // mixins
35 mixins = []
36 } = {}) => (
37 // each view requires reference to store
38 store,
39 // specific properties for this view
40 props = {}
41 ) => {
42 // root element should not be changed
43 const element = createElement(tag, `filepond--${name}`, attributes);
44
45 // style reference should also not be changed
46 const style = window.getComputedStyle(element, null);
47
48 // element rectangle
49 const rect = updateRect();
50 let frameRect = null;
51
52 // rest state
53 let isResting = false;
54
55 // pretty self explanatory
56 const childViews = [];
57
58 // loaded mixins
59 const activeMixins = [];
60
61 // references to created children
62 const ref = {};
63
64 // state used for each instance
65 const state = {};
66
67 // list of writers that will be called to update this view
68 const writers = [
69 write // default writer
70 ];

Callers 15

dropLabel.jsFile · 0.85
item.jsFile · 0.85
listScroller.jsFile · 0.85
list.jsFile · 0.85
drip.jsFile · 0.85
browser.jsFile · 0.85
root.jsFile · 0.85
assistant.jsFile · 0.85
data.jsFile · 0.85
fileStatus.jsFile · 0.85

Calls 8

createElementFunction · 0.90
updateRectFunction · 0.90
appendChildFunction · 0.90
appendChildViewFunction · 0.90
removeChildViewFunction · 0.90
createObjectFunction · 0.90
createChildViewFunction · 0.85
createFunction · 0.50

Tested by

no test coverage detected