<commit_before>require('garnet');

var
	kind = require('enyo/kind'),
	ri = require('enyo/resolution'),
	Button = require('enyo/Button'),
	Collection = require('enyo/Collection');

var
	Item = require('garnet/Item'),
	Scroller = require('garnet/Scroller'),
	PanelManager = require('garnet/PanelManager');

var
	SampleDataListPanel = require('./DataListSample').DataListPanel;

var
	panelStyle = 'width: ' + ri.scale(320) + 'px; height: ' + ri.scale(320) + 'px; position: relative; display: inline-block; margin: ' + ri.scale(20) + 'px',
	buttonStyle = 'margin: ' + ri.scale(30) + 'px ' + ri.scale(10) + 'px;';

module.exports = kind({
	name: 'g.sample.PanelManagerSample',
	horizontal: 'hidden',
	classes: 'enyo-unselectable enyo-fit garnet g-sample',
	kind: Scroller,
	components: [
		{content: '< PanelManager Sample', classes: 'g-sample-header', ontap: 'goBack'},

		{content: 'Fixed + Push Floating', classes: 'g-sample-subheader'},
		{style: panelStyle, components: [
			{name: 'fixedFloating', kind: PanelManager, classes: 'enyo-fit', pageIndicator: true, components: [
				{name: 'fixedFloatingList', kind: SampleDataListPanel, title: true, titleContent: 'Fixed Floating', commandBarComponents: [
					{src: '@../assets/btn_share.svg', ontap: 'handleShareTapped'}
				]},
				{components: [
					{kind: Scroller, classes: 'enyo-fit', components: [
						{kind: Button, content: 'Push Another Panel', style: buttonStyle, ontap: 'handlePushTapped'}
					]}
				]}
			]}
		]}
	],
	bindings: [
		{from: 'collection', to: '$.fixedFloatingList.collection'}
	],<commit_msg>add illustration of PanelManager lifecycle event methods<commit_after>require('garnet');

var
	kind = require('enyo/kind'),
	ri = require('enyo/resolution'),
	Button = require('enyo/Button'),
	Collection = require('enyo/Collection');

var
	Item = require('garnet/Item'),
	Scroller = require('garnet/Scroller'),
	PanelManager = require('garnet/PanelManager');

var
	SampleDataListPanel = require('./DataListSample').DataListPanel;

var
	panelStyle = 'width: ' + ri.scale(320) + 'px; height: ' + ri.scale(320) + 'px; position: relative; display: inline-block; margin: ' + ri.scale(20) + 'px',
	buttonStyle = 'margin: ' + ri.scale(30) + 'px ' + ri.scale(10) + 'px;';

var List = kind({
	kind: SampleDataListPanel,
	title: true,
	titleContent: 'Fixed Floating',
	events: {
		onShare: ''
	},
	commandBarComponents: [
		{src: '@../assets/btn_share.svg', ontap: 'doShare'}
	],
	// Illustrating the 4 lifecycle methods that are invoked by garnet/PanelManager on this panel
	activate: function (event) {
		this.log('Activating the List', event.dragging ? 'during drag' : '');
	},
	deactivate: function (event) {
		this.log('Deactivating the List', event.dragging ? 'during drag' : '');
	},
	activated: function (event) {
		this.log('List has been activated');
	},
	deactivated: function (event) {
		this.log('List has been deactivated');
	}
});

module.exports = kind({
	name: 'g.sample.PanelManagerSample',
	horizontal: 'hidden',
	classes: 'enyo-unselectable enyo-fit garnet g-sample',
	kind: Scroller,
	components: [
		{content: '< PanelManager Sample', classes: 'g-sample-header', ontap: 'goBack'},

		{content: 'Fixed + Push Floating', classes: 'g-sample-subheader'},
		{style: panelStyle, components: [
			{name: 'fixedFloating', kind: PanelManager, classes: 'enyo-fit', pageIndicator: true, components: [
				{name: 'fixedFloatingList', kind: List, onShare: 'handleShareTapped'},
				{components: [
					{kind: Scroller, classes: 'enyo-fit', components: [
						{kind: Button, content: 'Push Another Panel', style: buttonStyle, ontap: 'handlePushTapped'}
					]}
				]}
			]}
		]}
	],
	bindings: [
		{from: 'collection', to: '$.fixedFloatingList.collection'}
	],
{'fraction_non_alphanumeric': 0.1739480032162959, 'fraction_numerical': 0.006700616456714018, 'mean_word_length': 4.777089783281734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '341733', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1253, 'n_words': 290}