Api: Add missed et2-select-access widget

This commit is contained in:
nathan 2024-02-14 15:27:28 -07:00
parent 2bbac91254
commit 222c56f5af
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import {Et2Select} from "../Et2Select";
import {Et2StaticSelectMixin, StaticOptions} from "../StaticOptions";
export class Et2SelectAccess extends Et2StaticSelectMixin(Et2Select)
{
constructor()
{
super();
this._static_options = StaticOptions.access(this);
}
}
customElements.define("et2-select-access", Et2SelectAccess);

View File

@ -2,6 +2,7 @@
* Import all our sub-types * Import all our sub-types
*/ */
import './Select/Et2SelectAccess';
import './Select/Et2SelectAccount'; import './Select/Et2SelectAccount';
import './Select/Et2SelectApp'; import './Select/Et2SelectApp';
import './Select/Et2SelectBitwise'; import './Select/Et2SelectBitwise';

View File

@ -379,6 +379,15 @@ export const StaticOptions = new class StaticOptionsType
return this.cached_server_side(widget, 'select-app', options, true); return this.cached_server_side(widget, 'select-app', options, true);
} }
access(widget : Et2SelectWidgets) : SelectOption[]
{
return [
{value: "private", label: "Private"},
{value: "public", label: "Global public"},
{value: "group", label: "Group public"}
];
}
cat(widget : Et2SelectWidgets) : Promise<SelectOption[]> cat(widget : Et2SelectWidgets) : Promise<SelectOption[]>
{ {
var options = [widget.globalCategories, /*?*/, widget.application, widget.parentCat]; var options = [widget.globalCategories, /*?*/, widget.application, widget.parentCat];