@omegagrid/toolbar 0.6.107 → 0.6.109
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/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorTypes, ComponentId, IconSpec } from "@omegagrid/core";
|
|
1
|
+
import { ColorTypes, ComponentAdapter, ComponentId, IconSpec } from "@omegagrid/core";
|
|
2
2
|
import { NodeSource } from "@omegagrid/tree";
|
|
3
3
|
import { TemplateResult } from "lit-html";
|
|
4
4
|
export type ToolbarItemType = 'divider' | 'button' | 'togglebutton' | 'dropdown' | 'dropdown-button' | 'dropdown-custom' | 'color' | 'text' | 'label' | 'dropdown-menu';
|
|
@@ -15,6 +15,7 @@ export type ToolbarItem = {
|
|
|
15
15
|
caption?: string;
|
|
16
16
|
content?: TemplateResult<1>;
|
|
17
17
|
items?: ToolbarItem[][] | NodeSource[];
|
|
18
|
+
adapter?: ComponentAdapter;
|
|
18
19
|
colspan?: number;
|
|
19
20
|
default?: boolean;
|
|
20
21
|
placeholder?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,eAAe,GAC1B,SAAS,GAAC,QAAQ,GAAC,cAAc,GAAC,UAAU,GAAC,iBAAiB,GAC9D,iBAAiB,GAAC,OAAO,GAAC,MAAM,GAAC,OAAO,GAAC,eAAe,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAC,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,EAAE,EAAE,GAAC,UAAU,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,WAAW,CAAC,GAAC,WAAW,CAAC;CACzF,CAAA"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColorTypes, ComponentId, IconSpec } from \"@omegagrid/core\";\nimport { NodeSource } from \"@omegagrid/tree\"\nimport { TemplateResult } from \"lit-html\";\n\nexport type ToolbarItemType = \n\t'divider'|'button'|'togglebutton'|'dropdown'|'dropdown-button'|\n\t'dropdown-custom'|'color'|'text'|'label'|'dropdown-menu';\n\nexport type ToolbarItem = {\n\ttype: ToolbarItemType,\n\tid: string,\n\ttitle?: string,\n\tvalue?: unknown,\n\ttooltip?: string,\n\tcolor?: ColorTypes,\n\ticon?: IconSpec|string,\n\twidth?: number,\n\ttext?: string,\n\tcaption?: string,\n\tcontent?: TemplateResult<1>,\n\titems?: ToolbarItem[][]|NodeSource[],\n\tcolspan?: number,\n\tdefault?: boolean,\n\tplaceholder?: string,\n\tdisabled?: boolean,\n\thidden?: boolean,\n\tgap?: number,\n\toptions?: Record<string, unknown>,\n\tcreateComponent?: (id: ComponentId, value?: unknown) => Promise<HTMLElement>|HTMLElement,\n}"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColorTypes, ComponentAdapter, ComponentId, IconSpec } from \"@omegagrid/core\";\nimport { NodeSource } from \"@omegagrid/tree\"\nimport { TemplateResult } from \"lit-html\";\n\nexport type ToolbarItemType = \n\t'divider'|'button'|'togglebutton'|'dropdown'|'dropdown-button'|\n\t'dropdown-custom'|'color'|'text'|'label'|'dropdown-menu';\n\nexport type ToolbarItem = {\n\ttype: ToolbarItemType,\n\tid: string,\n\ttitle?: string,\n\tvalue?: unknown,\n\ttooltip?: string,\n\tcolor?: ColorTypes,\n\ticon?: IconSpec|string,\n\twidth?: number,\n\ttext?: string,\n\tcaption?: string,\n\tcontent?: TemplateResult<1>,\n\titems?: ToolbarItem[][]|NodeSource[],\n\tadapter?: ComponentAdapter,\n\tcolspan?: number,\n\tdefault?: boolean,\n\tplaceholder?: string,\n\tdisabled?: boolean,\n\thidden?: boolean,\n\tgap?: number,\n\toptions?: Record<string, unknown>,\n\tcreateComponent?: (id: ComponentId, value?: unknown) => Promise<HTMLElement>|HTMLElement,\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarDropdown.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdown.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"toolbarDropdown.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdown.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAwD,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGrG,qBACa,eAAgB,SAAQ,UAAU;IAE9C,MAAM,CAAC,MAAM,4BAMV;IAGH,IAAI,EAAE,YAAY,CAAC;IAGnB,IAAI,EAAE,WAAW,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO;IAcP,SAAS,aASR;IAED,MAAM,6CAQJ;CAEF"}
|
|
@@ -27,6 +27,7 @@ let ToolbarDropdown = class ToolbarDropdown extends LitElement {
|
|
|
27
27
|
<og-tree-dropdown
|
|
28
28
|
color="gray"
|
|
29
29
|
@change="${this._onChange}"
|
|
30
|
+
.adapter="${this.item.adapter}"
|
|
30
31
|
.caption="${this.item.caption}"
|
|
31
32
|
.value="${this.value == null ? null : [[this.value, 0, 1]]}">
|
|
32
33
|
</og-tree-dropdown>
|
|
@@ -35,13 +36,15 @@ let ToolbarDropdown = class ToolbarDropdown extends LitElement {
|
|
|
35
36
|
updated() {
|
|
36
37
|
if (this.item.width)
|
|
37
38
|
dom.setSize(this.tree, { w: this.item.width });
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
if (!this.item.adapter) {
|
|
40
|
+
this.tree.setSourceData(this.item.items, {
|
|
41
|
+
globalLevels: false,
|
|
42
|
+
selectMode: SelectMode.Single,
|
|
43
|
+
checkboxes: false,
|
|
44
|
+
expanders: false,
|
|
45
|
+
allowEmpty: false
|
|
46
|
+
});
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
49
|
};
|
|
47
50
|
ToolbarDropdown.styles = [css `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarDropdown.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAc,UAAU,
|
|
1
|
+
{"version":3,"file":"toolbarDropdown.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAc,UAAU,EAA8C,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGnC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAiCN,cAAS,GAAG,GAAG,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,eAAe,GAAG,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AAC;QACJ,CAAC;IACF,CAAC;;AA7BM,sBAAM,GAAG,CAAC,GAAG,CAAA;;;;aAIR,SAAS,CAAC,2BAA2B;;EAEhD,CAAC,AANW,CAMV;AAGH;IADC,KAAK,CAAC,kBAAkB,CAAC;6CACP;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACP;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;8CACX;AAjBF,eAAe;IAD3B,aAAa,CAAC,qBAAqB,CAAC;GACxB,eAAe,CAsD3B","sourcesContent":["import { dom } from '@omegagrid/core';\nimport constants from '../../constants';\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ToolbarItem } from '../../types';\nimport { NodeSource, SelectMode, SerializedValue, TreeAdapter, TreeDropdown } from '@omegagrid/tree';\nimport { actions } from '@omegagrid/core';\n\n@customElement('og-toolbar-dropdown')\nexport class ToolbarDropdown extends LitElement {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\theight: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t}\n\t`];\n\n\t@query('og-tree-dropdown')\n\ttree: TreeDropdown;\n\n\t@property({type: Object})\n\titem: ToolbarItem;\n\n\t@property({type: String})\n\tvalue: string;\n\n\tupdated() {\n\t\tif (this.item.width) dom.setSize(this.tree, {w: this.item.width});\n\t\t\n\t\tif (!this.item.adapter) {\n\t\t\tthis.tree.setSourceData(this.item.items as NodeSource[], {\n\t\t\t\tglobalLevels: false,\n\t\t\t\tselectMode: SelectMode.Single,\n\t\t\t\tcheckboxes: false,\n\t\t\t\texpanders: false,\n\t\t\t\tallowEmpty: false\n\t\t\t});\n\t\t}\n\t}\n\n\t_onChange = () => {\n\t\tthis.tree.close();\n\t\tconst serializedValue = this.tree.value;\n\t\tthis.value = serializedValue && serializedValue[0] && serializedValue[0][0] ? serializedValue[0][0] : null;\n\t\tactions.dispatchActionEvent(this, 'toolbar', {\n\t\t\ttype: 'change',\n\t\t\tkey: this.item.id,\n\t\t\tvalue: this.value\n\t\t});\n\t}\n\n\trender = () => html`\n\t\t<og-tree-dropdown\n\t\t\tcolor=\"gray\"\n\t\t\t@change=\"${this._onChange}\"\n\t\t\t.adapter=\"${this.item.adapter as TreeAdapter}\"\n\t\t\t.caption=\"${this.item.caption}\"\n\t\t\t.value=\"${this.value == null ? null : [[this.value, 0, 1]] as SerializedValue[]}\">\n\t\t</og-tree-dropdown>\n\t`;\n\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/toolbar",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.109",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Toolbar component",
|
|
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.6.
|
|
31
|
-
"@omegagrid/localize": "^0.6.
|
|
32
|
-
"@omegagrid/tree": "^0.6.
|
|
30
|
+
"@omegagrid/core": "^0.6.109",
|
|
31
|
+
"@omegagrid/localize": "^0.6.109",
|
|
32
|
+
"@omegagrid/tree": "^0.6.109",
|
|
33
33
|
"lit": "^3.1.1",
|
|
34
34
|
"lit-html": "^3.1.1",
|
|
35
35
|
"ts-debounce": "^4.0.0"
|