|
3 | 3 | "name": "The Ember API", |
4 | 4 | "description": "The Ember API: a framework for building ambitious web applications", |
5 | 5 | "url": "http://emberjs.com/", |
6 | | - "version": "1.12.0-beta.1" |
| 6 | + "version": "1.12.0-beta.2" |
7 | 7 | }, |
8 | 8 | "files": { |
9 | 9 | "bower_components/rsvp/lib/rsvp/promise/all.js": { |
|
4053 | 4053 | "submodule": "ember-views", |
4054 | 4054 | "namespace": "Ember", |
4055 | 4055 | "file": "packages/ember-views/lib/views/select.js", |
4056 | | - "line": 96, |
| 4056 | + "line": 82, |
4057 | 4057 | "description": "The `Ember.Select` view class renders a\n[select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,\nallowing the user to choose from a list of options.\n\nThe text and `value` property of each `<option>` element within the\n`<select>` element are populated from the objects in the `Element.Select`'s\n`content` property. The underlying data object of the selected `<option>` is\nstored in the `Element.Select`'s `value` property.\n\n## The Content Property (array of strings)\n\nThe simplest version of an `Ember.Select` takes an array of strings as its\n`content` property. The string will be used as both the `value` property and\nthe inner text of each `<option>` element inside the rendered `<select>`.\n\nExample:\n\n```javascript\nApp.ApplicationController = Ember.ObjectController.extend({\n names: [\"Yehuda\", \"Tom\"]\n});\n```\n\n```handlebars\n{{view \"select\" content=names}}\n```\n\nWould result in the following HTML:\n\n```html\n<select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n</select>\n```\n\nYou can control which `<option>` is selected through the `Ember.Select`'s\n`value` property:\n\n```javascript\nApp.ApplicationController = Ember.ObjectController.extend({\n selectedName: 'Tom',\n names: [\"Yehuda\", \"Tom\"]\n});\n```\n\n```handlebars\n{{view \"select\" content=names value=selectedName}}\n```\n\nWould result in the following HTML with the `<option>` for 'Tom' selected:\n\n```html\n<select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\" selected=\"selected\">Tom</option>\n</select>\n```\n\nA user interacting with the rendered `<select>` to choose \"Yehuda\" would\nupdate the value of `selectedName` to \"Yehuda\".\n\n## The Content Property (array of Objects)\n\nAn `Ember.Select` can also take an array of JavaScript or Ember objects as\nits `content` property.\n\nWhen using objects you need to tell the `Ember.Select` which property should\nbe accessed on each object to supply the `value` attribute of the `<option>`\nand which property should be used to supply the element text.\n\nThe `optionValuePath` option is used to specify the path on each object to\nthe desired property for the `value` attribute. The `optionLabelPath`\nspecifies the path on each object to the desired property for the\nelement's text. Both paths must reference each object itself as `content`:\n\n```javascript\nApp.ApplicationController = Ember.ObjectController.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ]\n});\n```\n\n```handlebars\n{{view \"select\"\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"}}\n```\n\nWould result in the following HTML:\n\n```html\n<select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\">Tom</option>\n</select>\n```\n\nThe `value` attribute of the selected `<option>` within an `Ember.Select`\ncan be bound to a property on another object:\n\n```javascript\nApp.ApplicationController = Ember.ObjectController.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ],\n currentProgrammer: {\n id: 2\n }\n});\n```\n\n```handlebars\n{{view \"select\"\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n value=currentProgrammer.id}}\n```\n\nWould result in the following HTML with a selected option:\n\n```html\n<select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n</select>\n```\n\nInteracting with the rendered element by selecting the first option\n('Yehuda') will update the `id` of `currentProgrammer`\nto match the `value` property of the newly selected `<option>`.\n\nAlternatively, you can control selection through the underlying objects\nused to render each object by binding the `selection` option. When the selected\n`<option>` is changed, the property path provided to `selection`\nwill be updated to match the content object of the rendered `<option>`\nelement:\n\n```javascript\n\nvar yehuda = {firstName: \"Yehuda\", id: 1, bff4eva: 'tom'}\nvar tom = {firstName: \"Tom\", id: 2, bff4eva: 'yehuda'};\n\nApp.ApplicationController = Ember.ObjectController.extend({\n selectedPerson: tom,\n programmers: [ yehuda, tom ]\n});\n```\n\n```handlebars\n{{view \"select\"\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n selection=selectedPerson}}\n```\n\nWould result in the following HTML with a selected option:\n\n```html\n<select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n</select>\n```\n\nInteracting with the rendered element by selecting the first option\n('Yehuda') will update the `selectedPerson` to match the object of\nthe newly selected `<option>`. In this case it is the first object\nin the `programmers`\n\n## Supplying a Prompt\n\nA `null` value for the `Ember.Select`'s `value` or `selection` property\nresults in there being no `<option>` with a `selected` attribute:\n\n```javascript\nApp.ApplicationController = Ember.ObjectController.extend({\n selectedProgrammer: null,\n programmers: [\"Yehuda\", \"Tom\"]\n});\n```\n\n``` handlebars\n{{view \"select\"\n content=programmers\n value=selectedProgrammer\n}}\n```\n\nWould result in the following HTML:\n\n```html\n<select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n</select>\n```\n\nAlthough `selectedProgrammer` is `null` and no `<option>`\nhas a `selected` attribute the rendered HTML will display the\nfirst item as though it were selected. You can supply a string\nvalue for the `Ember.Select` to display when there is no selection\nwith the `prompt` option:\n\n```javascript\nApp.ApplicationController = Ember.ObjectController.extend({\n selectedProgrammer: null,\n programmers: [ \"Yehuda\", \"Tom\" ]\n});\n```\n\n```handlebars\n{{view \"select\"\n content=programmers\n value=selectedProgrammer\n prompt=\"Please select a name\"\n}}\n```\n\nWould result in the following HTML:\n\n```html\n<select class=\"ember-select\">\n <option>Please select a name</option>\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n</select>\n```", |
4058 | 4058 | "extends": "Ember.View" |
4059 | 4059 | }, |
|
20111 | 20111 | }, |
20112 | 20112 | { |
20113 | 20113 | "file": "packages/ember-views/lib/views/select.js", |
20114 | | - "line": 354, |
| 20114 | + "line": 340, |
20115 | 20115 | "description": "The `multiple` attribute of the select element. Indicates whether multiple\noptions can be selected.", |
20116 | 20116 | "itemtype": "property", |
20117 | 20117 | "name": "multiple", |
|
20124 | 20124 | }, |
20125 | 20125 | { |
20126 | 20126 | "file": "packages/ember-views/lib/views/select.js", |
20127 | | - "line": 364, |
| 20127 | + "line": 350, |
20128 | 20128 | "description": "The `disabled` attribute of the select element. Indicates whether\nthe element is disabled from interactions.", |
20129 | 20129 | "itemtype": "property", |
20130 | 20130 | "name": "disabled", |
|
20137 | 20137 | }, |
20138 | 20138 | { |
20139 | 20139 | "file": "packages/ember-views/lib/views/select.js", |
20140 | | - "line": 374, |
| 20140 | + "line": 360, |
20141 | 20141 | "description": "The `required` attribute of the select element. Indicates whether\na selected option is required for form validation.", |
20142 | 20142 | "itemtype": "property", |
20143 | 20143 | "name": "required", |
|
20151 | 20151 | }, |
20152 | 20152 | { |
20153 | 20153 | "file": "packages/ember-views/lib/views/select.js", |
20154 | | - "line": 385, |
| 20154 | + "line": 371, |
20155 | 20155 | "description": "The list of options.\n\nIf `optionLabelPath` and `optionValuePath` are not overridden, this should\nbe a list of strings, which will serve simultaneously as labels and values.\n\nOtherwise, this should be a list of objects. For instance:\n\n```javascript\nvar App = Ember.Application.create();\nvar App.MySelect = Ember.Select.extend({\n content: Ember.A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n});\n```", |
20156 | 20156 | "itemtype": "property", |
20157 | 20157 | "name": "content", |
|
20164 | 20164 | }, |
20165 | 20165 | { |
20166 | 20166 | "file": "packages/ember-views/lib/views/select.js", |
20167 | | - "line": 411, |
| 20167 | + "line": 397, |
20168 | 20168 | "description": "When `multiple` is `false`, the element of `content` that is currently\nselected, if any.\n\nWhen `multiple` is `true`, an array of such elements.", |
20169 | 20169 | "itemtype": "property", |
20170 | 20170 | "name": "selection", |
|
20177 | 20177 | }, |
20178 | 20178 | { |
20179 | 20179 | "file": "packages/ember-views/lib/views/select.js", |
20180 | | - "line": 423, |
| 20180 | + "line": 409, |
20181 | 20181 | "description": "In single selection mode (when `multiple` is `false`), value can be used to\nget the current selection's value or set the selection by its value.\n\nIt is not currently supported in multiple selection mode.", |
20182 | 20182 | "itemtype": "property", |
20183 | 20183 | "name": "value", |
|
20190 | 20190 | }, |
20191 | 20191 | { |
20192 | 20192 | "file": "packages/ember-views/lib/views/select.js", |
20193 | | - "line": 443, |
| 20193 | + "line": 429, |
20194 | 20194 | "description": "If given, a top-most dummy option will be rendered to serve as a user\nprompt.", |
20195 | 20195 | "itemtype": "property", |
20196 | 20196 | "name": "prompt", |
|
20203 | 20203 | }, |
20204 | 20204 | { |
20205 | 20205 | "file": "packages/ember-views/lib/views/select.js", |
20206 | | - "line": 453, |
| 20206 | + "line": 439, |
20207 | 20207 | "description": "The path of the option labels. See [content](/api/classes/Ember.Select.html#property_content).", |
20208 | 20208 | "itemtype": "property", |
20209 | 20209 | "name": "optionLabelPath", |
|
20216 | 20216 | }, |
20217 | 20217 | { |
20218 | 20218 | "file": "packages/ember-views/lib/views/select.js", |
20219 | | - "line": 462, |
| 20219 | + "line": 448, |
20220 | 20220 | "description": "The path of the option values. See [content](/api/classes/Ember.Select.html#property_content).", |
20221 | 20221 | "itemtype": "property", |
20222 | 20222 | "name": "optionValuePath", |
|
20229 | 20229 | }, |
20230 | 20230 | { |
20231 | 20231 | "file": "packages/ember-views/lib/views/select.js", |
20232 | | - "line": 471, |
| 20232 | + "line": 457, |
20233 | 20233 | "description": "The path of the option group.\nWhen this property is used, `content` should be sorted by `optionGroupPath`.", |
20234 | 20234 | "itemtype": "property", |
20235 | 20235 | "name": "optionGroupPath", |
|
20242 | 20242 | }, |
20243 | 20243 | { |
20244 | 20244 | "file": "packages/ember-views/lib/views/select.js", |
20245 | | - "line": 481, |
| 20245 | + "line": 467, |
20246 | 20246 | "description": "The view class for optgroup.", |
20247 | 20247 | "itemtype": "property", |
20248 | 20248 | "name": "groupView", |
|
20255 | 20255 | }, |
20256 | 20256 | { |
20257 | 20257 | "file": "packages/ember-views/lib/views/select.js", |
20258 | | - "line": 511, |
| 20258 | + "line": 497, |
20259 | 20259 | "description": "The view class for option.", |
20260 | 20260 | "itemtype": "property", |
20261 | 20261 | "name": "optionView", |
|
0 commit comments