@operato/context 10.29.81 → 10.29.84
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/stories/ox-context-page-toolbar-select-buttons.stories.d.ts +25 -0
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +151 -0
- package/dist/stories/ox-context-page-toolbar-select.stories.d.ts +24 -0
- package/dist/stories/ox-context-page-toolbar-select.stories.js +115 -0
- package/dist/stories/ox-context-page-toolbar.stories.d.ts +24 -0
- package/dist/stories/ox-context-page-toolbar.stories.js +115 -0
- package/dist/stories/ox-context-toolbar-complex.stories.d.ts +24 -0
- package/dist/stories/ox-context-toolbar-complex.stories.js +169 -0
- package/dist/stories/ox-context-toolbar-cooldown.stories.d.ts +18 -0
- package/dist/stories/ox-context-toolbar-cooldown.stories.js +100 -0
- package/dist/stories/ox-context-toolbar-empty.stories.d.ts +23 -0
- package/dist/stories/ox-context-toolbar-empty.stories.js +98 -0
- package/dist/stories/ox-context-toolbar-overflow.stories.d.ts +24 -0
- package/dist/stories/ox-context-toolbar-overflow.stories.js +153 -0
- package/dist/stories/ox-context-toolbar.stories.d.ts +19 -0
- package/dist/stories/ox-context-toolbar.stories.js +209 -0
- package/package.json +21 -8
- package/CHANGELOG.md +0 -5517
- package/dist/src/index.js.map +0 -1
- package/dist/src/layouts/ox-context-page-toolbar.js.map +0 -1
- package/dist/src/layouts/ox-context-toolbar.js.map +0 -1
- package/dist/src/styles/ox-context-toolbar-overlay-style.js.map +0 -1
- package/dist/src/tools/ox-page-action-context-bar.js.map +0 -1
- package/dist/src/tools/ox-page-action-overlay-template.js.map +0 -1
- package/dist/src/tools/ox-page-title-bar.js.map +0 -1
- package/dist/src/tools/ox-title-bar.js.map +0 -1
- package/dist/src/tools/page-action-render.js.map +0 -1
- package/dist/src/tools/page-action.js.map +0 -1
- package/dist/test/action-bar-contract.test.d.ts +0 -2
- package/dist/test/action-bar-contract.test.js +0 -179
- package/dist/test/action-bar-contract.test.js.map +0 -1
- package/dist/test/action-bar-focus.test.d.ts +0 -1
- package/dist/test/action-bar-focus.test.js +0 -67
- package/dist/test/action-bar-focus.test.js.map +0 -1
- package/dist/test/action-bar-overflow.test.d.ts +0 -1
- package/dist/test/action-bar-overflow.test.js +0 -42
- package/dist/test/action-bar-overflow.test.js.map +0 -1
- package/dist/test/page-frames.test.d.ts +0 -1
- package/dist/test/page-frames.test.js +0 -59
- package/dist/test/page-frames.test.js.map +0 -1
- package/dist/test/page-title-description.test.d.ts +0 -1
- package/dist/test/page-title-description.test.js +0 -90
- package/dist/test/page-title-description.test.js.map +0 -1
- package/dist/test/title-search-typing.test.d.ts +0 -2
- package/dist/test/title-search-typing.test.js +0 -37
- package/dist/test/title-search-typing.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/test/action-bar-contract.test.ts +0 -200
- package/test/action-bar-focus.test.ts +0 -83
- package/test/action-bar-overflow.test.ts +0 -50
- package/test/page-frames.test.ts +0 -67
- package/test/page-title-description.test.ts +0 -106
- package/test/title-search-typing.test.ts +0 -43
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAA;AAC5D,cAAc,wBAAwB,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA","sourcesContent":["export * from './styles/ox-context-toolbar-overlay-style.js'\nexport * from './tools/page-action.js'\nexport { renderPageAction, PageActionStyles } from './tools/page-action-render.js'\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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,M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AI,CAAA,sBAAsB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ;YACtF,CAAC,CAAC,OAAO;;KAEZ,CAAA;IACH,CAAC;IAES,UAAU;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAA;IAClC,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;AAxEQ,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CA8G9B","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 { TOOL_POSITION } from '@operato/layout'\nimport { ContextController } from '@operato/shell'\n\n@customElement('ox-context-page-toolbar')\nexport class ContextPageToolbar extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n flex-direction: row-reverse;\n gap: var(--spacing-medium);\n\n position: relative;\n\n justify-content: end;\n align-items: center;\n\n text-transform: capitalize;\n\n --context-action-bar-button-margin: var(--spacing-none);\n --context-action-bar-more-button-border-radius: 2px;\n\n --md-icon-size: 20px;\n }\n\n :host > div {\n display: flex;\n flex-direction: row;\n\n align-items: center;\n gap: var(--spacing-small);\n }\n\n md-icon {\n width: 32px;\n height: 32px;\n box-sizing: border-box;\n\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-container);\n border-radius: var(--md-sys-shape-corner-small);\n padding: var(--spacing-small);\n\n &:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n border-color: var(--md-sys-color-primary);\n }\n }\n\n @media screen and (max-width: 460px) {\n :host {\n gap: 0;\n }\n\n :host > div {\n gap: 0;\n }\n\n md-icon {\n border-radius: 0;\n }\n }\n `\n ]\n }\n\n private _context = new ContextController(this)\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 <slot name=\"front\"></slot>\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 <slot name=\"rear\"></slot>\n `\n }\n\n protected willUpdate() {\n this.tools = this._context.tools\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-context-toolbar.js","sourceRoot":"","sources":["../../../src/layouts/ox-context-toolbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAA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ent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { TOOL_POSITION } from '@operato/layout'\nimport { RouteController, ContextController } from '@operato/shell'\n\n@customElement('ox-context-toolbar')\nexport class ContextToolbar extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n\n color: var(--context-toolbar-background-color, var(--md-sys-color-on-secondary-container));\n background-color: var(--context-toolbar-background-color, var(--md-sys-color-secondary-container));\n box-shadow: var(--context-toolbar-shadow-line);\n\n padding: 0;\n\n --md-icon-size: 20px;\n }\n\n div[container] {\n flex: 1;\n\n display: flex;\n position: relative;\n overflow: hidden;\n\n justify-content: space-between;\n\n gap: var(--spacing-medium);\n padding: var(--spacing-small) var(--spacing-medium);\n\n &:not(:has(> *)) {\n padding: 0;\n }\n\n div {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n\n align-items: center;\n overflow: hidden;\n padding: 0;\n }\n\n #front-end md-icon,\n #front md-icon {\n border: var(--context-toolbar-function-button-border, none);\n }\n\n #front-end md-icon {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-on-primary-container);\n }\n\n #front-end md-icon:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n\n #front md-icon {\n color: var(--md-sys-color-on-secondary-container);\n background-color: var(--md-sys-color-secondary-container);\n }\n\n #front md-icon:hover {\n color: var(--md-sys-color-on-secondary);\n background-color: var(--md-sys-color-secondary);\n }\n\n md-icon {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border: 1px solid var(--md-sys-color-primary-container);\n border-radius: var(--md-sys-shape-corner-small);\n padding: var(--spacing-small);\n\n &:hover {\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-primary);\n }\n }\n\n div md-icon {\n border-radius: 0;\n }\n\n div md-icon:first-child {\n border-top-left-radius: var(--md-sys-shape-corner-small);\n border-bottom-left-radius: var(--md-sys-shape-corner-small);\n }\n\n div md-icon:last-child {\n border-top-right-radius: var(--md-sys-shape-corner-small);\n border-bottom-right-radius: var(--md-sys-shape-corner-small);\n }\n\n #center {\n flex: 1;\n justify-content: end;\n }\n }\n\n @media only screen and (max-width: 460px) {\n div[container] {\n padding: 0;\n gap: 0;\n --md-assist-chip-container-shape: 0;\n }\n\n div[container] div md-icon {\n border-radius: 0 !important;\n }\n\n div[container] div md-icon:not(:last-child) {\n border-right-width: 0;\n }\n }\n `\n ]\n }\n\n private _route = new RouteController(this)\n private _context = new ContextController(this)\n\n @query('[container]') private container!: HTMLDivElement\n\n render() {\n const context = this._route.context || {}\n\n if (context.toolbar === false) {\n return nothing\n }\n\n let contextKeys = Object.keys(context).filter(key => !!context[key])\n let tools = (this._context.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 <div container>\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\n ? html`<div id=\"rear\">${rearTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n ${rearEndTools.length > 0\n ? html`<div id=\"rear-end\">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`\n : nothing}\n </div>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n requestAnimationFrame(() => {\n /*\n 하위 엘리먼트들이 실제로 보일 필요가 없을 때는, 이 엘리먼트도 숨김 처리함.\n &:not(:has(> *)) 처리로 모두 해결되지 않으므로, 로직 처리로 보완함.\n &:not(:has(> *)) 가 필요없으나, 남겨 두었음.\n */\n if (!this.container) {\n return\n }\n\n const children = this.container.querySelectorAll('*')\n\n let zero = true\n\n // 모든 하위 엘리먼트의 높이를 확인\n for (const child of Array.from(children)) {\n if ((child as HTMLElement).offsetHeight !== 0) {\n zero = false\n break\n }\n }\n\n // 모든 하위 엘리먼트의 높이가 0이면 부모 엘리먼트의 display를 none으로 변경\n this.container.style.padding = zero ? '0' : 'revert-layer'\n })\n }\n\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-context-toolbar-overlay-style.js","sourceRoot":"","sources":["../../../src/styles/ox-context-toolbar-overlay-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuD5C,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport const ContextToolbarOverlayStyle = css`\n :host {\n display: block;\n\n background-color: var(--context-ui-background-color);\n box-shadow: var(--context-ui-box-shadow);\n padding: var(--context-ui-padding);\n }\n\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n overflow-y: auto;\n }\n\n li {\n display: flex;\n\n border-bottom: var(--context-ui-list-border-bottom);\n padding: var(--context-ui-list-padding);\n }\n\n li > md-icon {\n font-size: 1em;\n\n padding: var(--context-ui-padding);\n color: var(--context-ui-list-color);\n }\n\n li > span {\n margin: auto 0;\n flex: 1;\n\n color: var(--context-ui-list-color);\n }\n\n li:hover md-icon,\n li:hover span {\n color: #fff;\n }\n\n li:hover {\n cursor: pointer;\n\n border-bottom: var(--context-ui-list-border-hover-bottom);\n }\n\n @media (max-width: 460px) {\n :host {\n min-width: 100%;\n box-shadow: none;\n border-radius: 0;\n }\n }\n`\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAc,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE5E,mGAAmG;AACnG,MAAM,UAAU,GAAG,EAAE,CAAA;AAGd,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAA7C;;QAoKG,WAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAA;QAEf,YAAO,GAAiB,EAAE,CAAA;QAEpC,cAAS,GAAY,KAAK,CAAA;QAGnC,gBAAW,GAAG,CAAC,CAAA;QAGf,mBAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAA;QAC3C,mBAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CA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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;AArJ4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAA2B;AAEpC;IAAhB,KAAK,EAAE;uDAAmC;AACrB;IAArB,KAAK,CAAC,aAAa,CAAC;uDAA2B;AAzKrC,oBAAoB;IADhC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,oBAAoB,CA2ThC","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-page-action-overlay-template.js'\n\nimport { css, html, LitElement, nothing, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { i18next } from '@operato/i18n'\nimport { openOverlay } from '@operato/layout'\nimport { RouteController } from '@operato/shell'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { formElementHeight } from '@operato/styles/form-element-heights.js'\n\nimport { arrangePageActions, PageAction, pageActionRunner } from './page-action.js'\nimport { PageActionStyles, renderPageAction } from './page-action-render.js'\n\n/** The width 「더보기」 takes at the bar's right end - its icon (2rem) and padding (10px each side). */\nconst MORE_WIDTH = 52\n\n@customElement('ox-page-action-context-bar')\nexport class PageActionContextBar extends LitElement {\n static get styles() {\n return [\n ButtonContainerStyles,\n PageActionStyles,\n css`\n :host {\n display: flex;\n position: relative;\n /*\n * The bar shrinks to the room its parent gives - without this its content width wins (min-width: auto of a\n * flex item that clips) and the actions are pushed out of the toolbar's left edge.\n */\n min-width: 0;\n max-width: 100%;\n overflow-x: clip;\n overflow-y: hidden;\n\n text-transform: capitalize;\n }\n\n /*\n * ── 키보드로 온 사람에게 지금 어디인지 보인다 ──────────────────────\n * 여기 있던 것은 :host *:focus { outline: none } 한 줄이다. 그런데 이 줄의 단추는 자기\n * 스타일에 이미 초점 표시를 갖고 있었다(ButtonContainerStyles 의 button &:focus-visible,\n * 2px). **그 한 줄이 그것을 이겼다** — :host *:focus 는 특정도 (0,2,0) 이고\n * button:focus-visible 은 (0,1,1) 이다. 그래서 선언은 있는데 화면에는 아무것도 안 그려졌다.\n *\n * [확인함] 2026-09-19 :3500 — 이 줄의 단추에 초점을 주고 재니 outline-style: none 이었다.\n * (그 재기는 :focus 까지만 확인한다. 키보드 초점은 합성으로 못 만든다.)\n *\n * 마우스로 누를 때 테두리가 남는 것이 싫어서 껐던 것은 맞다. 그 뜻은 :focus-visible 이\n * 정확히 낸다. 그래서 끄는 것은 **그 밖의 초점에만** 건다.\n *\n * 굵기는 3px 로 맞춘다 — Material 단추의 링이 3px 이고, 한 줄에 우리 단추와 md 단추가 함께\n * 서므로 두 표시가 같아야 한다.\n */\n :host *:focus:not(:focus-visible) {\n outline: none;\n }\n\n :host *:focus-visible {\n outline: 3px solid var(--md-sys-color-primary);\n outline-offset: 2px;\n }\n\n [container] {\n flex: 1;\n\n display: flex;\n overflow: hidden;\n gap: var(--spacing-small);\n /*\n * 초점 링이 설 자리 — 링은 단추 **밖으로 5px** 를 쓴다(3px 굵기 + 2px 띄움). 2px 이던 때는\n * 이 줄이 overflow: hidden 이라 위아래가 잘렸다. 가로로 자르는 것은 남겨 둔다 —\n * 「더보기」가 scrollWidth > clientWidth 로 넘침을 재는데 그 값이 살아 있어야 한다.\n */\n padding: 5px;\n align-items: center;\n }\n\n /*\n * The buttons end where the screen's content ends. A document screen used to stop at the\n * reading measure (1080px) and this bar followed it there through context.frame; since\n * 2026-10-05 every frame fills the window between two equal gutters (user decision, ADR in\n * operato-application/adr), so the bar spans the window like the content and no frame narrows it.\n * The frame attribute is still set — it says what the screen is — but nothing here reads it.\n */\n\n /*\n * 액션바 위에 떠 있는 오버플로 버튼 — 배경과 구분되도록 **테마와 무관하게 어두운 표면**을 유지한다.\n *\n * 이전에는 --md-sys-color-inverse-surface 를 썼는데, inverse-* 는 스펙상 \"현재 테마의 반대\"라\n * 라이트에서는 어둡지만 다크에서 밝게 반전되어 눈에 튀었다(ox-snack-bar 와 같은 부류).\n * 반투명 어두운 값을 기본으로 두면 브랜드 팔레트와 무관하게 안정적이고 .dark 패치도 불필요하다.\n */\n [more] {\n position: absolute;\n bottom: 0;\n right: 0;\n color: var(--ox-context-more-color, rgba(255, 255, 255, 0.95));\n background-color: var(--ox-context-more-background, rgba(0, 0, 0, 0.85));\n box-shadow: var(--ox-context-more-shadow, -2px 0px 2px 1px rgba(0, 0, 0, 0.2));\n padding: var(--context-action-bar-more-button-padding, 11px 10px);\n font-size: 2rem;\n z-index: 10;\n }\n\n /*\n * An action that does not fit whole is not drawn - half a button under 「더보기」 reads as a broken one\n * (2026-11-05, a phone: 「게시 취소」 cut in two by the button). The overlay behind 「더보기」 lists every\n * action. Which ones are kept is measured at their natural widths (layoutActions), so hiding one does not\n * change the decision.\n */\n [container] > [overflowed] {\n display: none;\n }\n\n [container] > * {\n flex: none;\n }\n\n /* The main action is always kept; on the narrowest bar it gives up width before it gives up its place. */\n [container] > [raised] {\n flex: 0 1 auto;\n min-width: 2.5rem;\n overflow: hidden;\n }\n\n /* Destructive actions stand apart from the rest (arranged first, configurePageActions). */\n [container] > [danger] + :not([danger]) {\n margin-left: var(--spacing-medium);\n }\n\n :host([overflown]) [container] {\n padding-right: var(--context-action-bar-more-width, 52px);\n }\n\n [more] {\n box-sizing: border-box;\n width: var(--context-action-bar-more-width, 52px);\n text-align: center;\n }\n\n select,\n input[type='text'] {\n box-sizing: border-box;\n padding: 0 var(--spacing-small);\n height: ${formElementHeight('--form-element-height-medium')};\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n color: var(--md-sys-color-on-primary);\n background-color: var(--md-sys-color-on-primary);\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n }\n\n @media screen and (max-width: 460px) {\n [container] {\n padding: 0;\n gap: 0;\n }\n\n /* 아주 좁은 화면 — 버튼을 붙여 한 덩어리로 만든다(사이 여백이 자리를 먹는다). */\n button {\n border-radius: 0;\n }\n\n button:not(:last-child) {\n border-right-width: 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 private _route = new RouteController(this)\n\n @property({ type: Array }) actions: PageAction[] = []\n\n @state() private overflown: boolean = false\n @query('[container]') container?: HTMLDivElement\n\n private layoutFrame = 0\n private resizeObserver?: ResizeObserver\n private observedParent?: Element | null\n private onRunnerChange = () => this.requestUpdate()\n private onWindowResize = () => this.scheduleLayout()\n\n connectedCallback() {\n super.connectedCallback()\n window.addEventListener('resize', this.onWindowResize)\n pageActionRunner.addEventListener('change', this.onRunnerChange)\n this.resizeObserver = new ResizeObserver(() => this.scheduleLayout())\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n window.removeEventListener('resize', this.onWindowResize)\n pageActionRunner.removeEventListener('change', this.onRunnerChange)\n this.resizeObserver?.disconnect()\n this.observedParent = undefined\n cancelAnimationFrame(this.layoutFrame)\n }\n\n render() {\n return this.actions.length > 0\n ? html`\n <div container>${this.renderActions()}</div>\n <!--\n 넘친 동작들에 닿는 **유일한 길**이다. 이름이 있어 낭독기가 읽고, 키보드 초점을 받는다.\n -->\n ${this.overflown\n ? html`\n <md-icon\n more\n role=\"button\"\n tabindex=\"0\"\n title=${i18next.t('text.more-actions', { defaultValue: 'more actions' })}\n aria-label=${i18next.t('text.more-actions', { defaultValue: 'more actions' })}\n @click=${this.showMore.bind(this)}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n this.showMore()\n }}\n >more_horiz</md-icon\n >\n `\n : html``}\n `\n : nothing\n }\n\n renderActions() {\n return html`${arrangePageActions(this.actions).map(({ action, role }) => renderPageAction(action, role))}`\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('actions')) this.scheduleLayout()\n const parent = this.parentElement\n if (parent !== this.observedParent) {\n this.resizeObserver?.disconnect()\n if (parent) this.resizeObserver?.observe(parent)\n this.observedParent = parent\n }\n }\n\n private scheduleLayout() {\n cancelAnimationFrame(this.layoutFrame)\n this.layoutFrame = requestAnimationFrame(() => this.layoutActions())\n }\n\n /**\n * The width the bar may take: what its parent holds less the other things beside it. The bar's own width follows its\n * content, so it cannot tell the room it is given (2026-11-08: 650px of actions in a 403px toolbar measured as fitting).\n */\n private availableWidth(): number {\n const parent = this.parentElement\n if (!parent) return this.getBoundingClientRect().width\n const style = getComputedStyle(parent)\n const gap = parseFloat(style.columnGap) || 0\n const siblings = Array.from(parent.children).filter(child => child !== this && (child as HTMLElement).offsetParent !== null)\n const taken = siblings.reduce((sum, child) => sum + child.getBoundingClientRect().width + gap, 0)\n return parent.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0) - taken\n }\n\n /**\n * Lays out what fits. Every action is first measured at its natural width; when they all fit, nothing is hidden.\n * Otherwise 「더보기」 takes the right end, the main action is always kept, and the others are kept from the right\n * (next to the main action) while they fit; the rest are listed only behind 「더보기」.\n */\n layoutActions() {\n const container = this.container\n if (!container) return\n const items = Array.from(container.children) as HTMLElement[]\n items.forEach(item => item.removeAttribute('overflowed'))\n this.removeAttribute('overflown')\n\n const style = getComputedStyle(container)\n const gap = parseFloat(style.columnGap) || 0\n const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0)\n const widths = items.map(item => item.getBoundingClientRect().width)\n const natural = widths.reduce((sum, width) => sum + width, 0) + gap * Math.max(0, items.length - 1) + padding\n const available = this.availableWidth()\n\n if (natural <= available + 0.5) {\n this.overflown = false\n return\n }\n\n const more = parseFloat(getComputedStyle(this).getPropertyValue('--context-action-bar-more-width')) || MORE_WIDTH\n let room = available - padding - more\n const keep = new Set<number>()\n items.forEach((item, at) => {\n if (item.hasAttribute('raised')) {\n keep.add(at)\n room -= widths[at] + gap\n }\n })\n for (let at = items.length - 1; at >= 0; at--) {\n if (keep.has(at)) continue\n if (widths[at] + gap > room) break\n keep.add(at)\n room -= widths[at] + gap\n }\n items.forEach((item, at) => item.toggleAttribute('overflowed', !keep.has(at)))\n this.setAttribute('overflown', '')\n this.overflown = true\n }\n\n protected willUpdate() {\n const { actions, frame } = this._route.context || {}\n /* The bar has no box of its own to measure; the attribute is what the stylesheet reads. */\n if (frame) this.setAttribute('frame', String(frame))\n else this.removeAttribute('frame')\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 +0,0 @@
|
|
|
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,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAExE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE5E;;;GAGG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,UAAU;IAAlD;;QA4BG,WAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAA;QAClC,mBAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAA;IAgBrD,CAAC;IA5CC,MAAM,KAAK,MAAM;QACf,OAAO;YACL,eAAe;YACf,qBAAqB;YACrB,gBAAgB;YAChB,0BAA0B;YAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;OAiBF;SACF,CAAA;IACH,CAAC;IAKD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAClE,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAA;QAC5B,gBAAgB,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IACrE,CAAC;IAED,MAAM;;QACJ,MAAM,OAAO,GAAG,CAAA,MAAA,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,0CAAE,OAAO,0CAAE,MAAM,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAI,EAAE,CAAA;QACrF,OAAO,IAAI,CAAA,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,EAAE,CAAA;IACvG,CAAC;CACF,CAAA;AA7CY,yBAAyB;IADrC,aAAa,CAAC,iCAAiC,CAAC;GACpC,yBAAyB,CA6CrC","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { RouteController } from '@operato/shell'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\n\nimport { ContextToolbarOverlayStyle } from '../styles/ox-context-toolbar-overlay-style.js'\nimport { arrangePageActions, pageActionRunner } from './page-action.js'\nimport { PageActionStyles, renderPageAction } from './page-action-render.js'\n\n/**\n * 「더보기」 - every action of the page, drawn by the same renderer as the bar (page-action-render.ts): the same name,\n * icon, main/danger look, disabled reason and running state. A run started here is the same run the bar shows.\n */\n@customElement('ox-page-action-overlay-template')\nexport class PageActionOverlayTemplate extends LitElement {\n static get styles() {\n return [\n ScrollbarStyles,\n ButtonContainerStyles,\n PageActionStyles,\n ContextToolbarOverlayStyle,\n css`\n :host {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-small);\n align-items: center;\n }\n\n /* The same focus mark as the bar: none for a mouse press, a ring for the keyboard. */\n :host *:focus:not(:focus-visible) {\n outline: none;\n }\n\n :host *:focus-visible {\n outline: 3px solid var(--md-sys-color-primary);\n outline-offset: 2px;\n }\n `\n ]\n }\n\n private _route = new RouteController(this)\n private onRunnerChange = () => this.requestUpdate()\n\n connectedCallback() {\n super.connectedCallback()\n pageActionRunner.addEventListener('change', this.onRunnerChange)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n pageActionRunner.removeEventListener('change', this.onRunnerChange)\n }\n\n render() {\n const actions = this._route.context?.actions?.filter((action: any) => !!action) || []\n return html`${arrangePageActions(actions).map(({ action, role }) => renderPageAction(action, role))}`\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAArC;;QAqLG,WAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAA;QAC1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AC5B,CAAC,CAAC,IAAI,CAAA,mBAAmB,CAAC,CAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB;gBAChF,CAAC,CAAC,IAAI,CAAA,EAAE;gBACR,UAAU,CAAC,CAAC,CAAC,IAAI,CAAA,mBAAmB,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;;AA/QM,mBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgLF;CACF,AAlLY,CAkLZ;AAUgB;IAAhB,KAAK,EAAE;6CAAoB;AA7LjB,YAAY;IADxB,aAAa,CAAC,mBAAmB,CAAC;GACtB,YAAY,CAiRxB","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 { keyed } from 'lit/directives/keyed.js'\nimport { openHelp, ScreenHelpController } from '@operato/help'\nimport { RouteController } from '@operato/shell'\n\n@customElement('ox-page-title-bar')\nexport class PageTitleBar extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n align-items: center;\n /*\n * 줄 높이를 여기서 잡는다. 전에는 제목의 위 여백을 크게 주어(padding-top: medium) 줄을\n * 벌렸는데, 그러면 **제목 글자가 자기 상자 안에서 아래로 내려앉는다.** 옆의 검색은 가운데에\n * 있으니 둘이 어긋나 보였다. [확인함] 제목 상자 41x36 여백 8px 4px 4px. 2026-09-02\n *\n * 줄의 높이는 줄이 갖고, 제목은 위아래 같은 여백을 갖는다.\n */\n min-height: 36px;\n /*\n * ── 그릴 것이 없으면 자리도 없다 ──────────────────────────────────────\n * 제목도 검색도 필터도 없는 화면에서 이 요소가 **자식 0개인 채로 36px 을 차지**했다.\n * 배우기 문서에서 눈에 걸렸다 — 제목 줄을 끄자 문서 위에 빈 띠가 남았다.\n * [확인함] 2026-09-04 · 높이 36 · 자식 0\n *\n * min-height 는 그릴 것이 있을 때의 줄 높이다. 없을 때는 아래 [blank] 가 걷는다.\n */\n /*\n * 줄의 숨 쉴 자리 — **위와 오른쪽을 같게.**\n *\n * 전에는 제목의 위 여백(padding-top: medium)이 그 일을 하고 있었다. 그것을 걷어 글자를 가운데로\n * 맞추자 줄이 탭 바에 붙고, 알약은 원래부터 오른쪽 끝에 붙어 있었다 — 위 0 · 오른쪽 0.\n * [확인함] 2026-09-02\n *\n * 왼쪽은 화면의 여백(--ui-gutter)에 맞춘다 — 제목 글자가 본문 첫 글자와 같은 선에 선다.\n * 제목 상자가 자기 여백(spacing-small)을 가지므로 그만큼 뺀다. 전에는 0 이어서 문서 화면에서\n * 제목(x214)과 본문(x229)이 15px 어긋났다. [확인함 :4000 1440 창] 2026-10-05\n */\n padding: var(--spacing-medium) var(--spacing-medium) var(--spacing-small)\n calc(var(--ui-gutter, 16px) - var(--spacing-small, 4px));\n box-sizing: border-box;\n text-transform: capitalize;\n\n --help-icon-color: var(--md-sys-color-on-surface);\n --help-icon-hover-color: var(--md-sys-color-on-surface-variant);\n /*\n * ── 0.2 는 안 보인다 (2026-09-05) ────────────────────────────────\n * 도움말은 「있는 줄 알아야」 누른다. 20% 로 두면 야간 모드에서 대비 1.78:1 이고\n * (실측: 성숙도 화면 제목 옆), 밝은 모드도 비슷하다. 선택해 볼 생각을 못 한다.\n *\n * 0.5 면 밝은 화면 3.4 · 어두운 화면 3.9 로 UI 요소 기준(3:1)을 넘고, 제목보다는\n * 여전히 뒤에 선다.\n */\n --help-icon-opacity: 0.5;\n /* 마우스가 오면 또렷해진다. 전에는 이 이름이 선언되어 있지 않아 무효 치환 덕에\n 우연히 1 이 되고 있었다. */\n --help-icon-hover-opacity: 1;\n --help-icon-size: 20px;\n\n --md-icon-size: 20px;\n\n --input-search-padding: var(--spacing-small);\n --input-search-font: normal 14px var(--theme-font);\n }\n\n /*\n * 아무것도 그리지 않았다 — 자리를 비운다. updated() 가 그려진 것을 세어 붙인다.\n *\n * 왜 CSS 로만 못 하나: :host(:empty) 는 **바깥 DOM 의 자식**을 보므로 이 부품에서는 늘\n * 참이다(쓰는 쪽이 자식을 넣지 않는다). 그려진 것은 그림자 안에 있어서 세어야 한다.\n */\n :host([blank]) {\n display: none;\n }\n\n [titler] {\n display: flex;\n padding: var(--spacing-small);\n font: var(--context-toolbar-title);\n color: var(--context-toolbar-title-color, var(--md-sys-color-on-surface));\n }\n\n [titler] > * {\n align-self: center;\n }\n\n /*\n * One line under the title that says what the screen is for (context.description). It takes\n * the whole row, so the search pill stays on the title's line. Without the key nothing is\n * drawn and the bar is exactly as before (ADR-0060 decision 8).\n */\n :host([described]) {\n flex-wrap: wrap;\n }\n\n [description] {\n order: 10;\n flex-basis: 100%;\n padding: 0 var(--spacing-small) var(--spacing-small);\n font-size: var(--ui-t-body, 13px);\n line-height: 1.45;\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n text-transform: none;\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(--md-sys-color-on-secondary-container);\n }\n\n [search] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n /*\n * 알약의 높이를 정한다. 안의 입력이 정하게 두면 23px 이 되어 제목 줄보다 낮고, 알약이라\n * 그 차이가 눈에 걸린다.\n */\n min-height: 28px;\n box-sizing: border-box;\n\n align-self: center;\n /*\n * 검색은 강조 동작이 아니라 현재 목록을 좁히는 도구다. primary 의 반대색을 면으로\n * 쓰면 다크 도메인에서 밝은 알약으로 뒤집혀 제목 줄보다 먼저 읽힌다. 표준 surface\n * 단계 안에서만 분리해 다른 애플리케이션의 검색과 같은 톤을 유지한다.\n */\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface-container-low);\n border-radius: var(--md-sys-shape-corner-full);\n margin-left: auto;\n padding: 0 var(--spacing-medium);\n }\n\n [search] > * {\n align-self: center;\n }\n\n /*\n * 알약 안의 장치는 **한 단 흐리다** — 돋보기와 필터 여닫기.\n *\n * 둘 다 값이 아니라 값을 다루는 장치다. 입력한 글자와 같은 색이면 빈 알약에서 장치만 눈에 걸린다.\n * 마우스가 오면 진해져서 누를 수 있음을 말한다.\n */\n [search] ox-input-search {\n /*\n * 검색 알약이 이미 표면과 모양을 책임진다. 입력 자체의 기본 surface-variant 배경을\n * 그대로 두면 알약 안에 또 하나의 상자가 생겨 경계가 도드라진다.\n */\n --ox-input-search-background-color: transparent;\n --ox-input-search-color: var(--md-sys-color-on-surface);\n --ox-input-search-icon-color: var(--ui-faint, #8a959c);\n }\n\n [search] > md-icon:not([help]) {\n color: var(--ui-faint, #8a959c);\n cursor: pointer;\n transition: color 0.12s ease;\n }\n\n [search] > md-icon:not([help]):hover {\n color: var(--ui-muted, #57676f);\n }\n\n /*\n * The screen's name always shows (2026-10-12). A narrow window used to drop the title for the\n * search pill; now the pill moves to the next line when the row is too short, still at the right.\n */\n :host {\n flex-wrap: wrap;\n }\n `\n ]\n\n private _route = new RouteController(this)\n /* The screen's own help, else the part of the help found for its name (ADR-0181). */\n private _help = new ScreenHelpController(this)\n\n /*\n * The search field keeps what the user is typing through every re-render. Only a list query that was refused\n * (the user kept unsaved edits) draws it anew, so it shows the committed term again.\n */\n @state() private refused = 0\n private onRefused = () => this.refused++\n\n connectedCallback() {\n super.connectedCallback()\n document.addEventListener('query-refused', this.onRefused)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n document.removeEventListener('query-refused', this.onRefused)\n }\n\n /**\n * 그린 것이 하나도 없으면 host 에 `blank` 를 붙인다 — 그러면 자리를 비운다.\n *\n * 그리는 것은 제목 · 도움 · 검색·필터 알약 셋뿐이고 모두 요소 하나를 낸다. 무엇 때문에\n * 비었는지 따지지 않고 **그려진 것을 센다.** 조건이 늘어도 이 판단은 그대로 맞다.\n */\n updated() {\n this.toggleAttribute('blank', this.renderRoot.querySelector('div, md-icon') === null)\n this.toggleAttribute('described', this.renderRoot.querySelector('[description]') !== null)\n }\n\n render() {\n var { search, filter, title, help, heading, description } = this._route.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 /*\n * ── 화면이 자기 제목을 그리는 경우 ────────────────────────────────────────\n *\n * `context.title` 은 **화면의 이름**이고, 그 이름을 두 곳이 읽는다.\n *\n * MDI 탭 여러 화면 중 어느 것인가\n * 이 제목 줄 지금 읽는 것이 무엇인가\n *\n * 대개 둘 다 필요하다. 그런데 **화면이 이미 자기 제목을 크게 그리는 경우**가 있다 — 배우기\n * 문서가 그렇다. 문서 맨 위에 「공장의 모든 사건을 …」 같은 제목이 있고, 그 위에 이 줄이\n * 「배우기」를 또 얹고, 탭에도 「배우기」가 있다. **같은 말이 세 번이다.**\n *\n * 그때 title 을 빼면 탭 이름도 함께 빈다(page-mdibar 가 같은 값을 읽는다). 그래서 이름은\n * 그대로 두고 **이 줄만 끄는 방법**을 둔다. 이름은 하나이고, 그리는 자리마다 켜고 끈다.\n *\n * get context() { return { title: '배우기', heading: false } }\n *\n * 제목이 없으면 도움 아이콘도 걷힌다 — 아래 조건이 이미 `help && title` 이다. 문서 자체가\n * 도움인 화면에서 그 아이콘은 같은 말의 네 번째다.\n */\n if (heading === false) {\n title = ''\n }\n\n help = this._help.of({ help, title })\n\n return html`\n ${title && description ? html`<div description>${description}</div>` : html``}\n ${title ? html` <div titler>${icon ? html`<md-icon>${icon}</md-icon> ` : html``}${text}</div> ` : html``}\n ${help && title ? html` <md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon> ` : html``}\n ${searchable || filterable\n ? html`\n <div search>\n ${searchable\n ? keyed(this.refused, 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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-title-bar.js","sourceRoot":"","sources":["../../../src/tools/ox-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,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGzC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAuEG,WAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAA;QAC1C,qFAAqF;QAC7E,UAAK,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAE9C;;;WAGG;QACc,YAAO,GAAG,CAAC,CAAA;QACpB,cA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B,KAAK,EAAE;yCAAoB;AA/EjB,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CAoIpB","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 { keyed } from 'lit/directives/keyed.js'\nimport { openHelp, ScreenHelpController } from '@operato/help'\nimport { RouteController } from '@operato/shell'\n\n@customElement('ox-title-bar')\nexport class TitleBar extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n align-items: center;\n text-transform: capitalize;\n\n --help-icon-color: var(--md-sys-color-primary);\n --help-icon-hover-color: var(--md-sys-color-primary);\n --help-icon-opacity: 0.2;\n --help-icon-size: 20px;\n\n --md-icon-size: 20px;\n\n --input-search-padding: var(--spacing-medium);\n --input-search-focus-border-bottom: none;\n --input-search-font: normal 16px var(--theme-font);\n }\n\n [titler] {\n display: flex;\n font: var(--context-toolbar-title);\n }\n\n [titler] > * {\n align-self: center;\n }\n\n [help] {\n opacity: 0.5;\n font-size: var(--help-icon-size);\n color: var(--context-toolbar-title);\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] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n align-self: center;\n color: var(--md-sys-color-on-surface);\n background-color: var(--md-sys-color-surface-container-low);\n border-radius: var(--md-sys-shape-corner-full);\n padding: 0 var(--spacing-medium);\n }\n\n [search] > * {\n align-self: center;\n }\n\n ox-input-search {\n color: var(--md-sys-color-on-surface);\n /*\n * 입력 컴포넌트의 배경은 shadow DOM 안에서 custom property로 받는다. 일반\n * background-color 선언은 기본 surface-variant를 이기지 못해 알약 안에 각진\n * 상자가 남는다.\n */\n --ox-input-search-background-color: transparent;\n --ox-input-search-color: var(--md-sys-color-on-surface);\n border-radius: var(--md-sys-shape-corner-full);\n }\n `\n ]\n\n private _route = new RouteController(this)\n /* The screen's own help, else the part of the help found for its name (ADR-0181). */\n private _help = new ScreenHelpController(this)\n\n /*\n * The search field keeps what the user is typing through every re-render. Only a list query that was refused\n * (the user kept unsaved edits) draws it anew, so it shows the committed term again.\n */\n @state() private refused = 0\n private onRefused = () => this.refused++\n\n connectedCallback() {\n super.connectedCallback()\n document.addEventListener('query-refused', this.onRefused)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n document.removeEventListener('query-refused', this.onRefused)\n }\n\n render() {\n var { search, filter, title, help } = this._route.context || ({} as any)\n var { value = '', handler: searchHandler, placeholder = '', autofocus = true, maxLength } = 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 help = this._help.of({ help, title })\n\n if (searchable && title) {\n placeholder ||= text\n title = ''\n }\n\n return html`\n ${title ? html` <div titler>${icon ? html`<md-icon>${icon}</md-icon> ` : html``}${text}</div> ` : html``}\n ${help && title ? html` <md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon> ` : html``}\n ${searchable || filterable\n ? html`\n <div search>\n ${searchable\n ? keyed(this.refused, html` <ox-input-search\n .placeholder=${placeholder}\n .value=${value || ''}\n ?autofocus=${autofocus}\n .maxLength=${maxLength}\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()}>tune</md-icon>` : html``}\n </div>\n `\n : html``}\n `\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-action-render.js","sourceRoot":"","sources":["../../../src/tools/page-action-render.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OA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AAA,+BAA+B,IAAI,YAAY,CAAC,CAAC,CAAC,OAAO;QACtJ,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;;GAE/B,CAAA;AACH,CAAC;AAED,SAAS,GAAG,CAAC,MAAkB,EAAE,KAAY,EAAE,EAAE,KAAK,EAA0B;IAC9E,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC/C,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,EAAI,CAAA,CAAC,CAAA;AACzE,CAAC;AAED,SAAS,MAAM,CAAC,MAAkB,EAAE,OAA+B;IACjE,OAAO,CAAC,CAAgB,EAAE,EAAE;QAC1B,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG;YAAE,OAAM;QAC9C,CAAC,CAAC,cAAc,EAAE,CAAA;QAClB,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,CAAA;IACzB,CAAC,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;IAC/B,kBAAkB,CAAC,8BAA8B,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B7D,CAAA","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, nothing, TemplateResult } from 'lit'\nimport { notify } from '@operato/layout'\nimport { dangerButtonStyles } from '@operato/styles'\n\nimport { isButtonAction, PageAction, pageActionRunner, PageActionRole } from './page-action.js'\n\n/**\n * One action drawn the same way wherever it stands - the bar and 「더보기」 both call this.\n *\n * The role decides the look: `primary` is filled (`raised`), `danger` carries `danger` (drawn as a secondary\n * destructive button unless also raised - button-container-styles), `secondary` is plain. A running action shows a\n * turning icon and `aria-busy`; an action held by another run, or disabled by the page, is not pressable.\n *\n * A disabled action that says why (`disabledTitle`) stays focusable and hoverable (`aria-disabled`): the reason is its\n * tooltip, and pressing it says the reason instead of doing nothing. One without a reason is natively disabled.\n */\nexport function renderPageAction(action: PageAction, role: PageActionRole, options: { onRan?: () => void } = {}): TemplateResult {\n const { type, title, icon, select, href, disabled, disabledTitle } = action\n\n if (type === 'text') {\n return html`<span role=\"button\" tabindex=\"0\" @click=${(e: Event) => run(action, e, options)} @keydown=${keyRun(action, options)}>${title}</span>`\n }\n if (!isButtonAction(action)) {\n return type === 'link'\n ? html`<a href=${href ?? ''}>${title}</a>`\n : html`\n <select aria-label=${title ?? ''} @change=${(e: Event) => action.action?.(e)}>\n ${(select ?? []).map(option => html`<option>${option}</option>`)}\n </select>\n `\n }\n\n const running = pageActionRunner.isRunning(action)\n const held = pageActionRunner.isHeld(action)\n const iconOnly = type === 'icon' || !title\n const explained = !!disabled && !!disabledTitle\n const blocked = running || held || !!disabled\n\n return html`\n <button\n data-action=${action.id ?? title ?? icon ?? ''}\n ?icon-only=${iconOnly}\n ?raised=${role === 'primary'}\n ?danger=${role === 'danger'}\n ?disabled=${blocked && !explained}\n aria-disabled=${blocked ? 'true' : 'false'}\n aria-busy=${running ? 'true' : 'false'}\n ?running=${running}\n title=${explained ? disabledTitle! : title ?? ''}\n aria-label=${iconOnly ? title ?? icon ?? '' : nothing}\n @click=${(e: Event) => {\n if (explained && !running && !held) {\n notify({ message: disabledTitle!, level: 'info' })\n return\n }\n run(action, e, options)\n }}\n >\n ${running ? html`<md-icon working aria-hidden=\"true\">progress_activity</md-icon>` : icon ? html`<md-icon aria-hidden=\"true\">${icon}</md-icon>` : nothing}\n ${iconOnly ? nothing : title}\n </button>\n `\n}\n\nfunction run(action: PageAction, event: Event, { onRan }: { onRan?: () => void }) {\n const started = pageActionRunner.mayRun(action)\n pageActionRunner.run(action, event).finally(() => started && onRan?.())\n}\n\nfunction keyRun(action: PageAction, options: { onRan?: () => void }) {\n return (e: KeyboardEvent) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n run(action, e, options)\n }\n}\n\n/**\n * The running icon, the not-pressable look of an explained disabled action, and the secondary destructive look - shared\n * by the bar and 「더보기」. A danger action that is not the step's main action is drawn in the error colour on the\n * plain surface; filling it red made 삭제 the loudest button of a screen whose main action is 저장 (FOOTER-BUTTON-REVIEW\n * F02). The confirmation that follows a delete is where it is filled.\n */\nexport const PageActionStyles = css`\n ${dangerButtonStyles('button[danger]:not([raised])', 'text')}\n\n button[danger]:not([raised]) {\n border-color: var(--md-sys-color-error);\n }\n\n md-icon[working] {\n animation: page-action-rotate 1s linear infinite;\n }\n\n button[aria-disabled='true'] {\n opacity: 0.38;\n cursor: default;\n }\n\n button[running] {\n opacity: 1;\n cursor: progress;\n }\n\n @keyframes page-action-rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n`\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-action.js","sourceRoot":"","sources":["../../../src/tools/page-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA+CH,MAAM,MAAM,GAAqB,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;AAErE,+GAA+G;AAC/G,MAAM,UAAU,oBAAoB,CAAC,IAA+B;IAClE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAC7B,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,MAAM,CAAA;AACf,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAkB;IAC3C,OAAO,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;AACtF,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,MAAM,CAAC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ED;;;OAGG;IACH,KAAK,CAAC,GAAG,CAAC,MAAkB,EAAE,KAAa;QACzC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YAAE,OAAM;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;QAC1C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;QAC9C,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;QACvC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,CAAC,MAAO,CAAC,KAAK,CAAC,CAAA;YACpC,IAAI,MAAM,IAAI,OAAQ,MAA2B,CAAC,IAAI,KAAK,UAAU;gBAAE,MAAM,MAAM,CAAA;;gBAC9E,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;QACnE,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACxB,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAA","sourcesContent":["/**\n * What one action of a page's action bar is, and how it runs.\n *\n * A page declares its actions in `context.actions`. The bar draws the ones that fit and 「더보기」 lists every one; both\n * draw an action through `renderPageAction` and run it through `pageActionRunner`, so an action looks and behaves the\n * same in either place, and a run started in one is seen as running in the other.\n *\n * ── Running ────────────────────────────────────────────────────────────────────────────────────\n * An action runs once at a time: while it runs, the same action (by `id`, else `title`) is shown running and does not\n * start again - from the bar or from 「더보기」. Actions sharing a `group` exclude one another. An app can make every\n * action of a page exclusive (`configurePageActions({ exclusive: true })`): one change of a page at a time.\n *\n * Nothing is enabled by the runner when a run ends. Whether an action may run is the page's to say (`disabled`); the\n * bar draws the context the page holds now, so an action the page disabled while the run was out stays disabled.\n *\n * An action that returns at once (it opens a popup without awaiting it, it navigates) is held for `SETTLE_MS`, so a\n * double click does not run it twice. An action that returns a promise is held until it settles - no extra wait.\n *\n * The runner keeps the page's buttons from starting a change twice; it does not replace the server's own checks.\n */\n\nexport type PageActionEmphasis = {\n raised?: boolean\n outlined?: boolean\n dense?: boolean\n danger?: boolean\n}\n\nexport interface PageAction {\n /** A stable key: the same action in the bar and in 「더보기」, and across the page's context updates. Defaults to the title. */\n id?: string\n title?: string\n icon?: string\n /** What the action does. A promise keeps the action running until it settles. */\n action?: (event?: Event) => unknown\n /** `button` (default), `icon` (icon only, the title is its name), `text`, `select`, `link`. */\n type?: string\n select?: string[]\n href?: string\n /**\n * `{ raised }` marks the page's main action of this step - one per bar; `{ danger }` an action that destroys data.\n * The two are independent: a danger action is drawn as a secondary action unless it is also `raised`.\n */\n emphasis?: PageActionEmphasis | boolean\n /** Same as `emphasis.raised` (`'primary'`), stated as what it means. */\n priority?: 'primary' | 'secondary'\n disabled?: boolean\n /** Why the action is disabled - the button's tooltip and accessible description while it is. */\n disabledTitle?: string\n /** Actions of one group never run at the same time. */\n group?: string\n [key: string]: any\n}\n\nexport type PageActionRole = 'primary' | 'secondary' | 'danger'\n\nexport interface PageActionPolicy {\n /** Every action of a page excludes the others while it runs - one change of the page at a time. */\n exclusive: boolean\n /**\n * The bar arranges what the page declared: danger actions first, then the others in their order, the main action at\n * the right end; only the last `primary` action stays primary.\n */\n arrange: boolean\n}\n\nconst policy: PageActionPolicy = { exclusive: false, arrange: false }\n\n/** Sets the app's policy for every page's action bar (`@operato/context`). The platform default is neither. */\nexport function configurePageActions(next: Partial<PageActionPolicy>) {\n Object.assign(policy, next)\n}\n\nexport function pageActionPolicy(): Readonly<PageActionPolicy> {\n return policy\n}\n\nexport function emphasisOf(action: PageAction): PageActionEmphasis {\n return typeof action.emphasis === 'object' && action.emphasis ? action.emphasis : {}\n}\n\n/** The action's role as declared: `primary` (raised, not danger, or `priority: 'primary'`), `danger`, or `secondary`. */\nexport function roleOf(action: PageAction): PageActionRole {\n const { raised, danger } = emphasisOf(action)\n if (action.priority === 'primary') return 'primary'\n if (danger || action.danger) return 'danger'\n if (action.priority === 'secondary') return 'secondary'\n return raised ? 'primary' : 'secondary'\n}\n\n/** Whether the action is drawn as a button (not a text, select or link). */\nexport function isButtonAction(action: PageAction): boolean {\n const { type, select } = action\n return !(type === 'text' || type === 'select' || type === 'link' || (select && select.length > 0))\n}\n\nexport function actionKey(action: PageAction): string {\n return String(action.id ?? action.title ?? action.icon ?? '')\n}\n\n/**\n * The actions as the bar shows them, each with the role it is drawn in. With `arrange`, danger actions come first, then\n * the secondary ones in the page's order, and the main action last; a second `primary` is drawn as secondary.\n */\nexport function arrangePageActions(actions: readonly PageAction[]): { action: PageAction; role: PageActionRole }[] {\n const present = actions.filter(Boolean)\n const roles = present.map(action => ({ action, role: roleOf(action) }))\n if (!policy.arrange) return roles\n\n const lastPrimary = roles.map(one => one.role).lastIndexOf('primary')\n const settled = roles.map((one, at) => (one.role === 'primary' && at !== lastPrimary ? { ...one, role: 'secondary' as const } : one))\n const rank = (role: PageActionRole) => (role === 'danger' ? 0 : role === 'secondary' ? 1 : 2)\n return settled\n .map((one, at) => ({ one, at }))\n .sort((a, b) => rank(a.one.role) - rank(b.one.role) || a.at - b.at)\n .map(({ one }) => one)\n}\n\n/** How long an action that returned at once stays running - one double click. */\nexport const SETTLE_MS = 400\n\ntype Running = { group?: string }\n\n/**\n * Which actions are running now, shared by every bar and 「더보기」 of the page. Keyed by the page's address and the\n * action's key, so a run left behind on another page never blocks this one.\n */\nexport class PageActionRunner extends EventTarget {\n private running = new Map<string, Running>()\n\n private scoped(key: string) {\n return `${typeof location === 'undefined' ? '' : location.pathname}\\u0000${key}`\n }\n\n private get here() {\n const prefix = this.scoped('')\n return Array.from(this.running.entries()).filter(([key]) => key.startsWith(prefix))\n }\n\n isRunning(action: PageAction): boolean {\n return this.running.has(this.scoped(actionKey(action)))\n }\n\n /** Another action holds the page: one of the same group, or any while the policy is exclusive. */\n isHeld(action: PageAction): boolean {\n if (this.isRunning(action)) return false\n const others = this.here\n if (!others.length) return false\n if (policy.exclusive) return true\n return !!action.group && others.some(([, one]) => one.group === action.group)\n }\n\n /** Whether the action may start now - not running, not held, and not disabled by the page. */\n mayRun(action: PageAction): boolean {\n return !action.disabled && !this.isRunning(action) && !this.isHeld(action) && typeof action.action === 'function'\n }\n\n /**\n * Runs the action unless it may not start now. Resolves when it is no longer running; an error the action throws is\n * the action's to report and is passed on to the caller.\n */\n async run(action: PageAction, event?: Event): Promise<void> {\n if (!this.mayRun(action)) return\n const key = this.scoped(actionKey(action))\n this.running.set(key, { group: action.group })\n this.dispatchEvent(new Event('change'))\n try {\n const result = action.action!(event)\n if (result && typeof (result as Promise<unknown>).then === 'function') await result\n else await new Promise(resolve => setTimeout(resolve, SETTLE_MS))\n } finally {\n this.running.delete(key)\n this.dispatchEvent(new Event('change'))\n }\n }\n}\n\nexport const pageActionRunner = new PageActionRunner()\n"]}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import '../src/tools/ox-page-action-context-bar.js';
|
|
4
|
-
import '../src/tools/ox-page-action-overlay-template.js';
|
|
5
|
-
import { arrangePageActions, configurePageActions, pageActionRunner, roleOf } from '../src/tools/page-action.js';
|
|
6
|
-
const settle = async (el, rounds = 4) => {
|
|
7
|
-
for (let i = 0; i < rounds; i++) {
|
|
8
|
-
await new Promise(resolve => setTimeout(resolve, 60));
|
|
9
|
-
await el.updateComplete;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
async function barIn(width, actions) {
|
|
13
|
-
const host = await fixture(html `<div style="display:flex; justify-content:flex-end; overflow:hidden; width:${width}px"><ox-page-action-context-bar .actions=${actions}></ox-page-action-context-bar></div>`);
|
|
14
|
-
const el = host.querySelector('ox-page-action-context-bar');
|
|
15
|
-
await settle(el);
|
|
16
|
-
return { host: host, el };
|
|
17
|
-
}
|
|
18
|
-
const LONG = [
|
|
19
|
-
{ title: '차수 관리 열기와 아주 긴 번역 문구', action: () => { } },
|
|
20
|
-
{ title: '거래처로 등록', action: () => { } },
|
|
21
|
-
{ title: '실적 배분', action: () => { } },
|
|
22
|
-
{ title: '저장', icon: 'save', action: () => { }, emphasis: { raised: true } }
|
|
23
|
-
];
|
|
24
|
-
describe('동작 줄 — 부모 폭으로 넘침을 잰다 (F01)', () => {
|
|
25
|
-
for (const width of [320, 360, 390, 768]) {
|
|
26
|
-
it(`${width}px: 잘린 단추가 없고 주 동작이 보이며 나머지는 더보기로 닿는다`, async () => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const { host, el } = await barIn(width, LONG);
|
|
29
|
-
const box = host.getBoundingClientRect();
|
|
30
|
-
const buttons = Array.from(el.renderRoot.querySelectorAll('[container] > button'));
|
|
31
|
-
const shown = buttons.filter(one => getComputedStyle(one).display !== 'none');
|
|
32
|
-
for (const one of shown) {
|
|
33
|
-
const rect = one.getBoundingClientRect();
|
|
34
|
-
expect(rect.left >= box.left - 0.5, `「${(_a = one.textContent) === null || _a === void 0 ? void 0 : _a.trim()}」 왼쪽이 잘렸다`).to.equal(true);
|
|
35
|
-
expect(rect.right <= box.right + 0.5, `「${(_b = one.textContent) === null || _b === void 0 ? void 0 : _b.trim()}」 오른쪽이 잘렸다`).to.equal(true);
|
|
36
|
-
}
|
|
37
|
-
const primary = shown.find(one => one.hasAttribute('raised'));
|
|
38
|
-
expect(primary, '주 동작이 보이지 않는다').to.not.equal(undefined);
|
|
39
|
-
if (shown.length < buttons.length) {
|
|
40
|
-
const more = el.renderRoot.querySelector('[more]');
|
|
41
|
-
expect(more, '숨은 동작이 있는데 더보기가 없다').to.not.equal(null);
|
|
42
|
-
expect(more.getAttribute('tabindex')).to.equal('0');
|
|
43
|
-
expect(more.getBoundingClientRect().right <= box.right + 0.5).to.equal(true);
|
|
44
|
-
for (const one of shown)
|
|
45
|
-
expect(one.getBoundingClientRect().right <= more.getBoundingClientRect().left + 0.5).to.equal(true);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
it('부모가 넓어지면 숨겼던 동작을 다시 보인다', async () => {
|
|
50
|
-
const { host, el } = await barIn(320, LONG);
|
|
51
|
-
host.style.width = '1400px';
|
|
52
|
-
await settle(el, 6);
|
|
53
|
-
expect(el.renderRoot.querySelector('[more]')).to.equal(null);
|
|
54
|
-
expect(el.renderRoot.querySelectorAll('[container] > [overflowed]').length).to.equal(0);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
describe('동작의 역할과 순서 (F02 F05)', () => {
|
|
58
|
-
afterEach(() => configurePageActions({ arrange: false, exclusive: false }));
|
|
59
|
-
it('삭제는 raised 여도 위험 보조, 저장은 주 동작이다', () => {
|
|
60
|
-
expect(roleOf({ title: '삭제', emphasis: { raised: true, danger: true } })).to.equal('danger');
|
|
61
|
-
expect(roleOf({ title: '저장', emphasis: { raised: true } })).to.equal('primary');
|
|
62
|
-
expect(roleOf({ title: '상신', priority: 'primary' })).to.equal('primary');
|
|
63
|
-
});
|
|
64
|
-
it('arrange: 위험 동작은 앞, 주 동작은 오른쪽 끝, 주 동작은 하나', () => {
|
|
65
|
-
configurePageActions({ arrange: true });
|
|
66
|
-
const arranged = arrangePageActions([
|
|
67
|
-
{ title: '저장', emphasis: { raised: true } },
|
|
68
|
-
{ title: '삭제', emphasis: { raised: true, danger: true } },
|
|
69
|
-
{ title: '상신', emphasis: { raised: true } },
|
|
70
|
-
{ title: '첨부' }
|
|
71
|
-
]);
|
|
72
|
-
expect(arranged.map(one => `${one.action.title}:${one.role}`)).to.deep.equal(['삭제:danger', '저장:secondary', '첨부:secondary', '상신:primary']);
|
|
73
|
-
});
|
|
74
|
-
it('기본(arrange 없음)은 선언 순서를 그대로 둔다', () => {
|
|
75
|
-
const arranged = arrangePageActions([{ title: 'a', emphasis: { raised: true } }, { title: 'b', emphasis: { danger: true } }]);
|
|
76
|
-
expect(arranged.map(one => one.action.title)).to.deep.equal(['a', 'b']);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
describe('더보기는 기본 줄과 같은 렌더러로 그린다 (F04)', () => {
|
|
80
|
-
it('주 동작·위험·비활성·이유·아이콘이 같다', async () => {
|
|
81
|
-
const actions = [
|
|
82
|
-
{ title: '삭제', icon: 'delete', emphasis: { danger: true }, action: () => { } },
|
|
83
|
-
{ title: '발행', action: () => { }, disabled: true, disabledTitle: '먼저 저장하세요.' },
|
|
84
|
-
{ title: '저장', icon: 'save', emphasis: { raised: true }, action: () => { } }
|
|
85
|
-
];
|
|
86
|
-
const { el } = await barIn(1200, actions);
|
|
87
|
-
const overlay = (await fixture(html `<ox-page-action-overlay-template></ox-page-action-overlay-template>`));
|
|
88
|
-
overlay._route = { context: { actions } };
|
|
89
|
-
overlay.requestUpdate();
|
|
90
|
-
await overlay.updateComplete;
|
|
91
|
-
const describe = (root) => Array.from(root.querySelectorAll('button')).map(b => {
|
|
92
|
-
var _a;
|
|
93
|
-
return ({
|
|
94
|
-
text: (_a = b.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, ' ').trim(),
|
|
95
|
-
raised: b.hasAttribute('raised'),
|
|
96
|
-
danger: b.hasAttribute('danger'),
|
|
97
|
-
ariaDisabled: b.getAttribute('aria-disabled'),
|
|
98
|
-
title: b.getAttribute('title')
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
expect(describe(overlay.renderRoot)).to.deep.equal(describe(el.renderRoot));
|
|
102
|
-
expect(overlay.renderRoot.querySelector('md-assist-chip')).to.equal(null);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
describe('실행 상태는 공유된다 (F09)', () => {
|
|
106
|
-
afterEach(() => configurePageActions({ exclusive: false }));
|
|
107
|
-
it('같은 동작은 진행 중에 다시 시작하지 않는다 — 기본 줄과 더보기 사이에서도', async () => {
|
|
108
|
-
let runs = 0;
|
|
109
|
-
let release;
|
|
110
|
-
const action = { id: 'save', title: '저장', action: () => (runs++, new Promise(resolve => (release = resolve))) };
|
|
111
|
-
const { el } = await barIn(1200, [action]);
|
|
112
|
-
const button = el.renderRoot.querySelector('button');
|
|
113
|
-
button.click();
|
|
114
|
-
await el.updateComplete;
|
|
115
|
-
expect(button.getAttribute('aria-busy')).to.equal('true');
|
|
116
|
-
button.click();
|
|
117
|
-
pageActionRunner.run({ ...action });
|
|
118
|
-
expect(runs).to.equal(1);
|
|
119
|
-
release();
|
|
120
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
121
|
-
await el.updateComplete;
|
|
122
|
-
expect(button.getAttribute('aria-busy')).to.equal('false');
|
|
123
|
-
});
|
|
124
|
-
it('끝난 뒤 disabled 를 풀지 않는다 — 진행 중 업무 조건이 바뀌면 그 조건을 따른다', async () => {
|
|
125
|
-
let release;
|
|
126
|
-
const make = (disabled) => ({ id: 'issue', title: '발행', disabled, action: () => new Promise(resolve => (release = resolve)) });
|
|
127
|
-
const { el } = await barIn(1200, [make(false)]);
|
|
128
|
-
el.renderRoot.querySelector('button').click();
|
|
129
|
-
await el.updateComplete;
|
|
130
|
-
el.actions = [make(true)];
|
|
131
|
-
await el.updateComplete;
|
|
132
|
-
release();
|
|
133
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
134
|
-
await el.updateComplete;
|
|
135
|
-
const button = el.renderRoot.querySelector('button');
|
|
136
|
-
expect(button.disabled || button.getAttribute('aria-disabled') === 'true').to.equal(true);
|
|
137
|
-
});
|
|
138
|
-
it('exclusive: 한 동작이 도는 동안 다른 동작은 시작하지 않는다', async () => {
|
|
139
|
-
configurePageActions({ exclusive: true });
|
|
140
|
-
let release;
|
|
141
|
-
let submitted = 0;
|
|
142
|
-
const save = { id: 'save', title: '저장', action: () => new Promise(resolve => (release = resolve)) };
|
|
143
|
-
const submit = { id: 'submit', title: '상신', action: () => void submitted++ };
|
|
144
|
-
const { el } = await barIn(1200, [save, submit]);
|
|
145
|
-
const [saveButton, submitButton] = Array.from(el.renderRoot.querySelectorAll('button'));
|
|
146
|
-
saveButton.click();
|
|
147
|
-
await el.updateComplete;
|
|
148
|
-
expect(submitButton.disabled).to.equal(true);
|
|
149
|
-
submitButton.click();
|
|
150
|
-
expect(submitted).to.equal(0);
|
|
151
|
-
release();
|
|
152
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
153
|
-
await el.updateComplete;
|
|
154
|
-
expect(submitButton.disabled).to.equal(false);
|
|
155
|
-
});
|
|
156
|
-
it('group: 같은 묶음끼리만 막는다', async () => {
|
|
157
|
-
let release;
|
|
158
|
-
const a = { id: 'a', title: 'A', group: 'change', action: () => new Promise(resolve => (release = resolve)) };
|
|
159
|
-
const b = { id: 'b', title: 'B', group: 'change', action: () => { } };
|
|
160
|
-
const c = { id: 'c', title: 'C', action: () => { } };
|
|
161
|
-
pageActionRunner.run(a);
|
|
162
|
-
expect(pageActionRunner.mayRun(b)).to.equal(false);
|
|
163
|
-
expect(pageActionRunner.mayRun(c)).to.equal(true);
|
|
164
|
-
release();
|
|
165
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
166
|
-
expect(pageActionRunner.mayRun(b)).to.equal(true);
|
|
167
|
-
});
|
|
168
|
-
it('이유가 있는 비활성 동작은 초점을 받고 누르면 실행하지 않는다', async () => {
|
|
169
|
-
let runs = 0;
|
|
170
|
-
const { el } = await barIn(1200, [{ title: '발행', disabled: true, disabledTitle: '먼저 저장하세요.', action: () => void runs++ }]);
|
|
171
|
-
const button = el.renderRoot.querySelector('button');
|
|
172
|
-
expect(button.disabled).to.equal(false);
|
|
173
|
-
expect(button.getAttribute('aria-disabled')).to.equal('true');
|
|
174
|
-
expect(button.title).to.equal('먼저 저장하세요.');
|
|
175
|
-
button.click();
|
|
176
|
-
expect(runs).to.equal(0);
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
//# sourceMappingURL=action-bar-contract.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar-contract.test.js","sourceRoot":"","sources":["../../test/action-bar-contract.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,4CAA4C,CAAA;AACnD,OAAO,iDAAiD,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAc,gBAAgB,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAS5H,MAAM,MAAM,GAAG,KAAK,EAAE,EAAO,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE;IAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;QACrD,MAAM,EAAE,CAAC,cAAc,CAAA;IACzB,CAAC;AACH,CAAC,CAAA;AAED,KAAK,UAAU,KAAK,CAAC,KAAa,EAAE,OAAqB;IACvD,MAAM,IAAI,GAAG,MAAM,OAAO,CACxB,IAAI,CAAA,8EAA8E,KAAK,4CAA4C,OAAO,sCAAsC,CACjL,CAAA;IACD,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,4BAA4B,CAAQ,CAAA;IAClE,MAAM,MAAM,CAAC,EAAE,CAAC,CAAA;IAChB,OAAO,EAAE,IAAI,EAAE,IAAmB,EAAE,EAAE,EAAE,CAAA;AAC1C,CAAC;AAED,MAAM,IAAI,GAAG;IACX,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CA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AAC,KAAK,EAAE,CAAA;QACd,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/tools/ox-page-action-context-bar.js'\nimport '../src/tools/ox-page-action-overlay-template.js'\nimport { arrangePageActions, configurePageActions, PageAction, pageActionRunner, roleOf } from '../src/tools/page-action.js'\n\n/**\n * The page action contract (FOOTER-BUTTON-REVIEW F01 F02 F04 F05 F09 F10): the bar keeps every action reachable in the\n * room its parent gives, the main action stays, 「더보기」 draws an action as the bar does, and a run is shared.\n */\n\ntype Bar = HTMLElement & { renderRoot: ShadowRoot; updateComplete: Promise<unknown>; actions: PageAction[]; requestUpdate(): void }\n\nconst settle = async (el: Bar, rounds = 4) => {\n for (let i = 0; i < rounds; i++) {\n await new Promise(resolve => setTimeout(resolve, 60))\n await el.updateComplete\n }\n}\n\nasync function barIn(width: number, actions: PageAction[]) {\n const host = await fixture(\n html`<div style=\"display:flex; justify-content:flex-end; overflow:hidden; width:${width}px\"><ox-page-action-context-bar .actions=${actions}></ox-page-action-context-bar></div>`\n )\n const el = host.querySelector('ox-page-action-context-bar') as Bar\n await settle(el)\n return { host: host as HTMLElement, el }\n}\n\nconst LONG = [\n { title: '차수 관리 열기와 아주 긴 번역 문구', action: () => {} },\n { title: '거래처로 등록', action: () => {} },\n { title: '실적 배분', action: () => {} },\n { title: '저장', icon: 'save', action: () => {}, emphasis: { raised: true } }\n]\n\ndescribe('동작 줄 — 부모 폭으로 넘침을 잰다 (F01)', () => {\n for (const width of [320, 360, 390, 768]) {\n it(`${width}px: 잘린 단추가 없고 주 동작이 보이며 나머지는 더보기로 닿는다`, async () => {\n const { host, el } = await barIn(width, LONG)\n const box = host.getBoundingClientRect()\n const buttons = Array.from(el.renderRoot.querySelectorAll('[container] > button')) as HTMLElement[]\n const shown = buttons.filter(one => getComputedStyle(one).display !== 'none')\n for (const one of shown) {\n const rect = one.getBoundingClientRect()\n expect(rect.left >= box.left - 0.5, `「${one.textContent?.trim()}」 왼쪽이 잘렸다`).to.equal(true)\n expect(rect.right <= box.right + 0.5, `「${one.textContent?.trim()}」 오른쪽이 잘렸다`).to.equal(true)\n }\n const primary = shown.find(one => one.hasAttribute('raised'))\n expect(primary, '주 동작이 보이지 않는다').to.not.equal(undefined)\n if (shown.length < buttons.length) {\n const more = el.renderRoot.querySelector('[more]') as HTMLElement\n expect(more, '숨은 동작이 있는데 더보기가 없다').to.not.equal(null)\n expect(more.getAttribute('tabindex')).to.equal('0')\n expect(more.getBoundingClientRect().right <= box.right + 0.5).to.equal(true)\n for (const one of shown) expect(one.getBoundingClientRect().right <= more.getBoundingClientRect().left + 0.5).to.equal(true)\n }\n })\n }\n\n it('부모가 넓어지면 숨겼던 동작을 다시 보인다', async () => {\n const { host, el } = await barIn(320, LONG)\n host.style.width = '1400px'\n await settle(el, 6)\n expect(el.renderRoot.querySelector('[more]')).to.equal(null)\n expect(el.renderRoot.querySelectorAll('[container] > [overflowed]').length).to.equal(0)\n })\n})\n\ndescribe('동작의 역할과 순서 (F02 F05)', () => {\n afterEach(() => configurePageActions({ arrange: false, exclusive: false }))\n\n it('삭제는 raised 여도 위험 보조, 저장은 주 동작이다', () => {\n expect(roleOf({ title: '삭제', emphasis: { raised: true, danger: true } })).to.equal('danger')\n expect(roleOf({ title: '저장', emphasis: { raised: true } })).to.equal('primary')\n expect(roleOf({ title: '상신', priority: 'primary' })).to.equal('primary')\n })\n\n it('arrange: 위험 동작은 앞, 주 동작은 오른쪽 끝, 주 동작은 하나', () => {\n configurePageActions({ arrange: true })\n const arranged = arrangePageActions([\n { title: '저장', emphasis: { raised: true } },\n { title: '삭제', emphasis: { raised: true, danger: true } },\n { title: '상신', emphasis: { raised: true } },\n { title: '첨부' }\n ])\n expect(arranged.map(one => `${one.action.title}:${one.role}`)).to.deep.equal(['삭제:danger', '저장:secondary', '첨부:secondary', '상신:primary'])\n })\n\n it('기본(arrange 없음)은 선언 순서를 그대로 둔다', () => {\n const arranged = arrangePageActions([{ title: 'a', emphasis: { raised: true } }, { title: 'b', emphasis: { danger: true } }])\n expect(arranged.map(one => one.action.title)).to.deep.equal(['a', 'b'])\n })\n})\n\ndescribe('더보기는 기본 줄과 같은 렌더러로 그린다 (F04)', () => {\n it('주 동작·위험·비활성·이유·아이콘이 같다', async () => {\n const actions: PageAction[] = [\n { title: '삭제', icon: 'delete', emphasis: { danger: true }, action: () => {} },\n { title: '발행', action: () => {}, disabled: true, disabledTitle: '먼저 저장하세요.' },\n { title: '저장', icon: 'save', emphasis: { raised: true }, action: () => {} }\n ]\n const { el } = await barIn(1200, actions)\n const overlay = (await fixture(html`<ox-page-action-overlay-template></ox-page-action-overlay-template>`)) as Bar\n ;(overlay as any)._route = { context: { actions } }\n overlay.requestUpdate()\n await overlay.updateComplete\n const describe = (root: ShadowRoot) =>\n Array.from(root.querySelectorAll('button')).map(b => ({\n text: b.textContent?.replace(/\\s+/g, ' ').trim(),\n raised: b.hasAttribute('raised'),\n danger: b.hasAttribute('danger'),\n ariaDisabled: b.getAttribute('aria-disabled'),\n title: b.getAttribute('title')\n }))\n expect(describe(overlay.renderRoot)).to.deep.equal(describe(el.renderRoot))\n expect(overlay.renderRoot.querySelector('md-assist-chip')).to.equal(null)\n })\n})\n\ndescribe('실행 상태는 공유된다 (F09)', () => {\n afterEach(() => configurePageActions({ exclusive: false }))\n\n it('같은 동작은 진행 중에 다시 시작하지 않는다 — 기본 줄과 더보기 사이에서도', async () => {\n let runs = 0\n let release!: () => void\n const action: PageAction = { id: 'save', title: '저장', action: () => (runs++, new Promise<void>(resolve => (release = resolve))) }\n const { el } = await barIn(1200, [action])\n const button = el.renderRoot.querySelector('button') as HTMLButtonElement\n button.click()\n await el.updateComplete\n expect(button.getAttribute('aria-busy')).to.equal('true')\n button.click()\n pageActionRunner.run({ ...action })\n expect(runs).to.equal(1)\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n await el.updateComplete\n expect(button.getAttribute('aria-busy')).to.equal('false')\n })\n\n it('끝난 뒤 disabled 를 풀지 않는다 — 진행 중 업무 조건이 바뀌면 그 조건을 따른다', async () => {\n let release!: () => void\n const make = (disabled: boolean): PageAction => ({ id: 'issue', title: '발행', disabled, action: () => new Promise<void>(resolve => (release = resolve)) })\n const { el } = await barIn(1200, [make(false)])\n ;(el.renderRoot.querySelector('button') as HTMLButtonElement).click()\n await el.updateComplete\n el.actions = [make(true)]\n await el.updateComplete\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n await el.updateComplete\n const button = el.renderRoot.querySelector('button') as HTMLButtonElement\n expect(button.disabled || button.getAttribute('aria-disabled') === 'true').to.equal(true)\n })\n\n it('exclusive: 한 동작이 도는 동안 다른 동작은 시작하지 않는다', async () => {\n configurePageActions({ exclusive: true })\n let release!: () => void\n let submitted = 0\n const save: PageAction = { id: 'save', title: '저장', action: () => new Promise<void>(resolve => (release = resolve)) }\n const submit: PageAction = { id: 'submit', title: '상신', action: () => void submitted++ }\n const { el } = await barIn(1200, [save, submit])\n const [saveButton, submitButton] = Array.from(el.renderRoot.querySelectorAll('button')) as HTMLButtonElement[]\n saveButton.click()\n await el.updateComplete\n expect(submitButton.disabled).to.equal(true)\n submitButton.click()\n expect(submitted).to.equal(0)\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n await el.updateComplete\n expect(submitButton.disabled).to.equal(false)\n })\n\n it('group: 같은 묶음끼리만 막는다', async () => {\n let release!: () => void\n const a: PageAction = { id: 'a', title: 'A', group: 'change', action: () => new Promise<void>(resolve => (release = resolve)) }\n const b: PageAction = { id: 'b', title: 'B', group: 'change', action: () => {} }\n const c: PageAction = { id: 'c', title: 'C', action: () => {} }\n pageActionRunner.run(a)\n expect(pageActionRunner.mayRun(b)).to.equal(false)\n expect(pageActionRunner.mayRun(c)).to.equal(true)\n release()\n await new Promise(resolve => setTimeout(resolve, 10))\n expect(pageActionRunner.mayRun(b)).to.equal(true)\n })\n\n it('이유가 있는 비활성 동작은 초점을 받고 누르면 실행하지 않는다', async () => {\n let runs = 0\n const { el } = await barIn(1200, [{ title: '발행', disabled: true, disabledTitle: '먼저 저장하세요.', action: () => void runs++ }])\n const button = el.renderRoot.querySelector('button') as HTMLButtonElement\n expect(button.disabled).to.equal(false)\n expect(button.getAttribute('aria-disabled')).to.equal('true')\n expect(button.title).to.equal('먼저 저장하세요.')\n button.click()\n expect(runs).to.equal(0)\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../src/tools/ox-page-action-context-bar.js';
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* 요소끼리 비교하지 않는다 — 실패하면 chai 가 DOM 을 펼치다 러너가 멈춘다. */
|
|
2
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import '../src/tools/ox-page-action-context-bar.js';
|
|
5
|
-
/**
|
|
6
|
-
* 키보드로 온 사람이 **지금 어디인지 보인다.**
|
|
7
|
-
*
|
|
8
|
-
* ── 무엇이 있었나 ─────────────────────────────────────────────────────────
|
|
9
|
-
* 이 줄의 스타일에 `:host *:focus { outline: none }` 한 줄이 있었고 대신 그릴 것이 없었다. 그래서
|
|
10
|
-
* **하단 동작 줄의 단추에는 초점 표시가 아예 없었다** — 모든 제품의 모든 화면에 이 줄이 선다.
|
|
11
|
-
* [확인함] 2026-09-19 :3500 — 단추에 초점을 주고 재니 `outline-style: none` · `box-shadow: none`.
|
|
12
|
-
*
|
|
13
|
-
* 마우스로 누를 때 테두리가 뜨는 것이 싫어서 지운 것은 맞다. 그 뜻은 `:focus-visible` 이 정확히 낸다.
|
|
14
|
-
*
|
|
15
|
-
* ── 자리도 함께 준다 ──────────────────────────────────────────────────────
|
|
16
|
-
* 링은 단추 **밖으로 5px** 를 쓴다(3px 굵기 + 2px 띄움). 담는 줄이 `overflow: hidden` 이고 여백이
|
|
17
|
-
* 2px 이던 때는 그려도 위아래가 잘렸다. 그래서 이 시험은 **그렸나**와 **설 자리가 있나**를 함께 본다.
|
|
18
|
-
*/
|
|
19
|
-
const ACTIONS = [
|
|
20
|
-
{ title: 'save', action: () => { } },
|
|
21
|
-
{ title: 'cancel', action: () => { } }
|
|
22
|
-
];
|
|
23
|
-
async function bar() {
|
|
24
|
-
const el = (await fixture(html `
|
|
25
|
-
<ox-page-action-context-bar .actions=${ACTIONS}></ox-page-action-context-bar>
|
|
26
|
-
`));
|
|
27
|
-
await el.updateComplete;
|
|
28
|
-
return el;
|
|
29
|
-
}
|
|
30
|
-
const buttonOf = (el) => el.renderRoot.querySelector('button');
|
|
31
|
-
describe('하단 동작 줄의 초점 표시', () => {
|
|
32
|
-
it('키보드로 온 초점에 테두리를 그린다', async () => {
|
|
33
|
-
const el = await bar();
|
|
34
|
-
expect(buttonOf(el), '단추가 없다').to.not.equal(null);
|
|
35
|
-
/*
|
|
36
|
-
* 브라우저는 **키를 누른 뒤의 초점**만 키보드 초점으로 본다. 합성 키는 그림자 DOM 을 못 지나므로
|
|
37
|
-
* (2026-09-18 에 그것으로 없는 결함을 보고했다) 여기서는 규칙이 서 있는지를 본다. 실제로 그려지는
|
|
38
|
-
* 것은 앱에서 잰다.
|
|
39
|
-
*
|
|
40
|
-
* **주석을 걷고 본다.** 안 그러면 이 파일이 설명으로 적은 옛 규칙이 검사를 만족시킨다 —
|
|
41
|
-
* 자기 산문을 세는 것이 이 집 시험의 오래된 함정이다.
|
|
42
|
-
*/
|
|
43
|
-
const rules = Array.from(el.constructor.elementStyles)
|
|
44
|
-
.map((sheet) => { var _a; return String((_a = sheet.cssText) !== null && _a !== void 0 ? _a : ''); })
|
|
45
|
-
.join('\n')
|
|
46
|
-
.replace(/\/\*[\s\S]*?\*\//g, ' ');
|
|
47
|
-
/* 큰 문자열을 match 에 넣으면 실패 출력이 화면을 덮는다 — 참·거짓만 본다. */
|
|
48
|
-
expect(/:focus-visible\s*\{[^}]*outline:\s*3px solid/.test(rules), 'focus-visible 에 그릴 것이 없다').to.equal(true);
|
|
49
|
-
expect(/\*:focus\s*\{\s*outline:\s*none/.test(rules), '초점을 통째로 끄는 줄이 남아 있다').to.equal(false);
|
|
50
|
-
expect(/:focus:not\(:focus-visible\)\s*\{[^}]*outline:\s*none/.test(rules), '마우스 초점을 끄는 줄이 없다 — 누를 때마다 테두리가 뜬다').to.equal(true);
|
|
51
|
-
});
|
|
52
|
-
it('링이 설 자리가 있다 — 그려도 잘리면 없는 것과 같다', async () => {
|
|
53
|
-
const el = await bar();
|
|
54
|
-
const container = el.renderRoot.querySelector('[container]');
|
|
55
|
-
const style = getComputedStyle(container);
|
|
56
|
-
/* 링은 밖으로 5px 를 쓴다: 3px 굵기 + 2px 띄움. */
|
|
57
|
-
expect(parseFloat(style.paddingTop), '위 여백이 링보다 좁다').to.be.at.least(5);
|
|
58
|
-
expect(parseFloat(style.paddingBottom), '아래 여백이 링보다 좁다').to.be.at.least(5);
|
|
59
|
-
expect(parseFloat(style.paddingLeft), '왼쪽 여백이 링보다 좁다').to.be.at.least(5);
|
|
60
|
-
});
|
|
61
|
-
it('가로로 자르는 것은 그대로다 — 「더보기」가 넘침을 그 값으로 잰다', async () => {
|
|
62
|
-
const el = await bar();
|
|
63
|
-
const container = el.renderRoot.querySelector('[container]');
|
|
64
|
-
expect(getComputedStyle(container).overflowX).to.equal('hidden');
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=action-bar-focus.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar-focus.test.js","sourceRoot":"","sources":["../../test/action-bar-focus.test.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,4CAA4C,CAAA;AAEnD;;;;;;;;;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CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["/* 요소끼리 비교하지 않는다 — 실패하면 chai 가 DOM 을 펼치다 러너가 멈춘다. */\nimport { expect, fixture } from '@open-wc/testing'\nimport { html } from 'lit'\n\nimport '../src/tools/ox-page-action-context-bar.js'\n\n/**\n * 키보드로 온 사람이 **지금 어디인지 보인다.**\n *\n * ── 무엇이 있었나 ─────────────────────────────────────────────────────────\n * 이 줄의 스타일에 `:host *:focus { outline: none }` 한 줄이 있었고 대신 그릴 것이 없었다. 그래서\n * **하단 동작 줄의 단추에는 초점 표시가 아예 없었다** — 모든 제품의 모든 화면에 이 줄이 선다.\n * [확인함] 2026-09-19 :3500 — 단추에 초점을 주고 재니 `outline-style: none` · `box-shadow: none`.\n *\n * 마우스로 누를 때 테두리가 뜨는 것이 싫어서 지운 것은 맞다. 그 뜻은 `:focus-visible` 이 정확히 낸다.\n *\n * ── 자리도 함께 준다 ──────────────────────────────────────────────────────\n * 링은 단추 **밖으로 5px** 를 쓴다(3px 굵기 + 2px 띄움). 담는 줄이 `overflow: hidden` 이고 여백이\n * 2px 이던 때는 그려도 위아래가 잘렸다. 그래서 이 시험은 **그렸나**와 **설 자리가 있나**를 함께 본다.\n */\n\nconst ACTIONS = [\n { title: 'save', action: () => {} },\n { title: 'cancel', action: () => {} }\n]\n\nasync function bar() {\n const el = (await fixture(html`\n <ox-page-action-context-bar .actions=${ACTIONS}></ox-page-action-context-bar>\n `)) as HTMLElement & { renderRoot: ShadowRoot; updateComplete: Promise<unknown> }\n\n await el.updateComplete\n return el\n}\n\nconst buttonOf = (el: HTMLElement & { renderRoot: ShadowRoot }) => el.renderRoot.querySelector('button') as HTMLElement\n\ndescribe('하단 동작 줄의 초점 표시', () => {\n it('키보드로 온 초점에 테두리를 그린다', async () => {\n const el = await bar()\n\n expect(buttonOf(el), '단추가 없다').to.not.equal(null)\n\n /*\n * 브라우저는 **키를 누른 뒤의 초점**만 키보드 초점으로 본다. 합성 키는 그림자 DOM 을 못 지나므로\n * (2026-09-18 에 그것으로 없는 결함을 보고했다) 여기서는 규칙이 서 있는지를 본다. 실제로 그려지는\n * 것은 앱에서 잰다.\n *\n * **주석을 걷고 본다.** 안 그러면 이 파일이 설명으로 적은 옛 규칙이 검사를 만족시킨다 —\n * 자기 산문을 세는 것이 이 집 시험의 오래된 함정이다.\n */\n const rules = Array.from((el.constructor as any).elementStyles)\n .map((sheet: any) => String(sheet.cssText ?? ''))\n .join('\\n')\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, ' ')\n\n /* 큰 문자열을 match 에 넣으면 실패 출력이 화면을 덮는다 — 참·거짓만 본다. */\n expect(/:focus-visible\\s*\\{[^}]*outline:\\s*3px solid/.test(rules), 'focus-visible 에 그릴 것이 없다').to.equal(true)\n expect(/\\*:focus\\s*\\{\\s*outline:\\s*none/.test(rules), '초점을 통째로 끄는 줄이 남아 있다').to.equal(false)\n expect(\n /:focus:not\\(:focus-visible\\)\\s*\\{[^}]*outline:\\s*none/.test(rules),\n '마우스 초점을 끄는 줄이 없다 — 누를 때마다 테두리가 뜬다'\n ).to.equal(true)\n })\n\n it('링이 설 자리가 있다 — 그려도 잘리면 없는 것과 같다', async () => {\n const el = await bar()\n const container = el.renderRoot.querySelector('[container]') as HTMLElement\n const style = getComputedStyle(container)\n\n /* 링은 밖으로 5px 를 쓴다: 3px 굵기 + 2px 띄움. */\n expect(parseFloat(style.paddingTop), '위 여백이 링보다 좁다').to.be.at.least(5)\n expect(parseFloat(style.paddingBottom), '아래 여백이 링보다 좁다').to.be.at.least(5)\n expect(parseFloat(style.paddingLeft), '왼쪽 여백이 링보다 좁다').to.be.at.least(5)\n })\n\n it('가로로 자르는 것은 그대로다 — 「더보기」가 넘침을 그 값으로 잰다', async () => {\n const el = await bar()\n const container = el.renderRoot.querySelector('[container]') as HTMLElement\n\n expect(getComputedStyle(container).overflowX).to.equal('hidden')\n })\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../src/tools/ox-page-action-context-bar.js';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import '../src/tools/ox-page-action-context-bar.js';
|
|
4
|
-
/**
|
|
5
|
-
* On a phone the actions do not all fit. 「더보기」 stands over the bar's right end, and an action that does not fit
|
|
6
|
-
* whole is not drawn - it was drawn cut in two under 「더보기」 (2026-11-05, 375px, the announcement view).
|
|
7
|
-
*/
|
|
8
|
-
const ACTIONS = ['edit', 'read status', 'remind again', 'withdraw post', 'duplicate'].map(title => ({ title, action: () => { } }));
|
|
9
|
-
async function barOf(width) {
|
|
10
|
-
/* The bar sits in a toolbar part as wide as the room left (ox-context-toolbar #center); it measures that room. */
|
|
11
|
-
const host = await fixture(html `<div style="display:flex; justify-content:flex-end; width:${width}px"><ox-page-action-context-bar .actions=${ACTIONS}></ox-page-action-context-bar></div>`);
|
|
12
|
-
const el = host.querySelector('ox-page-action-context-bar');
|
|
13
|
-
/* the measure runs on the next frame, throttled; then 「더보기」 renders and the marks are taken again */
|
|
14
|
-
for (let i = 0; i < 4; i++) {
|
|
15
|
-
await new Promise(resolve => setTimeout(resolve, 150));
|
|
16
|
-
await el.updateComplete;
|
|
17
|
-
}
|
|
18
|
-
return el;
|
|
19
|
-
}
|
|
20
|
-
const right = (el) => el.getBoundingClientRect().right;
|
|
21
|
-
const left = (el) => el.getBoundingClientRect().left;
|
|
22
|
-
describe('하단 동작 줄이 넘칠 때', () => {
|
|
23
|
-
it('「더보기」 밑에 반쯤 걸린 단추는 그리지 않는다', async () => {
|
|
24
|
-
var _a;
|
|
25
|
-
const el = await barOf(260);
|
|
26
|
-
const more = el.renderRoot.querySelector('[more]');
|
|
27
|
-
expect(more, '넘치는데 「더보기」가 없다').to.not.equal(null);
|
|
28
|
-
const buttons = Array.from(el.renderRoot.querySelectorAll('[container] > button'));
|
|
29
|
-
const shown = buttons.filter(one => getComputedStyle(one).display !== 'none');
|
|
30
|
-
expect(shown.length, '보이는 단추가 없다').to.be.greaterThan(0);
|
|
31
|
-
expect(shown.length, '모두 보인다 - 넘침을 재지 못했다').to.be.lessThan(buttons.length);
|
|
32
|
-
for (const one of shown) {
|
|
33
|
-
expect(right(one) <= left(more) + 0.5, `「${(_a = one.textContent) === null || _a === void 0 ? void 0 : _a.trim()}」가 「더보기」 밑으로 들어간다`).to.equal(true);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
it('넉넉하면 아무것도 감추지 않는다', async () => {
|
|
37
|
-
const el = await barOf(1200);
|
|
38
|
-
expect(el.renderRoot.querySelector('[more]')).to.equal(null);
|
|
39
|
-
expect(el.renderRoot.querySelectorAll('[container] > [overflowed]').length).to.equal(0);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=action-bar-overflow.test.js.map
|