@omegagrid/commands 0.10.102 → 0.10.103

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.
@@ -8,6 +8,7 @@ export type Options = {
8
8
  itemStyle?: CSSResultOrNative | string | (CSSResultOrNative | string)[];
9
9
  itemHeight?: number;
10
10
  inputDelay?: number;
11
+ collapseToggle?: boolean;
11
12
  } & CommonOptions;
12
13
  export declare function initOptions(options?: Partial<Options>, origOptions?: Options): Options;
13
14
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/model/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAGxC,MAAM,MAAM,OAAO,GAAG;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,iBAAiB,GAAC,MAAM,GAAC,CAAC,iBAAiB,GAAC,MAAM,CAAC,EAAE,CAAC;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,aAAa,CAAC;AAQlB,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,WAAW,GAAE,OAAc,GAAG,OAAO,CAS5F"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/model/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAGxC,MAAM,MAAM,OAAO,GAAG;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,iBAAiB,GAAC,MAAM,GAAC,CAAC,iBAAiB,GAAC,MAAM,CAAC,EAAE,CAAC;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,aAAa,CAAC;AASlB,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,WAAW,GAAE,OAAc,GAAG,OAAO,CAS5F"}
@@ -4,6 +4,7 @@ const DEFAULT_OPTIONS = {
4
4
  commandDelimiter: '>',
5
5
  itemHeight: constants.COMMAND_ITEM_HEIGHT,
6
6
  inputDelay: 100,
7
+ collapseToggle: false
7
8
  };
8
9
  export function initOptions(options, origOptions = null) {
9
10
  const opts = {
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/model/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAGnE,OAAO,SAAS,MAAM,cAAc,CAAC;AAWrC,MAAM,eAAe,GAAqB;IACzC,gBAAgB,EAAE,GAAG;IACrB,UAAU,EAAE,SAAS,CAAC,mBAAmB;IACzC,UAAU,EAAE,GAAG;CACf,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,OAA0B,EAAE,cAAuB,IAAI;IAClF,MAAM,IAAI,GAAG;QACZ,GAAG,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC;QAC1C,GAAG,eAAe;QAClB,GAAG,WAAW;QACd,GAAG,OAAO;KACV,CAAC;IAEF,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["import { initCommonOptions, CommonOptions } from \"@omegagrid/core\";\nimport { CommandRenderer, GroupRenderer } from \"../ui\";\nimport { CSSResultOrNative } from \"lit\";\nimport constants from \"../constants\";\n\nexport type Options = {\n\tcommandRenderer?: CommandRenderer,\n\tgroupRenderer?: GroupRenderer,\n\tcommandDelimiter?: string,\n\titemStyle?: CSSResultOrNative|string|(CSSResultOrNative|string)[],\n\titemHeight?: number,\n\tinputDelay?: number,\n} & CommonOptions;\n\nconst DEFAULT_OPTIONS: Partial<Options> = {\n\tcommandDelimiter: '>',\n\titemHeight: constants.COMMAND_ITEM_HEIGHT,\n\tinputDelay: 100,\n};\n\nexport function initOptions(options?: Partial<Options>, origOptions: Options = null): Options {\n\tconst opts = {\n\t\t...initCommonOptions(options, origOptions),\n\t\t...DEFAULT_OPTIONS,\n\t\t...origOptions,\n\t\t...options,\n\t};\n\n\treturn opts;\n}\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/model/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAGnE,OAAO,SAAS,MAAM,cAAc,CAAC;AAYrC,MAAM,eAAe,GAAqB;IACzC,gBAAgB,EAAE,GAAG;IACrB,UAAU,EAAE,SAAS,CAAC,mBAAmB;IACzC,UAAU,EAAE,GAAG;IACf,cAAc,EAAE,KAAK;CACrB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,OAA0B,EAAE,cAAuB,IAAI;IAClF,MAAM,IAAI,GAAG;QACZ,GAAG,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC;QAC1C,GAAG,eAAe;QAClB,GAAG,WAAW;QACd,GAAG,OAAO;KACV,CAAC;IAEF,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["import { initCommonOptions, CommonOptions } from \"@omegagrid/core\";\nimport { CommandRenderer, GroupRenderer } from \"../ui\";\nimport { CSSResultOrNative } from \"lit\";\nimport constants from \"../constants\";\n\nexport type Options = {\n\tcommandRenderer?: CommandRenderer,\n\tgroupRenderer?: GroupRenderer,\n\tcommandDelimiter?: string,\n\titemStyle?: CSSResultOrNative|string|(CSSResultOrNative|string)[],\n\titemHeight?: number,\n\tinputDelay?: number,\n\tcollapseToggle?: boolean\n} & CommonOptions;\n\nconst DEFAULT_OPTIONS: Partial<Options> = {\n\tcommandDelimiter: '>',\n\titemHeight: constants.COMMAND_ITEM_HEIGHT,\n\tinputDelay: 100,\n\tcollapseToggle: false\n};\n\nexport function initOptions(options?: Partial<Options>, origOptions: Options = null): Options {\n\tconst opts = {\n\t\t...initCommonOptions(options, origOptions),\n\t\t...DEFAULT_OPTIONS,\n\t\t...origOptions,\n\t\t...options,\n\t};\n\n\treturn opts;\n}\n"]}
@@ -70,11 +70,14 @@ export declare class CommandWindow extends LitElement {
70
70
  private _updateToken;
71
71
  updateCommands(updateOptions?: boolean): Promise<void>;
72
72
  toggleGroup(groupId: string): Promise<void>;
73
+ toggleCollapse(): Promise<void>;
73
74
  private getSectionTitle;
74
75
  layout(): void;
76
+ get hasControls(): boolean;
75
77
  renderTabs: () => "" | TemplateResult<1>;
76
78
  renderDropdown: () => "" | TemplateResult<1>;
77
- renderSwitches: () => "" | TemplateResult<1>;
79
+ get isCollapsed(): boolean;
80
+ renderControls: () => "" | TemplateResult<1>;
78
81
  render: () => TemplateResult<1>;
79
82
  }
80
83
  //# sourceMappingURL=commandWindow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commandWindow.d.ts","sourceRoot":"","sources":["../../src/ui/commandWindow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAe,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACrH,OAAO,EAAE,eAAe,EAAC,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAe,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAA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EnB,cAAc,CAAC,aAAa,UAAQ;IAwCpC,WAAW,CAAC,OAAO,EAAE,MAAM;IAiC3B,cAAc;IAoCpB,OAAO,CAAC,eAAe;IAIvB,MAAM;IAQN,IAAI,WAAW,YAEd;IAED,UAAU,+BAiBJ;IAEN,cAAc,+BAYP;IAEP,IAAI,WAAW,YAGd;IAED,cAAc,+BA2BP;IAEP,MAAM,0BAyCJ;CAEF"}
@@ -211,20 +211,32 @@ let CommandWindow = class CommandWindow extends LitElement {
211
211
  }))}">
212
212
  </og-dropdown-list>
213
213
  ` : '';
214
- this.renderSwitches = () => this.activeSection?.switches?.length > 0 ? html `
215
- <div class="switches">
216
- ${this.activeSection.switches.map((s) => html `
217
- <og-button
218
- type="toggle"
219
- .text="${s.value}"
220
- .state="${s.checked ? 'checked' : 'unchecked'}"
221
- @click="${(e) => {
214
+ this.renderControls = () => this.hasControls ? html `
215
+ <div class="controls">
216
+ <div class="switches">
217
+ ${this.activeSection?.switches?.map((s) => html `
218
+ <og-button
219
+ type="toggle"
220
+ .text="${s.value}"
221
+ .state="${s.checked ? 'checked' : 'unchecked'}"
222
+ @click="${(e) => {
222
223
  s.checked = e.target.state === 'checked';
223
224
  this.focus();
224
225
  this.updateCommands();
225
226
  }}">
226
- </og-button>
227
- `)}
227
+ </og-button>
228
+ `)}
229
+ </div>
230
+
231
+ ${this.options.collapseToggle && this.visibleItems?.[0] ? html `
232
+ <div class="buttons">
233
+ <og-button
234
+ color="transparent"
235
+ .icon="${this.isCollapsed ? 'square-plus' : 'square-minus'}"
236
+ @click="${() => this.toggleCollapse()}">
237
+ </og-button>
238
+ </div>
239
+ ` : ''}
228
240
  </div>
229
241
  ` : '';
230
242
  this.render = () => html `
@@ -240,7 +252,7 @@ let CommandWindow = class CommandWindow extends LitElement {
240
252
  ${this.sectionPosition == 'right' ? this.renderDropdown() : ''}
241
253
  </div>
242
254
 
243
- ${this.sectionPosition != 'bottom' ? this.renderSwitches() : ''}
255
+ ${this.sectionPosition != 'bottom' ? this.renderControls() : ''}
244
256
 
245
257
  ${this.text != null ? html `<div class="text">${this.text}</div>` : ''}
246
258
 
@@ -265,7 +277,7 @@ let CommandWindow = class CommandWindow extends LitElement {
265
277
  </og-list>
266
278
  </div>
267
279
 
268
- ${this.sectionPosition == 'bottom' ? this.renderSwitches() : ''}
280
+ ${this.sectionPosition == 'bottom' ? this.renderControls() : ''}
269
281
 
270
282
  ${this.sectionPosition == 'bottom' ? this.renderTabs() : ''}
271
283
  `;
@@ -374,6 +386,38 @@ let CommandWindow = class CommandWindow extends LitElement {
374
386
  }
375
387
  }
376
388
  this.list.size = this.visibleItems.length;
389
+ this.requestUpdate();
390
+ }
391
+ async toggleCollapse() {
392
+ const open = this.isCollapsed;
393
+ const groups = [...this.model.groups.values()];
394
+ this.list.reset();
395
+ if (open && this.adapter) {
396
+ // load commands of groups that are being opened, same as in toggleGroup
397
+ await Promise.all(groups.filter(g => !g.open).map(async (group) => {
398
+ const commands = await this.adapter.getCommands({
399
+ sectionId: this.activeSection?.id,
400
+ groupId: group.id,
401
+ filter: this.filterValue
402
+ });
403
+ if (commands?.length > 0) {
404
+ group.commands.clear();
405
+ commands.forEach(c => {
406
+ if (!c.group || c.group == group.id)
407
+ group.addCommand(c);
408
+ });
409
+ }
410
+ }));
411
+ }
412
+ groups.forEach(g => g.open = open);
413
+ this.visibleItems = this.adapter
414
+ ? this.model.filter(null, this.showGroups, true)
415
+ : this.model.filter(this.filterValue, this.showGroups, true);
416
+ this.list.size = this.visibleItems.length;
417
+ this.list.selectedIndex = Math.max(0, this.visibleItems.findIndex(item => item instanceof Command));
418
+ this.list.renderItems(true);
419
+ this.requestUpdate(); // visibleItems is not reactive, refresh collapse button icon
420
+ this.focus();
377
421
  }
378
422
  getSectionTitle(section) {
379
423
  return (section.title ?? section.id) + (section.triggerCommand ? ` (${section.triggerCommand})` : '');
@@ -385,6 +429,14 @@ let CommandWindow = class CommandWindow extends LitElement {
385
429
  this.listWrapper.style.flexBasis = dom.px(this.list.offsetHeight);
386
430
  dom.setSize(this.listWrapper, { h: this.list.offsetHeight });
387
431
  }
432
+ get hasControls() {
433
+ return this.activeSection?.switches?.length > 0 || this.options.collapseToggle;
434
+ }
435
+ get isCollapsed() {
436
+ if (!(this.visibleItems?.[0] instanceof CommandGroup))
437
+ return false;
438
+ return !this.visibleItems[0].open;
439
+ }
388
440
  };
389
441
  CommandWindow.styles = [style];
390
442
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"commandWindow.js","sourceRoot":"","sources":["../../src/ui/commandWindow.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAmB,WAAW,EAA8B,MAAM,UAAU,CAAC;AAErH,OAAO,EAAU,GAAG,EAA0F,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzJ,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,MAAM,OAAO,YAAa,SAAQ,KAAK;IAMtC,YAAY,IAAY,EAAE,IAA4B;QACrD,KAAK,CAAC,WAAW,IAAI,EAAE,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;QACzD,IAAI,IAAI;YAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;CACD;AAKD,MAAM,wBAAwB,GAAoB,CAAC,IAAoB,EAAE,OAAgB,EAAE,EAAE;IAC5F,O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AK,CAAC,OAAO,CAAC;4CACS;AAGxB;IADC,KAAK,CAAC,kBAAkB,CAAC;+CACH;AAvEX,aAAa;IADzB,aAAa,CAAC,aAAa,CAAC;GAChB,aAAa,CA8azB","sourcesContent":["import { Commands, Command, CommandGroup, CommandsSection, initOptions, CommandMode, CommandSource } from \"../model\";\nimport { CommandsAdapter} from \"../adapters\";\nimport { Button, dom, DropdownList, events, List, ListItemRenderer, ListItemRendererOptions, ListSelectEvent, ListSelectTrigger } from \"@omegagrid/core\";\nimport { LitElement, html, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { debounce } from \"ts-debounce\";\nimport { style, itemStyle } from \"./commandWindow.style\";\nimport { styleMap } from \"lit-html/directives/style-map.js\";\nimport { TabEvent } from \"@omegagrid/tabs\";\nimport { msg } from \"@omegagrid/localize\";\n\nexport class CommandEvent extends Event {\n\n\treadonly command?: Command;\n\treadonly value?: string;\n\treadonly section?: CommandsSection;\n\n\tconstructor(type: string, args?: Partial<CommandEvent>) {\n\t\tsuper(`command.${type}`, {bubbles: true, composed: true})\n\t\tif (args) Object.assign(this, args);\n\t}\n}\n\nexport type CommandRenderer = (div: HTMLDivElement, command: Command, opts?: ListItemRendererOptions) => string | void | TemplateResult<1> | null;\nexport type GroupRenderer = (div: HTMLDivElement, group: CommandGroup, opts?: ListItemRendererOptions) => string | void | TemplateResult<1> | null;\n\nconst DEFAULT_COMMAND_RENDERER: CommandRenderer = (_div: HTMLDivElement, command: Command) => {\n\treturn html`<div class=\"command\">${command.name}</div>`;\n};\n\nconst DEFAULT_GROUP_RENDERER: GroupRenderer = (_div: HTMLDivElement, group: CommandGroup) => {\n\treturn html`\n\t\t<div class=\"group\" @mousedown=\"${(e: MouseEvent) => e.preventDefault()}\">\n\t\t\t<div class=\"group-toggle\">\n\t\t\t\t<og-icon icon=\"angle-${group.open ? 'down' : 'right'}\"></og-icon>\n\t\t\t</div>\n\n\t\t\t<div class=\"group-text\">\n\t\t\t\t${group.name}\n\t\t\t</div>\n\t\t</div>\n\t`;\n};\n\n@customElement('og-commands')\nexport class CommandWindow extends LitElement {\n\n\tstatic styles = [style];\n\n\tprivate visibleItems: (Command|CommandGroup)[];\n\n\t@property({type: Object})\n\toptions = initOptions();\n\n\t/**\n\t * search = commands are filtered by input value\n\t * input = commands are not filtered, input is used to enter custom value\n\t * none = no input, only command list is shown\n\t */\n\t@property({type: String})\n\tmode: CommandMode = 'search';\n\n\t@property({type: String})\n\tvalue: string;\n\n\t@property({type: String, reflect: true})\n\tsectionPosition: 'top'|'bottom'|'left'|'right' = 'right';\n\n\t@property({type: Number})\n\tdropdownWidth = 100;\n\n\t@property({type: String})\n\ttext: string;\n\n\t@property({type: Array})\n\tcommands: CommandSource[];\n\n\t@property({type: Object})\n\tadapter: CommandsAdapter;\n\n\t@property({type: Object})\n\ttarget: HTMLElement;\n\n\t/** default input placeholder, sections can override it with their own */\n\t@property({type: String})\n\tplaceholder = '';\n\n\t/** currently displayed placeholder (section placeholder or the default one) */\n\t@state()\n\tactivePlaceholder = '';\n\n\t@property({type: Boolean})\n\tshowGroups = false\n\n\t@property({type: Object})\n\tmodel = new Commands();\n\n\t@state()\n\tsections: CommandsSection[] = [{id: 'default'}];\n\n\t@state()\n\tactiveSectionIndex = 0;\n\n\t@state()\n\tnoResults = false;\n\n\t@query('.list')\n\tlistWrapper: HTMLDivElement;\n\n\t@query('og-list')\n\tlist: List;\n\n\t@query('input')\n\tinput: HTMLInputElement;\n\n\t@query('og-dropdown-list')\n\tdropdown: DropdownList;\n\n\tget activeSection() { return this.sections?.[this.activeSectionIndex] }\n\n\tget inputValue() { return this.input?.value ?? '' }\n\tget parsedInput() {\n\t\tconst input = this.inputValue;\n\t\tconst chunks = input.split(' ', 2);\n\t\tif (chunks.length > 1) {\n\t\t\tconst section = (this.sections ?? []).findIndex(s => s?.triggerCommand == chunks[0]);\n\t\t\tconst value = section > -1 ? chunks[1] ?? '' : input;\n\t\t\treturn { section, value };\n\t\t} else {\n\t\t\treturn { section: -1, value: input};\n\t\t}\n\t}\n\n\tget filterValue() {\n\t\treturn this.mode == 'search' ? this.parsedInput?.value ?? '' : '';\n\t}\n\n\tget commandRenderer(): CommandRenderer {\n\t\treturn this.options?.commandRenderer || DEFAULT_COMMAND_RENDERER;\n\t}\n\n\tget groupRenderer(): GroupRenderer {\n\t\treturn this.options?.groupRenderer || DEFAULT_GROUP_RENDERER;\n\t}\n\n\tasync exec(dispatchEvent = true) {\n\t\tconst input = this.parsedInput;\n\t\tconst command = this.visibleItems[this.list.selectedIndex];\n\n\t\tif (!(command instanceof Command)) return;\n\n\t\tthis.clearFilter(false);\n\n\t\tcommand.exec(input.value);\n\t\tif (this.adapter) {\n\t\t\tthis.adapter.exec(command, input.value);\n\t\t}\n\n\t\tif (dispatchEvent) this.dispatchEvent(new CommandEvent('exec', {\n\t\t\tcommand: command,\n\t\t\tsection: this.sections.find(s => s.id === input.section),\n\t\t\tvalue: input.value\n\t\t}));\n\t}\n\n\t_onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key != 'Escape') e.stopPropagation();\n\n\t\tswitch (e.key) {\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.list.moveDown();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.list.moveUp();\n\t\t\t\tbreak;\n\t\t\tcase 'Enter':\n\t\t\t\te.preventDefault();\n\t\t\t\tif (this.visibleItems[this.list.selectedIndex] instanceof CommandGroup)\n\t\t\t\t\tthis.toggleGroup((this.visibleItems[this.list.selectedIndex] as CommandGroup).id);\n\t\t\t\telse this.exec();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t_debounceInput = debounce(() => {\n\t\tif (this.mode == 'search') {\n\t\t\tconst input = this.parsedInput;\n\t\t\tif (input.section > -1) {\n\t\t\t\tthis.activeSectionIndex = input.section;\n\t\t\t\tthis.input.value = '';\n\t\t\t\tthis.updateCommands(true);\n\t\t\t} else {\n\t\t\t\tthis.updateCommands();\n\t\t\t}\n\t\t} else if (this.mode == 'none') { // online highlight first match\n\t\t\tconst input = this.parsedInput;\n\t\t\tconst commands = this.model.filter(input.value, false) as Command[];\n\t\t\tif (commands.length > 0) {\n\t\t\t\tconst index = this.visibleItems.findIndex(item => item instanceof Command && item.id === commands[0].id);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tthis.list.selectedIndex = index;\n\t\t\t\t\tthis.list.renderItems(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, this.options.inputDelay);\n\n\t_onInput = (e: InputEvent) => {\n\t\te.stopPropagation();\n\t\tthis._debounceInput();\n\t}\n\n\t_onSectionSelect = async (e: TabEvent) => {\n\t\tif (this.activeSectionIndex == e.index) return;\n\t\tthis.activeSectionIndex = e.index;\n\t\tthis.updateCommands(true);\n\t\tthis.focus();\n\t}\n\n\t_onDropdownChange = async (_e: events.ChangeEvent) => {\n\t\tthis.activeSectionIndex = this.sections.findIndex(s => s.id === this.dropdown.value);\n\t\tthis.updateCommands(true);\n\t\tthis.focus();\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('click', e => e.stopPropagation());\n\t\tthis.addEventListener('keydown', this._onKeyDown);\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\tfocus() {\n\t\tthis.input?.focus();\n\t}\n\n\tclearFilter(updateCommands = true) {\n\t\tthis.input.value = '';\n\t\tthis.focus();\n\t\tif (updateCommands) this.updateCommands();\n\t}\n\n\tasync willUpdate(props: PropertyValues) {\n\t\tif (props.has('adapter') && this.adapter) {\n\t\t\tthis.adapter.attach(this);\n\t\t\tconst sections = await this.adapter.getSections();\n\t\t\tconst options = await this.adapter.getOptions(sections?.length ? sections[0].id : null);\n\t\t\tthis.sections = sections;\n\t\t\tif (options) this.options = initOptions(options);\n\t\t} else {\n\t\t\tif (props.has('commands') && this.commands) {\n\t\t\t\tthis.model.clear();\n\t\t\t\tthis.commands.forEach(c => this.model.register(c));\n\t\t\t}\n\n\t\t\tif (props.has('options')) {\n\t\t\t\tthis.options = initOptions(this.options);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync updated(props: Map<PropertyKey, unknown>) {\n\t\tif (['commands', 'adapter', 'model', 'activeSectionIndex'].some(p => props.has(p))) {\n\t\t\tawait this.updateCommands(true);\n\t\t}\n\t}\n\n\t_onSelect = (e: ListSelectEvent) => {\n\t\tconst item = this.visibleItems[e.index];\n\t\tif (item instanceof Command) {\n\t\t\tif (this.mode == 'search') this.input.value = item.name;\n\t\t\tif (e.trigger == ListSelectTrigger.Click || e.trigger == ListSelectTrigger.Enter) {\n\t\t\t\tthis.exec();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.input.value = '';\n\t\t\tif (e.trigger == ListSelectTrigger.Click || e.trigger == ListSelectTrigger.Enter) {\n\t\t\t\tthis.toggleGroup((item as CommandGroup).id);\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(() => this.input.focus());\n\t}\n\n\t_itemRenderer: ListItemRenderer = (div: HTMLDivElement, index: number, opts?: ListItemRendererOptions) => {\n\t\treturn this.visibleItems[index] instanceof CommandGroup\n\t\t\t? this.groupRenderer(div, this.visibleItems[index] as CommandGroup, opts)\n\t\t\t: this.commandRenderer(div, this.visibleItems[index] as Command, opts);\n\t}\n\n\tprivate _updateToken = 0;\n\n\tasync updateCommands(updateOptions = false) {\n\t\tif (this.adapter) {\n\t\t\tthis.model.clear();\n\t\t\tconst switches = this.activeSection?.switches?.filter(s => s.checked).map(s => s.key) || [];\n\n\t\t\tif (updateOptions) {\n\t\t\t\tconst options = await this.adapter.getOptions(this.activeSection?.id);\n\t\t\t\tthis.options = initOptions(options);\n\t\t\t}\n\n\t\t\tthis._updateToken++; // prevents race conditions when multiple requests are made in quick succession\n\t\t\tconst updateToken = this._updateToken;\n\n\t\t\tconst [groups, commands] = (await Promise.all([this.adapter.getGroups({\n\t\t\t\tsectionId: this.activeSection?.id,\n\t\t\t\tfilter: this.filterValue,\n\t\t\t\tswitches\n\t\t\t}), this.adapter.getCommands({\n\t\t\t\tsectionId: this.activeSection?.id,\n\t\t\t\tfilter: this.filterValue,\n\t\t\t\tswitches\n\t\t\t})]));\n\n\t\t\tif (updateToken != this._updateToken) return;\n\n\t\t\tgroups?.forEach(group => this.model.registerGroup(group));\n\t\t\tcommands?.forEach(command => this.model.register(command));\n\t\t\tthis.visibleItems = this.model.filter(null, this.showGroups, true);\n\t\t} else {\n\t\t\tthis.visibleItems = this.model.filter(this.filterValue, this.showGroups);\n\t\t}\n\n\t\tthis.activePlaceholder = this.activeSection?.placeholder || this.placeholder || '';\n\t\tthis.list.reset();\n\t\tthis.list.size = this.visibleItems.length;\n\t\tthis.list.selectedIndex = this.visibleItems.findIndex(item => item instanceof Command) ?? 0;\n\t\tthis.list.renderItems(true);\n\t\tthis.noResults = this.visibleItems.length == 0;\n\t}\n\n\tasync toggleGroup(groupId: string) {\n\t\tconst group = this.model.groups.get(groupId);\n\t\tthis.list.reset();\n\n\t\tif (group.open) {\n\t\t\tgroup.open = false;\n\t\t\tthis.visibleItems = this.model.filter(this.filterValue, this.showGroups, true);\n\t\t\tthis.list.size = this.visibleItems.length;\n\t\t} else {\n\t\t\tgroup.open = true;\n\t\t\tif (this.adapter) {\n\t\t\t\tconst commands = (await Promise.all([this.adapter.getCommands({\n\t\t\t\t\tsectionId: this.activeSection?.id,\n\t\t\t\t\tgroupId,\n\t\t\t\t\tfilter: this.filterValue\n\t\t\t\t})]))[0];\n\n\t\t\t\tif (commands.length > 0) {\n\t\t\t\t\tgroup.commands.clear();\n\t\t\t\t\tcommands.forEach(c => {\n\t\t\t\t\t\tif (!c.group || c.group == groupId) group.addCommand(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.visibleItems = this.model.filter(null, this.showGroups, true);\n\t\t\t} else {\n\t\t\t\tthis.visibleItems = this.model.filter(this.filterValue, this.showGroups, true);\n\t\t\t}\n\t\t}\n\t\tthis.list.size = this.visibleItems.length;\n\t}\n\n\tprivate getSectionTitle(section: CommandsSection) {\n\t\treturn (section.title ?? section.id) + (section.triggerCommand ? ` (${section.triggerCommand})` : '');\n\t}\n\n\tlayout() {\n\t\tif (!this.listWrapper) return;\n\n\t\tthis.listWrapper.style.transition = `flex-basis 0.2s ease-in-out`;\n\t\tthis.listWrapper.style.flexBasis = dom.px(this.list.offsetHeight);\n\t\tdom.setSize(this.listWrapper, {h: this.list.offsetHeight});\n\t}\n\n\trenderTabs = () => this.sections?.length > 1 ? html`\n\t\t<og-container\n\t\t\t.horizontalSliderPosition=\"${this.sectionPosition == 'top' ? 'bottom' : 'top'}\"\n\t\t\tscrollMode=\"horizontal\"\n\t\t\tsliderSize=\"4\">\n\t\t\t<og-tabs\n\t\t\t\tslot=\"content\"\n\t\t\t\tclass=\"tabs\"\n\t\t\t\ttabSize=\"stretch\"\n\t\t\t\ttabAlign=\"center\"\n\t\t\t\tstyle=\"${styleMap({borderTop: this.sectionPosition == 'bottom' ? '1px solid var(--og-border)' : ''})}\"\n\t\t\t\t@tab.select=\"${this._onSectionSelect}\"\n\t\t\t\t.position=\"${this.sectionPosition == 'top' ? 'top' : 'bottom'}\"\n\t\t\t\t.selectedIndex=\"${this.activeSectionIndex}\"\n\t\t\t\t.items=\"${this.sections.map(section => ({...section, title: this.getSectionTitle(section)}))}\">\n\t\t\t</og-tabs>\n\t\t</og-container>\n\t` : ''\n\n\trenderDropdown = () => this.sections?.length > 1 ? html`\n\t\t<og-dropdown-list\n\t\t\tstyle=\"${styleMap({flex: `0 0 ${this.dropdownWidth}px`})}\"\n\t\t\tcolor=\"transparent\"\n\t\t\t.value=\"${this.activeSection?.id}\"\n\t\t\t@change=\"${this._onDropdownChange}\"\n\t\t\t.items=\"${this.sections.map(section => ({\n\t\t\t\tk: section.id as string,\n\t\t\t\tv: this.getSectionTitle(section),\n\t\t\t\ticon: section.icon\n\t\t\t}))}\">\n\t\t</og-dropdown-list>\n\t` : '';\n\n\trenderSwitches = () => this.activeSection?.switches?.length > 0 ? html`\n\t\t<div class=\"switches\">\n\t\t\t${this.activeSection.switches.map((s) => html`\n\t\t\t\t<og-button\n\t\t\t\t\ttype=\"toggle\"\n\t\t\t\t\t.text=\"${s.value}\"\n\t\t\t\t\t.state=\"${s.checked ? 'checked' : 'unchecked'}\"\n\t\t\t\t\t@click=\"${(e: PointerEvent) => {\n\t\t\t\t\t\ts.checked = (e.target as Button).state === 'checked';\n\t\t\t\t\t\tthis.focus();\n\t\t\t\t\t\tthis.updateCommands();\n\t\t\t\t\t}}\">\n\t\t\t\t</og-button>\n\t\t\t`)}\n\t\t</div>\n\t` : '';\n\n\trender = () => html`\n\t\t<div class=\"input\">\n\t\t\t${this.sectionPosition == 'left' ? this.renderDropdown() : ''}\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\t@input=\"${this._onInput}\"\n\t\t\t\t.placeholder=\"${this.activePlaceholder || this.placeholder}\"\n\t\t\t\t.value=\"${this.value ?? ''}\">\n\n\t\t\t${this.sectionPosition == 'right' ? this.renderDropdown() : ''}\n\t\t</div>\n\n\t\t${this.sectionPosition != 'bottom' ? this.renderSwitches() : ''}\n\n\t\t${this.text != null ? html`<div class=\"text\">${this.text}</div>` : ''}\n\n\t\t${this.sectionPosition == 'top' ? this.renderTabs() : ''}\n\n\t\t${this.noResults ? html`\n\t\t\t<div class=\"no-results\">${msg('No results found')}</div>\n\t\t` : ''}\n\n\t\t<div class=\"list\">\n\t\t\t<og-list\n\t\t\t\tanimations\n\t\t\t\tarrowEvents\n\t\t\t\tmaxHeight=\"300\"\n\t\t\t\t?dynamicItemHeight=\"${this.options?.commandRenderer != null}\"\n\t\t\t\t.customStyle=\"${[this.options?.itemStyle, itemStyle]}\"\n\t\t\t\t.lineHeight=\"${this.options.itemHeight - 2}\"\n\t\t\t\t.itemHeight=\"${this.options.itemHeight}\"\n\t\t\t\t.itemRenderer=\"${this._itemRenderer}\"\n\t\t\t\t@select=\"${this._onSelect}\"\n\t\t\t\t@render=\"${() => this.layout()}\">\n\t\t\t</og-list>\n\t\t</div>\n\n\t\t${this.sectionPosition == 'bottom' ? this.renderSwitches() : ''}\n\n\t\t${this.sectionPosition == 'bottom' ? this.renderTabs() : ''}\n\t`;\n\n}\n"]}
1
+ {"version":3,"file":"commandWindow.js","sourceRoot":"","sources":["../../src/ui/commandWindow.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAmB,WAAW,EAA8B,MAAM,UAAU,CAAC;AAErH,OAAO,EAAU,GAAG,EAA0F,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzJ,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,MAAM,OAAO,YAAa,SAAQ,KAAK;IAMtC,YAAY,IAAY,EAAE,IAA4B;QACrD,KAAK,CAAC,WAAW,IAAI,EAAE,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;QACzD,IAAI,IAAI;YAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;CACD;AAKD,MAAM,wBAAwB,GAAoB,CAAC,IAAoB,EAAE,OAAgB,EAAE,EAAE;IAC5F,OAAO,IAAI,CAAA,wBAAwB,OAAO,CAAC,IAAI,QAAQ,CAAC;AACzD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EX,aAAa;IADzB,aAAa,CAAC,aAAa,CAAC;GAChB,aAAa,CAwezB","sourcesContent":["import { Commands, Command, CommandGroup, CommandsSection, initOptions, CommandMode, CommandSource } from \"../model\";\nimport { CommandsAdapter} from \"../adapters\";\nimport { Button, dom, DropdownList, events, List, ListItemRenderer, ListItemRendererOptions, ListSelectEvent, ListSelectTrigger } from \"@omegagrid/core\";\nimport { LitElement, html, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { debounce } from \"ts-debounce\";\nimport { style, itemStyle } from \"./commandWindow.style\";\nimport { styleMap } from \"lit-html/directives/style-map.js\";\nimport { TabEvent } from \"@omegagrid/tabs\";\nimport { msg } from \"@omegagrid/localize\";\n\nexport class CommandEvent extends Event {\n\n\treadonly command?: Command;\n\treadonly value?: string;\n\treadonly section?: CommandsSection;\n\n\tconstructor(type: string, args?: Partial<CommandEvent>) {\n\t\tsuper(`command.${type}`, {bubbles: true, composed: true})\n\t\tif (args) Object.assign(this, args);\n\t}\n}\n\nexport type CommandRenderer = (div: HTMLDivElement, command: Command, opts?: ListItemRendererOptions) => string | void | TemplateResult<1> | null;\nexport type GroupRenderer = (div: HTMLDivElement, group: CommandGroup, opts?: ListItemRendererOptions) => string | void | TemplateResult<1> | null;\n\nconst DEFAULT_COMMAND_RENDERER: CommandRenderer = (_div: HTMLDivElement, command: Command) => {\n\treturn html`<div class=\"command\">${command.name}</div>`;\n};\n\nconst DEFAULT_GROUP_RENDERER: GroupRenderer = (_div: HTMLDivElement, group: CommandGroup) => {\n\treturn html`\n\t\t<div class=\"group\" @mousedown=\"${(e: MouseEvent) => e.preventDefault()}\">\n\t\t\t<div class=\"group-toggle\">\n\t\t\t\t<og-icon icon=\"angle-${group.open ? 'down' : 'right'}\"></og-icon>\n\t\t\t</div>\n\n\t\t\t<div class=\"group-text\">\n\t\t\t\t${group.name}\n\t\t\t</div>\n\t\t</div>\n\t`;\n};\n\n@customElement('og-commands')\nexport class CommandWindow extends LitElement {\n\n\tstatic styles = [style];\n\n\tprivate visibleItems: (Command|CommandGroup)[];\n\n\t@property({type: Object})\n\toptions = initOptions();\n\n\t/**\n\t * search = commands are filtered by input value\n\t * input = commands are not filtered, input is used to enter custom value\n\t * none = no input, only command list is shown\n\t */\n\t@property({type: String})\n\tmode: CommandMode = 'search';\n\n\t@property({type: String})\n\tvalue: string;\n\n\t@property({type: String, reflect: true})\n\tsectionPosition: 'top'|'bottom'|'left'|'right' = 'right';\n\n\t@property({type: Number})\n\tdropdownWidth = 100;\n\n\t@property({type: String})\n\ttext: string;\n\n\t@property({type: Array})\n\tcommands: CommandSource[];\n\n\t@property({type: Object})\n\tadapter: CommandsAdapter;\n\n\t@property({type: Object})\n\ttarget: HTMLElement;\n\n\t/** default input placeholder, sections can override it with their own */\n\t@property({type: String})\n\tplaceholder = '';\n\n\t/** currently displayed placeholder (section placeholder or the default one) */\n\t@state()\n\tactivePlaceholder = '';\n\n\t@property({type: Boolean})\n\tshowGroups = false\n\n\t@property({type: Object})\n\tmodel = new Commands();\n\n\t@state()\n\tsections: CommandsSection[] = [{id: 'default'}];\n\n\t@state()\n\tactiveSectionIndex = 0;\n\n\t@state()\n\tnoResults = false;\n\n\t@query('.list')\n\tlistWrapper: HTMLDivElement;\n\n\t@query('og-list')\n\tlist: List;\n\n\t@query('input')\n\tinput: HTMLInputElement;\n\n\t@query('og-dropdown-list')\n\tdropdown: DropdownList;\n\n\tget activeSection() { return this.sections?.[this.activeSectionIndex] }\n\n\tget inputValue() { return this.input?.value ?? '' }\n\tget parsedInput() {\n\t\tconst input = this.inputValue;\n\t\tconst chunks = input.split(' ', 2);\n\t\tif (chunks.length > 1) {\n\t\t\tconst section = (this.sections ?? []).findIndex(s => s?.triggerCommand == chunks[0]);\n\t\t\tconst value = section > -1 ? chunks[1] ?? '' : input;\n\t\t\treturn { section, value };\n\t\t} else {\n\t\t\treturn { section: -1, value: input};\n\t\t}\n\t}\n\n\tget filterValue() {\n\t\treturn this.mode == 'search' ? this.parsedInput?.value ?? '' : '';\n\t}\n\n\tget commandRenderer(): CommandRenderer {\n\t\treturn this.options?.commandRenderer || DEFAULT_COMMAND_RENDERER;\n\t}\n\n\tget groupRenderer(): GroupRenderer {\n\t\treturn this.options?.groupRenderer || DEFAULT_GROUP_RENDERER;\n\t}\n\n\tasync exec(dispatchEvent = true) {\n\t\tconst input = this.parsedInput;\n\t\tconst command = this.visibleItems[this.list.selectedIndex];\n\n\t\tif (!(command instanceof Command)) return;\n\n\t\tthis.clearFilter(false);\n\n\t\tcommand.exec(input.value);\n\t\tif (this.adapter) {\n\t\t\tthis.adapter.exec(command, input.value);\n\t\t}\n\n\t\tif (dispatchEvent) this.dispatchEvent(new CommandEvent('exec', {\n\t\t\tcommand: command,\n\t\t\tsection: this.sections.find(s => s.id === input.section),\n\t\t\tvalue: input.value\n\t\t}));\n\t}\n\n\t_onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key != 'Escape') e.stopPropagation();\n\n\t\tswitch (e.key) {\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.list.moveDown();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.list.moveUp();\n\t\t\t\tbreak;\n\t\t\tcase 'Enter':\n\t\t\t\te.preventDefault();\n\t\t\t\tif (this.visibleItems[this.list.selectedIndex] instanceof CommandGroup)\n\t\t\t\t\tthis.toggleGroup((this.visibleItems[this.list.selectedIndex] as CommandGroup).id);\n\t\t\t\telse this.exec();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t_debounceInput = debounce(() => {\n\t\tif (this.mode == 'search') {\n\t\t\tconst input = this.parsedInput;\n\t\t\tif (input.section > -1) {\n\t\t\t\tthis.activeSectionIndex = input.section;\n\t\t\t\tthis.input.value = '';\n\t\t\t\tthis.updateCommands(true);\n\t\t\t} else {\n\t\t\t\tthis.updateCommands();\n\t\t\t}\n\t\t} else if (this.mode == 'none') { // online highlight first match\n\t\t\tconst input = this.parsedInput;\n\t\t\tconst commands = this.model.filter(input.value, false) as Command[];\n\t\t\tif (commands.length > 0) {\n\t\t\t\tconst index = this.visibleItems.findIndex(item => item instanceof Command && item.id === commands[0].id);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tthis.list.selectedIndex = index;\n\t\t\t\t\tthis.list.renderItems(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, this.options.inputDelay);\n\n\t_onInput = (e: InputEvent) => {\n\t\te.stopPropagation();\n\t\tthis._debounceInput();\n\t}\n\n\t_onSectionSelect = async (e: TabEvent) => {\n\t\tif (this.activeSectionIndex == e.index) return;\n\t\tthis.activeSectionIndex = e.index;\n\t\tthis.updateCommands(true);\n\t\tthis.focus();\n\t}\n\n\t_onDropdownChange = async (_e: events.ChangeEvent) => {\n\t\tthis.activeSectionIndex = this.sections.findIndex(s => s.id === this.dropdown.value);\n\t\tthis.updateCommands(true);\n\t\tthis.focus();\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('click', e => e.stopPropagation());\n\t\tthis.addEventListener('keydown', this._onKeyDown);\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\tfocus() {\n\t\tthis.input?.focus();\n\t}\n\n\tclearFilter(updateCommands = true) {\n\t\tthis.input.value = '';\n\t\tthis.focus();\n\t\tif (updateCommands) this.updateCommands();\n\t}\n\n\tasync willUpdate(props: PropertyValues) {\n\t\tif (props.has('adapter') && this.adapter) {\n\t\t\tthis.adapter.attach(this);\n\t\t\tconst sections = await this.adapter.getSections();\n\t\t\tconst options = await this.adapter.getOptions(sections?.length ? sections[0].id : null);\n\t\t\tthis.sections = sections;\n\t\t\tif (options) this.options = initOptions(options);\n\t\t} else {\n\t\t\tif (props.has('commands') && this.commands) {\n\t\t\t\tthis.model.clear();\n\t\t\t\tthis.commands.forEach(c => this.model.register(c));\n\t\t\t}\n\n\t\t\tif (props.has('options')) {\n\t\t\t\tthis.options = initOptions(this.options);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync updated(props: Map<PropertyKey, unknown>) {\n\t\tif (['commands', 'adapter', 'model', 'activeSectionIndex'].some(p => props.has(p))) {\n\t\t\tawait this.updateCommands(true);\n\t\t}\n\t}\n\n\t_onSelect = (e: ListSelectEvent) => {\n\t\tconst item = this.visibleItems[e.index];\n\t\tif (item instanceof Command) {\n\t\t\tif (this.mode == 'search') this.input.value = item.name;\n\t\t\tif (e.trigger == ListSelectTrigger.Click || e.trigger == ListSelectTrigger.Enter) {\n\t\t\t\tthis.exec();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.input.value = '';\n\t\t\tif (e.trigger == ListSelectTrigger.Click || e.trigger == ListSelectTrigger.Enter) {\n\t\t\t\tthis.toggleGroup((item as CommandGroup).id);\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(() => this.input.focus());\n\t}\n\n\t_itemRenderer: ListItemRenderer = (div: HTMLDivElement, index: number, opts?: ListItemRendererOptions) => {\n\t\treturn this.visibleItems[index] instanceof CommandGroup\n\t\t\t? this.groupRenderer(div, this.visibleItems[index] as CommandGroup, opts)\n\t\t\t: this.commandRenderer(div, this.visibleItems[index] as Command, opts);\n\t}\n\n\tprivate _updateToken = 0;\n\n\tasync updateCommands(updateOptions = false) {\n\t\tif (this.adapter) {\n\t\t\tthis.model.clear();\n\t\t\tconst switches = this.activeSection?.switches?.filter(s => s.checked).map(s => s.key) || [];\n\n\t\t\tif (updateOptions) {\n\t\t\t\tconst options = await this.adapter.getOptions(this.activeSection?.id);\n\t\t\t\tthis.options = initOptions(options);\n\t\t\t}\n\n\t\t\tthis._updateToken++; // prevents race conditions when multiple requests are made in quick succession\n\t\t\tconst updateToken = this._updateToken;\n\n\t\t\tconst [groups, commands] = (await Promise.all([this.adapter.getGroups({\n\t\t\t\tsectionId: this.activeSection?.id,\n\t\t\t\tfilter: this.filterValue,\n\t\t\t\tswitches\n\t\t\t}), this.adapter.getCommands({\n\t\t\t\tsectionId: this.activeSection?.id,\n\t\t\t\tfilter: this.filterValue,\n\t\t\t\tswitches\n\t\t\t})]));\n\n\t\t\tif (updateToken != this._updateToken) return;\n\n\t\t\tgroups?.forEach(group => this.model.registerGroup(group));\n\t\t\tcommands?.forEach(command => this.model.register(command));\n\t\t\tthis.visibleItems = this.model.filter(null, this.showGroups, true);\n\t\t} else {\n\t\t\tthis.visibleItems = this.model.filter(this.filterValue, this.showGroups);\n\t\t}\n\n\t\tthis.activePlaceholder = this.activeSection?.placeholder || this.placeholder || '';\n\t\tthis.list.reset();\n\t\tthis.list.size = this.visibleItems.length;\n\t\tthis.list.selectedIndex = this.visibleItems.findIndex(item => item instanceof Command) ?? 0;\n\t\tthis.list.renderItems(true);\n\t\tthis.noResults = this.visibleItems.length == 0;\n\t}\n\n\tasync toggleGroup(groupId: string) {\n\t\tconst group = this.model.groups.get(groupId);\n\t\tthis.list.reset();\n\n\t\tif (group.open) {\n\t\t\tgroup.open = false;\n\t\t\tthis.visibleItems = this.model.filter(this.filterValue, this.showGroups, true);\n\t\t\tthis.list.size = this.visibleItems.length;\n\t\t} else {\n\t\t\tgroup.open = true;\n\t\t\tif (this.adapter) {\n\t\t\t\tconst commands = (await Promise.all([this.adapter.getCommands({\n\t\t\t\t\tsectionId: this.activeSection?.id,\n\t\t\t\t\tgroupId,\n\t\t\t\t\tfilter: this.filterValue\n\t\t\t\t})]))[0];\n\n\t\t\t\tif (commands.length > 0) {\n\t\t\t\t\tgroup.commands.clear();\n\t\t\t\t\tcommands.forEach(c => {\n\t\t\t\t\t\tif (!c.group || c.group == groupId) group.addCommand(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.visibleItems = this.model.filter(null, this.showGroups, true);\n\t\t\t} else {\n\t\t\t\tthis.visibleItems = this.model.filter(this.filterValue, this.showGroups, true);\n\t\t\t}\n\t\t}\n\t\tthis.list.size = this.visibleItems.length;\n\t\tthis.requestUpdate();\n\t}\n\n\tasync toggleCollapse() {\n\t\tconst open = this.isCollapsed;\n\t\tconst groups = [...this.model.groups.values()];\n\t\tthis.list.reset();\n\n\t\tif (open && this.adapter) {\n\t\t\t// load commands of groups that are being opened, same as in toggleGroup\n\t\t\tawait Promise.all(groups.filter(g => !g.open).map(async group => {\n\t\t\t\tconst commands = await this.adapter.getCommands({\n\t\t\t\t\tsectionId: this.activeSection?.id,\n\t\t\t\t\tgroupId: group.id,\n\t\t\t\t\tfilter: this.filterValue\n\t\t\t\t});\n\n\t\t\t\tif (commands?.length > 0) {\n\t\t\t\t\tgroup.commands.clear();\n\t\t\t\t\tcommands.forEach(c => {\n\t\t\t\t\t\tif (!c.group || c.group == group.id) group.addCommand(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tgroups.forEach(g => g.open = open);\n\n\t\tthis.visibleItems = this.adapter\n\t\t\t? this.model.filter(null, this.showGroups, true)\n\t\t\t: this.model.filter(this.filterValue, this.showGroups, true);\n\n\t\tthis.list.size = this.visibleItems.length;\n\t\tthis.list.selectedIndex = Math.max(0, this.visibleItems.findIndex(item => item instanceof Command));\n\t\tthis.list.renderItems(true);\n\t\tthis.requestUpdate(); // visibleItems is not reactive, refresh collapse button icon\n\t\tthis.focus();\n\t}\n\n\tprivate getSectionTitle(section: CommandsSection) {\n\t\treturn (section.title ?? section.id) + (section.triggerCommand ? ` (${section.triggerCommand})` : '');\n\t}\n\n\tlayout() {\n\t\tif (!this.listWrapper) return;\n\n\t\tthis.listWrapper.style.transition = `flex-basis 0.2s ease-in-out`;\n\t\tthis.listWrapper.style.flexBasis = dom.px(this.list.offsetHeight);\n\t\tdom.setSize(this.listWrapper, {h: this.list.offsetHeight});\n\t}\n\n\tget hasControls() {\n\t\treturn this.activeSection?.switches?.length > 0 || this.options.collapseToggle;\n\t}\n\n\trenderTabs = () => this.sections?.length > 1 ? html`\n\t\t<og-container\n\t\t\t.horizontalSliderPosition=\"${this.sectionPosition == 'top' ? 'bottom' : 'top'}\"\n\t\t\tscrollMode=\"horizontal\"\n\t\t\tsliderSize=\"4\">\n\t\t\t<og-tabs\n\t\t\t\tslot=\"content\"\n\t\t\t\tclass=\"tabs\"\n\t\t\t\ttabSize=\"stretch\"\n\t\t\t\ttabAlign=\"center\"\n\t\t\t\tstyle=\"${styleMap({borderTop: this.sectionPosition == 'bottom' ? '1px solid var(--og-border)' : ''})}\"\n\t\t\t\t@tab.select=\"${this._onSectionSelect}\"\n\t\t\t\t.position=\"${this.sectionPosition == 'top' ? 'top' : 'bottom'}\"\n\t\t\t\t.selectedIndex=\"${this.activeSectionIndex}\"\n\t\t\t\t.items=\"${this.sections.map(section => ({...section, title: this.getSectionTitle(section)}))}\">\n\t\t\t</og-tabs>\n\t\t</og-container>\n\t` : ''\n\n\trenderDropdown = () => this.sections?.length > 1 ? html`\n\t\t<og-dropdown-list\n\t\t\tstyle=\"${styleMap({flex: `0 0 ${this.dropdownWidth}px`})}\"\n\t\t\tcolor=\"transparent\"\n\t\t\t.value=\"${this.activeSection?.id}\"\n\t\t\t@change=\"${this._onDropdownChange}\"\n\t\t\t.items=\"${this.sections.map(section => ({\n\t\t\t\tk: section.id as string,\n\t\t\t\tv: this.getSectionTitle(section),\n\t\t\t\ticon: section.icon\n\t\t\t}))}\">\n\t\t</og-dropdown-list>\n\t` : '';\n\n\tget isCollapsed() {\n\t\tif (!(this.visibleItems?.[0] instanceof CommandGroup)) return false;\n\t\treturn !this.visibleItems[0].open;\n\t}\n\n\trenderControls = () => this.hasControls ? html`\n\t\t<div class=\"controls\">\n\t\t\t<div class=\"switches\">\n\t\t\t\t${this.activeSection?.switches?.map((s) => html`\n\t\t\t\t\t<og-button\n\t\t\t\t\t\ttype=\"toggle\"\n\t\t\t\t\t\t.text=\"${s.value}\"\n\t\t\t\t\t\t.state=\"${s.checked ? 'checked' : 'unchecked'}\"\n\t\t\t\t\t\t@click=\"${(e: PointerEvent) => {\n\t\t\t\t\t\t\ts.checked = (e.target as Button).state === 'checked';\n\t\t\t\t\t\t\tthis.focus();\n\t\t\t\t\t\t\tthis.updateCommands();\n\t\t\t\t\t\t}}\">\n\t\t\t\t\t</og-button>\n\t\t\t\t`)}\n\t\t\t</div>\n\n\t\t\t${this.options.collapseToggle && this.visibleItems?.[0] ? html`\n\t\t\t\t<div class=\"buttons\">\n\t\t\t\t\t<og-button\n\t\t\t\t\t\tcolor=\"transparent\"\n\t\t\t\t\t\t.icon=\"${this.isCollapsed ? 'square-plus' : 'square-minus'}\"\n\t\t\t\t\t\t@click=\"${() => this.toggleCollapse()}\">\n\t\t\t\t\t</og-button>\n\t\t\t\t</div>\t\n\t\t\t` : ''}\n\t\t</div>\n\t` : '';\n\n\trender = () => html`\n\t\t<div class=\"input\">\n\t\t\t${this.sectionPosition == 'left' ? this.renderDropdown() : ''}\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\t@input=\"${this._onInput}\"\n\t\t\t\t.placeholder=\"${this.activePlaceholder || this.placeholder}\"\n\t\t\t\t.value=\"${this.value ?? ''}\">\n\n\t\t\t${this.sectionPosition == 'right' ? this.renderDropdown() : ''}\n\t\t</div>\n\n\t\t${this.sectionPosition != 'bottom' ? this.renderControls() : ''}\n\n\t\t${this.text != null ? html`<div class=\"text\">${this.text}</div>` : ''}\n\n\t\t${this.sectionPosition == 'top' ? this.renderTabs() : ''}\n\n\t\t${this.noResults ? html`\n\t\t\t<div class=\"no-results\">${msg('No results found')}</div>\n\t\t` : ''}\n\n\t\t<div class=\"list\">\n\t\t\t<og-list\n\t\t\t\tanimations\n\t\t\t\tarrowEvents\n\t\t\t\tmaxHeight=\"300\"\n\t\t\t\t?dynamicItemHeight=\"${this.options?.commandRenderer != null}\"\n\t\t\t\t.customStyle=\"${[this.options?.itemStyle, itemStyle]}\"\n\t\t\t\t.lineHeight=\"${this.options.itemHeight - 2}\"\n\t\t\t\t.itemHeight=\"${this.options.itemHeight}\"\n\t\t\t\t.itemRenderer=\"${this._itemRenderer}\"\n\t\t\t\t@select=\"${this._onSelect}\"\n\t\t\t\t@render=\"${() => this.layout()}\">\n\t\t\t</og-list>\n\t\t</div>\n\n\t\t${this.sectionPosition == 'bottom' ? this.renderControls() : ''}\n\n\t\t${this.sectionPosition == 'bottom' ? this.renderTabs() : ''}\n\t`;\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"commandWindow.style.d.ts","sourceRoot":"","sources":["../../src/ui/commandWindow.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,yBAyGjB,CAAC;AAEF,eAAO,MAAM,SAAS,yBAuCrB,CAAC"}
1
+ {"version":3,"file":"commandWindow.style.d.ts","sourceRoot":"","sources":["../../src/ui/commandWindow.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,yBAsHjB,CAAC;AAEF,eAAO,MAAM,SAAS,yBAuCrB,CAAC"}
@@ -95,11 +95,24 @@ export const style = css `
95
95
  padding-top: 6px;
96
96
  }
97
97
 
98
- .switches {
99
- padding: 0 6px 6px 6px;
98
+ .controls {
99
+ display: flex;
100
+ flex-direction: row;
101
+ align-items: center;
102
+ height: 16px;
103
+ margin-bottom: 6px;
104
+ padding: 0 6px;
105
+ }
106
+
107
+ .controls .buttons og-button {
108
+ width: 16px;
109
+ }
110
+
111
+ .controls .switches {
112
+ flex: 1;
100
113
  }
101
114
 
102
- .switches og-button {
115
+ .controls .switches og-button {
103
116
  font-size: 0.8em;
104
117
  height: 16px;
105
118
  border: 1px solid var(--og-accent-color);
@@ -1 +1 @@
1
- {"version":3,"file":"commandWindow.style.js","sourceRoot":"","sources":["../../src/ui/commandWindow.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGvB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BX,SAAS,CAAC,mBAAmB,GAAG,CAAC;;;;iBAIjC,SAAS,CAAC,mBAAmB,GAAG,CAAC;;;;;;;CAOjD,CAAC","sourcesContent":["import { css } from 'lit';\nimport constants from '../constants';\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host {\n\t\tbackground: var(--og-commands-background);\n\t\tcolor: var(--og-commands-color);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tbox-shadow: 0px 0px 6px 1px var(--og-commands-shadow);\n\t\tborder: 1px solid var(--og-border);\n\t\tborder-radius: var(--og-base-radius);\n\t\tfont-family: var(--og-font-family);\n\t\tfont-size: var(--og-font-size);\n\t}\n\n\t.text {\n\t\tpadding: 4px 4px 8px 4px;\n\t}\n\n\t.input {\n\t\twidth: 100%;\n\t\tpadding: 6px;\n\t\tdisplay: flex;\n\t\tflex: 0 0 40px;\n\t\tflex-direction: row;\n\t}\n\n\t:host([sectionposition=\"left\"]) .input > input {\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t:host([sectionposition=\"right\"]) .input > input {\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t}\n\n\t:host([sectionposition=\"left\"]) .input > og-dropdown-list {\n\t\tborder-right: none;\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t}\n\n\t:host([sectionposition=\"right\"]) .input > og-dropdown-list {\n\t\tborder-left: none;\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t.input > og-dropdown-list {\n\t\theight: 100%;\n\t\tborder: 1px solid var(--og-accent-color);\n\t\tpadding-right: 5px;\n\t}\n\n\t.input > input {\n\t\twidth: 100%;\n\t\tfont-size: 16px;\n\t\tpadding: 4px;\n\t\tborder: 1px solid var(--og-accent-color);\n\t\tborder-radius: var(--og-base-radius);\n\t\tbackground-color: var(--og-commands-input-background);\n\t\tcolor: var(--og-commands-color);\n\t\toutline: none;\n\t\tflex: 1;\n\t}\n\n\t.tabs {\n\t\tflex: 0;\n\t}\n\n\t.list {\n\t\tflex: 0;\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t}\n\n\tog-container {\n\t\theight: 30px;\n\t}\n\n\tog-list {\n\t\theight: 250px;\n\t}\n\n\t.no-results {\n\t\tpadding: 0 10px 10px 10px;\n\t}\n\n\t:host([sectionposition=\"bottom\"]) .switches {\n\t\tpadding-top: 6px;\n\t}\n\n\t.switches {\n\t\tpadding: 0 6px 6px 6px;\n\t}\n\n\t.switches og-button {\n\t\tfont-size: 0.8em;\n\t\theight: 16px;\n\t\tborder: 1px solid var(--og-accent-color);\n\t\tborder-radius: 8px;\n\t}\n`;\n\nexport const itemStyle = css`\n\t.item {\n\t\tborder: 1px solid transparent;\n\t\tborder-radius: var(--og-base-radius);\n\t}\n\n\t.item.selected {\n\t\tborder: 1px solid var(--og-accent-color);\n\t}\n\n\t.item>div {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\n\t\theight: 100%;\n\t\tpadding: 0 5px;\n\t}\n\n\t.item .group {\n\t\tbackground-color: var(--og-commands-header-background);\n\t\tborder-radius: var(--og-base-radius);\n\t}\n\n\t.item .group-toggle {\n\t\twidth: 15px;\n\t}\n\n\t.item .group-text {\n\t\tline-height: ${constants.COMMAND_ITEM_HEIGHT - 2}px;\n\t}\n\n\t.item .group og-icon {\n\t\tline-height: ${constants.COMMAND_ITEM_HEIGHT - 2}px;\n\t\tdisplay: inline;\n\t}\n\n\t.item .command {\n\t\tmargin-left: 10px;\n\t}\n`;\n"]}
1
+ {"version":3,"file":"commandWindow.style.js","sourceRoot":"","sources":["../../src/ui/commandWindow.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsHvB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BX,SAAS,CAAC,mBAAmB,GAAG,CAAC;;;;iBAIjC,SAAS,CAAC,mBAAmB,GAAG,CAAC;;;;;;;CAOjD,CAAC","sourcesContent":["import { css } from 'lit';\nimport constants from '../constants';\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host {\n\t\tbackground: var(--og-commands-background);\n\t\tcolor: var(--og-commands-color);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tbox-shadow: 0px 0px 6px 1px var(--og-commands-shadow);\n\t\tborder: 1px solid var(--og-border);\n\t\tborder-radius: var(--og-base-radius);\n\t\tfont-family: var(--og-font-family);\n\t\tfont-size: var(--og-font-size);\n\t}\n\n\t.text {\n\t\tpadding: 4px 4px 8px 4px;\n\t}\n\n\t.input {\n\t\twidth: 100%;\n\t\tpadding: 6px;\n\t\tdisplay: flex;\n\t\tflex: 0 0 40px;\n\t\tflex-direction: row;\n\t}\n\n\t:host([sectionposition=\"left\"]) .input > input {\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t:host([sectionposition=\"right\"]) .input > input {\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t}\n\n\t:host([sectionposition=\"left\"]) .input > og-dropdown-list {\n\t\tborder-right: none;\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t}\n\n\t:host([sectionposition=\"right\"]) .input > og-dropdown-list {\n\t\tborder-left: none;\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t.input > og-dropdown-list {\n\t\theight: 100%;\n\t\tborder: 1px solid var(--og-accent-color);\n\t\tpadding-right: 5px;\n\t}\n\n\t.input > input {\n\t\twidth: 100%;\n\t\tfont-size: 16px;\n\t\tpadding: 4px;\n\t\tborder: 1px solid var(--og-accent-color);\n\t\tborder-radius: var(--og-base-radius);\n\t\tbackground-color: var(--og-commands-input-background);\n\t\tcolor: var(--og-commands-color);\n\t\toutline: none;\n\t\tflex: 1;\n\t}\n\n\t.tabs {\n\t\tflex: 0;\n\t}\n\n\t.list {\n\t\tflex: 0;\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t}\n\n\tog-container {\n\t\theight: 30px;\n\t}\n\n\tog-list {\n\t\theight: 250px;\n\t}\n\n\t.no-results {\n\t\tpadding: 0 10px 10px 10px;\n\t}\n\n\t:host([sectionposition=\"bottom\"]) .switches {\n\t\tpadding-top: 6px;\n\t}\n\n\t.controls {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\theight: 16px;\n\t\tmargin-bottom: 6px;\n\t\tpadding: 0 6px;\n\t}\n\n\t.controls .buttons og-button {\n\t\twidth: 16px;\n\t}\n\n\t.controls .switches {\n\t\tflex: 1;\n\t}\n\n\t.controls .switches og-button {\n\t\tfont-size: 0.8em;\n\t\theight: 16px;\n\t\tborder: 1px solid var(--og-accent-color);\n\t\tborder-radius: 8px;\n\t}\n`;\n\nexport const itemStyle = css`\n\t.item {\n\t\tborder: 1px solid transparent;\n\t\tborder-radius: var(--og-base-radius);\n\t}\n\n\t.item.selected {\n\t\tborder: 1px solid var(--og-accent-color);\n\t}\n\n\t.item>div {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\n\t\theight: 100%;\n\t\tpadding: 0 5px;\n\t}\n\n\t.item .group {\n\t\tbackground-color: var(--og-commands-header-background);\n\t\tborder-radius: var(--og-base-radius);\n\t}\n\n\t.item .group-toggle {\n\t\twidth: 15px;\n\t}\n\n\t.item .group-text {\n\t\tline-height: ${constants.COMMAND_ITEM_HEIGHT - 2}px;\n\t}\n\n\t.item .group og-icon {\n\t\tline-height: ${constants.COMMAND_ITEM_HEIGHT - 2}px;\n\t\tdisplay: inline;\n\t}\n\n\t.item .command {\n\t\tmargin-left: 10px;\n\t}\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/commands",
3
- "version": "0.10.102",
3
+ "version": "0.10.103",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Command window",
6
6
  "main": "./dist/index.js",
@@ -27,9 +27,9 @@
27
27
  "_prepublish": "yarn test && yarn lint"
28
28
  },
29
29
  "dependencies": {
30
- "@omegagrid/core": "^0.10.102",
31
- "@omegagrid/localize": "^0.10.102",
32
- "@omegagrid/tabs": "^0.10.102",
30
+ "@omegagrid/core": "^0.10.103",
31
+ "@omegagrid/localize": "^0.10.103",
32
+ "@omegagrid/tabs": "^0.10.103",
33
33
  "lit": "^3.1.1",
34
34
  "lit-html": "^3.1.1",
35
35
  "ts-debounce": "^4.0.0"