@ni/nimble-components 29.1.7 → 29.2.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.
- package/dist/all-components-bundle.js +861 -470
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2873 -2758
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +1 -0
- package/dist/esm/all-components.js +1 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/combobox/template.js +1 -1
- package/dist/esm/combobox/template.js.map +1 -1
- package/dist/esm/list-option/template.js +1 -0
- package/dist/esm/list-option/template.js.map +1 -1
- package/dist/esm/list-option-group/index.d.ts +65 -0
- package/dist/esm/list-option-group/index.js +130 -0
- package/dist/esm/list-option-group/index.js.map +1 -0
- package/dist/esm/list-option-group/styles.d.ts +1 -0
- package/dist/esm/list-option-group/styles.js +62 -0
- package/dist/esm/list-option-group/styles.js.map +1 -0
- package/dist/esm/list-option-group/template.d.ts +2 -0
- package/dist/esm/list-option-group/template.js +37 -0
- package/dist/esm/list-option-group/template.js.map +1 -0
- package/dist/esm/rich-text/mention-listbox/template.js +3 -3
- package/dist/esm/rich-text/mention-listbox/template.js.map +1 -1
- package/dist/esm/select/index.d.ts +11 -2
- package/dist/esm/select/index.js +149 -36
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/select/template.d.ts +4 -0
- package/dist/esm/select/template.js +11 -2
- package/dist/esm/select/template.js.map +1 -1
- package/dist/esm/select/testing/select.pageobject.d.ts +4 -1
- package/dist/esm/select/testing/select.pageobject.js +15 -0
- package/dist/esm/select/testing/select.pageobject.js.map +1 -1
- package/dist/esm/wafer-map/{modules/experimental → experimental}/computations.d.ts +25 -8
- package/dist/esm/wafer-map/{modules/experimental → experimental}/computations.js +87 -8
- package/dist/esm/wafer-map/experimental/computations.js.map +1 -0
- package/dist/esm/wafer-map/{modules/experimental → experimental}/hover-handler.d.ts +1 -1
- package/dist/esm/wafer-map/{modules/experimental → experimental}/hover-handler.js +3 -5
- package/dist/esm/wafer-map/experimental/hover-handler.js.map +1 -0
- package/dist/esm/wafer-map/experimental/worker-renderer.d.ts +24 -0
- package/dist/esm/wafer-map/experimental/worker-renderer.js +75 -0
- package/dist/esm/wafer-map/experimental/worker-renderer.js.map +1 -0
- package/dist/esm/wafer-map/index.d.ts +4 -3
- package/dist/esm/wafer-map/index.js +54 -18
- package/dist/esm/wafer-map/index.js.map +1 -1
- package/dist/esm/wafer-map/modules/computations.d.ts +1 -1
- package/dist/esm/wafer-map/modules/computations.js.map +1 -1
- package/dist/esm/wafer-map/modules/data-manager.d.ts +2 -1
- package/dist/esm/wafer-map/modules/data-manager.js.map +1 -1
- package/dist/esm/wafer-map/modules/prerendering.js.map +1 -1
- package/dist/esm/wafer-map/modules/wafer-map-update-tracker.d.ts +4 -0
- package/dist/esm/wafer-map/modules/wafer-map-update-tracker.js +37 -2
- package/dist/esm/wafer-map/modules/wafer-map-update-tracker.js.map +1 -1
- package/dist/esm/wafer-map/types.d.ts +0 -16
- package/dist/esm/wafer-map/types.js.map +1 -1
- package/dist/esm/wafer-map/workers/matrix-renderer.d.ts +1 -1
- package/dist/esm/wafer-map/workers/matrix-renderer.js +1 -1
- package/dist/esm/wafer-map/workers/matrix-renderer.js.map +1 -1
- package/dist/esm/wafer-map/workers/types.d.ts +39 -0
- package/dist/esm/wafer-map/workers/types.js +2 -0
- package/dist/esm/wafer-map/workers/types.js.map +1 -0
- package/package.json +1 -1
- package/dist/esm/wafer-map/modules/experimental/computations.js.map +0 -1
- package/dist/esm/wafer-map/modules/experimental/data-manager.d.ts +0 -21
- package/dist/esm/wafer-map/modules/experimental/data-manager.js +0 -41
- package/dist/esm/wafer-map/modules/experimental/data-manager.js.map +0 -1
- package/dist/esm/wafer-map/modules/experimental/hover-handler.js.map +0 -1
- package/dist/esm/wafer-map/modules/experimental/prerendering.d.ts +0 -18
- package/dist/esm/wafer-map/modules/experimental/prerendering.js +0 -63
- package/dist/esm/wafer-map/modules/experimental/prerendering.js.map +0 -1
- package/dist/esm/wafer-map/modules/experimental/worker-renderer.d.ts +0 -13
- package/dist/esm/wafer-map/modules/experimental/worker-renderer.js +0 -96
- package/dist/esm/wafer-map/modules/experimental/worker-renderer.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,UAAU,CAAC;AAClB,OAAO,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AACxB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,CAAC;AAClB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,SAAS,CAAC;AACjB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AAClC,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAChC,OAAO,4BAA4B,CAAC;AACpC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC","sourcesContent":["/**\n * Import of all the web components available in Nimble.\n * Production applications are encouraged to import only components\n * that are required instead of leveraging this file.\n */\n\nimport './anchor';\nimport './anchor-button';\nimport './anchor-menu-item';\nimport './anchor-tab';\nimport './anchor-tabs';\nimport './anchor-tree-item';\nimport './anchored-region';\nimport './banner';\nimport './breadcrumb';\nimport './breadcrumb-item';\nimport './button';\nimport './card';\nimport './card-button';\nimport './checkbox';\nimport './combobox';\nimport './dialog';\nimport './drawer';\nimport './icons/all-icons';\nimport './label-provider/core';\nimport './label-provider/table';\nimport './list-option';\nimport './mapping/empty';\nimport './mapping/icon';\nimport './mapping/spinner';\nimport './mapping/text';\nimport './menu';\nimport './menu-button';\nimport './menu-item';\nimport './number-field';\nimport './radio';\nimport './radio-group';\nimport './rich-text/editor';\nimport './rich-text/viewer';\nimport './select';\nimport './spinner';\nimport './switch';\nimport './tab';\nimport './tab-panel';\nimport './table';\nimport './table-column/anchor';\nimport './table-column/date-text';\nimport './table-column/duration-text';\nimport './table-column/mapping';\nimport './table-column/number-text';\nimport './table-column/text';\nimport './tabs';\nimport './tabs-toolbar';\nimport './text-area';\nimport './text-field';\nimport './theme-provider';\nimport './toggle-button';\nimport './toolbar';\nimport './tooltip';\nimport './tree-item';\nimport './tree-view';\nimport './unit/byte';\nimport './unit/volt';\nimport './wafer-map';\n"]}
|
|
1
|
+
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,UAAU,CAAC;AAClB,OAAO,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AACxB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,CAAC;AAClB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,SAAS,CAAC;AACjB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AAClC,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAChC,OAAO,4BAA4B,CAAC;AACpC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC","sourcesContent":["/**\n * Import of all the web components available in Nimble.\n * Production applications are encouraged to import only components\n * that are required instead of leveraging this file.\n */\n\nimport './anchor';\nimport './anchor-button';\nimport './anchor-menu-item';\nimport './anchor-tab';\nimport './anchor-tabs';\nimport './anchor-tree-item';\nimport './anchored-region';\nimport './banner';\nimport './breadcrumb';\nimport './breadcrumb-item';\nimport './button';\nimport './card';\nimport './card-button';\nimport './checkbox';\nimport './combobox';\nimport './dialog';\nimport './drawer';\nimport './icons/all-icons';\nimport './label-provider/core';\nimport './label-provider/table';\nimport './list-option';\nimport './list-option-group';\nimport './mapping/empty';\nimport './mapping/icon';\nimport './mapping/spinner';\nimport './mapping/text';\nimport './menu';\nimport './menu-button';\nimport './menu-item';\nimport './number-field';\nimport './radio';\nimport './radio-group';\nimport './rich-text/editor';\nimport './rich-text/viewer';\nimport './select';\nimport './spinner';\nimport './switch';\nimport './tab';\nimport './tab-panel';\nimport './table';\nimport './table-column/anchor';\nimport './table-column/date-text';\nimport './table-column/duration-text';\nimport './table-column/mapping';\nimport './table-column/number-text';\nimport './table-column/text';\nimport './tabs';\nimport './tabs-toolbar';\nimport './text-area';\nimport './text-field';\nimport './theme-provider';\nimport './toggle-button';\nimport './toolbar';\nimport './tooltip';\nimport './tree-item';\nimport './tree-view';\nimport './unit/byte';\nimport './unit/volt';\nimport './wafer-map';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/combobox/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAGH,iBAAiB,EACjB,eAAe,EACf,OAAO,EACV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAGjB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,CAAA;;yBAER,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;wBACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;iBAC1B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;iBACrF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;oBACR,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;kBACjC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAmB,CAAC;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AC,OAAO,EAAE,UAAU,CAAC;;WAEvC,iBAAiB;cACd,GAAG,CAAC,QAAQ,CAAC;;;;yCAIc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,KAAK,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;yCACxE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;;;;uBAI3E,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;;;sBAGb,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;;;6BAGT,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;kBAC1B,GAAG,CAAC,SAAS,CAAC;;;sBAGV,OAAO,CAAC;IACtB,MAAM,EAAE,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,YAAY,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC/E,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,gBAAgB;CAC7B,CAAC;;;YAGM,iBAAiB;;CAE5B,CAAC","sourcesContent":["import { type ViewTemplate, html, ref, slotted } from '@microsoft/fast-element';\nimport {\n type FoundationElementTemplate,\n type ComboboxOptions,\n startSlotTemplate,\n endSlotTemplate,\n Listbox\n} from '@microsoft/fast-foundation';\nimport type { Combobox } from '.';\nimport { anchoredRegionTag } from '../anchored-region';\nimport { DropdownPosition } from '../patterns/dropdown/types';\nimport { overflow } from '../utilities/directive/overflow';\n\n// prettier-ignore\nexport const template: FoundationElementTemplate<\nViewTemplate<Combobox>,\nComboboxOptions\n> = (context, definition) => html`\n <template\n aria-disabled=\"${x => x.ariaDisabled}\"\n autocomplete=\"${x => x.autocomplete}\"\n class=\"${x => (x.open ? 'open' : '')} ${x => (x.disabled ? 'disabled' : '')} ${x => x.position}\"\n ?open=\"${x => x.open}\"\n tabindex=\"${x => (!x.disabled ? '0' : null)}\"\n @click=\"${(x, c) => x.clickHandler(c.event as MouseEvent)}\"\n @focusout=\"${(x, c) => x.focusoutHandler(c.event as FocusEvent)}\"\n @keydown=\"${(x, c) => x.keydownHandler(c.event as KeyboardEvent)}\"\n >\n <div class=\"control\" part=\"control\" ${ref('controlWrapper')}>\n ${startSlotTemplate(context, definition)}\n <slot name=\"control\">\n <input\n aria-activedescendant=\"${x => (x.open ? x.ariaActiveDescendant : null)}\"\n aria-autocomplete=\"${x => x.ariaAutoComplete}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-haspopup=\"listbox\"\n class=\"selected-value\"\n part=\"selected-value\"\n placeholder=\"${x => x.placeholder}\"\n role=\"combobox\"\n type=\"text\"\n ?disabled=\"${x => x.disabled}\"\n :value=\"${x => x.value}\"\n @input=\"${(x, c) => x.inputHandler(c.event as InputEvent)}\"\n @keyup=\"${(x, c) => x.keyupHandler(c.event as KeyboardEvent)}\"\n ${ref('control')}\n ${overflow('hasOverflow')}\n title=${x => (x.hasOverflow && x.value ? x.value : null)}\n />\n <div class=\"indicator\" part=\"indicator\" aria-hidden=\"true\">\n <slot name=\"indicator\">\n ${definition.indicator || ''}\n </slot>\n </div>\n </slot>\n ${endSlotTemplate(context, definition)}\n </div>\n <${anchoredRegionTag}\n ${ref('region')}\n class=\"anchored-region\"\n fixed-placement\n auto-update-mode=\"auto\"\n vertical-default-position=\"${x => (x.positionAttribute === DropdownPosition.above ? 'top' : 'bottom')}\"\n vertical-positioning-mode=\"${x => (!x.positionAttribute ? 'dynamic' : 'locktodefault')}\"\n horizontal-default-position=\"center\"\n horizontal-positioning-mode=\"locktodefault\"\n horizontal-scaling=\"anchor\"\n ?hidden=\"${x => !x.open}\">\n <div\n class=\"listbox\"\n id=\"${x => x.listboxId}\"\n part=\"listbox\"\n role=\"listbox\"\n ?disabled=\"${x => x.disabled}\"\n ${ref('listbox')}\n >\n <slot\n ${slotted({\n filter: (n: Node) => n instanceof HTMLElement && Listbox.slottedOptionFilter(n),\n flatten: true,\n property: 'slottedOptions',\n })}\n ></slot>\n </div>\n </${anchoredRegionTag}>\n </template>\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/combobox/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAGH,iBAAiB,EACjB,eAAe,EACf,OAAO,EACV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAGjB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,CAAA;;yBAER,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;wBACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;iBAC1B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;iBACrF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;oBACR,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;kBACjC,CAAC,CAAC,EAA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AC,IAAI,CAAC;;;;0BAIlD,UAAU,CAAC,SAAS,IAAI,EAAE;;;;cAItC,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC;;WAEvC,iBAAiB;cACd,GAAG,CAAC,QAAQ,CAAC;;;;yCAIc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,KAAK,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;yCACxE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;;;;uBAI3E,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;;;sBAGb,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;;;6BAGT,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;kBAC1B,GAAG,CAAC,SAAS,CAAC;;;sBAGV,OAAO,CAAC;IACtB,MAAM,EAAE,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,YAAY,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC/E,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,gBAAgB;CAC7B,CAAC;;;YAGM,iBAAiB;;CAE5B,CAAC","sourcesContent":["import { type ViewTemplate, html, ref, slotted } from '@microsoft/fast-element';\nimport {\n type FoundationElementTemplate,\n type ComboboxOptions,\n startSlotTemplate,\n endSlotTemplate,\n Listbox\n} from '@microsoft/fast-foundation';\nimport type { Combobox } from '.';\nimport { anchoredRegionTag } from '../anchored-region';\nimport { DropdownPosition } from '../patterns/dropdown/types';\nimport { overflow } from '../utilities/directive/overflow';\n\n// prettier-ignore\nexport const template: FoundationElementTemplate<\nViewTemplate<Combobox>,\nComboboxOptions\n> = (context, definition) => html`\n <template\n aria-disabled=\"${x => x.ariaDisabled}\"\n autocomplete=\"${x => x.autocomplete}\"\n class=\"${x => (x.open ? 'open' : '')} ${x => (x.disabled ? 'disabled' : '')} ${x => x.position}\"\n ?open=\"${x => x.open}\"\n tabindex=\"${x => (!x.disabled ? '0' : null)}\"\n @click=\"${(x, c) => x.clickHandler(c.event as MouseEvent)}\"\n @focusout=\"${(x, c) => x.focusoutHandler(c.event as FocusEvent)}\"\n @keydown=\"${(x, c) => x.keydownHandler(c.event as KeyboardEvent)}\"\n >\n <div class=\"control\" part=\"control\" ${ref('controlWrapper')}>\n ${startSlotTemplate(context, definition)}\n <slot name=\"control\">\n <input\n aria-activedescendant=\"${x => (x.open ? x.ariaActiveDescendant : null)}\"\n aria-autocomplete=\"${x => x.ariaAutoComplete}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-haspopup=\"listbox\"\n class=\"selected-value\"\n part=\"selected-value\"\n placeholder=\"${x => x.placeholder}\"\n role=\"combobox\"\n type=\"text\"\n ?disabled=\"${x => x.disabled}\"\n :value=\"${x => x.value}\"\n @input=\"${(x, c) => x.inputHandler(c.event as InputEvent)}\"\n @keyup=\"${(x, c) => x.keyupHandler(c.event as KeyboardEvent)}\"\n ${ref('control')}\n ${overflow('hasOverflow')}\n title=${x => (x.hasOverflow && x.value ? x.value : null)}\n />\n <div class=\"indicator\" part=\"indicator\" aria-hidden=\"true\">\n <slot name=\"indicator\">\n ${definition.indicator || ''}\n </slot>\n </div>\n </slot>\n ${endSlotTemplate(context, definition)}\n </div>\n <${anchoredRegionTag}\n ${ref('region')}\n class=\"anchored-region\"\n fixed-placement\n auto-update-mode=\"auto\"\n vertical-default-position=\"${x => (x.positionAttribute === DropdownPosition.above ? 'top' : 'bottom')}\"\n vertical-positioning-mode=\"${x => (!x.positionAttribute ? 'dynamic' : 'locktodefault')}\"\n horizontal-default-position=\"center\"\n horizontal-positioning-mode=\"locktodefault\"\n horizontal-scaling=\"anchor\"\n ?hidden=\"${x => !x.open}\">\n <div\n class=\"listbox\"\n id=\"${x => x.listboxId}\"\n part=\"listbox\"\n role=\"listbox\"\n ?disabled=\"${x => x.disabled}\"\n ${ref('listbox')}\n >\n <slot name=\"option\"\n ${slotted({\n filter: (n: Node) => n instanceof HTMLElement && Listbox.slottedOptionFilter(n),\n flatten: true,\n property: 'slottedOptions',\n })}\n ></slot>\n </div>\n </${anchoredRegionTag}>\n </template>\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/list-option/template.ts"],"names":[],"mappings":"AAAA,wMAAwM;AACxM,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EACH,iBAAiB,EAGjB,eAAe,EAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D;;;GAGG;AACH,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAGjB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,CAAA;;wBAET,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;yBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;yBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;yBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;wBACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;iBACzB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC,QAAQ,IAAI,UAAU,EAAE,CAAC,CAAC,QAAQ,IAAI,UAAU,CAAC;KACzF,MAAM,CAAC,OAAO,CAAC;KACf,IAAI,CAAC,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/list-option/template.ts"],"names":[],"mappings":"AAAA,wMAAwM;AACxM,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EACH,iBAAiB,EAGjB,eAAe,EAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D;;;GAGG;AACH,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAGjB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,CAAA;;wBAET,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;yBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;yBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;yBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;wBACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;iBACzB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC,QAAQ,IAAI,UAAU,EAAE,CAAC,CAAC,QAAQ,IAAI,UAAU,CAAC;KACzF,MAAM,CAAC,OAAO,CAAC;KACf,IAAI,CAAC,GAAG,CAAC;;;;UAIR,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC;;;;cAIlC,QAAQ,CAAC,aAAa,CAAC;oBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC;;oBAE1E,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC;;UAElD,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC;;CAE7C,CAAC","sourcesContent":["// Based on template in FAST repo: https://github.com/microsoft/fast/blob/2ea80697bc3a5193e6123fb08ac3be2a76571aeb/packages/web-components/fast-foundation/src/listbox-option/listbox-option.template.ts\nimport { html, ref, slotted } from '@microsoft/fast-element';\nimport type { ViewTemplate } from '@microsoft/fast-element';\nimport {\n startSlotTemplate,\n type FoundationElementTemplate,\n type ListboxOptionOptions,\n endSlotTemplate\n} from '@microsoft/fast-foundation';\nimport type { ListOption } from '.';\nimport { overflow } from '../utilities/directive/overflow';\n\n/**\n * The template for the {@link @microsoft/fast-foundation#(ListboxOption:class)} component.\n * @public\n */\n// prettier-ignore\nexport const template: FoundationElementTemplate<\nViewTemplate<ListOption>,\nListboxOptionOptions\n> = (context, definition) => html`\n <template\n aria-checked=\"${x => x.ariaChecked}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-posinset=\"${x => x.ariaPosInSet}\"\n aria-selected=\"${x => x.ariaSelected}\"\n aria-setsize=\"${x => x.ariaSetSize}\"\n class=\"${x => [x.checked && 'checked', x.selected && 'selected', x.disabled && 'disabled']\n .filter(Boolean)\n .join(' ')}\"\n role=\"option\"\n slot=\"option\"\n >\n ${startSlotTemplate(context, definition)}\n <span\n class=\"content\"\n part=\"content\"\n ${overflow('hasOverflow')}\n title=${x => (x.hasOverflow && x.elementTextContent ? x.elementTextContent : null)}\n >\n <slot ${ref('contentSlot')} ${slotted('content')}></slot>\n </span>\n ${endSlotTemplate(context, definition)}\n </template>\n`;\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
+
import { ListOption } from '../list-option';
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLElementTagNameMap {
|
|
5
|
+
'nimble-list-option-group': ListOptionGroup;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A nimble-styled HTML listbox option group
|
|
10
|
+
*/
|
|
11
|
+
export declare class ListOptionGroup extends FoundationElement {
|
|
12
|
+
/**
|
|
13
|
+
* The label for the group.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
* @remarks
|
|
17
|
+
* If a label is also provided via slotted content, the label attribute
|
|
18
|
+
* will have precedence.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The hidden state of the element.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
* @defaultValue - false
|
|
26
|
+
* @remarks
|
|
27
|
+
* HTML Attribute: hidden
|
|
28
|
+
*/
|
|
29
|
+
hidden: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* This attribute is required to allow use-cases that offer dynamic filtering
|
|
33
|
+
* (like the Select) to visually hide groups that are filtered out, but still
|
|
34
|
+
* allow users to use the native 'hidden' attribute without it being affected
|
|
35
|
+
* by the filtering process.
|
|
36
|
+
*/
|
|
37
|
+
visuallyHidden: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
topSeparatorVisible: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
bottomSeparatorVisible: boolean;
|
|
46
|
+
/** @internal */
|
|
47
|
+
hasOverflow: boolean;
|
|
48
|
+
/** @internal */
|
|
49
|
+
labelSlot: HTMLSlotElement;
|
|
50
|
+
/** @internal */
|
|
51
|
+
listOptions: ListOption[];
|
|
52
|
+
/** @internal */
|
|
53
|
+
get labelContent(): string;
|
|
54
|
+
private readonly hiddenOptions;
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
clickHandler(e: MouseEvent): void;
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
handleChange(source: unknown, propertyName: string): void;
|
|
63
|
+
private listOptionsChanged;
|
|
64
|
+
}
|
|
65
|
+
export declare const listOptionGroupTag = "nimble-list-option-group";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
+
import { observable, attr, volatile, Observable } from '@microsoft/fast-element';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
import { template } from './template';
|
|
6
|
+
import { ListOption } from '../list-option';
|
|
7
|
+
/**
|
|
8
|
+
* A nimble-styled HTML listbox option group
|
|
9
|
+
*/
|
|
10
|
+
export class ListOptionGroup extends FoundationElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* The hidden state of the element.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @defaultValue - false
|
|
18
|
+
* @remarks
|
|
19
|
+
* HTML Attribute: hidden
|
|
20
|
+
*/
|
|
21
|
+
this.hidden = false;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* This attribute is required to allow use-cases that offer dynamic filtering
|
|
25
|
+
* (like the Select) to visually hide groups that are filtered out, but still
|
|
26
|
+
* allow users to use the native 'hidden' attribute without it being affected
|
|
27
|
+
* by the filtering process.
|
|
28
|
+
*/
|
|
29
|
+
this.visuallyHidden = false;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
this.topSeparatorVisible = false;
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
this.bottomSeparatorVisible = false;
|
|
38
|
+
/** @internal */
|
|
39
|
+
this.hasOverflow = false;
|
|
40
|
+
this.hiddenOptions = new Set();
|
|
41
|
+
}
|
|
42
|
+
/** @internal */
|
|
43
|
+
get labelContent() {
|
|
44
|
+
if (this.label) {
|
|
45
|
+
return this.label;
|
|
46
|
+
}
|
|
47
|
+
if (!this.$fastController.isConnected) {
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
const nodes = this.labelSlot.assignedNodes();
|
|
51
|
+
return nodes
|
|
52
|
+
.filter(node => node.textContent?.trim() !== '')
|
|
53
|
+
.map(node => node.textContent?.trim())
|
|
54
|
+
.join(' ');
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
clickHandler(e) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
e.stopImmediatePropagation();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
handleChange(source, propertyName) {
|
|
67
|
+
if (source instanceof ListOption
|
|
68
|
+
&& (propertyName === 'hidden' || propertyName === 'visuallyHidden')) {
|
|
69
|
+
if (source.hidden || source.visuallyHidden) {
|
|
70
|
+
this.hiddenOptions.add(source);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this.hiddenOptions.delete(source);
|
|
74
|
+
}
|
|
75
|
+
this.visuallyHidden = this.hiddenOptions.size === this.listOptions.length;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
listOptionsChanged(prev, next) {
|
|
79
|
+
this.hiddenOptions.clear();
|
|
80
|
+
next.filter(o => o.hidden || o.visuallyHidden).forEach(o => this.hiddenOptions.add(o));
|
|
81
|
+
prev?.forEach(o => {
|
|
82
|
+
const notifier = Observable.getNotifier(o);
|
|
83
|
+
notifier.unsubscribe(this, 'hidden');
|
|
84
|
+
notifier.unsubscribe(this, 'visuallyHidden');
|
|
85
|
+
});
|
|
86
|
+
let allOptionsHidden = true;
|
|
87
|
+
next?.forEach(o => {
|
|
88
|
+
const notifier = Observable.getNotifier(o);
|
|
89
|
+
notifier.subscribe(this, 'hidden');
|
|
90
|
+
notifier.subscribe(this, 'visuallyHidden');
|
|
91
|
+
allOptionsHidden = allOptionsHidden && (o.hidden || o.visuallyHidden);
|
|
92
|
+
});
|
|
93
|
+
this.visuallyHidden = next.length === 0 || allOptionsHidden;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
__decorate([
|
|
97
|
+
attr
|
|
98
|
+
], ListOptionGroup.prototype, "label", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
attr({ mode: 'boolean' })
|
|
101
|
+
], ListOptionGroup.prototype, "hidden", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
attr({ attribute: 'visually-hidden', mode: 'boolean' })
|
|
104
|
+
], ListOptionGroup.prototype, "visuallyHidden", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
attr({ attribute: 'top-separator-visible', mode: 'boolean' })
|
|
107
|
+
], ListOptionGroup.prototype, "topSeparatorVisible", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
attr({ attribute: 'bottom-separator-visible', mode: 'boolean' })
|
|
110
|
+
], ListOptionGroup.prototype, "bottomSeparatorVisible", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
observable
|
|
113
|
+
], ListOptionGroup.prototype, "hasOverflow", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
observable
|
|
116
|
+
], ListOptionGroup.prototype, "listOptions", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
volatile
|
|
119
|
+
], ListOptionGroup.prototype, "labelContent", null);
|
|
120
|
+
const nimbleListOptionGroup = ListOptionGroup.compose({
|
|
121
|
+
baseName: 'list-option-group',
|
|
122
|
+
baseClass: FoundationElement,
|
|
123
|
+
template,
|
|
124
|
+
styles
|
|
125
|
+
});
|
|
126
|
+
DesignSystem.getOrCreate()
|
|
127
|
+
.withPrefix('nimble')
|
|
128
|
+
.register(nimbleListOptionGroup());
|
|
129
|
+
export const listOptionGroupTag = 'nimble-list-option-group';
|
|
130
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/list-option-group/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EACH,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,UAAU,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAA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cAAc,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,CAAC;IAChE,CAAC;CACJ;AAlHU;IADN,IAAI;8CACiB;AAWN;IADf,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;+CACK;AAUxB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;uDAC1B;AAMvB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4DAC3B;AAM5B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;+DAC3B;AAI/B;IADN,UAAU;oDACgB;AAOpB;IADN,UAAU;oDACuB;AAIlC;IADC,QAAQ;mDAeR;AAsDL,MAAM,qBAAqB,GAAG,eAAe,CAAC,OAAO,CAAC;IAClD,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,iBAAiB;IAC5B,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC","sourcesContent":["import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';\nimport {\n observable,\n attr,\n volatile,\n Observable\n} from '@microsoft/fast-element';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { ListOption } from '../list-option';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-list-option-group': ListOptionGroup;\n }\n}\n\n/**\n * A nimble-styled HTML listbox option group\n */\nexport class ListOptionGroup extends FoundationElement {\n /**\n * The label for the group.\n *\n * @public\n * @remarks\n * If a label is also provided via slotted content, the label attribute\n * will have precedence.\n */\n @attr\n public label?: string;\n\n /**\n * The hidden state of the element.\n *\n * @public\n * @defaultValue - false\n * @remarks\n * HTML Attribute: hidden\n */\n @attr({ mode: 'boolean' })\n public override hidden = false;\n\n /**\n * @internal\n * This attribute is required to allow use-cases that offer dynamic filtering\n * (like the Select) to visually hide groups that are filtered out, but still\n * allow users to use the native 'hidden' attribute without it being affected\n * by the filtering process.\n */\n @attr({ attribute: 'visually-hidden', mode: 'boolean' })\n public visuallyHidden = false;\n\n /**\n * @internal\n */\n @attr({ attribute: 'top-separator-visible', mode: 'boolean' })\n public topSeparatorVisible = false;\n\n /**\n * @internal\n */\n @attr({ attribute: 'bottom-separator-visible', mode: 'boolean' })\n public bottomSeparatorVisible = false;\n\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /** @internal */\n public labelSlot!: HTMLSlotElement;\n\n /** @internal */\n @observable\n public listOptions!: ListOption[];\n\n /** @internal */\n @volatile\n public get labelContent(): string {\n if (this.label) {\n return this.label;\n }\n\n if (!this.$fastController.isConnected) {\n return '';\n }\n\n const nodes = this.labelSlot.assignedNodes();\n return nodes\n .filter(node => node.textContent?.trim() !== '')\n .map(node => node.textContent?.trim())\n .join(' ');\n }\n\n private readonly hiddenOptions: Set<ListOption> = new Set();\n\n /**\n * @internal\n */\n public clickHandler(e: MouseEvent): void {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n\n /**\n * @internal\n */\n public handleChange(source: unknown, propertyName: string): void {\n if (\n source instanceof ListOption\n && (propertyName === 'hidden' || propertyName === 'visuallyHidden')\n ) {\n if (source.hidden || source.visuallyHidden) {\n this.hiddenOptions.add(source);\n } else {\n this.hiddenOptions.delete(source);\n }\n\n this.visuallyHidden = this.hiddenOptions.size === this.listOptions.length;\n }\n }\n\n private listOptionsChanged(\n prev: ListOption[] | undefined,\n next: ListOption[]\n ): void {\n this.hiddenOptions.clear();\n next.filter(o => o.hidden || o.visuallyHidden).forEach(o => this.hiddenOptions.add(o));\n prev?.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, 'hidden');\n notifier.unsubscribe(this, 'visuallyHidden');\n });\n\n let allOptionsHidden = true;\n next?.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.subscribe(this, 'hidden');\n notifier.subscribe(this, 'visuallyHidden');\n allOptionsHidden = allOptionsHidden && (o.hidden || o.visuallyHidden);\n });\n\n this.visuallyHidden = next.length === 0 || allOptionsHidden;\n }\n}\n\nconst nimbleListOptionGroup = ListOptionGroup.compose({\n baseName: 'list-option-group',\n baseClass: FoundationElement,\n template,\n styles\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleListOptionGroup());\nexport const listOptionGroupTag = 'nimble-list-option-group';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { display } from '../utilities/style/display';
|
|
3
|
+
import { borderColor, fillHoverColor, fillHoverSelectedColor, fillSelectedColor, groupHeaderFont, groupHeaderFontColor, groupHeaderTextTransform, smallPadding } from '../theme-provider/design-tokens';
|
|
4
|
+
export const styles = css `
|
|
5
|
+
${display('flex')}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
cursor: default;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:host([visually-hidden]) {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host::after,
|
|
17
|
+
:host::before {
|
|
18
|
+
content: ' ';
|
|
19
|
+
margin-top: ${smallPadding};
|
|
20
|
+
margin-bottom: ${smallPadding};
|
|
21
|
+
border-bottom: ${borderColor} 2px solid;
|
|
22
|
+
opacity: 0.1;
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([top-separator-visible])::before,
|
|
27
|
+
:host([bottom-separator-visible])::after {
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
slot[name='option']::slotted([role='option']) {
|
|
32
|
+
background-color: transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
slot[name='option']::slotted([role='option']:hover) {
|
|
36
|
+
background-color: ${fillHoverColor};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
slot[name='option']::slotted([role='option'][active-option]) {
|
|
40
|
+
background-color: ${fillSelectedColor};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
slot[name='option']::slotted([role='option'][active-option]:hover) {
|
|
44
|
+
background-color: ${fillHoverSelectedColor};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.label-display {
|
|
48
|
+
font: ${groupHeaderFont};
|
|
49
|
+
text-transform: ${groupHeaderTextTransform};
|
|
50
|
+
color: ${groupHeaderFontColor};
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
margin-left: ${smallPadding};
|
|
55
|
+
margin-bottom: ${smallPadding};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.label-slot.hidden {
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/list-option-group/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EACH,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,EACf,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;;;;;;;;;;;;sBAcC,YAAY;yBACT,YAAY;yBACZ,WAAW;;;;;;;;;;;;;;;4BAeR,cAAc;;;;4BAId,iBAAiB;;;;4BAIjB,sBAAsB;;;;gBAIlC,eAAe;0BACL,wBAAwB;iBACjC,oBAAoB;;;;uBAId,YAAY;yBACV,YAAY;;;;;;CAMpC,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { display } from '../utilities/style/display';\n\nimport {\n borderColor,\n fillHoverColor,\n fillHoverSelectedColor,\n fillSelectedColor,\n groupHeaderFont,\n groupHeaderFontColor,\n groupHeaderTextTransform,\n smallPadding\n} from '../theme-provider/design-tokens';\n\nexport const styles = css`\n ${display('flex')}\n\n :host {\n cursor: default;\n flex-direction: column;\n }\n\n :host([visually-hidden]) {\n display: none;\n }\n\n :host::after,\n :host::before {\n content: ' ';\n margin-top: ${smallPadding};\n margin-bottom: ${smallPadding};\n border-bottom: ${borderColor} 2px solid;\n opacity: 0.1;\n display: none;\n }\n\n :host([top-separator-visible])::before,\n :host([bottom-separator-visible])::after {\n display: block;\n }\n\n slot[name='option']::slotted([role='option']) {\n background-color: transparent;\n }\n\n slot[name='option']::slotted([role='option']:hover) {\n background-color: ${fillHoverColor};\n }\n\n slot[name='option']::slotted([role='option'][active-option]) {\n background-color: ${fillSelectedColor};\n }\n\n slot[name='option']::slotted([role='option'][active-option]:hover) {\n background-color: ${fillHoverSelectedColor};\n }\n\n .label-display {\n font: ${groupHeaderFont};\n text-transform: ${groupHeaderTextTransform};\n color: ${groupHeaderFontColor};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-left: ${smallPadding};\n margin-bottom: ${smallPadding};\n }\n\n .label-slot.hidden {\n display: none;\n }\n`;\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { html, ref, slotted, when } from '@microsoft/fast-element';
|
|
2
|
+
import { overflow } from '../utilities/directive/overflow';
|
|
3
|
+
import { ListOption } from '../list-option';
|
|
4
|
+
const isListOption = (n) => {
|
|
5
|
+
return n instanceof ListOption;
|
|
6
|
+
};
|
|
7
|
+
// prettier-ignore
|
|
8
|
+
export const template = html `
|
|
9
|
+
<template
|
|
10
|
+
role="group"
|
|
11
|
+
aria-label="${x => x.labelContent}"
|
|
12
|
+
slot="option"
|
|
13
|
+
>
|
|
14
|
+
<span ${overflow('hasOverflow')}
|
|
15
|
+
class="label-display"
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
title=${x => (x.hasOverflow && x.labelContent ? x.labelContent : null)}
|
|
18
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
19
|
+
>
|
|
20
|
+
${when(x => (typeof x.label === 'string'), html `${x => x.label}`)}
|
|
21
|
+
<slot ${ref('labelSlot')}
|
|
22
|
+
class="label-slot ${x => (typeof x.label === 'string' ? 'hidden' : '')}"
|
|
23
|
+
>
|
|
24
|
+
</slot>
|
|
25
|
+
</span>
|
|
26
|
+
<span class="content" part="content" role="none">
|
|
27
|
+
<slot name="option"
|
|
28
|
+
${slotted({
|
|
29
|
+
flatten: true,
|
|
30
|
+
filter: (n) => isListOption(n),
|
|
31
|
+
property: 'listOptions'
|
|
32
|
+
})}
|
|
33
|
+
></slot>
|
|
34
|
+
</span>
|
|
35
|
+
</template>
|
|
36
|
+
`;
|
|
37
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/list-option-group/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,YAAY,GAAG,CAAC,CAAO,EAAW,EAAE;IACtC,OAAO,CAAC,YAAY,UAAU,CAAC;AACnC,CAAC,CAAC;AAEF,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAiB;;;kBAG3B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;;;YAGzB,QAAQ,CAAC,aAAa,CAAC;;;gBAGnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;kBAC5D,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAmB,CAAC;;UAEvD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,EAAE,IAAI,CAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;gBAC1E,GAAG,CAAC,WAAW,CAAC;gCACA,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;;;;;;UAMxE,OAAO,CAAC;IACV,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,CAAC,CAAO,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACpC,QAAQ,EAAE,aAAa;CAC1B,CAAC;;;;CAIL,CAAC","sourcesContent":["import { html, ref, slotted, when } from '@microsoft/fast-element';\nimport type { ListOptionGroup } from '.';\nimport { overflow } from '../utilities/directive/overflow';\nimport { ListOption } from '../list-option';\n\nconst isListOption = (n: Node): boolean => {\n return n instanceof ListOption;\n};\n\n// prettier-ignore\nexport const template = html<ListOptionGroup>`\n<template\n role=\"group\"\n aria-label=\"${x => x.labelContent}\"\n slot=\"option\"\n>\n <span ${overflow('hasOverflow')} \n class=\"label-display\"\n aria-hidden=\"true\"\n title=${x => (x.hasOverflow && x.labelContent ? x.labelContent : null)}\n @click=\"${(x, c) => x.clickHandler(c.event as MouseEvent)}\"\n >\n ${when(x => (typeof x.label === 'string'), html<ListOptionGroup>`${x => x.label}`)} \n <slot ${ref('labelSlot')}\n class=\"label-slot ${x => (typeof x.label === 'string' ? 'hidden' : '')}\"\n >\n </slot>\n </span>\n <span class=\"content\" part=\"content\" role=\"none\">\n <slot name=\"option\"\n ${slotted({\n flatten: true,\n filter: (n: Node) => isListOption(n),\n property: 'listOptions'\n })}\n></slot>\n </span>\n</template>\n`;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html, ref, slotted } from '@microsoft/fast-element';
|
|
2
|
-
import {
|
|
2
|
+
import { Listbox } from '@microsoft/fast-foundation';
|
|
3
3
|
import { anchoredRegionTag } from '../../anchored-region';
|
|
4
4
|
// prettier-ignore
|
|
5
5
|
export const template = html `
|
|
@@ -22,8 +22,8 @@ export const template = html `
|
|
|
22
22
|
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
23
23
|
?disabled="${x => x.disabled}"
|
|
24
24
|
>
|
|
25
|
-
<slot
|
|
26
|
-
${slotted({ filter: (n) => n instanceof HTMLElement &&
|
|
25
|
+
<slot name="option"
|
|
26
|
+
${slotted({ filter: (n) => n instanceof HTMLElement && Listbox.slottedOptionFilter(n), flatten: true, property: 'slottedOptions' })}
|
|
27
27
|
>
|
|
28
28
|
</slot>
|
|
29
29
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/rich-text/mention-listbox/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/rich-text/mention-listbox/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAwB;;WAEzC,iBAAiB;cACd,GAAG,CAAC,QAAQ,CAAC;;;;;;;;;uBASJ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;;;;;0BAKT,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAmB,CAAC;6BAC5C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;;;sBAGtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,YAAY,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;;;;YAIjJ,iBAAiB;;CAE5B,CAAC","sourcesContent":["import { html, ref, slotted } from '@microsoft/fast-element';\nimport { Listbox } from '@microsoft/fast-foundation';\nimport type { RichTextMentionListbox } from '.';\nimport { anchoredRegionTag } from '../../anchored-region';\n\n// prettier-ignore\nexport const template = html<RichTextMentionListbox>`\n <template>\n <${anchoredRegionTag}\n ${ref('region')}\n class=\"anchored-region\"\n fixed-placement\n auto-update-mode=\"auto\"\n vertical-default-position=\"bottom\"\n vertical-positioning-mode=\"locktodefault\"\n horizontal-default-position=\"center\"\n horizontal-positioning-mode=\"locktodefault\"\n horizontal-scaling=\"anchor\"\n ?hidden=\"${x => !x.open}\">\n <div\n class=\"listbox\"\n part=\"listbox\"\n role=\"listbox\"\n @click=\"${(x, c) => x.clickHandler(c.event as MouseEvent)}\"\n ?disabled=\"${x => x.disabled}\"\n >\n <slot name=\"option\"\n ${slotted({ filter: (n: Node) => n instanceof HTMLElement && Listbox.slottedOptionFilter(n), flatten: true, property: 'slottedOptions' })}\n >\n </slot>\n </div>\n </${anchoredRegionTag}>\n </template>\n`;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnchoredRegion, ListboxOption, SelectPosition } from '@microsoft/fast-foundation';
|
|
2
2
|
import { DropdownAppearance, ListOptionOwner } from '../patterns/dropdown/types';
|
|
3
3
|
import type { ErrorPattern } from '../patterns/error/types';
|
|
4
|
-
import { ListOption } from '../list-option';
|
|
4
|
+
import type { ListOption } from '../list-option';
|
|
5
5
|
import { FilterMode } from './types';
|
|
6
6
|
import { FormAssociatedSelect } from './models/select-form-associated';
|
|
7
7
|
declare global {
|
|
@@ -122,7 +122,7 @@ export declare class Select extends FormAssociatedSelect implements ErrorPattern
|
|
|
122
122
|
/**
|
|
123
123
|
* @internal
|
|
124
124
|
*/
|
|
125
|
-
slottedOptionsChanged(prev: Element[], next: Element[]): void;
|
|
125
|
+
slottedOptionsChanged(prev: Element[] | undefined, next: Element[] | undefined): void;
|
|
126
126
|
/**
|
|
127
127
|
* @internal
|
|
128
128
|
*/
|
|
@@ -267,16 +267,25 @@ export declare class Select extends FormAssociatedSelect implements ErrorPattern
|
|
|
267
267
|
* @internal
|
|
268
268
|
*/
|
|
269
269
|
protected setDefaultSelectedOption(): void;
|
|
270
|
+
private getSlottedOptions;
|
|
270
271
|
private setActiveOption;
|
|
271
272
|
private focusAndScrollActiveOptionIntoView;
|
|
272
273
|
private getPlaceholderOption;
|
|
273
274
|
private setPositioning;
|
|
275
|
+
private updateAdjacentSeparatorState;
|
|
276
|
+
private setTopSeparatorState;
|
|
277
|
+
private setBottomSeparatorState;
|
|
278
|
+
private getPreviousVisibleOptionOrGroup;
|
|
279
|
+
private getNextVisibleOptionOrGroup;
|
|
280
|
+
private isOptionHiddenOrFilteredOut;
|
|
281
|
+
private filterMatchesText;
|
|
274
282
|
/**
|
|
275
283
|
* Filter available options by text value.
|
|
276
284
|
*
|
|
277
285
|
* @public
|
|
278
286
|
*/
|
|
279
287
|
private filterOptions;
|
|
288
|
+
private getGroupOptions;
|
|
280
289
|
/**
|
|
281
290
|
* Sets the value and display value to match the first selected option.
|
|
282
291
|
*
|