How to use the @dojo/widgets/d.w function in @dojo/widgets

To help you get started, we’ve selected a few @dojo/widgets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dojo / examples / todo-mvc / src / widgets / createMainSection.ts View on Github external
getChildrenNodes: function (this: Widget): DNode[] {
			const { properties: { todos, allCompleted: checked, activeFilter } } = this;
			const checkBoxProperties: CheckboxProperties = {
				id: 'todo-toggle',
				checked,
				classes: [ 'toggle-all' ],
				onChange: todoToggleAll
			};

			return [
				w(createCheckboxInput, checkBoxProperties),
				w(createTodoList, { todos, activeFilter })
			];
		}
	}
github dojo / examples / todo-mvc / src / widgets / createTodoItem.ts View on Github external
getChildrenNodes: function(this: TodoItem): (DNode | null)[] {
				const { properties: { id: todoId, completed: checked, label, editing: focused = false } } = this;

				return [
					v('div.view', [
						w(createCheckboxInput, { classes: [ 'toggle' ], checked, onChange: bind(todoToggleComplete, this) }),
						w(createLabel, { label, onDblclick: bind(todoEdit, this), onKeypress: bind(todoEdit, this) }),
						w(createButton, { classes: [ 'destroy' ], onClick: bind(todoRemove, this) })
					]),
					focused ? w(createFocusableTextInput, {
						value: label,
						id: todoId,
						focused, classes: [ 'edit' ],
						onBlur: bind(todoSave, this),
						onKeyUp: bind(todoEditInput, this)
					}) : null
				];
			}
		}
github dojo / examples / todo-mvc / src / widgets / createTodoFooter.ts View on Github external
getChildrenNodes: function(this: TodoFooter): (DNode | null)[] {
			const { activeCount, activeFilter, completedCount } = this.properties;
			const countLabel = activeCount === 1 ? 'item' : 'items';

			return [
				v('span', { 'class': 'todo-count' }, [
					v('strong', [activeCount + ' ']),
					v('span', [countLabel + ' left'])
				]),
				w(createTodoFilter, {
					classes: [ 'filters' ],
					activeFilter
				}),
				completedCount ? w(createButton, {
					onClick: clearCompleted,
					label: 'Clear completed',
					classes: [ 'clear-completed' ]
				}) : null
			];
		}
	}
github dojo / examples / todo-mvc / src / widgets / createMainSection.ts View on Github external
getChildrenNodes: function (this: Widget): DNode[] {
			const { properties: { todos, allCompleted: checked, activeFilter } } = this;
			const checkBoxProperties: CheckboxProperties = {
				id: 'todo-toggle',
				checked,
				classes: [ 'toggle-all' ],
				onChange: todoToggleAll
			};

			return [
				w(createCheckboxInput, checkBoxProperties),
				w(createTodoList, { todos, activeFilter })
			];
		}
	}
github dojo / examples / todo-mvc / src / widgets / createTodoItem.ts View on Github external
getChildrenNodes: function(this: TodoItem): (DNode | null)[] {
				const { properties: { id: todoId, completed: checked, label, editing: focused = false } } = this;

				return [
					v('div.view', [
						w(createCheckboxInput, { classes: [ 'toggle' ], checked, onChange: bind(todoToggleComplete, this) }),
						w(createLabel, { label, onDblclick: bind(todoEdit, this), onKeypress: bind(todoEdit, this) }),
						w(createButton, { classes: [ 'destroy' ], onClick: bind(todoRemove, this) })
					]),
					focused ? w(createFocusableTextInput, {
						value: label,
						id: todoId,
						focused, classes: [ 'edit' ],
						onBlur: bind(todoSave, this),
						onKeyUp: bind(todoEditInput, this)
					}) : null
				];
			}
		}
github dojo / examples / todo-mvc / src / widgets / createTodoItem.ts View on Github external
getChildrenNodes: function(this: TodoItem): (DNode | null)[] {
				const { properties: { id: todoId, completed: checked, label, editing: focused = false } } = this;

				return [
					v('div.view', [
						w(createCheckboxInput, { classes: [ 'toggle' ], checked, onChange: bind(todoToggleComplete, this) }),
						w(createLabel, { label, onDblclick: bind(todoEdit, this), onKeypress: bind(todoEdit, this) }),
						w(createButton, { classes: [ 'destroy' ], onClick: bind(todoRemove, this) })
					]),
					focused ? w(createFocusableTextInput, {
						value: label,
						id: todoId,
						focused, classes: [ 'edit' ],
						onBlur: bind(todoSave, this),
						onKeyUp: bind(todoEditInput, this)
					}) : null
				];
			}
		}
github dojo / examples / todo-mvc / src / widgets / createTodoItem.ts View on Github external
getChildrenNodes: function(this: TodoItem): (DNode | null)[] {
				const { properties: { id: todoId, completed: checked, label, editing: focused = false } } = this;

				return [
					v('div.view', [
						w(createCheckboxInput, { classes: [ 'toggle' ], checked, onChange: bind(todoToggleComplete, this) }),
						w(createLabel, { label, onDblclick: bind(todoEdit, this), onKeypress: bind(todoEdit, this) }),
						w(createButton, { classes: [ 'destroy' ], onClick: bind(todoRemove, this) })
					]),
					focused ? w(createFocusableTextInput, {
						value: label,
						id: todoId,
						focused, classes: [ 'edit' ],
						onBlur: bind(todoSave, this),
						onKeyUp: bind(todoEditInput, this)
					}) : null
				];
			}
		}
github dojo / examples / todo-mvc / src / widgets / createTodoFooter.ts View on Github external
getChildrenNodes: function(this: TodoFooter): (DNode | null)[] {
			const { activeCount, activeFilter, completedCount } = this.properties;
			const countLabel = activeCount === 1 ? 'item' : 'items';

			return [
				v('span', { 'class': 'todo-count' }, [
					v('strong', [activeCount + ' ']),
					v('span', [countLabel + ' left'])
				]),
				w(createTodoFilter, {
					classes: [ 'filters' ],
					activeFilter
				}),
				completedCount ? w(createButton, {
					onClick: clearCompleted,
					label: 'Clear completed',
					classes: [ 'clear-completed' ]
				}) : null
			];
		}
	}