flexdesk 0.11.1 → 0.12.1
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/README.md +55 -0
- package/css/flexdesk.css +105 -9
- package/css/overrides.css +29 -9
- package/dist/charts.js +2 -2
- package/dist/{chunk-EHHTKD7B.js → chunk-2LEJQD4H.js} +2 -2
- package/dist/{chunk-5QPGYHBN.js → chunk-CWPMLX67.js} +2 -2
- package/dist/{chunk-6CGH73BC.js → chunk-M2L4XW2U.js} +224 -31
- package/dist/chunk-M2L4XW2U.js.map +7 -0
- package/dist/{chunk-6EZPPN4E.js → chunk-NNFTETK3.js} +8 -4
- package/dist/chunk-NNFTETK3.js.map +7 -0
- package/dist/flexdesk.css +105 -9
- package/dist/flow.js +2 -2
- package/dist/tiles.js +2 -2
- package/dist/widgets.js +3 -3
- package/dist/wm.js +23 -5
- package/dist/wm.js.map +2 -2
- package/package.json +1 -1
- package/src/tiling/content_registry.js +5 -0
- package/src/tiling/tile_renderer.js +45 -3
- package/src/ui/components/data_table.js +266 -31
- package/src/ui/components/modal.js +4 -2
- package/dist/chunk-6CGH73BC.js.map +0 -7
- package/dist/chunk-6EZPPN4E.js.map +0 -7
- /package/dist/{chunk-EHHTKD7B.js.map → chunk-2LEJQD4H.js.map} +0 -0
- /package/dist/{chunk-5QPGYHBN.js.map → chunk-CWPMLX67.js.map} +0 -0
|
@@ -17,7 +17,9 @@ function openForm({ title, fields = [], defaults = {}, submitLabel = "OK", onFie
|
|
|
17
17
|
body.className = "twm-modal__body-host";
|
|
18
18
|
body.innerHTML = `
|
|
19
19
|
<form class="twm-modal__form">
|
|
20
|
-
|
|
20
|
+
<div class="twm-modal__fields">
|
|
21
|
+
${fields.map((f) => _renderEntry(f, defaults[f.name] ?? f.default)).join("")}
|
|
22
|
+
</div>
|
|
21
23
|
<div class="twm-modal__error" data-role="form-error" hidden></div>
|
|
22
24
|
<div class="twm-modal__actions">
|
|
23
25
|
<button type="button" class="twm-btn" data-action="cancel">Cancel</button>
|
|
@@ -453,8 +455,10 @@ function _estimateHeight(fields) {
|
|
|
453
455
|
const rows = Number(f.rows) || 4;
|
|
454
456
|
body += 32 + rows * 18;
|
|
455
457
|
if (f.hint) body += 16;
|
|
456
|
-
} else if (f.type === "checkbox")
|
|
457
|
-
|
|
458
|
+
} else if (f.type === "checkbox") {
|
|
459
|
+
body += 32;
|
|
460
|
+
if (f.hint) body += 16;
|
|
461
|
+
} else {
|
|
458
462
|
body += 46;
|
|
459
463
|
if (f.hint) body += 16;
|
|
460
464
|
}
|
|
@@ -626,4 +630,4 @@ export {
|
|
|
626
630
|
openConfirm,
|
|
627
631
|
openModal
|
|
628
632
|
};
|
|
629
|
-
//# sourceMappingURL=chunk-
|
|
633
|
+
//# sourceMappingURL=chunk-NNFTETK3.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ui/components/modal.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Modal helpers \u2014 prompt with form, yes/no confirm.\n *\n * Built on the canonical `ManagedWindow` (with `modal: true`) so dialogs\n * go through the same window system as everything else: same chrome,\n * same backdrop, same Esc-to-close behaviour, same z-stacking.\n *\n * Returns Promises that resolve with the form data (or null on cancel)\n * / a boolean (confirm).\n *\n * Field schema:\n * { name, label, type='text', default, step?, options?, required?,\n * placeholder?, hint?, validator?, rows?, create?, pick?, displayFor? }\n *\n * - type: 'text' | 'number' | 'password' | 'select' | 'textarea' |\n * 'checkbox' | 'picker'\n * - hint: small dim help line rendered under the field\n * - validator: fn(value, allValues) => string | null (inline error)\n * - rows: number of textarea rows (only used for type='textarea')\n *\n * Section dividers \u2014 entries of the form `{ section: 'Label' }` are\n * rendered as a small uppercase heading that groups the fields below\n * them. Useful for longer forms. A section that also carries a `name`\n * can be hidden and shown by `onFieldChange`'s `setVisible`.\n *\n * Picker \u2014 a value the user LOOKS UP rather than types (an id chosen in a\n * search dialog, say). The row shows a read-only box and a search button;\n * the button (or a click on the box) awaits `pick(currentValue)`, which\n * resolves to `{ value, label }`, a bare value, or null to leave the field\n * alone. The value is what is submitted, the label is what is shown, and\n * `displayFor(value)` gives the label for the value the form opens with:\n *\n * {\n * name: 'parent', label: 'Parent', type: 'picker',\n * pick: async (current) => ({ value: 'EPIC-0001', label: 'EPIC-0001 \u2014 Auth' }),\n * displayFor: (value) => titleOf(value),\n * }\n *\n * Dependent-property pick-or-create \u2014 a `select` field that carries a\n * `create` spec renders as a **type-ahead combobox** instead of a\n * dropdown: the user picks an existing option OR types a new value.\n * On submit, a value that isn't an existing option is created via\n * `create.onCreate(value)` before the form resolves:\n *\n * {\n * name: 'asset_kind', label: 'Asset kind', type: 'select',\n * options: [...], // existing values (autocomplete)\n * create: {\n * onCreate: async (typed) => finalValue | null, // make the entity\n * hint: 'new asset kind', // shown when the typed value is new\n * },\n * }\n *\n * `create: true` is the degenerate case \u2014 \"pick one of these, or type\n * anything\" \u2014 where the typed value IS the value and there is no entity to\n * create, so there is no \"will create\" hint either. A bare `true` used to\n * reach `f.create.onCreate(v)` and fail the submit with \"onCreate is not a\n * function\", blaming the user for typing their own name.\n */\n\nimport { ManagedWindow } from '../../ui/components/managed_window.js';\n\n/**\n * C25. WHERE A DIALOG OPENS, when the application spans more than one window.\n *\n * Every modal here is a `ManagedWindow` with no `container`, so it mounts into\n * `document.body` \u2014 and \"document\" is the document this MODULE was loaded in.\n * A consumer that opens a second browser window with `window.open` and builds\n * its DOM from the opener's realm (which is how a pop-out grid works: same\n * modules, same JS context, a different document) therefore gets its dialogs in\n * the window it popped OUT of. The user presses \"Add column\" on their second\n * monitor and a dialog appears on the first, behind whatever is there.\n *\n * Passing a container at each call site was the other option and it is worse:\n * twenty-one of them across eleven files, every one of which would have to be\n * given a document it has no other reason to know about, and any one missed is\n * this bug again with no way to see it from here.\n *\n * So the HOST is ambient and the consumer sets it when its focus moves. Null \u2014\n * every consumer today \u2014 means `document.body`, exactly as before.\n */\nlet _modalHost = null;\nexport function setModalHost(el) { _modalHost = el || null; }\nexport function modalHost() { return _modalHost; }\n\nlet _modalSeq = 1;\n\n/**\n * @param {object} o\n * @param {Function?} o.onFieldChange `(name, value, api)` \u2014 called after any\n * field's `change`, and ONCE on open with `name === null` so the form starts\n * consistent with its defaults. `api` is\n * `{ setVisible(name, on), get(name), set(name, value) }`, addressing fields\n * and named sections by name. `get` reads the control as it stands (a\n * checkbox as a boolean, everything else as its string); `set` writes it and\n * does NOT call `onFieldChange` back, so a hook that fills one field from\n * another cannot loop.\n *\n * It exists for the form whose Type select spans two record kinds and must\n * show the fields of the kind actually chosen. Rebuilding the form on every\n * change would lose what the user had already typed, so every field is\n * built once and the irrelevant rows are hidden. A hidden row keeps its\n * value and is still submitted \u2014 the caller drops what its chosen kind does\n * not use \u2014 but it is not ASKED about: its `required` and its `validator`\n * stand down until it is shown again, because a constraint on a field the\n * user cannot see is a submit button that silently does nothing.\n *\n * Absent \u2014 every caller before it \u2014 nothing here runs.\n */\nexport function openForm({ title, fields = [], defaults = {}, submitLabel = 'OK', onFieldChange = null } = {}) {\n return new Promise((resolve) => {\n // Build the form body \u2014 same markup as the legacy overlay,\n // minus the outer .ea-modal wrapper (ManagedWindow owns the\n // chrome now).\n const body = document.createElement('div');\n body.className = 'twm-modal__body-host';\n body.innerHTML = `\n <form class=\"twm-modal__form\">\n <div class=\"twm-modal__fields\">\n ${fields.map((f) => _renderEntry(f, defaults[f.name] ?? f.default)).join('')}\n </div>\n <div class=\"twm-modal__error\" data-role=\"form-error\" hidden></div>\n <div class=\"twm-modal__actions\">\n <button type=\"button\" class=\"twm-btn\" data-action=\"cancel\">Cancel</button>\n <button type=\"submit\" class=\"twm-btn twm-btn--primary\">${submitLabel}</button>\n </div>\n </form>\n `;\n\n const win = new ManagedWindow({\n container: _modalHost,\n id: `twm-modal-${_modalSeq++}`,\n title: title || 'Dialog',\n icon: 'edit_note',\n content: body,\n modal: true,\n canMinimize: false,\n canMaximize: false,\n canResize: false,\n canDrag: true,\n defaultWidth: _estimateWidth(fields),\n defaultHeight: _estimateHeight(fields),\n onClose: () => { if (!_resolved) { _resolved = true; resolve(null); } },\n });\n win.show();\n\n let _resolved = false;\n const close = (result) => {\n if (_resolved) return;\n _resolved = true;\n resolve(result);\n try { win.close({ force: true }); } catch {}\n };\n\n const errEl = body.querySelector('[data-role=\"form-error\"]');\n const showError = (msg) => {\n if (!errEl) return;\n errEl.textContent = msg;\n errEl.hidden = !msg;\n };\n body.querySelector('[data-action=\"cancel\"]')?.addEventListener('click', () => close(null));\n\n const formFields = fields.filter((f) => !f.section);\n for (const f of formFields) {\n if (f.type === 'select' && f.create) _wireComboboxHint(body, f);\n if (f.type === 'picker') _wirePicker(body, f);\n }\n const rowHidden = (name) => !!body.querySelector(`[data-field-row=\"${name}\"]`)?.hidden;\n\n const clearFieldError = (name) => {\n const row = body.querySelector(`[data-field-row=\"${name}\"]`);\n const errEl = body.querySelector(`[data-field-error=\"${name}\"]`);\n if (row) row.classList.remove('twm-is-invalid');\n if (errEl) { errEl.textContent = ''; errEl.hidden = true; }\n };\n const setFieldError = (name, msg) => {\n const row = body.querySelector(`[data-field-row=\"${name}\"]`);\n const errEl = body.querySelector(`[data-field-error=\"${name}\"]`);\n if (row) row.classList.add('twm-is-invalid');\n if (errEl) { errEl.textContent = msg; errEl.hidden = false; }\n };\n // Clear per-field errors on input so the user sees the row recover.\n for (const f of formFields) {\n const el = body.querySelector(`[name=\"${f.name}\"]`);\n el?.addEventListener('input', () => clearFieldError(f.name));\n el?.addEventListener('change', () => clearFieldError(f.name));\n }\n\n // Adaptive fields \u2014 see `onFieldChange` above.\n if (typeof onFieldChange === 'function') {\n const fieldOf = (name) => formFields.find((f) => f.name === name) || null;\n const api = {\n setVisible(name, on) {\n const row = body.querySelector(`[data-field-row=\"${name}\"]`);\n if (!row) return;\n // The attribute alone loses to `.twm-modal__row { display:\n // grid }` in any stylesheet that has not got the `[hidden]`\n // rule flexdesk.css carries, so the inline style says it too.\n row.hidden = !on;\n row.style.display = on ? '' : 'none';\n clearFieldError(name);\n // A required control nobody can see blocks the submit with\n // no message the user can find. Remembered on the control,\n // so showing the row gives back exactly what it had.\n for (const el of row.querySelectorAll('input, select, textarea')) {\n if (!on && el.required) { el.required = false; el.dataset.twmRequired = '1'; }\n else if (on && el.dataset.twmRequired) { el.required = true; delete el.dataset.twmRequired; }\n }\n },\n get(name) {\n const el = body.querySelector(`[name=\"${name}\"]`);\n if (!el) return undefined;\n return el.type === 'checkbox' ? !!el.checked : el.value;\n },\n set(name, value) {\n const el = body.querySelector(`[name=\"${name}\"]`);\n if (!el) return;\n if (el.type === 'checkbox') { el.checked = !!value; return; }\n el.value = value == null ? '' : String(value);\n const f = fieldOf(name);\n if (f?.type === 'picker') {\n const display = body.querySelector(`[data-picker-display=\"${name}\"]`);\n if (display) display.value = _pickerLabel(f, el.value);\n }\n },\n };\n const fire = (name) => {\n try { onFieldChange(name, name == null ? undefined : api.get(name), api); }\n catch (err) { console.error('[modal] onFieldChange threw', err); }\n };\n for (const f of formFields) {\n const el = body.querySelector(`[name=\"${f.name}\"]`);\n el?.addEventListener('change', () => fire(f.name));\n }\n // Once on open, so a preselected value is reflected immediately\n // rather than only after the user touches something.\n fire(null);\n }\n\n body.querySelector('form').addEventListener('submit', async (e) => {\n e.preventDefault();\n const submitBtn = body.querySelector('button[type=\"submit\"]');\n showError('');\n const data = {};\n for (const f of formFields) {\n const el = body.querySelector(`[name=\"${f.name}\"]`);\n if (!el) continue;\n let v;\n if (f.type === 'checkbox') {\n v = !!el.checked;\n } else if (f.type === 'number') {\n v = (el.value === '' ? null : Number(el.value));\n } else {\n v = el.value;\n }\n if (f.type === 'select' && f.create) {\n const spec = _createSpec(f);\n const known = new Set(_optionValues(f.options));\n if (v && !known.has(v)) {\n if (submitBtn) submitBtn.disabled = true;\n let created;\n let failMsg = null;\n try { created = await spec.onCreate(v); }\n catch (err) { created = null; failMsg = err?.message || String(err); }\n if (submitBtn) submitBtn.disabled = false;\n if (created == null) {\n const hint = spec.hint || f.label.toLowerCase();\n showError(failMsg\n ? `Couldn't create ${hint} \"${v}\": ${failMsg}`\n : `Couldn't create ${hint} \"${v}\". See the toast for details.`);\n return;\n }\n v = created;\n }\n }\n data[f.name] = v;\n }\n // Per-field validators run after collection so they can see\n // peer values (e.g. confirm-password matches password).\n let firstBadName = null;\n for (const f of formFields) {\n clearFieldError(f.name);\n if (rowHidden(f.name)) continue;\n let msg = null;\n // A picker's value lives in a hidden input, which the browser's\n // own `required` check skips \u2014 so it is checked here.\n if (f.type === 'picker' && f.required && !data[f.name]) msg = 'Required.';\n else if (typeof f.validator !== 'function') continue;\n else {\n try { msg = f.validator(data[f.name], data); } catch (err) { msg = err?.message || String(err); }\n }\n if (msg) {\n setFieldError(f.name, msg);\n if (!firstBadName) firstBadName = f.name;\n }\n }\n if (firstBadName) {\n body.querySelector(`[data-picker=\"${firstBadName}\"]`)?.focus();\n body.querySelector(`[name=\"${firstBadName}\"]:not([type=\"hidden\"])`)?.focus();\n return;\n }\n close(data);\n });\n\n // Focus first field on next frame so the managed-window mount\n // settles before we steal focus.\n // Not a picker's hidden value, and not a field in a row that\n // `onFieldChange` hid on open.\n requestAnimationFrame(() => {\n const first = [...body.querySelectorAll('input:not([type=\"hidden\"]), select, textarea')]\n .find((el) => !el.closest('[data-field-row]')?.hidden);\n first?.focus();\n });\n });\n}\n\n\nexport function openConfirm({\n title, message, confirmLabel = 'OK',\n cancelLabel = 'Cancel',\n danger = false, icon = null,\n} = {}) {\n return new Promise((resolve) => {\n const body = document.createElement('div');\n body.className = 'twm-modal__body-host';\n const cls = danger ? 'twm-btn twm-btn--danger' : 'twm-btn twm-btn--primary';\n body.innerHTML = `\n <div class=\"twm-modal__body\">${message}</div>\n <div class=\"twm-modal__actions\">\n <button type=\"button\" class=\"twm-btn\" data-action=\"cancel\">${cancelLabel}</button>\n <button type=\"button\" class=\"${cls}\" data-action=\"confirm\">${confirmLabel}</button>\n </div>\n `;\n\n let _resolved = false;\n const win = new ManagedWindow({\n container: _modalHost,\n id: `twm-confirm-${_modalSeq++}`,\n title: title || 'Confirm',\n icon: icon || (danger ? 'warning' : 'help'),\n content: body,\n modal: true,\n canMinimize: false,\n canMaximize: false,\n canResize: false,\n canDrag: true,\n defaultWidth: 380,\n defaultHeight: 180,\n onClose: () => { if (!_resolved) { _resolved = true; resolve(false); } },\n });\n win.show();\n const close = (v) => {\n if (_resolved) return;\n _resolved = true;\n resolve(v);\n try { win.close({ force: true }); } catch {}\n };\n body.querySelector('[data-action=\"cancel\"]').addEventListener('click', () => close(false));\n body.querySelector('[data-action=\"confirm\"]').addEventListener('click', () => close(true));\n requestAnimationFrame(() => {\n body.querySelector(`[data-action=\"${danger ? 'cancel' : 'confirm'}\"]`)?.focus();\n });\n });\n}\n\n\n/**\n * `openModal` \u2014 rich-content modal. The third helper alongside\n * `openForm` (field-based) and `openConfirm` (yes/no).\n *\n * Use when the modal body is arbitrary DOM the caller renders itself\n * \u2014 a chart, a Monaco editor, a table, a diff view. The shell still\n * goes through ManagedWindow so the chrome, focus trap, Esc handling,\n * and z-stacking match every other modal in the app.\n *\n * Schema:\n * - `title` window title (string)\n * - `icon` optional material-symbols-outlined glyph for the\n * title bar; defaults to `info`\n * - `content` HTMLElement appended into the body. Caller owns\n * rendering \u2014 `openModal` doesn't size or style the\n * internal content beyond making it scrollable.\n * - `actions` `[{ label, value, primary?, danger?, icon? }, \u2026]`. If\n * omitted, defaults to a single `[Close]` action that\n * resolves with `null`. The first action with\n * `primary: true` is the rightmost; otherwise the\n * last action wins. Esc / X / backdrop resolve with\n * `null` regardless of what's in `actions`. `icon` is\n * an optional material-symbols-outlined ligature drawn\n * BEFORE the label; when it is given the label lives in\n * a `.twm-btn__label` span, because an icon font's\n * ligature name is itself text and would otherwise be\n * read back as part of the label.\n * - `width`,\n * `height` initial size in px. Defaults: 640 \u00D7 480.\n * - `onMount` optional `(contentEl) => void` invoked once after\n * the content is appended \u2014 handy when the caller\n * needs the bounding rect to size a chart / Monaco /\n * SVG inside the body.\n * - `backdropBlur` backdrop blur radius in px (`0` disables it).\n * - `backdropOpacity` backdrop dim, 0 (clear) \u2026 1 (opaque). Use a low\n * value (with `backdropBlur: 0`) to keep the background\n * legible \u2014 e.g. a live-applied editor where you want to\n * watch the content behind update. Omit both to inherit\n * the default look (blur 2px over a 50% dim).\n * - `maximizable` C29. Draw a maximise button in the title bar.\n * Default `false`, which is byte-for-byte what every\n * existing caller has always got.\n * - `onMaximizeChange` `(maximized, contentEl) => void`, called on each\n * flip. Only useful with `maximizable`.\n *\n * \u2550\u2550 C29. WHY A DIALOG'S MAXIMISE IS THE GEOMETRIC ONE \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n *\n * Everywhere else in this library maximise means BACK TO TILE: the window\n * stops being a window and its content returns to the tile it came out of.\n * That is R14, it is the product owner's ruling \u2014 *\"maximize here means back\n * to tile\"* \u2014 and it holds for the chrome button, the title bar's\n * double-click, an embedder's window menu and the aero-snap top edge alike.\n *\n * A DIALOG HAS NO TILE. It was never lifted out of one; it is modal, it owns\n * the screen until it resolves, and \"back to tile\" names a destination that\n * does not exist for it. So here maximise can only mean the rectangle, and\n * that is not a contradiction of the ruling but its boundary: THE RULING IS\n * ABOUT WINDOWS THAT CAME FROM A TILE. Do not \"fix\" this into a dock \u2014 there\n * is nothing to dock into, and `bringBackWindow` would refuse it anyway.\n *\n * Mechanically that means setting no `onMaximize` at all rather than reaching\n * for `toggleMaximize({claimable: false})`: with nothing claiming the gesture,\n * the ordinary path IS the rectangle, and the escape hatch is for consumers\n * who have claimed it.\n *\n * The dialog stays a dialog while maximised \u2014 `modal: true` is untouched, so\n * the backdrop, the Esc handler and the Tab focus trap (all of which hang off\n * `this.element` and the top-most-window test, not off geometry) go on working\n * exactly as they did.\n *\n * Returns a Promise resolving with the chosen action's `value`, or\n * `null` if the user dismissed the modal.\n */\nexport function openModal({\n title = 'Dialog',\n icon = 'info',\n content = null,\n actions = null,\n width = 640,\n height = 480,\n onMount = null,\n backdropBlur = undefined,\n backdropOpacity = undefined,\n maximizable = false,\n onMaximizeChange = null,\n} = {}) {\n return new Promise((resolve) => {\n const body = document.createElement('div');\n body.className = 'twm-modal__body-host';\n\n const bodyInner = document.createElement('div');\n bodyInner.className = 'twm-modal__body twm-modal__body--rich';\n if (content instanceof HTMLElement) bodyInner.appendChild(content);\n body.appendChild(bodyInner);\n\n // Actions row \u2014 default = single Close button. Esc / backdrop /\n // X all bypass this and resolve with null.\n const acts = Array.isArray(actions) && actions.length > 0\n ? actions\n : [{ label: 'Close', value: null }];\n const actionsEl = document.createElement('div');\n actionsEl.className = 'twm-modal__actions';\n acts.forEach((a, i) => {\n const btn = document.createElement('button');\n btn.type = 'button';\n let cls = 'twm-btn';\n if (a.primary) cls += ' twm-btn--primary';\n if (a.danger) cls += ' twm-btn--danger';\n btn.className = cls;\n // C26. AN ACTION MAY CARRY A GLYPH \u2014 additively, and only when it\n // asks for one. Without `icon` the button is byte-identical to what\n // every existing caller gets today: one text node, so a consumer\n // reading `btn.textContent` to find its own button keeps working.\n //\n // With one, the label moves into its own span so that reading it\n // back is still possible: an icon font's ligature name IS text\n // content (\"save\" renders as a glyph but reads as the word), so a\n // bare `textContent` on a button with an icon would answer\n // \"saveSave\". `.twm-btn__label` is the answer to \"what does this\n // button say\", and `aria-hidden` on the glyph is what keeps a screen\n // reader from saying the ligature name out loud beside the label.\n if (a.icon) {\n const glyph = document.createElement('span');\n glyph.className = 'material-symbols-outlined twm-btn__glyph';\n glyph.textContent = String(a.icon);\n glyph.setAttribute('aria-hidden', 'true');\n const text = document.createElement('span');\n text.className = 'twm-btn__label';\n text.textContent = String(a.label || '');\n btn.append(glyph, text);\n } else {\n btn.textContent = String(a.label || '');\n }\n btn.dataset.actionIdx = String(i);\n // C27. AN ACTION MAY START DISABLED, and be enabled later.\n //\n // Every action here dismisses the dialog and resolves the promise \u2014\n // that is the documented contract, and it is why a caller cannot\n // \"refuse\" a submit: by the time it sees the value, the form and\n // everything typed into it are gone. So a dialog whose primary\n // action is not yet valid has had exactly two options: let the user\n // press it and lose their work to a toast, or reach into this markup\n // from outside, which is the coupling C6 exists to remove.\n //\n // `disabled` plus the controller handed to `onMount` is the third.\n // Absent \u2014 every existing caller \u2014 the button is enabled exactly as\n // before.\n if (a.disabled) btn.disabled = true;\n if (a.value !== undefined && a.value !== null) {\n btn.dataset.actionValue = String(a.value);\n }\n actionsEl.appendChild(btn);\n });\n body.appendChild(actionsEl);\n\n let _resolved = false;\n // DECLARED BEFORE THE WINDOW, INSTALLED AFTER IT. `onClose` below closes\n // over `_dropMaxListener`, and `show()` runs between the two \u2014 so\n // leaving the declaration down where the listener is installed would\n // stretch a temporal dead zone across a call that could come back\n // through `onClose`. The cost of getting that wrong is a ReferenceError\n // inside a dismissal, which is the least debuggable place in this file.\n let _onMax = null;\n const _dropMaxListener = () => {\n if (!_onMax) return;\n window.removeEventListener('managed-window-maximized', _onMax);\n _onMax = null;\n };\n const win = new ManagedWindow({\n container: _modalHost,\n id: `twm-modal-${_modalSeq++}`,\n title,\n icon,\n content: body,\n modal: true,\n backdropBlur,\n backdropOpacity,\n canMinimize: false,\n // C29. OPT-IN, and `false` is still the default \u2014 a confirmation\n // and a two-field form have nothing to do with the extra room, and\n // a button that grows a dialog nobody wanted grown is noise in the\n // one place a user looks for the X. `onMaximize` is deliberately\n // NOT set: see the C29 note in the header \u2014 with nothing claiming\n // the gesture, `toggleMaximize` runs the rectangle, which is the\n // only thing maximise can mean for a window with no tile.\n canMaximize: !!maximizable,\n canResize: true,\n canDrag: true,\n defaultWidth: width,\n defaultHeight: height,\n // Esc, the X and the backdrop all land here without passing through\n // `close`, so the listener is dropped here as well as there \u2014 the\n // three dismissals a user reaches for most are exactly the ones\n // that would otherwise leak it.\n onClose: () => {\n _dropMaxListener();\n if (!_resolved) { _resolved = true; resolve(null); }\n },\n });\n win.show();\n\n // C29. THE STATE, FOR A CALLER WHOSE LAYOUT DEPENDS ON IT.\n //\n // `managed-window-maximized` (C16) is the framework's own edge and it\n // is global, so it is filtered on the id \u2014 the alternative, wrapping\n // `win.toggleMaximize`, would miss `_restoreState`'s replay of a\n // persisted maximised window and any consumer calling the method\n // directly. Removed on close: a dialog is short-lived and twenty of\n // them over a session leaving listeners behind is a leak with no\n // symptom until the twenty-first.\n //\n // The CSS half needs no listener at all \u2014 `ManagedWindow` toggles\n // `.twm-managed-window--maximized` on its own element, which is an\n // ancestor of everything in here, so a stylesheet can respond without\n // any of this. The callback is for the layout a stylesheet cannot\n // reach: content whose height was fixed by the CALLER's own rules.\n if (maximizable && typeof onMaximizeChange === 'function') {\n _onMax = (e) => {\n if (e.detail?.id !== win.id) return;\n try { onMaximizeChange(!!e.detail.maximized, bodyInner); }\n catch (err) { console.warn('[modal] onMaximizeChange threw', err); }\n };\n window.addEventListener('managed-window-maximized', _onMax);\n }\n\n const close = (value) => {\n if (_resolved) return;\n _resolved = true;\n _dropMaxListener();\n resolve(value);\n try { win.close({ force: true }); } catch {}\n };\n actionsEl.addEventListener('click', (e) => {\n const btn = e.target.closest('[data-action-idx]');\n if (!btn) return;\n const idx = Number(btn.dataset.actionIdx);\n const a = acts[idx];\n if (!a) return;\n // `keepOpen` actions are side-effects (Copy, Apply\n // Without Close, etc.): if the action's `onClick` returns\n // anything (or just runs), the modal stays open. Use this\n // for Copy buttons and the like.\n if (a.keepOpen) {\n // `onClick` receives `close` so the handler can\n // validate, do an async side-effect, and only then\n // dismiss the modal with whatever value it chooses.\n // Returning early without calling `close` leaves the\n // modal open (which is the whole point of keepOpen).\n try { a.onClick?.(close); } catch (err) { console.warn(err); }\n return;\n }\n close(a.value);\n });\n\n /**\n * C27. What `onMount` is handed alongside the body, so a form can keep\n * its own submit honest without knowing this file's markup.\n *\n * Addressed by an action's VALUE rather than its index: an index is a\n * fact about the order the caller happened to list them in, and a caller\n * that inserted a \"Save and add another\" in the middle would silently\n * start disabling Cancel.\n */\n const controls = {\n // NOT `CSS.escape`. It is a browser global that jsdom does not\n // provide, and this file is mounted under jsdom by four render\n // tests \u2014 so reaching for it turns \"the dialog is valid\" into a\n // ReferenceError in every one of them, and into nothing at all in a\n // headless consumer. An attribute selector needs `\"` and `\\`\n // escaped and nothing else.\n actionButton: (value) => actionsEl.querySelector(\n `[data-action-value=\"${String(value).replace(/[\"\\\\]/g, '\\\\$&')}\"]`),\n setActionEnabled(value, enabled) {\n const btn = controls.actionButton(value);\n if (btn) btn.disabled = !enabled;\n return !!btn;\n },\n };\n\n // onMount runs after the next frame so layout has settled and\n // the inner content has a real bounding box for sizing.\n if (typeof onMount === 'function') {\n requestAnimationFrame(() => {\n try { onMount(bodyInner, controls); } catch (err) { console.warn(err); }\n });\n }\n // C28. THE FIRST FIELD, IF THERE IS ONE. Otherwise the primary button.\n //\n // A dialog that asks for a name should let you type it: *\"on any 'new'\n // dialog I would like to have the first input focused by default, so\n // that I can directly start typing.\"* Focusing the action button first\n // means every new table, project and column begins with a click into a\n // field that was the only place the caret could sensibly have been.\n //\n // The button remains the fallback, which is what keeps Enter useful on\n // a dialog that asks nothing \u2014 a confirmation has no field, and there\n // the primary action IS the answer.\n //\n // DISABLED CONTROLS ARE SKIPPED, and so is anything `readonly`: a form\n // whose first control is a read-only statement panel (C27's disabled\n // primary is the sibling case) would swallow the caret into a box that\n // cannot take it.\n requestAnimationFrame(() => {\n const field = bodyInner.querySelector(\n 'input:not([type=\"hidden\"]):not([disabled]):not([readonly]),'\n + ' textarea:not([disabled]):not([readonly]),'\n + ' select:not([disabled])');\n if (field) {\n field.focus();\n // The caret at the END of whatever is already there, not\n // selecting it: an edit dialog opens on a value the user means\n // to amend, and a selected value is one keystroke from gone.\n try { field.setSelectionRange?.(field.value.length, field.value.length); }\n catch { /* a `select`, or an input type with no selection */ }\n return;\n }\n const idx = acts.findIndex((a) => a.primary);\n const which = idx >= 0 ? idx : acts.length - 1;\n actionsEl.querySelector(`[data-action-idx=\"${which}\"]`)?.focus();\n });\n });\n}\n\n\n// \u2500\u2500\u2500 helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction _estimateHeight(fields) {\n // Header (~36) + actions row (~46) + section dividers (~32 each)\n // + per-field rows (~46 text, ~140 textarea, ~32 checkbox)\n // + body padding. Clamped to 200..80vh.\n let body = 0;\n for (const f of fields) {\n if (f.section) body += 32;\n else if (f.type === 'textarea') {\n const rows = Number(f.rows) || 4;\n body += 32 + rows * 18;\n if (f.hint) body += 16;\n }\n else if (f.type === 'checkbox') { body += 32; if (f.hint) body += 16; }\n else { body += 46; if (f.hint) body += 16; }\n }\n const base = 36 + 46 + 28 + body;\n const max = Math.floor(window.innerHeight * 0.8);\n return Math.max(200, Math.min(base, max));\n}\n\nfunction _estimateWidth(fields) {\n // Forms with a textarea or section divider get the wider layout so\n // multi-line content + grouped fields breathe; otherwise 480 px is\n // enough for label + single-line input pairs.\n const wide = fields.some((f) => f && (f.type === 'textarea' || f.section));\n return wide ? 640 : 480;\n}\n\nfunction _optionValues(options) {\n return (options || []).map((o) => (typeof o === 'object') ? o.value : o);\n}\n\n/** Normalise a `create` spec. `true` means the typed value is accepted as-is. */\nfunction _createSpec(f) {\n if (!f || !f.create) return null;\n if (f.create === true) return { onCreate: async (v) => v, hint: null };\n return {\n onCreate: typeof f.create.onCreate === 'function' ? f.create.onCreate : async (v) => v,\n hint: f.create.hint ?? null,\n };\n}\n\n/** What a picker shows for `value`: the caller's `displayFor`, else the value. */\nfunction _pickerLabel(f, value) {\n if (typeof f.displayFor !== 'function') return value == null ? '' : String(value);\n try { return String(f.displayFor(value) ?? ''); }\n catch (err) { console.warn('[modal] displayFor threw', err); return String(value ?? ''); }\n}\n\n/** Hook a picker field's search button up to the caller's `pick()`, and keep\n * the hidden value and the visible display in step. */\nfunction _wirePicker(host, f) {\n const hidden = host.querySelector(`input[type=\"hidden\"][name=\"${f.name}\"]`);\n const display = host.querySelector(`[data-picker-display=\"${f.name}\"]`);\n const btn = host.querySelector(`[data-picker=\"${f.name}\"]`);\n if (!hidden || !display || !btn || typeof f.pick !== 'function') return;\n\n let busy = false;\n const open = async () => {\n if (busy) return; // one search at a time\n busy = true;\n let picked;\n try { picked = await f.pick(hidden.value); }\n catch (err) { console.warn('[modal] pick threw', err); picked = null; }\n finally { busy = false; }\n if (picked == null) return; // cancelled \u2014 leave it alone\n const isPair = typeof picked === 'object';\n hidden.value = String((isPair ? picked.value : picked) ?? '');\n display.value = isPair && picked.label != null\n ? String(picked.label) : _pickerLabel(f, hidden.value);\n // A hidden input fires no `change` of its own; this is the one the\n // field-error clear and `onFieldChange` listen for.\n hidden.dispatchEvent(new Event('change', { bubbles: true }));\n };\n btn.addEventListener('click', open);\n // The read-only box is the obvious thing to click; make it work too.\n display.addEventListener('click', open);\n}\n\n\n/** Show / hide the \"\u21B3 will create \u2026\" hint as the user types into a\n * create-capable combobox. */\nfunction _wireComboboxHint(host, f) {\n const input = host.querySelector(`input[name=\"${f.name}\"]`);\n const hintEl = host.querySelector(`.twm-combobox__hint[data-for=\"${f.name}\"]`);\n if (!input || !hintEl) return;\n // With `create: true` the typed value simply IS the value \u2014 there is no\n // entity being made, so promising to \"create\" one is a lie that reads as\n // a warning.\n if (f.create === true) return;\n const known = new Set(_optionValues(f.options));\n const label = _createSpec(f).hint || 'new entry';\n const update = () => {\n const v = input.value.trim();\n if (v && !known.has(v)) {\n hintEl.textContent = `\u21B3 will create ${label} \u201C${v}\u201D`;\n hintEl.hidden = false;\n } else {\n hintEl.hidden = true;\n }\n };\n input.addEventListener('input', update);\n update();\n}\n\n\nfunction _renderEntry(f, value) {\n if (f && f.section != null) {\n // A named section is addressable by `setVisible`, so a heading can be\n // hidden along with the group it introduces.\n const attr = f.name ? ` data-field-row=\"${f.name}\"` : '';\n return `<div class=\"twm-modal__section\"${attr}>${_esc(f.section)}</div>`;\n }\n return _renderField(f, value);\n}\n\nfunction _renderField(f, value) {\n const required = f.required ? 'required' : '';\n const rowMod = (f.type === 'textarea') ? ' twm-modal__row--multiline' : '';\n const hintHtml = f.hint\n ? `<div class=\"twm-modal__hint--field\">${_esc(f.hint)}</div>` : '';\n const errHtml = `<div class=\"twm-modal__field-error\" data-field-error=\"${f.name}\" hidden></div>`;\n const wrap = (inner) => `\n <label class=\"twm-modal__row${rowMod}\" data-field-row=\"${f.name}\">\n <span>${_esc(f.label || '')}</span>\n ${inner}\n ${hintHtml}\n ${errHtml}\n </label>\n `;\n\n if (f.type === 'checkbox') {\n const checked = (value === true || value === 'true') ? 'checked' : '';\n return `\n <label class=\"twm-modal__row\" data-field-row=\"${f.name}\">\n <span></span>\n <span class=\"twm-modal__check\">\n <input name=\"${f.name}\" type=\"checkbox\" ${checked}>\n <span>${_esc(f.label || '')}</span>\n </span>\n ${hintHtml}\n ${errHtml}\n </label>\n `;\n }\n\n if (f.type === 'textarea') {\n const v = value == null ? '' : String(value);\n const rows = f.rows != null ? `rows=\"${Number(f.rows) || 4}\"` : 'rows=\"4\"';\n const placeholder = f.placeholder ? `placeholder=\"${_esc(f.placeholder)}\"` : '';\n return wrap(`<textarea name=\"${f.name}\" ${rows} ${placeholder} ${required}>${_esc(v)}</textarea>`);\n }\n\n const v = value == null ? '' : String(value);\n if (f.type === 'picker') {\n // The display text and the stored value are different things (an id\n // vs. \"EPIC-0001 \u2014 Auth rewrite\"), so the value rides in a hidden\n // input \u2014 the one the submit reads by name \u2014 and the visible box is\n // read-only.\n const placeholder = f.placeholder ? `placeholder=\"${_esc(f.placeholder)}\"` : '';\n return wrap(`\n <div class=\"twm-picker\">\n <input type=\"hidden\" name=\"${f.name}\" value=\"${_esc(v)}\">\n <input class=\"twm-picker__display\" data-picker-display=\"${f.name}\" type=\"text\"\n value=\"${_esc(_pickerLabel(f, v))}\" ${placeholder} readonly>\n <button type=\"button\" class=\"twm-btn twm-picker__btn\" data-picker=\"${f.name}\"\n aria-label=\"Search\" title=\"Search\">\n <span class=\"material-symbols-outlined\" aria-hidden=\"true\">search</span>\n </button>\n </div>\n `);\n }\n if (f.type === 'select' && f.create) {\n const dlId = `ea-dl-${f.name}-${_modalSeq}`;\n const opts = _optionValues(f.options)\n .map((ov) => `<option value=\"${_esc(ov)}\"></option>`).join('');\n const placeholder = f.placeholder\n ? `placeholder=\"${_esc(f.placeholder)}\"` : 'placeholder=\"type to pick or create\u2026\"';\n return wrap(`\n <div class=\"twm-combobox\">\n <input name=\"${f.name}\" type=\"text\" list=\"${dlId}\"\n value=\"${_esc(v)}\" ${placeholder} ${required}\n autocomplete=\"off\">\n <datalist id=\"${dlId}\">${opts}</datalist>\n <span class=\"twm-combobox__hint\" data-for=\"${f.name}\" hidden></span>\n </div>\n `);\n }\n if (f.type === 'select') {\n const opts = (f.options || []).map((o) => {\n const ov = (typeof o === 'object') ? o.value : o;\n const ol = (typeof o === 'object') ? o.label : o;\n return `<option value=\"${_esc(ov)}\" ${ov === v ? 'selected' : ''}>${_esc(ol)}</option>`;\n }).join('');\n return wrap(`<select name=\"${f.name}\" ${required}>${opts}</select>`);\n }\n const step = f.step != null ? `step=\"${f.step}\"` : '';\n const placeholder = f.placeholder ? `placeholder=\"${_esc(f.placeholder)}\"` : '';\n const type = (f.type === 'number' || f.type === 'password') ? f.type : 'text';\n return wrap(`<input name=\"${f.name}\" type=\"${type}\" value=\"${_esc(v)}\" ${step} ${placeholder} ${required}>`);\n}\n\nfunction _esc(s) {\n return String(s == null ? '' : s)\n .replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAiFA,IAAI,aAAa;AACV,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AAAA,gCAEnC,IAAI,KAAK,IAAI;AAAA,6DACgB,EAAE,IAAI;AAAA;AAAA,SAE1D;AAAA,EACL;AACA,MAAI,EAAE,SAAS,UAAU;AACrB,UAAM,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC,MAAM;AACtC,YAAM,KAAM,OAAO,MAAM,WAAY,EAAE,QAAQ;AAC/C,YAAM,KAAM,OAAO,MAAM,WAAY,EAAE,QAAQ;AAC/C,aAAO,kBAAkB,KAAK,EAAE,CAAC,KAAK,OAAO,IAAI,aAAa,EAAE,IAAI,KAAK,EAAE,CAAC;AAAA,IAChF,CAAC,EAAE,KAAK,EAAE;AACV,WAAO,KAAK,iBAAiB,EAAE,IAAI,KAAK,QAAQ,IAAI,IAAI,WAAW;AAAA,EACvE;AACA,QAAM,OAAO,EAAE,QAAQ,OAAO,SAAS,EAAE,IAAI,MAAM;AACnD,QAAM,cAAc,EAAE,cAAc,gBAAgB,KAAK,EAAE,WAAW,CAAC,MAAM;AAC7E,QAAM,OAAQ,EAAE,SAAS,YAAY,EAAE,SAAS,aAAc,EAAE,OAAO;AACvE,SAAO,KAAK,gBAAgB,EAAE,IAAI,WAAW,IAAI,YAAY,KAAK,CAAC,CAAC,KAAK,IAAI,IAAI,WAAW,IAAI,QAAQ,GAAG;AAC/G;AAEA,SAAS,KAAK,GAAG;AACb,SAAO,OAAO,KAAK,OAAO,KAAK,CAAC,EAC3B,QAAQ,MAAM,OAAO,EAAE,QAAQ,MAAM,MAAM,EAAE,QAAQ,MAAM,MAAM,EACjE,QAAQ,MAAM,QAAQ;AAC/B;",
|
|
6
|
+
"names": ["errEl", "v", "placeholder"]
|
|
7
|
+
}
|
package/dist/flexdesk.css
CHANGED
|
@@ -706,6 +706,82 @@ body.twm-dt-col-resizing {
|
|
|
706
706
|
.twm-preview-table tbody tr.twm-dt-row--active > td:first-child {
|
|
707
707
|
box-shadow: inset 2px 0 0 0 var(--accent-bright, #007acc);
|
|
708
708
|
}
|
|
709
|
+
/* STORY-0016 `selectToggle` / `selectMode` — the select column. Narrow, never
|
|
710
|
+
* the time column (it is the first child, so the time rules reach it: (0,3,2)
|
|
711
|
+
* here beats them), and the time styling moves to the first column after it,
|
|
712
|
+
* so a table looks as it did before the column was added. Its boxes show only
|
|
713
|
+
* in select mode; the header's toggle always. */
|
|
714
|
+
.twm-preview-table.twm-dt--select tr > .twm-dt-select-cell {
|
|
715
|
+
width: 32px;
|
|
716
|
+
min-width: 0;
|
|
717
|
+
max-width: none;
|
|
718
|
+
padding-left: 6px;
|
|
719
|
+
padding-right: 2px;
|
|
720
|
+
text-align: left;
|
|
721
|
+
color: inherit;
|
|
722
|
+
font-weight: inherit;
|
|
723
|
+
white-space: nowrap;
|
|
724
|
+
}
|
|
725
|
+
.twm-preview-table.twm-dt--select:not(.twm-dt--first-plain) tr > .twm-dt-select-cell + th,
|
|
726
|
+
.twm-preview-table.twm-dt--select:not(.twm-dt--first-plain) tr > .twm-dt-select-cell + td {
|
|
727
|
+
width: 120px;
|
|
728
|
+
min-width: 100px;
|
|
729
|
+
font-weight: 500;
|
|
730
|
+
color: #bbb;
|
|
731
|
+
}
|
|
732
|
+
.twm-preview-table.twm-dt--select:not(.twm-dt--first-plain) tr > th.twm-dt-select-cell + th {
|
|
733
|
+
font-weight: 600;
|
|
734
|
+
color: #aaa;
|
|
735
|
+
}
|
|
736
|
+
.twm-preview-table.twm-dt--select td.twm-dt-select-cell .twm-dt-select-box {
|
|
737
|
+
display: none;
|
|
738
|
+
margin: 0;
|
|
739
|
+
vertical-align: middle;
|
|
740
|
+
cursor: pointer;
|
|
741
|
+
}
|
|
742
|
+
.twm-preview-table.twm-dt--selecting td.twm-dt-select-cell .twm-dt-select-box {
|
|
743
|
+
display: inline-block;
|
|
744
|
+
}
|
|
745
|
+
.twm-preview-table.twm-dt--select th.twm-dt-select-cell .twm-dt-select-all {
|
|
746
|
+
margin: 0 4px 0 0;
|
|
747
|
+
vertical-align: middle;
|
|
748
|
+
cursor: pointer;
|
|
749
|
+
}
|
|
750
|
+
.twm-preview-table.twm-dt--select th.twm-dt-select-cell .twm-dt-select-toggle {
|
|
751
|
+
display: inline-flex;
|
|
752
|
+
align-items: center;
|
|
753
|
+
justify-content: center;
|
|
754
|
+
width: 20px;
|
|
755
|
+
height: 20px;
|
|
756
|
+
margin: -3px 0;
|
|
757
|
+
padding: 0;
|
|
758
|
+
border: 0;
|
|
759
|
+
border-radius: 3px;
|
|
760
|
+
background: transparent;
|
|
761
|
+
color: inherit;
|
|
762
|
+
font-size: 16px;
|
|
763
|
+
line-height: 1;
|
|
764
|
+
vertical-align: middle;
|
|
765
|
+
cursor: pointer;
|
|
766
|
+
opacity: 0.7;
|
|
767
|
+
}
|
|
768
|
+
.twm-preview-table.twm-dt--select th.twm-dt-select-cell .twm-dt-select-toggle:hover,
|
|
769
|
+
.twm-preview-table.twm-dt--select th.twm-dt-select-cell .twm-dt-select-toggle[aria-pressed="true"] {
|
|
770
|
+
opacity: 1;
|
|
771
|
+
background: rgba(255, 255, 255, 0.08);
|
|
772
|
+
}
|
|
773
|
+
.twm-preview-table.twm-dt--select th.twm-dt-select-cell .twm-dt-select-toggle:focus-visible {
|
|
774
|
+
opacity: 1;
|
|
775
|
+
outline: 1px solid var(--accent-bright, #007acc);
|
|
776
|
+
}
|
|
777
|
+
/* In the mode a click ticks: a pointer on every row, and the keyboard's row
|
|
778
|
+
* (the arrows move it, Space ticks it) drawn as an outline. */
|
|
779
|
+
.twm-preview-table.twm-dt--selecting tbody tr:not(.twm-dt-spacer):not(.data-table__empty-row) {
|
|
780
|
+
cursor: pointer;
|
|
781
|
+
}
|
|
782
|
+
.twm-preview-table.twm-dt--selecting tbody tr.twm-dt-row--cursor > td {
|
|
783
|
+
box-shadow: inset 0 1px 0 0 var(--accent-bright, #007acc), inset 0 -1px 0 0 var(--accent-bright, #007acc);
|
|
784
|
+
}
|
|
709
785
|
/* `rowIcon` — drawn from `data-twm-icon` so the icon's NAME is not cell
|
|
710
786
|
* text (not in a copy, not in the clipped-cell tooltip). The span carries the
|
|
711
787
|
* icon font's class; the pseudo-element inherits its font and ligatures. Top
|
|
@@ -4889,36 +4965,54 @@ button.twm-about-dialog__btn--close:focus {
|
|
|
4889
4965
|
color: #fff;
|
|
4890
4966
|
}
|
|
4891
4967
|
/* Content area — drop the host padding so the body host controls its
|
|
4892
|
-
* own zones (form rows + flush-bottom action strip).
|
|
4968
|
+
* own zones (form rows + flush-bottom action strip). The content never
|
|
4969
|
+
* scrolls itself: the zone above the strip does, so the strip stays whole
|
|
4970
|
+
* and in view when the fields outgrow the window. */
|
|
4893
4971
|
.twm-managed-window--modal .twm-managed-window__content {
|
|
4894
4972
|
background: var(--ea-bg-content);
|
|
4895
4973
|
padding: 0;
|
|
4896
|
-
overflow:
|
|
4974
|
+
overflow: hidden;
|
|
4897
4975
|
}
|
|
4898
4976
|
.twm-managed-window--modal .twm-modal__body-host {
|
|
4899
4977
|
display: flex;
|
|
4900
4978
|
flex-direction: column;
|
|
4901
|
-
|
|
4979
|
+
height: 100%;
|
|
4902
4980
|
}
|
|
4903
|
-
/* Form sits inside the body host as a flex column
|
|
4904
|
-
*
|
|
4981
|
+
/* Form sits inside the body host as a flex column: the fields take the
|
|
4982
|
+
* room left over and scroll, the error banner and the actions row keep
|
|
4983
|
+
* their height below them. */
|
|
4905
4984
|
.twm-managed-window--modal .twm-modal__form {
|
|
4906
4985
|
display: flex;
|
|
4907
4986
|
flex-direction: column;
|
|
4908
4987
|
flex: 1 1 auto;
|
|
4988
|
+
min-height: 0;
|
|
4909
4989
|
padding: 0;
|
|
4990
|
+
overflow: hidden;
|
|
4991
|
+
}
|
|
4992
|
+
.twm-managed-window--modal .twm-modal__fields {
|
|
4993
|
+
flex: 1 1 auto;
|
|
4994
|
+
min-height: 0;
|
|
4995
|
+
overflow-y: auto;
|
|
4996
|
+
padding-bottom: 14px;
|
|
4997
|
+
}
|
|
4998
|
+
.twm-managed-window--modal .twm-modal__form > .twm-modal__error,
|
|
4999
|
+
.twm-managed-window--modal .twm-modal__form > .twm-modal__actions {
|
|
5000
|
+
flex: 0 0 auto;
|
|
5001
|
+
}
|
|
5002
|
+
.twm-managed-window--modal .twm-modal__form > .twm-modal__error {
|
|
5003
|
+
margin-bottom: 8px;
|
|
4910
5004
|
}
|
|
4911
5005
|
/* Field rows get inset margins so the action strip can run edge-to-edge
|
|
4912
5006
|
* as a true bottom band. */
|
|
4913
|
-
.twm-managed-window--modal .twm-
|
|
4914
|
-
.twm-managed-window--modal .twm-
|
|
5007
|
+
.twm-managed-window--modal .twm-modal__fields > .twm-modal__row,
|
|
5008
|
+
.twm-managed-window--modal .twm-modal__fields > .twm-modal__section,
|
|
4915
5009
|
.twm-managed-window--modal .twm-modal__form > .twm-modal__error,
|
|
4916
5010
|
.twm-managed-window--modal .twm-modal__body {
|
|
4917
5011
|
margin-left: 14px;
|
|
4918
5012
|
margin-right: 14px;
|
|
4919
5013
|
}
|
|
4920
|
-
.twm-managed-window--modal .twm-
|
|
4921
|
-
.twm-managed-window--modal .twm-
|
|
5014
|
+
.twm-managed-window--modal .twm-modal__fields > .twm-modal__row:first-of-type,
|
|
5015
|
+
.twm-managed-window--modal .twm-modal__fields > .twm-modal__section:first-child,
|
|
4922
5016
|
.twm-managed-window--modal .twm-modal__body:first-child {
|
|
4923
5017
|
margin-top: 14px;
|
|
4924
5018
|
}
|
|
@@ -5159,6 +5253,8 @@ button.twm-about-dialog__btn--close:focus {
|
|
|
5159
5253
|
line-height: 1.5;
|
|
5160
5254
|
color: var(--ea-text);
|
|
5161
5255
|
flex: 1 1 auto;
|
|
5256
|
+
min-height: 0;
|
|
5257
|
+
overflow-y: auto;
|
|
5162
5258
|
}
|
|
5163
5259
|
/* Form-level error banner — left accent stripe, dim red panel. */
|
|
5164
5260
|
.twm-managed-window--modal .twm-modal__error {
|
package/dist/flow.js
CHANGED
package/dist/tiles.js
CHANGED
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
} from "./chunk-O5OHMWBB.js";
|
|
17
17
|
import {
|
|
18
18
|
openRawTracesWindow
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-2LEJQD4H.js";
|
|
20
|
+
import "./chunk-M2L4XW2U.js";
|
|
21
21
|
import "./chunk-6JSOVNID.js";
|
|
22
22
|
import "./chunk-FL5KFNQH.js";
|
|
23
23
|
import {
|
package/dist/widgets.js
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
hideContextMenu,
|
|
10
10
|
setHelpProvider,
|
|
11
11
|
showContextMenu
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CWPMLX67.js";
|
|
13
13
|
import {
|
|
14
14
|
modalHost,
|
|
15
15
|
openConfirm,
|
|
16
16
|
openForm,
|
|
17
17
|
openModal,
|
|
18
18
|
setModalHost
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NNFTETK3.js";
|
|
20
20
|
import {
|
|
21
21
|
ActionDropdown
|
|
22
22
|
} from "./chunk-O5OHMWBB.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
parseDateValue,
|
|
37
37
|
parseDuration,
|
|
38
38
|
resolvePaging
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-M2L4XW2U.js";
|
|
40
40
|
import {
|
|
41
41
|
ManagedWindow,
|
|
42
42
|
ROW_CONTROL_SELECTOR,
|
package/dist/wm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HelpModal,
|
|
3
3
|
showContextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CWPMLX67.js";
|
|
5
5
|
import {
|
|
6
6
|
openForm
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NNFTETK3.js";
|
|
8
8
|
import {
|
|
9
9
|
ManagedWindow,
|
|
10
10
|
isRowActivation
|
|
@@ -3420,7 +3420,7 @@ var TileRenderer = class {
|
|
|
3420
3420
|
const kindKey = this._leafKindKey(leaf);
|
|
3421
3421
|
let entry = this._leafCache.get(leaf.id);
|
|
3422
3422
|
if (entry && entry.kindKey === kindKey) {
|
|
3423
|
-
entry.titleEl.textContent = leaf.title || (leaf.content ? leaf.content.kind : "empty");
|
|
3423
|
+
entry.titleEl.textContent = entry.liveTitle || leaf.title || (leaf.content ? leaf.content.kind : "empty");
|
|
3424
3424
|
_paintLeafIcon(entry.iconEl, leaf, entry.content, this.ctx);
|
|
3425
3425
|
if (this.tabLayout === "header") this._refreshHeaderLabels(leaf, entry);
|
|
3426
3426
|
return entry.wrapEl;
|
|
@@ -3545,11 +3545,26 @@ var TileRenderer = class {
|
|
|
3545
3545
|
this.ctx.onLeafAction?.(leaf.id, btn.dataset.action);
|
|
3546
3546
|
});
|
|
3547
3547
|
let content = {};
|
|
3548
|
+
let liveTitle = null;
|
|
3549
|
+
let liveEntry = null;
|
|
3548
3550
|
if (leaf.content) {
|
|
3549
|
-
const
|
|
3551
|
+
const setTitle = (text) => {
|
|
3552
|
+
const next = text == null || text === "" ? null : String(text);
|
|
3553
|
+
if (!liveEntry) {
|
|
3554
|
+
liveTitle = next;
|
|
3555
|
+
title.textContent = next || leaf.title || leaf.content.kind;
|
|
3556
|
+
return;
|
|
3557
|
+
}
|
|
3558
|
+
if (this._leafCache.get(leaf.id) !== liveEntry) return;
|
|
3559
|
+
liveEntry.liveTitle = next;
|
|
3560
|
+
const now = this.tree?.get?.(leaf.id) || leaf;
|
|
3561
|
+
liveEntry.titleEl.textContent = next || now.title || (now.content ? now.content.kind : "empty");
|
|
3562
|
+
};
|
|
3563
|
+
const leafCtx = { ...this.ctx, leafId: leaf.id, setTitle };
|
|
3550
3564
|
const activeProps = activeTab?.props ?? leaf.content.props;
|
|
3551
3565
|
content = this.content.mount(leaf.content.kind, body, activeProps, leafCtx);
|
|
3552
3566
|
if (content.title) title.textContent = content.title;
|
|
3567
|
+
if (liveTitle) title.textContent = liveTitle;
|
|
3553
3568
|
_paintLeafIcon(icon, leaf, content, this.ctx);
|
|
3554
3569
|
_paintContentActions(contentActions, content.chromeActions);
|
|
3555
3570
|
_vetoStructuralActions(actions, content.chrome);
|
|
@@ -3575,9 +3590,12 @@ var TileRenderer = class {
|
|
|
3575
3590
|
// mounts into. Null under the `bottom` layout, which is plain
|
|
3576
3591
|
// markup this file writes itself.
|
|
3577
3592
|
tabStrip: null,
|
|
3578
|
-
tabStripHostEl: null
|
|
3593
|
+
tabStripHostEl: null,
|
|
3594
|
+
// C41. Null until the content calls `ctx.setTitle`.
|
|
3595
|
+
liveTitle
|
|
3579
3596
|
};
|
|
3580
3597
|
this._leafCache.set(leaf.id, entry);
|
|
3598
|
+
liveEntry = entry;
|
|
3581
3599
|
this._renderTabBar(leaf, entry);
|
|
3582
3600
|
return wrap;
|
|
3583
3601
|
}
|