@operato/context 2.0.0-alpha.66 → 2.0.0-alpha.68

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/demo/index.html +13 -2
  3. package/dist/src/layouts/ox-context-page-toolbar.js +18 -8
  4. package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
  5. package/dist/src/layouts/ox-context-toolbar.d.ts +1 -1
  6. package/dist/src/tools/ox-page-action-context-bar.js +4 -4
  7. package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
  8. package/dist/src/tools/ox-page-action-overlay-template.js +3 -3
  9. package/dist/src/tools/ox-page-action-overlay-template.js.map +1 -1
  10. package/dist/src/tools/ox-page-title-bar.js +1 -1
  11. package/dist/src/tools/ox-page-title-bar.js.map +1 -1
  12. package/dist/tsconfig.tsbuildinfo +1 -1
  13. package/package.json +8 -8
  14. package/src/layouts/ox-context-page-toolbar.ts +18 -8
  15. package/src/tools/ox-page-action-context-bar.ts +4 -4
  16. package/src/tools/ox-page-action-overlay-template.ts +3 -3
  17. package/src/tools/ox-page-title-bar.ts +1 -1
  18. package/dist/stories/ox-context-page-toolbar.stories copy.d.ts +0 -24
  19. package/dist/stories/ox-context-page-toolbar.stories copy.js +0 -90
  20. package/dist/stories/ox-context-page-toolbar.stories copy.js.map +0 -1
  21. package/dist/stories/ox-context-toolbar-complex-2.stories.d.ts +0 -19
  22. package/dist/stories/ox-context-toolbar-complex-2.stories.js +0 -136
  23. package/dist/stories/ox-context-toolbar-complex-2.stories.js.map +0 -1
  24. package/dist/stories/ox-context-toolbar-complex.stories copy.d.ts +0 -19
  25. package/dist/stories/ox-context-toolbar-complex.stories copy.js +0 -146
  26. package/dist/stories/ox-context-toolbar-complex.stories copy.js.map +0 -1
  27. package/dist/stories/ox-context-toolbar.stories copy.d.ts +0 -19
  28. package/dist/stories/ox-context-toolbar.stories copy.js +0 -82
  29. package/dist/stories/ox-context-toolbar.stories copy.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.0-alpha.68](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.67...v2.0.0-alpha.68) (2024-04-13)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * mwc=>md for context ([2bc13f2](https://github.com/hatiolab/operato/commit/2bc13f285f257782f73e5d7b5d1ddd197df85393))
12
+
13
+
14
+
15
+ ## [2.0.0-alpha.67](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.66...v2.0.0-alpha.67) (2024-04-13)
16
+
17
+
18
+ ### :bug: Bug Fix
19
+
20
+ * mwc=>md for context ([eacd9a5](https://github.com/hatiolab/operato/commit/eacd9a5b698969156f430f3d26233fdf7edccdf3))
21
+
22
+
23
+
6
24
  ## [2.0.0-alpha.66](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.65...v2.0.0-alpha.66) (2024-04-13)
7
25
 
8
26
 
package/demo/index.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en-GB">
3
3
  <head>
4
4
  <meta charset="utf-8" />
@@ -16,7 +16,18 @@
16
16
  }
17
17
  </style>
18
18
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
19
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
19
+ <link
20
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
21
+ rel="stylesheet"
22
+ />
23
+ <link
24
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
25
+ rel="stylesheet"
26
+ />
27
+ <link
28
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
29
+ rel="stylesheet"
30
+ />
20
31
  </head>
21
32
  <body>
22
33
  <div id="demo"></div>
@@ -20,9 +20,9 @@ let ContextPageToolbar = class ContextPageToolbar extends connect(store)(LitElem
20
20
  --context-action-bar-button-margin: 0px;
21
21
  --context-action-bar-more-button-border-radius: 2px;
22
22
 
23
- --mdc-icon-size: 20px;
24
- --mdc-button-height: 20px;
25
- --mdc-button-horizontal-padding: 2px;
23
+ --md-icon-size: 20px;
24
+ --md-button-height: 20px;
25
+ --md-button-horizontal-padding: 2px;
26
26
  }
27
27
 
28
28
  :host > div {
@@ -30,7 +30,7 @@ let ContextPageToolbar = class ContextPageToolbar extends connect(store)(LitElem
30
30
  flex-direction: row;
31
31
 
32
32
  align-items: center;
33
- gap:var(--padding-narrow);
33
+ gap: var(--padding-narrow);
34
34
  }
35
35
 
36
36
  * {
@@ -38,19 +38,29 @@ let ContextPageToolbar = class ContextPageToolbar extends connect(store)(LitElem
38
38
  }
39
39
 
40
40
  md-icon {
41
- background-color: var(--button-background-color,#fafbfc);
41
+ background-color: var(--button-background-color, #fafbfc);
42
42
  border: 1px solid rgba(var(--primary-color-rgb), 0.5);
43
- border-radius:var(--button-border-radius);
43
+ border-radius: var(--button-border-radius);
44
44
  padding: var(--iconbtn-padding, 2px);
45
45
 
46
46
  color: var(--primary-color);
47
-
48
- &:hover{
47
+
48
+ &:hover {
49
49
  background-color: var(--primary-color);
50
50
 
51
51
  color: var(--theme-white-color);
52
52
  }
53
53
  }
54
+
55
+ @media screen and (max-width: 460px) {
56
+ :host > div {
57
+ gap: 0;
58
+ }
59
+
60
+ md-icon {
61
+ border-radius: 0;
62
+ }
63
+ }
54
64
  `
55
65
  ];
56
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ox-context-page-toolbar.js","sourceRoot":"","sources":["../../../src/layouts/ox-context-page-toolbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,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ACvB,CAAC,CAAC,IAAI,CAAA,sBAAsB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ;YACtF,CAAC,CAAC,OAAO;KACZ,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,MAAA,KAAK,CAAC,OAAO,0CAAE,KAAK,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAA;AA3C6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAa;AACb;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDAIvB;AAvDQ,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CA6F9B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, TemplateResult, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { TOOL_POSITION } from '@operato/layout'\nimport { store } from '@operato/shell'\n\n@customElement('ox-context-page-toolbar')\nexport class ContextPageToolbar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n flex-direction: row-reverse;\n position: relative;\n\n justify-content: end;\n align-items: center;\n\n --context-action-bar-button-margin: 0px;\n --context-action-bar-more-button-border-radius: 2px;\n\n --mdc-icon-size: 20px;\n --mdc-button-height: 20px;\n --mdc-button-horizontal-padding: 2px;\n }\n\n :host > div {\n display: flex;\n flex-direction: row;\n\n align-items: center;\n gap:var(--padding-narrow);\n }\n\n * {\n cursor: pointer;\n }\n\n md-icon {\n background-color: var(--button-background-color,#fafbfc);\n border: 1px solid rgba(var(--primary-color-rgb), 0.5);\n border-radius:var(--button-border-radius);\n padding: var(--iconbtn-padding, 2px);\n\n color: var(--primary-color);\n \n &:hover{\n background-color: var(--primary-color);\n\n color: var(--theme-white-color);\n }\n }\n `\n ]\n }\n\n @property({ type: Object }) context: any\n @property({ type: Array }) tools?: {\n position: TOOL_POSITION\n template: TemplateResult\n context?: string\n }[]\n\n render() {\n let contextKeys = Object.keys(this.context).filter(key => !!this.context[key])\n let tools = (this.tools || []).filter(tool => {\n if (!tool.context || contextKeys.includes(tool.context)) {\n return tool\n }\n })\n\n let frontEndTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT_END)\n let frontTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT)\n let centerTools = tools.filter(tool => tool.position == TOOL_POSITION.CENTER)\n let rearTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR)\n let rearEndTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR_END)\n\n return html`\n ${frontEndTools.length > 0\n ? html`<div id=\"front-end\">${frontEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${frontTools.length > 0\n ? html`<div id=\"front\">${frontTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${centerTools.length > 0\n ? html`<div id=\"center\">${centerTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearTools.length > 0 ? html`<div id=\"rear\">${rearTools.map(tool => html` ${tool.template} `)}</div>` : nothing}\n ${rearEndTools.length > 0\n ? html`<div id=\"rear-end\">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n `\n }\n\n stateChanged(state: any) {\n if (state.context) {\n this.tools = state.context?.tools\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ox-context-page-toolbar.js","sourceRoot":"","sources":["../../../src/layouts/ox-context-page-toolbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,OAAO,EAAE,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAgB,MA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,CAAA,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ;YACtF,CAAC,CAAC,OAAO;KACZ,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,GAAG,MAAA,KAAK,CAAC,OAAO,0CAAE,KAAK,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAA;AA3C6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAa;AACb;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDAIvB;AAjEQ,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CAuG9B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, TemplateResult, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { TOOL_POSITION } from '@operato/layout'\nimport { store } from '@operato/shell'\n\n@customElement('ox-context-page-toolbar')\nexport class ContextPageToolbar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n flex-direction: row-reverse;\n position: relative;\n\n justify-content: end;\n align-items: center;\n\n --context-action-bar-button-margin: 0px;\n --context-action-bar-more-button-border-radius: 2px;\n\n --md-icon-size: 20px;\n --md-button-height: 20px;\n --md-button-horizontal-padding: 2px;\n }\n\n :host > div {\n display: flex;\n flex-direction: row;\n\n align-items: center;\n gap: var(--padding-narrow);\n }\n\n * {\n cursor: pointer;\n }\n\n md-icon {\n background-color: var(--button-background-color, #fafbfc);\n border: 1px solid rgba(var(--primary-color-rgb), 0.5);\n border-radius: var(--button-border-radius);\n padding: var(--iconbtn-padding, 2px);\n\n color: var(--primary-color);\n\n &:hover {\n background-color: var(--primary-color);\n\n color: var(--theme-white-color);\n }\n }\n\n @media screen and (max-width: 460px) {\n :host > div {\n gap: 0;\n }\n\n md-icon {\n border-radius: 0;\n }\n }\n `\n ]\n }\n\n @property({ type: Object }) context: any\n @property({ type: Array }) tools?: {\n position: TOOL_POSITION\n template: TemplateResult\n context?: string\n }[]\n\n render() {\n let contextKeys = Object.keys(this.context).filter(key => !!this.context[key])\n let tools = (this.tools || []).filter(tool => {\n if (!tool.context || contextKeys.includes(tool.context)) {\n return tool\n }\n })\n\n let frontEndTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT_END)\n let frontTools = tools.filter(tool => tool.position == TOOL_POSITION.FRONT)\n let centerTools = tools.filter(tool => tool.position == TOOL_POSITION.CENTER)\n let rearTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR)\n let rearEndTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR_END)\n\n return html`\n ${frontEndTools.length > 0\n ? html`<div id=\"front-end\">${frontEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${frontTools.length > 0\n ? html`<div id=\"front\">${frontTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${centerTools.length > 0\n ? html`<div id=\"center\">${centerTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearTools.length > 0 ? html`<div id=\"rear\">${rearTools.map(tool => html` ${tool.template} `)}</div>` : nothing}\n ${rearEndTools.length > 0\n ? html`<div id=\"rear-end\">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n `\n }\n\n stateChanged(state: any) {\n if (state.context) {\n this.tools = state.context?.tools\n }\n }\n}\n"]}
@@ -11,7 +11,7 @@ export declare class ContextToolbar extends ContextToolbar_base {
11
11
  static get styles(): import("lit").CSSResult[];
12
12
  private context;
13
13
  private tools?;
14
- render(): typeof nothing | import("lit-html").TemplateResult<1>;
14
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
15
15
  stateChanged(state: any): void;
16
16
  }
17
17
  export {};
@@ -59,14 +59,14 @@ let PageActionContextBar = class PageActionContextBar extends connect(store)(Lit
59
59
  }
60
60
 
61
61
  [danger] {
62
- color: var(--mdc-danger-button-primary-color);
63
- border-color: var(--mdc-danger-button-outline-color);
62
+ color: var(--md-danger-button-primary-color);
63
+ border-color: var(--md-danger-button-outline-color);
64
64
 
65
65
  md-icon {
66
- color: var(--mdc-danger-button-primary-color);
66
+ color: var(--md-danger-button-primary-color);
67
67
  }
68
68
  &:hover {
69
- background-color: var(--mdc-danger-button-primary-color);
69
+ background-color: var(--md-danger-button-primary-color);
70
70
  }
71
71
  }
72
72
 
@@ -1 +1 @@
1
- {"version":3,"file":"ox-page-action-context-bar.js","sourceRoot":"","sources":["../../../src/tools/ox-page-action-context-bar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,sCAAsC,CAAA;AAE7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,QAAQ,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAG/B,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAA7D;;QA+FsB,YAAO,GAQ5B,EAAE,CAAA;QACS,cAAS,GAAY,KAAK,CAAA;IA0G7C,CAAC;IAjNC,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwFF;SACF,CAAA;IACH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AC,eAAe,CAAC,SAAS,CAAC,CAAA;gCACnC,CAAC;4BACH,CAAC;;iCAEU,IAAI,IAAI,UAAU;wBAC3B,KAAK;;mBAEV,CAAA;QACb,CAAC,CAAC;KACH,CAAA;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAA6B;QACzC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,qBAAqB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,MAAM,EAAE,OAAO,EAAE,GAAG,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,OAAO,KAAI,EAAE,CAAA;QAE9C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IAED,QAAQ;QACN,WAAW,CAAC,yBAAyB,EAAE;YACrC,QAAQ,EAAE,IAAI,CAAA,qEAAqE;SACpF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAnH4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAQlB;AACS;IAAhB,KAAK,EAAE;uDAAmC;AAxGhC,oBAAoB;IADhC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,oBAAoB,CAkNhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-page-action-overlay-template.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport throttle from 'lodash-es/throttle'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { openOverlay } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { sleep } from '@operato/utils'\n\n@customElement('ox-page-action-context-bar')\nexport class PageActionContextBar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n overflow: hidden;\n gap: var(--padding-narrow);\n }\n\n :host *:focus {\n outline: none;\n }\n\n button {\n display: flex;\n align-items: center;\n background-color: var(--button-background-color, #fafbfc);\n border: 1px solid rgba(var(--primary-color-rgb), 0.5);\n border-radius: var(--button-border-radius);\n\n font-size: var(--fontsize-default);\n color: var(--secondary-color);\n\n md-icon {\n margin: 4px 1px;\n\n --md-icon-size: 18px;\n color: var(--primary-color);\n }\n &:hover {\n background-color: var(--primary-color);\n\n color: var(--theme-white-color);\n\n md-icon {\n color: var(--white-theme-color);\n }\n }\n }\n\n [filled] {\n font-variation-settings: 'FILL' 1;\n }\n\n [danger] {\n color: var(--mdc-danger-button-primary-color);\n border-color: var(--mdc-danger-button-outline-color);\n\n md-icon {\n color: var(--mdc-danger-button-primary-color);\n }\n &:hover {\n background-color: var(--mdc-danger-button-primary-color);\n }\n }\n\n [more] {\n position: absolute;\n top: 0;\n right: 0;\n background-color: var(--context-action-bar-more-button-background-color);\n box-shadow: -2px 0px 2px 1px rgba(0, 0, 0, 0.2);\n padding: var(--context-action-bar-more-button-padding);\n color: var(--context-action-bar-more-button-color);\n padding: 10px;\n font-size: 2rem;\n }\n\n @media screen and (max-width: 460px) {\n :host {\n gap: 0;\n }\n\n [more] {\n margin-top: -10px;\n }\n\n button {\n border-radius: 0;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n @property({ type: Array }) actions: {\n title: string\n action: () => void\n icon: string\n type: string\n select: string[]\n href?: string\n emphasis?: boolean\n }[] = []\n @state() private overflown: boolean = false\n\n private overflownUpdaterThrottle: any\n private resizeCallback: any\n\n get overflownUpdater() {\n if (!this.overflownUpdaterThrottle) {\n this.overflownUpdaterThrottle = throttle(() => {\n this.overflown = this.scrollWidth > this.clientWidth\n }, 100)\n }\n\n return this.overflownUpdaterThrottle\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.resizeCallback = () => this.overflownUpdater()\n\n window.addEventListener('resize', this.resizeCallback)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n window.removeEventListener('resize', this.resizeCallback)\n }\n\n render() {\n return html`\n ${this.renderActions()}\n ${this.overflown ? html` <md-icon more @click=${this.showMore.bind(this)}>more_horiz</md-icon> ` : html``}\n `\n }\n\n renderActions() {\n return html`\n ${this.actions.map(($action, idx) => {\n let { type, title, icon, action, select, href, emphasis } = $action as any\n let { outlined, raised, dense, danger, filled } = emphasis || {}\n\n return type == 'text'\n ? html` <span @click=${action}>${title}</span> `\n : type == 'select' || (select && select.length > 0)\n ? html`\n <select @change=${action}>\n ${select.map((option: any) => html` <option>${option}</option> `)}\n </select>\n `\n : type == 'link'\n ? html` <a href=${href}>${title}</a> `\n : type == 'icon'\n ? html`<md-icon @click=${action}>${icon}</md-icon>`\n : html`\n <button\n ?dense=${dense}\n ?raised=${raised}\n ?outlined=${outlined}\n ?danger=${danger}\n ?filled=${filled}\n @click=${async (e: MouseEvent) => {\n /* all actions should be bloked for a second */\n const button = e.currentTarget as any\n button.icon = 'rotate_right'\n button.setAttribute('working', true)\n button.disabled = true\n\n try {\n await action()\n } finally {\n await sleep(1000)\n button.disabled = false\n /* because icon can be changed after sleep, don't use closure 'icon'. */\n button.icon = this.actions[idx]?.icon || 'done_all'\n button.removeAttribute('working')\n }\n }}\n >\n <md-icon>${icon || 'done_all'}</md-icon>\n ${title}\n </button>\n `\n })}\n `\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('actions')) {\n requestAnimationFrame(this.overflownUpdater)\n }\n }\n\n stateChanged(state: any) {\n const { actions } = state.route?.context || {}\n\n if (actions) {\n this.actions = actions.filter((action: any) => !!action)\n }\n }\n\n showMore() {\n openOverlay('context-toolbar-overlay', {\n template: html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`\n })\n }\n}\n"]}
1
+ {"version":3,"file":"ox-page-action-context-bar.js","sourceRoot":"","sources":["../../../src/tools/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,MAAA,KAAK,CAAC,KAAK,0CAAE,OAAO,KAAI,EAAE,CAAA;QAE9C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IAED,QAAQ;QACN,WAAW,CAAC,yBAAyB,EAAE;YACrC,QAAQ,EAAE,IAAI,CAAA,qEAAqE;SACpF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAnH4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAQlB;AACS;IAAhB,KAAK,EAAE;uDAAmC;AAxGhC,oBAAoB;IADhC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,oBAAoB,CAkNhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-page-action-overlay-template.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport throttle from 'lodash-es/throttle'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { openOverlay } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { sleep } from '@operato/utils'\n\n@customElement('ox-page-action-context-bar')\nexport class PageActionContextBar extends connect(store)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n overflow: hidden;\n gap: var(--padding-narrow);\n }\n\n :host *:focus {\n outline: none;\n }\n\n button {\n display: flex;\n align-items: center;\n background-color: var(--button-background-color, #fafbfc);\n border: 1px solid rgba(var(--primary-color-rgb), 0.5);\n border-radius: var(--button-border-radius);\n\n font-size: var(--fontsize-default);\n color: var(--secondary-color);\n\n md-icon {\n margin: 4px 1px;\n\n --md-icon-size: 18px;\n color: var(--primary-color);\n }\n &:hover {\n background-color: var(--primary-color);\n\n color: var(--theme-white-color);\n\n md-icon {\n color: var(--white-theme-color);\n }\n }\n }\n\n [filled] {\n font-variation-settings: 'FILL' 1;\n }\n\n [danger] {\n color: var(--md-danger-button-primary-color);\n border-color: var(--md-danger-button-outline-color);\n\n md-icon {\n color: var(--md-danger-button-primary-color);\n }\n &:hover {\n background-color: var(--md-danger-button-primary-color);\n }\n }\n\n [more] {\n position: absolute;\n top: 0;\n right: 0;\n background-color: var(--context-action-bar-more-button-background-color);\n box-shadow: -2px 0px 2px 1px rgba(0, 0, 0, 0.2);\n padding: var(--context-action-bar-more-button-padding);\n color: var(--context-action-bar-more-button-color);\n padding: 10px;\n font-size: 2rem;\n }\n\n @media screen and (max-width: 460px) {\n :host {\n gap: 0;\n }\n\n [more] {\n margin-top: -10px;\n }\n\n button {\n border-radius: 0;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n @property({ type: Array }) actions: {\n title: string\n action: () => void\n icon: string\n type: string\n select: string[]\n href?: string\n emphasis?: boolean\n }[] = []\n @state() private overflown: boolean = false\n\n private overflownUpdaterThrottle: any\n private resizeCallback: any\n\n get overflownUpdater() {\n if (!this.overflownUpdaterThrottle) {\n this.overflownUpdaterThrottle = throttle(() => {\n this.overflown = this.scrollWidth > this.clientWidth\n }, 100)\n }\n\n return this.overflownUpdaterThrottle\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.resizeCallback = () => this.overflownUpdater()\n\n window.addEventListener('resize', this.resizeCallback)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n window.removeEventListener('resize', this.resizeCallback)\n }\n\n render() {\n return html`\n ${this.renderActions()}\n ${this.overflown ? html` <md-icon more @click=${this.showMore.bind(this)}>more_horiz</md-icon> ` : html``}\n `\n }\n\n renderActions() {\n return html`\n ${this.actions.map(($action, idx) => {\n let { type, title, icon, action, select, href, emphasis } = $action as any\n let { outlined, raised, dense, danger, filled } = emphasis || {}\n\n return type == 'text'\n ? html` <span @click=${action}>${title}</span> `\n : type == 'select' || (select && select.length > 0)\n ? html`\n <select @change=${action}>\n ${select.map((option: any) => html` <option>${option}</option> `)}\n </select>\n `\n : type == 'link'\n ? html` <a href=${href}>${title}</a> `\n : type == 'icon'\n ? html`<md-icon @click=${action}>${icon}</md-icon>`\n : html`\n <button\n ?dense=${dense}\n ?raised=${raised}\n ?outlined=${outlined}\n ?danger=${danger}\n ?filled=${filled}\n @click=${async (e: MouseEvent) => {\n /* all actions should be bloked for a second */\n const button = e.currentTarget as any\n button.icon = 'rotate_right'\n button.setAttribute('working', true)\n button.disabled = true\n\n try {\n await action()\n } finally {\n await sleep(1000)\n button.disabled = false\n /* because icon can be changed after sleep, don't use closure 'icon'. */\n button.icon = this.actions[idx]?.icon || 'done_all'\n button.removeAttribute('working')\n }\n }}\n >\n <md-icon>${icon || 'done_all'}</md-icon>\n ${title}\n </button>\n `\n })}\n `\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('actions')) {\n requestAnimationFrame(this.overflownUpdater)\n }\n }\n\n stateChanged(state: any) {\n const { actions } = state.route?.context || {}\n\n if (actions) {\n this.actions = actions.filter((action: any) => !!action)\n }\n }\n\n showMore() {\n openOverlay('context-toolbar-overlay', {\n template: html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`\n })\n }\n}\n"]}
@@ -32,8 +32,8 @@ let PageActionOverlayTemplate = class PageActionOverlayTemplate extends connect(
32
32
  }
33
33
 
34
34
  [danger] {
35
- --mdc-theme-primary: var(--mdc-danger-button-primary-color);
36
- --mdc-button-outline-color: var(--mdc-danger-button-outline-color);
35
+ --md-theme-primary: var(--md-danger-button-primary-color);
36
+ --md-button-outline-color: var(--md-danger-button-outline-color);
37
37
  }
38
38
 
39
39
  [filled] {
@@ -42,7 +42,7 @@ let PageActionOverlayTemplate = class PageActionOverlayTemplate extends connect(
42
42
 
43
43
  @media screen and (max-width: 460px) {
44
44
  button {
45
- --mdc-button-horizontal-padding: var(--padding-default);
45
+ --md-button-horizontal-padding: var(--padding-default);
46
46
  border-radius: 4px;
47
47
  }
48
48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AAY,CAAC,KAAU;;QACrB,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,MAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,OAAO,0CAAE,OAAO,0CAAE,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAI,EAAE,CAAA;IACvF,CAAC;CACF,CAAA;AAxDkB;IAAhB,KAAK,EAAE;0DAA4B;AAhDzB,yBAAyB;IADrC,aAAa,CAAC,iCAAiC,CAAC;GACpC,yBAAyB,CAwGrC","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { sleep } from '@operato/utils'\n\nimport { ContextToolbarOverlayStyle } from '../styles/ox-context-toolbar-overlay-style.js'\n\n@customElement('ox-page-action-overlay-template')\nexport class PageActionOverlayTemplate extends connect(store)(LitElement) {\n static get styles() {\n return [\n ScrollbarStyles,\n ContextToolbarOverlayStyle,\n css`\n :host {\n display: flex;\n flex-wrap: wrap;\n gap: var(--margin-narrow);\n }\n :host *:focus {\n outline: none;\n }\n\n button {\n background-color: var(--main-section-background-color);\n border-radius: var(--context-action-bar-more-button-border-radius);\n }\n\n [danger] {\n --mdc-theme-primary: var(--mdc-danger-button-primary-color);\n --mdc-button-outline-color: var(--mdc-danger-button-outline-color);\n }\n\n [filled] {\n font-variation-settings: 'FILL' 1;\n }\n\n @media screen and (max-width: 460px) {\n button {\n --mdc-button-horizontal-padding: var(--padding-default);\n border-radius: 4px;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n @state() private actions: any[] = []\n\n render() {\n return html`\n ${this.actions.map(($action, idx) => {\n let { type, title, icon, action, select, href, emphasis } = $action as any\n let { outlined, raised, dense, danger, filled } = emphasis || {}\n\n return type == 'text'\n ? html` <span>${title}</span> `\n : type == 'select' || (select && select.length > 0)\n ? html`\n <select @change=${action}>\n ${select.map((option: any) => html` <option>${option}</option> `)}\n </select>\n `\n : type == 'link'\n ? html` <a href=${href}>${title}</a> `\n : html`\n <button\n ?dense=${dense}\n ?raised=${raised}\n ?outlined=${outlined}\n ?danger=${danger}\n ?filled=${filled}\n @click=${async (e: MouseEvent) => {\n /* all actions should be bloked for a second */\n const button = e.currentTarget as any\n button.icon = 'rotate_right'\n button.setAttribute('working', true)\n button.disabled = true\n\n try {\n action()\n } finally {\n await sleep(1000)\n button.disabled = false\n /* because icon can be changed after sleep, don't use closure 'icon'. */\n button.icon = this.actions[idx]?.icon || 'done_all'\n button.removeAttribute('working')\n\n window.history.back()\n }\n }}\n >\n <md-icon>${icon || 'done_all'}</md-icon>\n ${title}\n </button>\n `\n })}\n `\n }\n\n stateChanged(state: any) {\n this.actions = state.route?.context?.actions?.filter((action: any) => !!action) || []\n }\n}\n"]}
1
+ {"version":3,"file":"ox-page-action-overlay-template.js","sourceRoot":"","sources":["../../../src/tools/ox-page-action-overlay-template.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAmB,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAA;AAGnF,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAAl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AM,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;4BACpC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAA;4BAEtB,IAAI,CAAC;gCACH,MAAM,EAAE,CAAA;4BACV,CAAC;oCAAS,CAAC;gCACT,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA;gCACjB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAA;gCACvB,wEAAwE;gCACxE,MAAM,CAAC,IAAI,GAAG,CAAA,MAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0CAAE,IAAI,KAAI,UAAU,CAAA;gCACnD,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;gCAEjC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;4BACvB,CAAC;wBACH,CAAC;;+BAEU,IAAI,IAAI,UAAU;sBAC3B,KAAK;;iBAEV,CAAA;QACX,CAAC,CAAC;KACH,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAU;;QACrB,IAAI,CAAC,OAAO,GAAG,CAAA,MAAA,MAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,OAAO,0CAAE,OAAO,0CAAE,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAI,EAAE,CAAA;IACvF,CAAC;CACF,CAAA;AAxDkB;IAAhB,KAAK,EAAE;0DAA4B;AAhDzB,yBAAyB;IADrC,aAAa,CAAC,iCAAiC,CAAC;GACpC,yBAAyB,CAwGrC","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { store } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { sleep } from '@operato/utils'\n\nimport { ContextToolbarOverlayStyle } from '../styles/ox-context-toolbar-overlay-style.js'\n\n@customElement('ox-page-action-overlay-template')\nexport class PageActionOverlayTemplate extends connect(store)(LitElement) {\n static get styles() {\n return [\n ScrollbarStyles,\n ContextToolbarOverlayStyle,\n css`\n :host {\n display: flex;\n flex-wrap: wrap;\n gap: var(--margin-narrow);\n }\n :host *:focus {\n outline: none;\n }\n\n button {\n background-color: var(--main-section-background-color);\n border-radius: var(--context-action-bar-more-button-border-radius);\n }\n\n [danger] {\n --md-theme-primary: var(--md-danger-button-primary-color);\n --md-button-outline-color: var(--md-danger-button-outline-color);\n }\n\n [filled] {\n font-variation-settings: 'FILL' 1;\n }\n\n @media screen and (max-width: 460px) {\n button {\n --md-button-horizontal-padding: var(--padding-default);\n border-radius: 4px;\n }\n }\n\n @keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n `\n ]\n }\n\n @state() private actions: any[] = []\n\n render() {\n return html`\n ${this.actions.map(($action, idx) => {\n let { type, title, icon, action, select, href, emphasis } = $action as any\n let { outlined, raised, dense, danger, filled } = emphasis || {}\n\n return type == 'text'\n ? html` <span>${title}</span> `\n : type == 'select' || (select && select.length > 0)\n ? html`\n <select @change=${action}>\n ${select.map((option: any) => html` <option>${option}</option> `)}\n </select>\n `\n : type == 'link'\n ? html` <a href=${href}>${title}</a> `\n : html`\n <button\n ?dense=${dense}\n ?raised=${raised}\n ?outlined=${outlined}\n ?danger=${danger}\n ?filled=${filled}\n @click=${async (e: MouseEvent) => {\n /* all actions should be bloked for a second */\n const button = e.currentTarget as any\n button.icon = 'rotate_right'\n button.setAttribute('working', true)\n button.disabled = true\n\n try {\n action()\n } finally {\n await sleep(1000)\n button.disabled = false\n /* because icon can be changed after sleep, don't use closure 'icon'. */\n button.icon = this.actions[idx]?.icon || 'done_all'\n button.removeAttribute('working')\n\n window.history.back()\n }\n }}\n >\n <md-icon>${icon || 'done_all'}</md-icon>\n ${title}\n </button>\n `\n })}\n `\n }\n\n stateChanged(state: any) {\n this.actions = state.route?.context?.actions?.filter((action: any) => !!action) || []\n }\n}\n"]}
@@ -63,7 +63,7 @@ PageTitleBar.styles = [
63
63
  --help-icon-opacity: 0.2;
64
64
  --help-icon-size: 20px;
65
65
 
66
- --mdc-icon-size: 20px;
66
+ --md-icon-size: 20px;
67
67
 
68
68
  --input-search-padding: var(--padding-narrow);
69
69
  --input-search-font: normal 14px var(--theme-font);
@@ -1 +1 @@
1
- {"version":3,"file":"ox-page-title-bar.js","sourceRoot":"","sources":["../../../src/tools/ox-page-title-bar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGxC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAArD;;QAkEL,WAAM,GAAG,cAAc,EAAE,CAAA;IA4C3B,CAAC;IA1CC,MAAM;QACJ,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,IAAK,EAAU,CAAA;QACjE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,GAAG,EAAE,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,MAAM,IAAK,EAAU,CAAA;QACtG,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,IAAK,EAAU,CAAA;QACxD,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,GAAG,OAAO,KAAK,KAAK,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BAAmB,CAAC,CAAa,EAAE,EAAE,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE;;WAE5G;YACH,CAAC,CAAC,IAAI,CAAA,EAAE;KACX,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAU;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAA;IACpC,CAAC;;AA5GM,mBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2DF;CACF,AA7DY,CA6DZ;AAEgB;IAAhB,KAAK,EAAE;6CAAqB;AAhElB,YAAY;IADxB,aAAa,CAAC,mBAAmB,CAAC;GACtB,YAAY,CA8GxB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-search.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { openHelp } from '@operato/help'\nimport { store } from '@operato/shell'\nimport { isMobileDevice } from '@operato/utils'\n\n@customElement('ox-page-title-bar')\nexport class PageTitleBar extends connect(store)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n align-items: center;\n\n --help-icon-color: var(--primary-text-color);\n --help-icon-hover-color: var(--secondary-text-color);\n --help-icon-opacity: 0.2;\n --help-icon-size: 20px;\n\n --mdc-icon-size: 20px;\n\n --input-search-padding: var(--padding-narrow);\n --input-search-font: normal 14px var(--theme-font);\n }\n\n [titler] {\n display: flex;\n padding: var(--padding-default) var(--padding-narrow) var(--padding-narrow) var(--padding-narrow);\n font: var(--context-toolbar-title);\n color: var(--title-text-color);\n }\n\n [titler] > * {\n align-self: center;\n }\n\n [help] {\n opacity: var(--help-icon-opacity);\n font-size: var(--help-icon-size);\n color: var(--help-icon-color);\n }\n\n [help]:hover {\n cursor: help;\n opacity: var(--help-icon-hover-opacity);\n color: var(--help-icon-hover-color);\n }\n\n [search] [help] {\n color: var(--secondary-color);\n }\n\n [search] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n align-self: center;\n color: var(--secondary-color);\n background-color: var(--opacity-light-color);\n border-radius: 999em;\n margin-left: auto;\n padding: 0 10px;\n }\n\n [search] > * {\n align-self: center;\n }\n `\n ]\n\n @state() private context: any\n\n mobile = isMobileDevice()\n\n render() {\n var { search, filter, title, help } = this.context || ({} as any)\n var { value = '', handler: searchHandler, placeholder = '', autofocus = true } = search || ({} as any)\n const { handler: filterHandler } = filter || ({} as any)\n const { icon, text = title } = typeof title === 'object' ? title : ({} as any)\n const searchable = typeof searchHandler == 'function'\n const filterable = typeof filterHandler == 'function'\n\n if (this.mobile && searchable && title) {\n placeholder ||= title\n title = ''\n }\n\n return html`\n ${title ? html` <div titler>${icon ? html`<md-icon>${icon}</md-icon>&nbsp;` : html``}${text}</div> ` : html``}\n ${help && title ? html` &nbsp;<md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon> ` : html``}\n ${searchable || filterable\n ? html`\n <div search>\n ${searchable\n ? html` <ox-input-search\n .placeholder=${placeholder}\n .value=${value || ''}\n ?autofocus=${autofocus}\n @change=${(e: Event) => {\n searchHandler((e.target as any).value)\n }}\n ></ox-input-search>`\n : html``}\n ${!title && help && searchable\n ? html`<md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon>`\n : html``}\n ${filterable ? html`<md-icon @click=${(e: MouseEvent) => filterHandler()}>unfold_more</md-icon>` : html``}\n </div>\n `\n : html``}\n `\n }\n\n stateChanged(state: any) {\n this.context = state.route.context\n }\n}\n"]}
1
+ {"version":3,"file":"ox-page-title-bar.js","sourceRoot":"","sources":["../../../src/tools/ox-page-title-bar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,E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;6CAAqB;AAhElB,YAAY;IADxB,aAAa,CAAC,mBAAmB,CAAC;GACtB,YAAY,CA8GxB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-search.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers'\n\nimport { openHelp } from '@operato/help'\nimport { store } from '@operato/shell'\nimport { isMobileDevice } from '@operato/utils'\n\n@customElement('ox-page-title-bar')\nexport class PageTitleBar extends connect(store)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n align-items: center;\n\n --help-icon-color: var(--primary-text-color);\n --help-icon-hover-color: var(--secondary-text-color);\n --help-icon-opacity: 0.2;\n --help-icon-size: 20px;\n\n --md-icon-size: 20px;\n\n --input-search-padding: var(--padding-narrow);\n --input-search-font: normal 14px var(--theme-font);\n }\n\n [titler] {\n display: flex;\n padding: var(--padding-default) var(--padding-narrow) var(--padding-narrow) var(--padding-narrow);\n font: var(--context-toolbar-title);\n color: var(--title-text-color);\n }\n\n [titler] > * {\n align-self: center;\n }\n\n [help] {\n opacity: var(--help-icon-opacity);\n font-size: var(--help-icon-size);\n color: var(--help-icon-color);\n }\n\n [help]:hover {\n cursor: help;\n opacity: var(--help-icon-hover-opacity);\n color: var(--help-icon-hover-color);\n }\n\n [search] [help] {\n color: var(--secondary-color);\n }\n\n [search] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n align-self: center;\n color: var(--secondary-color);\n background-color: var(--opacity-light-color);\n border-radius: 999em;\n margin-left: auto;\n padding: 0 10px;\n }\n\n [search] > * {\n align-self: center;\n }\n `\n ]\n\n @state() private context: any\n\n mobile = isMobileDevice()\n\n render() {\n var { search, filter, title, help } = this.context || ({} as any)\n var { value = '', handler: searchHandler, placeholder = '', autofocus = true } = search || ({} as any)\n const { handler: filterHandler } = filter || ({} as any)\n const { icon, text = title } = typeof title === 'object' ? title : ({} as any)\n const searchable = typeof searchHandler == 'function'\n const filterable = typeof filterHandler == 'function'\n\n if (this.mobile && searchable && title) {\n placeholder ||= title\n title = ''\n }\n\n return html`\n ${title ? html` <div titler>${icon ? html`<md-icon>${icon}</md-icon>&nbsp;` : html``}${text}</div> ` : html``}\n ${help && title ? html` &nbsp;<md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon> ` : html``}\n ${searchable || filterable\n ? html`\n <div search>\n ${searchable\n ? html` <ox-input-search\n .placeholder=${placeholder}\n .value=${value || ''}\n ?autofocus=${autofocus}\n @change=${(e: Event) => {\n searchHandler((e.target as any).value)\n }}\n ></ox-input-search>`\n : html``}\n ${!title && help && searchable\n ? html`<md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon>`\n : html``}\n ${filterable ? html`<md-icon @click=${(e: MouseEvent) => filterHandler()}>unfold_more</md-icon>` : html``}\n </div>\n `\n : html``}\n `\n }\n\n stateChanged(state: any) {\n this.context = state.route.context\n }\n}\n"]}