@omegagrid/toolbar 0.6.61 → 0.6.62
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/ui/controls/toolbarColorPicker.d.ts.map +1 -1
- package/dist/ui/controls/toolbarColorPicker.js +7 -0
- package/dist/ui/controls/toolbarColorPicker.js.map +1 -1
- package/dist/ui/controls/toolbarDropdownButton.d.ts.map +1 -1
- package/dist/ui/controls/toolbarDropdownButton.js +10 -0
- package/dist/ui/controls/toolbarDropdownButton.js.map +1 -1
- package/dist/ui/controls/toolbarDropdownMenu.d.ts.map +1 -1
- package/dist/ui/controls/toolbarDropdownMenu.js +2 -2
- package/dist/ui/controls/toolbarDropdownMenu.js.map +1 -1
- package/dist/ui/controls/toolbarText.d.ts.map +1 -1
- package/dist/ui/controls/toolbarText.js +12 -0
- package/dist/ui/controls/toolbarText.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarColorPicker.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarColorPicker.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,UAAU,EAAQ,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGrE,qBACa,kBAAmB,SAAQ,UAAU;IAEjD,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"toolbarColorPicker.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarColorPicker.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,UAAU,EAAQ,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGrE,qBACa,kBAAmB,SAAQ,UAAU;IAEjD,MAAM,CAAC,MAAM,4BAiCV;IAGH,IAAI,EAAE,WAAW,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,QAAQ,CAAC;IAGnB,UAAU,EAAE,cAAc,CAAC;IAE3B,SAAS,MAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,UAIzC;IAED,UAAU,MAAO,gBAAgB,UAGhC;IAED,aAAa,MAAO,gBAAgB,UAGnC;IAED,MAAM,6CAmBJ;CAEF"}
|
|
@@ -64,6 +64,8 @@ ToolbarColorPicker.styles = [css `
|
|
|
64
64
|
line-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;
|
|
65
65
|
padding: 0;
|
|
66
66
|
flex: 0;
|
|
67
|
+
border-top-right-radius: 0;
|
|
68
|
+
border-bottom-right-radius: 0;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
#btnContent {
|
|
@@ -73,6 +75,11 @@ ToolbarColorPicker.styles = [css `
|
|
|
73
75
|
text-align: center;
|
|
74
76
|
margin-left: 1px;
|
|
75
77
|
}
|
|
78
|
+
|
|
79
|
+
og-button+og-dropdown {
|
|
80
|
+
border-top-left-radius: 0;
|
|
81
|
+
border-bottom-left-radius: 0;
|
|
82
|
+
}
|
|
76
83
|
`];
|
|
77
84
|
__decorate([
|
|
78
85
|
property({ type: Object })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarColorPicker.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarColorPicker.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD,OAA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AC,aAAa,CAAC;oDACF;AAGnB;IADC,KAAK,CAAC,aAAa,CAAC;sDACM;AA/Cf,kBAAkB;IAD9B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,kBAAkB,CAsF9B","sourcesContent":["import constants from '../../constants';\nimport { css, LitElement, html } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { ToolbarItem } from '../../types';\nimport { ColorPickerEvent, Dropdown, events } from '@omegagrid/core';\nimport { actions } from '@omegagrid/core';\n\n@customElement('og-toolbar-colorpicker')\nexport class ToolbarColorPicker 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\tmax-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t}\n\n\t\tog-button {\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: block;\n\t\t\twidth: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\theight: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\tmax-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\tmin-width: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\tline-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\tpadding: 0;\n\t\t\tflex: 0;\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t#btnContent {\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tline-height: 20px;\n\t\t\ttext-align: center;\n\t\t\tmargin-left: 1px;\n\t\t}\n\n\t\tog-button+og-dropdown {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\t`];\n\n\t@property({type: Object})\n\titem: ToolbarItem;\n\n\t@property({type: String})\n\tvalue: string;\n\n\t@query('og-dropdown')\n\tdropdown: Dropdown;\n\n\t@query('#btnContent')\n\tbtnContent: HTMLDivElement;\n\n\t_onChange = (e: events.ChangeEvent<string>) => {\n\t\tthis.btnContent.style.backgroundColor = e.value;\n\t\tactions.dispatchActionEvent(this, 'toolbar', {type: 'select', key: this.item.id, value: e.value});\n\t\tthis.dropdown.close();\n\t}\n\n\t_onPreview = (e: ColorPickerEvent) => {\n\t\tthis.btnContent.style.backgroundColor = e.color;\n\t\tactions.dispatchActionEvent(this, 'toolbar', {type: 'preview', key: this.item.id, value: e.color});\n\t}\n\n\t_onPreviewEnd = (e: ColorPickerEvent) => {\n\t\tthis.btnContent.style.backgroundColor = e.color;\n\t\tactions.dispatchActionEvent(this, 'toolbar', {type: 'previewEnd', key: this.item.id, value: e.color});\n\t}\n\t\n\trender = () => html`\n\t\t<og-button mode=\"toggle\" color=\"gray\">\n\t\t\t<div id=\"btnContent\" slot=\"content\" style=\"${styleMap({backgroundColor: this.value})}\">\n\t\t\t\t${this.item.icon ? html`<og-icon .icon=\"${this.item.icon}\"></og-icon>` : ``}\n\t\t\t</div>\n\t\t</og-button>\n\t\t<og-dropdown\n\t\t\tstyle=\"min-width: 14px; flex: 0\"\n\t\t\tcolor=\"gray\"\n\t\t\talignment=\"left\"\n\t\t\tpositionOffset=\"${-constants.TOOLBAR_COMPONENT_SIZE_BASE}\">\n\t\t\t<og-colorpicker\n\t\t\t\tslot=\"content\"\n\t\t\t\t@change=\"${this._onChange}\"\n\t\t\t\t@preview=\"${this._onPreview}\"\n\t\t\t\t@previewEnd=\"${this._onPreviewEnd}\"\n\t\t\t\t@mousedown=\"${(e: MouseEvent) => e.stopPropagation()}\">\n\t\t\t</og-colorpicker>\n\t\t</og-dropdown>\n\t`;\n\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownButton.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,qBACa,qBAAsB,SAAQ,UAAU;IAEpD,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"toolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownButton.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,qBACa,qBAAsB,SAAQ,UAAU;IAEpD,MAAM,CAAC,MAAM,4BA0BV;IAEH,OAAO,wDAA4B;IACnC,IAAI,IAAI,gBAAgC;IAExC,WAAW,qDAAyB;IACpC,IAAI,QAAQ,aAAoC;IAGhD,MAAM,EAAE,aAAa,CAAC;IAGtB,IAAI,EAAE,WAAW,CAAC;IAGlB,WAAW,EAAE,WAAW,CAAC;IAGzB,IAAI,EAAE,UAAU,GAAC,QAAQ,CAAY;IAErC,UAAU;IAYV,YAAY;IAiCZ,MAAM,6CAqBJ;CAEF"}
|
|
@@ -86,6 +86,16 @@ ToolbarDropdownButton.styles = [css `
|
|
|
86
86
|
max-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
og-toolbar-button {
|
|
90
|
+
border-top-right-radius: 0;
|
|
91
|
+
border-bottom-right-radius: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
og-toolbar-button+og-dropdown {
|
|
95
|
+
border-top-left-radius: 0;
|
|
96
|
+
border-bottom-left-radius: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
89
99
|
og-button {
|
|
90
100
|
box-sizing: border-box;
|
|
91
101
|
display: block;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarDropdownButton.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownButton.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGnC,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;IAA9C;;
|
|
1
|
+
{"version":3,"file":"toolbarDropdownButton.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownButton.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGnC,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;IAA9C;;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AgB,CAAC,gBAAgB,EAAE,CAAC,CAAsB,EAAE,EAAE;YACvE,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YAC3C,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAC,CAAC,CAAC;QACzH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE;YAC/C,CAAC,CAAC,eAAe,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACJ,CAAC;;AAzFM,4BAAM,GAAG,CAAC,GAAG,CAAA;;;;iBAIJ,SAAS,CAAC,2BAA2B;;;;;;;;;;;;;;;;YAgB1C,SAAS,CAAC,2BAA2B;aACpC,SAAS,CAAC,2BAA2B;iBACjC,SAAS,CAAC,2BAA2B;kBACpC,SAAS,CAAC,2BAA2B;;;EAGrD,CAAC,AA1BW,CA0BV;AASH;IADC,KAAK,CAAC,mBAAmB,CAAC;qDACL;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;mDACP;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0DACA;AAGzB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;mDACY;AA9CzB,qBAAqB;IADjC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,qBAAqB,CAoHjC","sourcesContent":["import constants from '../../constants';\nimport { dom, Dropdown } from '@omegagrid/core';\nimport { LitElement, html, css } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ToolbarItem } from '../../types';\nimport { ToolbarGrid } from './toolbarGrid';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\nimport { ToolbarButton } from './toolbarButton';\nimport { actions } from '@omegagrid/core';\n\n@customElement('og-toolbar-dropdownbutton')\nexport class ToolbarDropdownButton 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\tmax-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t}\n\n\t\tog-toolbar-button {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\tog-toolbar-button+og-dropdown {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\n\t\tog-button {\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: block;\n\t\t\twidth: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\theight: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\tmax-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\tline-height: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px;\n\t\t\tpadding: 0;\n\t\t}\n\t`];\n\n\tgridRef = createRef<ToolbarGrid>();\n\tget grid() { return this.gridRef.value }\n\n\tdropdownRef = createRef<Dropdown>();\n\tget dropdown() { return this.dropdownRef.value }\n\n\t@query('og-toolbar-button')\n\tbutton: ToolbarButton;\n\n\t@property({type: Object})\n\titem: ToolbarItem;\n\n\t@property({type: Object})\n\tcurrentItem: ToolbarItem;\n\n\t@property({type: String})\n\tmode: 'dropdown'|'button' = 'button';\n\n\twillUpdate() {\n\t\tif (!this.currentItem && this.item?.items) {\n\t\t\tconst items = this.item.items as ToolbarItem[][];\n\t\t\tthis.currentItem = items.flatMap(row => row).find(item => item.default);\n\t\t\tif (!this.currentItem) this.currentItem = items[0][0];\n\t\t}\n\n\t\tif (this.item?.options?.mode) {\n\t\t\tthis.mode = this.item.options.mode as typeof this.mode;\n\t\t}\n\t}\n\n\tfirstUpdated() {\n\t\tdom.on(this.grid, 'click', 'og-toolbar-button', (e: PointerEvent, elm: ToolbarButton) => {\n\t\t\tthis.currentItem = elm.item;\n\t\t\tthis.dropdown.close();\n\t\t});\n\n\t\tlet previewId: string = null;\n\t\t\n\t\tdom.on(this.grid, 'mousemove', 'og-toolbar-button', (_e: MouseEvent, elm: ToolbarButton) => {\n\t\t\tif (previewId != elm.item.id) {\n\t\t\t\tpreviewId = elm.item.id;\n\t\t\t\tactions.dispatchActionEvent(this, 'toolbar', {type: 'preview', key: elm.item.id, value: elm.item.value});\n\t\t\t}\n\t\t});\n\n\t\tthis.grid.addEventListener('mouseleave', () => {\n\t\t\tactions.dispatchActionEvent(this, 'toolbar', {type: 'previewEnd', key: previewId, value: null});\n\t\t\tpreviewId = null;\n\t\t});\n\n\t\tthis.grid.addEventListener('toolbar.action', (e: actions.ActionEvent) => {\n\t\t\tactions.dispatchActionEvent(this, 'toolbar', e.action);\n\t\t});\n\n\t\tthis.button?.addEventListener('click', () => {\n\t\t\tactions.dispatchActionEvent(this, 'toolbar', {type: 'select', key: this.currentItem.id, value: this.currentItem.value});\n\t\t});\n\n\t\tthis.dropdown.addEventListener('mousedown', e => {\n\t\t\te.stopPropagation();\n\t\t});\n\t}\n\t\n\trender = () => html`\n\t\t${this.mode == 'button' ? html`\n\t\t\t<og-toolbar-button\n\t\t\t\tmode=\"toggle\"\n\t\t\t\tstyle=\"min-width: ${constants.TOOLBAR_COMPONENT_SIZE_BASE}px; flex: 0\"\n\t\t\t\tcolor=\"gray\"\n\t\t\t\t.item=\"${this.currentItem}\">\n\t\t\t</og-toolbar-button>\n\t\t` : null}\n\t\t\n\t\t<og-dropdown ${ref(this.dropdownRef)}\n\t\t\tstyle=\"min-width: 14px; flex: 0\"\n\t\t\tcolor=\"gray\"\n\t\t\talignment=\"left\"\n\t\t\t.icon=\"${this.mode == 'button' ? null : this.item.icon}\"\n\t\t\tpositionOffset=\"${-constants.TOOLBAR_COMPONENT_SIZE_BASE}\">\n\t\t\t<og-toolbar-grid ${ref(this.gridRef)}\n\t\t\t\tslot=\"content\"\n\t\t\t\t.items=\"${this.item.items}\">\n\t\t\t</og-toolbar-grid>\n\t\t</og-dropdown>\n\t`;\n\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownMenu.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"toolbarDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAuB,MAAM,iBAAiB,CAAC;AAI9F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,qBACa,mBAAoB,SAAQ,YAAY;IAEpD,MAAM,CAAC,MAAM,4BAMV;IAGH,IAAI,EAAE,WAAW,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IAEd,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;;CAsBtC"}
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { actions, ColorTypes, dom,
|
|
7
|
+
import { actions, ColorTypes, dom, DropdownMenu } from '@omegagrid/core';
|
|
8
8
|
import constants from '../../constants';
|
|
9
9
|
import { css } from 'lit';
|
|
10
10
|
import { customElement, property } from 'lit/decorators.js';
|
|
@@ -30,7 +30,7 @@ let ToolbarDropdownMenu = class ToolbarDropdownMenu extends DropdownMenu {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
ToolbarDropdownMenu.styles = [...
|
|
33
|
+
ToolbarDropdownMenu.styles = [...DropdownMenu.styles, css `
|
|
34
34
|
:host {
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: row;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarDropdownMenu.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownMenu.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"toolbarDropdownMenu.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarDropdownMenu.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAuB,MAAM,iBAAiB,CAAC;AAC9F,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIrD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,YAAY;IAgBpD,UAAU,CAAC,KAA2B;QACrC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC1D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import constants from '../../constants';\nimport { css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ToolbarItem } from '../../types';\n\n@customElement('og-toolbar-dropdownmenu')\nexport class ToolbarDropdownMenu extends DropdownMenu {\n\n\tstatic styles = [...DropdownMenu.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@property({type: Object})\n\titem: ToolbarItem;\n\n\t@property({type: String})\n\tvalue: string;\n\n\twillUpdate(props: Map<string, unknown>) {\n\t\tsuper.willUpdate(props);\n\t\tthis.style.width = dom.numToPixels(this.item.width || (this.item.text ? null : 23));\n\t\tthis.style.textAlign = this.item.text ? 'left' : 'center';\n\t\tthis.icon = this.item.icon;\n\t\tthis.color = ColorTypes.Gray;\n\t\tthis.label = this.item.caption ?? this.item.text;\n\t\tthis.noCaret = false;\n\t\tthis.items = (this.item.items || []) as MenuItem[];\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('menu.select', (e: MenuEvent) => {\n\t\t\tactions.dispatchActionEvent(this, 'toolbar', {\n\t\t\t\ttype: 'select', \n\t\t\t\tkey: (e.item.key ?? e.item.k)?.toString(), \n\t\t\t\tvalue: (e.item.value ?? e.item.v)?.toString()\n\t\t\t});\n\t\t});\n\t}\n\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarText.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAa,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,qBAEa,WAAY,SAAQ,UAAU;IAE1C,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"toolbarText.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/toolbarText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAa,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,qBAEa,WAAY,SAAQ,UAAU;IAE1C,MAAM,CAAC,MAAM,4BAwBV;IAGH,KAAK,SAAU;IAGf,IAAI,EAAE,WAAW,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,gBAAgB,CAAC;IAExB,WAAW,qDAAyB;IACpC,IAAI,QAAQ,aAAoC;IAEhD,OAAO,iDAAqB;IAC5B,IAAI,IAAI,SAAgC;IAExC,OAAO;IAUP,SAAS,MAAO,eAAe,UAQ9B;IAED,QAAQ,aAUP;IAED,MAAM,6CAoBJ;CAEF"}
|
|
@@ -38,6 +38,7 @@ let ToolbarText = class ToolbarText extends LitElement {
|
|
|
38
38
|
};
|
|
39
39
|
this.render = () => html `
|
|
40
40
|
<input
|
|
41
|
+
class="${this.item.items && this.item.items.length > 0 ? 'has-dropdown' : ''}"
|
|
41
42
|
type="text"
|
|
42
43
|
.value="${this.value ?? ''}"
|
|
43
44
|
placeholder="${this.item.placeholder}"
|
|
@@ -81,6 +82,17 @@ ToolbarText.styles = [css `
|
|
|
81
82
|
flex: 1;
|
|
82
83
|
min-width: 10px;
|
|
83
84
|
outline: none;
|
|
85
|
+
border-radius: var(--og-base-radius);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
input.has-dropdown {
|
|
89
|
+
border-top-right-radius: 0;
|
|
90
|
+
border-bottom-right-radius: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
og-dropdown {
|
|
94
|
+
border-top-left-radius: 0;
|
|
95
|
+
border-bottom-left-radius: 0;
|
|
84
96
|
}
|
|
85
97
|
`];
|
|
86
98
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarText.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarText.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAmC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClF,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;AAGnE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAIrD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;
|
|
1
|
+
{"version":3,"file":"toolbarText.js","sourceRoot":"","sources":["../../../src/ui/controls/toolbarText.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAmC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClF,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;AAGnE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAIrD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA6BN,UAAK,GAAG,MAAM,CAAC;QAWf,gBAAW,GAAG,SAAS,EAAY,CAAC;QAGpC,YAAO,GAAG,SAAS,EAAQ,CAAC;QAa5B,cAAS,GAAG,CAAC,CAAkB,EAA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AAW;IAFvB,aAAa,CAAC,iBAAiB,CAAC;IAChC,SAAS,CAAC,EAAC,KAAK,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAC,CAAC;GAC5D,WAAW,CAoGvB","sourcesContent":["import { dom, Dropdown, List, ListSelectEvent, colorable } 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 } from '@omegagrid/tree';\nimport { actions } from '@omegagrid/core';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\n\n@customElement('og-toolbar-text')\n@colorable({props: ['color', 'border', 'background'], selector: 'input'})\nexport class ToolbarText 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\n\t\tinput {\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tflex: 1;\n\t\t\tmin-width: 10px;\n\t\t\toutline: none;\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t}\n\n\t\tinput.has-dropdown {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\tog-dropdown {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\t`];\n\n\t@property({type: String, reflect: true})\n\tcolor = 'gray';\n\n\t@property({type: Object})\n\titem: ToolbarItem;\n\n\t@property({type: String})\n\tvalue: string;\n\n\t@query('input')\n\tinput: HTMLInputElement;\n\n\tdropdownRef = createRef<Dropdown>();\n\tget dropdown() { return this.dropdownRef.value }\n\n\tlistRef = createRef<List>();\n\tget list() { return this.listRef.value }\n\n\tupdated() {\n\t\tif (this.list) {\n\t\t\tthis.list.itemRenderer = (div: HTMLDivElement, index: number) => {\n\t\t\t\tdiv.style.paddingLeft = dom.numToPixels(5);\n\t\t\t\treturn (this.item.items[index] as NodeSource).v;\n\t\t\t}\n\t\t\tdom.setSize(this.list, {w: this.clientWidth});\n\t\t}\n\t}\n\n\t_onSelect = (e: ListSelectEvent) => {\n\t\tthis.dropdown.close();\n\t\tthis.value = (this.item.items[e.index] as NodeSource).k;\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\t_onKeyUp = () => {\n\t\tif (this.value != this.input.value) {\n\t\t\tthis.value = this.input.value;\n\t\t\tactions.dispatchActionEvent(this, 'toolbar', {\n\t\t\t\ttype: 'change',\n\t\t\t\tkey: this.item.id,\n\t\t\t\tvalue: this.value\n\t\t\t});\n\t\t\tthis.input.focus();\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t<input\n\t\t\tclass=\"${this.item.items && this.item.items.length > 0 ? 'has-dropdown' : ''}\"\n\t\t\ttype=\"text\"\n\t\t\t.value=\"${this.value ?? ''}\"\n\t\t\tplaceholder=\"${this.item.placeholder}\"\n\t\t\t@keyup=\"${this._onKeyUp}\">\n\t\t${this.item.items && this.item.items.length > 0 ? html`\n\t\t\t<og-dropdown ${ref(this.dropdownRef)}\n\t\t\t\tstyle=\"min-width: 14px; flex: 0\"\n\t\t\t\tcolor=\"gray\"\n\t\t\t\talignment=\"right\">\n\t\t\t\t<og-list ${ref(this.listRef)}\n\t\t\t\t\tslot=\"content\"\n\t\t\t\t\tsize=\"${this.item.items.length}\"\n\t\t\t\t\tmaxHeight=\"220\"\n\t\t\t\t\t@select=\"${this._onSelect}\">\n\t\t\t\t</og-list>\n\t\t\t</og-dropdown>\n\t\t` : ``}\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.62",
|
|
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.62",
|
|
31
|
+
"@omegagrid/localize": "^0.6.62",
|
|
32
|
+
"@omegagrid/tree": "^0.6.62",
|
|
33
33
|
"lit": "^3.1.1",
|
|
34
34
|
"lit-html": "^3.1.1",
|
|
35
35
|
"ts-debounce": "^4.0.0"
|