@nativescript-community/ui-collectionview 5.3.8 → 5.3.10

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.
@@ -0,0 +1,3 @@
1
+ declare class UICollectionViewCacheDelegateFlowLayout extends NSObject implements UICollectionViewDelegateFlowLayout {
2
+ cachedSizes: NSMutableArray;
3
+ }
@@ -0,0 +1,38 @@
1
+ declare const _default: {
2
+ props: {
3
+ items: {
4
+ validator: (val: any) => boolean;
5
+ required: boolean;
6
+ };
7
+ '+alias': {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ '+index': {
12
+ type: StringConstructor;
13
+ };
14
+ itemTemplateSelector: {
15
+ type: FunctionConstructor;
16
+ default: any;
17
+ };
18
+ };
19
+ template: string;
20
+ watch: {
21
+ items: {
22
+ handler(newVal: any, oldVal: any): void;
23
+ deep: boolean;
24
+ };
25
+ };
26
+ created(): void;
27
+ mounted(): void;
28
+ methods: {
29
+ getItem(index: any): any;
30
+ onItemTap(args: any): void;
31
+ updateViewTemplate(args: any): void;
32
+ onItemLoadingInternal(args: any): void;
33
+ onItemDisposingInternal(args: any): void;
34
+ refresh(): void;
35
+ scrollToIndex(index: any, animate?: boolean): void;
36
+ };
37
+ };
38
+ export default _default;
@@ -0,0 +1,105 @@
1
+ import { Observable, ObservableArray } from '@nativescript/core';
2
+ import { CollectionView } from '..';
3
+ const VUE_VIEW = '__vueVNodeRef__';
4
+ export default {
5
+ props: {
6
+ items: {
7
+ validator: (val) => !val || Array.isArray(val) || val instanceof ObservableArray,
8
+ required: true
9
+ },
10
+ '+alias': {
11
+ type: String,
12
+ default: 'item'
13
+ },
14
+ '+index': {
15
+ type: String
16
+ },
17
+ itemTemplateSelector: {
18
+ type: Function,
19
+ default: undefined
20
+ }
21
+ },
22
+ template: `<NativeCollectionView ref="listView" :items="items" v-bind="$attrs" v-on="listeners" @itemTap="onItemTap" @itemLoading="onItemLoadingInternal" @itemDisposing="onItemDisposingInternal"
23
+ >
24
+ <slot /></NativeCollectionView>`,
25
+ watch: {
26
+ items: {
27
+ handler(newVal, oldVal) {
28
+ if (!(oldVal instanceof Observable)) {
29
+ this.$refs.listView.setAttribute('items', newVal);
30
+ }
31
+ },
32
+ deep: true
33
+ }
34
+ },
35
+ created() {
36
+ // we need to remove the itemTap handler from a clone of the $listeners
37
+ // object because we are emitting the event ourselves with added data.
38
+ const listeners = Object.assign({}, this.$listeners);
39
+ delete listeners.itemTap;
40
+ this.listeners = listeners;
41
+ this.getItemContext = getItemContext.bind(this);
42
+ },
43
+ mounted() {
44
+ const listView = this.$refs.listView;
45
+ this.listView = listView.nativeView;
46
+ listView.setAttribute('itemTemplates', this.$templates.getKeyedTemplates());
47
+ const itemTemplateSelector = this.itemTemplateSelector
48
+ ? this.itemTemplateSelector // custom template selector if any
49
+ : (item, index, items) => this.$templates.selectorFn(this.getItemContext(item, index));
50
+ listView.setAttribute('itemTemplateSelector', itemTemplateSelector);
51
+ },
52
+ methods: {
53
+ getItem(index) {
54
+ return this.listView.getItemAtIndex(index);
55
+ },
56
+ onItemTap(args) {
57
+ this.$emit('itemTap', { item: this.getItem(args.index), ...args });
58
+ },
59
+ updateViewTemplate(args) {
60
+ const listView = args.object;
61
+ const index = args.index;
62
+ const items = args.object.items;
63
+ const currentItem = args.bindingContext;
64
+ const name = listView._itemTemplateSelector(currentItem, index, items);
65
+ const context = this.getItemContext(currentItem, index);
66
+ const oldVnode = args.view?.[VUE_VIEW];
67
+ if (args.view) {
68
+ args.view._batchUpdate(() => {
69
+ args.view = this.$templates.patchTemplate(name, context, oldVnode);
70
+ });
71
+ }
72
+ else {
73
+ args.view = this.$templates.patchTemplate(name, context, oldVnode);
74
+ }
75
+ },
76
+ onItemLoadingInternal(args) {
77
+ this.updateViewTemplate(args);
78
+ },
79
+ onItemDisposingInternal(args) {
80
+ const oldVnode = args.view && args.view[VUE_VIEW];
81
+ if (oldVnode) {
82
+ // properly dispose the oldVnode (this will unmount the tree)
83
+ this.__patch__(oldVnode, null);
84
+ }
85
+ },
86
+ refresh() {
87
+ this.listView.refresh();
88
+ },
89
+ scrollToIndex(index, animate = false) {
90
+ this.listView.scrollToIndex(index, animate);
91
+ }
92
+ // getSelectedItems() {
93
+ // return (this.listView as CollectionView).getSelectedItems();
94
+ // }
95
+ }
96
+ };
97
+ function getItemContext(item, index = -1, alias = this.$props['+alias'], index_alias = this.$props['+index']) {
98
+ return {
99
+ [alias]: item,
100
+ [index_alias || '$index']: index,
101
+ $even: index % 2 === 0,
102
+ $odd: index % 2 !== 0
103
+ };
104
+ }
105
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"../src/","sources":["vue/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEpC,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AACnC,eAAe;IACX,KAAK,EAAE;QACH,KAAK,EAAE;YACH,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,YAAY,eAAe;YAChF,QAAQ,EAAE,IAAI;SACjB;QACD,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,MAAM;SAClB;QACD,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM;SACf;QACD,oBAAoB,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,SAAS;SACrB;KACJ;IACD,QAAQ,EAAE;;kCAEoB;IAC9B,KAAK,EAAE;QACH,KAAK,EAAE;YACH,OAAO,CAAC,MAAM,EAAE,MAAM;gBAClB,IAAI,CAAC,CAAC,MAAM,YAAY,UAAU,CAAC,EAAE;oBACjC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO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,CAAC;QAChD,CAAC;QACD,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK;YAC/B,IAAI,CAAC,QAA2B,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACpE,CAAC;QACD,uBAAuB;QACvB,mEAAmE;QACnE,IAAI;KACP;CACJ,CAAC;AACF,SAAS,cAAc,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IACxG,OAAO;QACH,CAAC,KAAK,CAAC,EAAE,IAAI;QACb,CAAC,WAAW,IAAI,QAAQ,CAAC,EAAE,KAAK;QAChC,KAAK,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC;QACtB,IAAI,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC;KACxB,CAAC;AACN,CAAC"}
package/vue/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare const CollectionViewPlugin: {
2
+ install(Vue: any, options: any): void;
3
+ };
4
+ export default CollectionViewPlugin;
package/vue/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import { CollectionView } from '..';
2
+ const CollectionViewPlugin = {
3
+ install(Vue, options) {
4
+ Vue.registerElement('CollectionView', function () {
5
+ return CollectionView;
6
+ }, {
7
+ component: require('./component').default
8
+ });
9
+ }
10
+ };
11
+ export default CollectionViewPlugin;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEpC,MAAM,oBAAoB,GAAG;IACzB,OAAO,CAAC,GAAG,EAAE,OAAO;QAChB,GAAG,CAAC,eAAe,CACf,gBAAgB,EAChB;YACI,OAAO,cAAc,CAAC;QAC1B,CAAC,EACD;YACI,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO;SAC5C,CACJ,CAAC;IACN,CAAC;CACJ,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { ObservableArray } from '@nativescript/core';
2
+ import { PropType, VNode } from 'nativescript-vue';
3
+ export declare const CollectionView: import("nativescript-vue").DefineComponent<{
4
+ items: {
5
+ type: PropType<any[] | ObservableArray<any>>;
6
+ required: true;
7
+ };
8
+ alias: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ itemIdGenerator: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ itemTemplateSelector: FunctionConstructor;
17
+ }, () => VNode<import("nativescript-vue").RendererNode, import("nativescript-vue").RendererElement, {
18
+ [key: string]: any;
19
+ }>, unknown, {}, {}, import("nativescript-vue").ComponentOptionsMixin, import("nativescript-vue").ComponentOptionsMixin, {}, string, import("nativescript-vue").VNodeProps & import("nativescript-vue").AllowedComponentProps & import("nativescript-vue").ComponentCustomProps, Readonly<import("nativescript-vue").ExtractPropTypes<{
20
+ items: {
21
+ type: PropType<any[] | ObservableArray<any>>;
22
+ required: true;
23
+ };
24
+ alias: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ itemIdGenerator: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
32
+ itemTemplateSelector: FunctionConstructor;
33
+ }>>, {
34
+ itemIdGenerator: string;
35
+ alias: string;
36
+ }, {}>;
@@ -0,0 +1,105 @@
1
+ import { CollectionView as NSCollectionView } from '..';
2
+ import { Observable, ObservableArray } from '@nativescript/core';
3
+ import { ELEMENT_REF, NSVElement, NSVRoot, computed, defineComponent, getCurrentInstance, h, ref, render, toRaw, warn, watch } from 'nativescript-vue';
4
+ const LIST_CELL_ID = Symbol('list_cell_id');
5
+ const LIST_CELL_CONTAINER = Symbol('list_cell_container');
6
+ function getItemCtx(item, index, itemAlias, indexAlias) {
7
+ return {
8
+ [itemAlias]: item,
9
+ [indexAlias]: index,
10
+ index,
11
+ even: index % 2 === 0,
12
+ odd: index % 2 !== 0
13
+ };
14
+ }
15
+ export const CollectionView = defineComponent({
16
+ props: {
17
+ items: {
18
+ type: Object,
19
+ required: true
20
+ },
21
+ alias: {
22
+ type: String,
23
+ default: 'item'
24
+ },
25
+ itemIdGenerator: {
26
+ type: String,
27
+ default: '$index'
28
+ },
29
+ itemTemplateSelector: Function
30
+ },
31
+ setup(props, ctx) {
32
+ // const itemsCtx = computed(() => (props.items as []).map((item, index) => getItemCtx(item, index, props.alias, props.itemIdGenerator)));
33
+ const itemTemplates = Object.keys(ctx.slots).map((slotName) => ({
34
+ key: slotName,
35
+ createView() {
36
+ // no need to return anything here
37
+ }
38
+ }));
39
+ const getSlotName = (itemCtx, index, items) => props.itemTemplateSelector?.(itemCtx, index, items) ?? 'default';
40
+ const collectionView = ref(null);
41
+ const vm = getCurrentInstance();
42
+ watch(() => props.items, (oldVal, newVal) => {
43
+ if (!(oldVal instanceof Observable)) {
44
+ collectionView.value.setAttribute('items', newVal);
45
+ }
46
+ });
47
+ let cellId = 0;
48
+ const cells = ref({});
49
+ function onItemLoading(event) {
50
+ const index = event.index;
51
+ const id = event.view?.[LIST_CELL_ID] ?? `${cellId++}`;
52
+ const item = defineComponent(event.bindingContext, vm);
53
+ const itemCtx = getItemCtx(item, index, props.alias, props.itemIdGenerator);
54
+ // const itemCtx: ListItem = getItemCtx(props.items instanceof ObservableArray ? props.items.getItem(index) : props.items[index], index, props.alias, props.itemIdGenerator);
55
+ // update the cell data with the current row
56
+ const slotName = getSlotName(itemCtx, index, event.object.items);
57
+ cells.value[id] = {
58
+ itemCtx,
59
+ slotName
60
+ };
61
+ // trigger an update!
62
+ // vm?.update();
63
+ // find the vnode rendering this cell
64
+ const container = event.view?.[LIST_CELL_CONTAINER] ?? new NSVRoot();
65
+ const vnode = ctx.slots[slotName]?.(itemCtx)[0];
66
+ if (event.view) {
67
+ event.view._batchUpdate(() => {
68
+ // todo: handle the case where the slot is not found
69
+ render(vnode, container);
70
+ });
71
+ }
72
+ else {
73
+ // todo: handle the case where the slot is not found
74
+ render(vnode, container);
75
+ }
76
+ const cellEl = toRaw(vnode?.el?.nativeView);
77
+ cellEl[LIST_CELL_ID] = id;
78
+ cellEl[LIST_CELL_CONTAINER] = container;
79
+ event.view = cellEl;
80
+ }
81
+ // render all realized templates as children
82
+ const cellVNODES = () => Object.entries(cells.value).map(([id, entry]) => {
83
+ const vnodes = ctx.slots[entry.slotName]?.(entry.itemCtx) ?? [
84
+ // default template is just a label
85
+ h('Label', {
86
+ text: entry.itemCtx[props.alias]
87
+ })
88
+ ];
89
+ if (vnodes.length > 1) {
90
+ warn(`ListView template must contain a single root element. Found: ${vnodes.length}. Only the first one will be used.`);
91
+ }
92
+ const vnode = vnodes[0];
93
+ // set the key to the list cell id, so we can find this cell later...
94
+ vnode.key = id;
95
+ return vnode;
96
+ });
97
+ return () => h('NativeCollectionView', {
98
+ ref: collectionView,
99
+ items: props.items,
100
+ itemTemplates,
101
+ onItemLoading
102
+ });
103
+ }
104
+ });
105
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"../src/","sources":["vue3/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,gBAAgB,EAAE,MAAM,IAAI,CAAC;AACxD,OAAO,EAAiB,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAmB,QAAQ,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAcxK,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC5C,MAAM,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAE1D,SAAS,UAAU,CAAC,IAAS,EA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11 @@
1
+ import { CollectionView as VueCollectionView } from './component';
2
+ import '@vue/runtime-core';
3
+ declare const CollectionViewPlugin: {
4
+ install(app: any): void;
5
+ };
6
+ declare module '@vue/runtime-core' {
7
+ interface GlobalComponents {
8
+ CollectionView: typeof VueCollectionView;
9
+ }
10
+ }
11
+ export default CollectionViewPlugin;
package/vue3/index.js ADDED
@@ -0,0 +1,14 @@
1
+ import { CollectionView as VueCollectionView } from './component';
2
+ import { CollectionView as NativeCollectionView } from '..';
3
+ import '@vue/runtime-core';
4
+ const CollectionViewPlugin = {
5
+ install(app) {
6
+ app.registerElement('NativeCollectionView', () => NativeCollectionView, {
7
+ viewFlags: 8,
8
+ overwriteExisting: true
9
+ });
10
+ app.component('CollectionView', VueCollectionView);
11
+ }
12
+ };
13
+ export default CollectionViewPlugin;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["vue3/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,mBAAmB,CAAC;AAE3B,MAAM,oBAAoB,GAAG;IACzB,OAAO,CAAC,GAAQ;QACZ,GAAG,CAAC,eAAe,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,oBAAoB,EAAE;YACpE,SAAS,EAAE,CAAC;YACZ,iBAAiB,EAAE,IAAI;SAC1B,CAAC,CAAC;QACH,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACvD,CAAC;CACJ,CAAC;AAQF,eAAe,oBAAoB,CAAC"}