@lightningjs/blits 1.8.2 → 1.9.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,50 +0,0 @@
1
- import Component from '../component.js'
2
-
3
- export default () => {
4
- return Component('Layout', {
5
- /* eslint-disable no-unused-vars */
6
- code: {
7
- render: function anonymous(parent, component, context, components, effect, getRaw) {
8
- const elms = []
9
- let componentType
10
- const rootComponent = component
11
- let propData
12
- const elementConfig0 = {}
13
-
14
- elms[0] = this.element({ parent: parent || 'root' }, component)
15
-
16
- elementConfig0[Symbol.for('isSlot')] = true
17
- elementConfig0['ref'] = 'slot'
18
- elms[0].populate(elementConfig0)
19
- return elms
20
- },
21
- effects: [],
22
- context: {},
23
- },
24
- props: [
25
- 'direction',
26
- {
27
- key: 'gap',
28
- default: 0,
29
- },
30
- ],
31
- hooks: {
32
- ready() {
33
- this.___layout()
34
- },
35
- },
36
- methods: {
37
- // todo: review naming
38
- ___layout() {
39
- let offset = 0
40
-
41
- this.$select('slot').children.forEach((el) => {
42
- el.set(this.direction === 'vertical' ? 'y' : 'x', offset)
43
- // todo: grab width from interface, not directly from node
44
- offset +=
45
- (el.node[this.direction === 'vertical' ? 'height' : 'width'] || 0) + (this.gap || 0)
46
- })
47
- },
48
- },
49
- })
50
- }
@@ -1,34 +0,0 @@
1
- import Component from '../component.js'
2
-
3
- export default () => {
4
- return Component('Layout', {
5
- template: `
6
- <Slot ref="slot" />
7
- `,
8
- props: [
9
- 'direction',
10
- {
11
- key: 'gap',
12
- default: 0,
13
- },
14
- ],
15
- hooks: {
16
- ready() {
17
- this.___layout()
18
- },
19
- },
20
- methods: {
21
- // todo: review naming
22
- ___layout() {
23
- let offset = 0
24
-
25
- this.$select('slot').children.forEach((el) => {
26
- el.set(this.direction === 'vertical' ? 'y' : 'x', offset)
27
- // todo: grab width from interface, not directly from node
28
- offset +=
29
- (el.node[this.direction === 'vertical' ? 'height' : 'width'] || 0) + (this.gap || 0)
30
- })
31
- },
32
- },
33
- })
34
- }