ooxml-ui 0.19.0 → 0.21.0
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 +82 -36
- package/dist/base.d.ts +118 -0
- package/dist/{account.d.ts → chrome/account-profile.d.ts} +0 -6
- package/dist/chrome/account.d.ts +17 -0
- package/dist/chrome/backstage.d.ts +78 -0
- package/dist/chrome/find-bar.d.ts +111 -0
- package/dist/chrome/print-preview.d.ts +39 -0
- package/dist/chrome/ruler.d.ts +43 -0
- package/dist/chrome/status-bar.d.ts +80 -0
- package/dist/chrome/status-item.d.ts +40 -0
- package/dist/chrome/tab-strip.d.ts +88 -0
- package/dist/chrome/title-bar-types.d.ts +75 -0
- package/dist/chrome/title-bar.d.ts +81 -0
- package/dist/{chunk-5L3NYLAW.js → chunk-2X6QYQ3Q.js} +10 -1
- package/dist/{chunk-OAGGHX23.js → chunk-3MDKXKKQ.js} +53 -65
- package/dist/chunk-5A4REH6T.js +259 -0
- package/dist/chunk-E47762NY.js +90 -0
- package/dist/chunk-HNGJI5EZ.js +834 -0
- package/dist/{chunk-A3QNC6VS.js → chunk-HSJH6SUW.js} +41 -1
- package/dist/{chunk-GWAPPX66.js → chunk-HZ422LTR.js} +1 -49
- package/dist/chunk-UTLCJKYC.js +4527 -0
- package/dist/controls.d.ts +58 -46
- package/dist/controls.js +5 -5
- package/dist/dialog/dialog-footer.d.ts +40 -0
- package/dist/dialog/dialog.d.ts +52 -0
- package/dist/{options.d.ts → dialog/options-dialog.d.ts} +46 -1
- package/dist/form/checkable.d.ts +49 -0
- package/dist/form/checkbox.d.ts +8 -0
- package/dist/form/radio.d.ts +68 -0
- package/dist/form/search-field.d.ts +54 -0
- package/dist/{select-menu.d.ts → form/select-menu.d.ts} +3 -13
- package/dist/form/select.d.ts +115 -0
- package/dist/form/switch.d.ts +11 -0
- package/dist/form/zoom-slider.d.ts +61 -0
- package/dist/glyph.d.ts +2 -0
- package/dist/icon.d.ts +19 -0
- package/dist/icons.d.ts +0 -3
- package/dist/icons.js +1 -3
- package/dist/index.d.ts +4 -1
- package/dist/index.js +17 -12
- package/dist/menu/command-search.d.ts +74 -0
- package/dist/menu/context-menu.d.ts +89 -0
- package/dist/menu/menu-button.d.ts +77 -0
- package/dist/menu/menu-item.d.ts +52 -0
- package/dist/menu/menu-separator.d.ts +7 -0
- package/dist/notices/paste-options.d.ts +41 -0
- package/dist/notices/read-only-banner.d.ts +53 -0
- package/dist/notices/toasts.d.ts +40 -0
- package/dist/presence/presence.d.ts +53 -0
- package/dist/presence.d.ts +1 -31
- package/dist/presence.js +3 -3
- package/dist/ribbon/button.d.ts +60 -0
- package/dist/ribbon/gallery-styles.d.ts +2 -0
- package/dist/ribbon/gallery.d.ts +97 -0
- package/dist/ribbon/ribbon-group.d.ts +35 -0
- package/dist/{ribbon-section.d.ts → ribbon/ribbon-section.d.ts} +14 -1
- package/dist/ribbon/ribbon-stack.d.ts +10 -0
- package/dist/ribbon/ribbon-tabs.d.ts +82 -0
- package/dist/ribbon/ribbon-toggle.d.ts +49 -0
- package/dist/ribbon/ribbon-toolbar.d.ts +15 -0
- package/dist/ribbon/safe-svg.d.ts +1 -0
- package/dist/smartart/smartart.d.ts +43 -0
- package/dist/smartart.d.ts +1 -14
- package/dist/smartart.js +3 -3
- package/dist/styles.d.ts +1 -4
- package/dist/teams/app-rail.d.ts +29 -0
- package/dist/teams/avatar.d.ts +39 -0
- package/dist/teams/base.d.ts +17 -0
- package/dist/teams/call-controls.d.ts +61 -0
- package/dist/teams/call-grid.d.ts +33 -0
- package/dist/teams/channel-list.d.ts +40 -0
- package/dist/teams/chat-composer.d.ts +60 -0
- package/dist/teams/chat-list.d.ts +51 -0
- package/dist/teams/icons.d.ts +3 -0
- package/dist/teams/index.d.ts +14 -0
- package/dist/teams/prejoin.d.ts +40 -0
- package/dist/teams.js +5 -0
- package/dist/theme.js +2 -2
- package/dist/tokens.d.ts +245 -207
- package/package.json +12 -6
- package/dist/backstage.d.ts +0 -28
- package/dist/button.d.ts +0 -14
- package/dist/checkable.d.ts +0 -4
- package/dist/chrome-controls.d.ts +0 -52
- package/dist/chunk-6DZC4M2H.js +0 -5562
- package/dist/chunk-DECL6RNI.js +0 -119
- package/dist/chunk-UYPH4ESZ.js +0 -78
- package/dist/command-search.d.ts +0 -18
- package/dist/context-menu.d.ts +0 -20
- package/dist/dialog.d.ts +0 -13
- package/dist/document-notices.d.ts +0 -55
- package/dist/find-bar.d.ts +0 -15
- package/dist/menu.d.ts +0 -15
- package/dist/print-preview.d.ts +0 -11
- package/dist/radio.d.ts +0 -1
- package/dist/ribbon-tabs.d.ts +0 -14
- package/dist/ribbon-toggle.d.ts +0 -1
- package/dist/ribbon.d.ts +0 -24
- package/dist/ruler.d.ts +0 -10
- package/dist/search-field.d.ts +0 -1
- package/dist/select-styles.d.ts +0 -6
- package/dist/select.d.ts +0 -19
- package/dist/status-bar-view.d.ts +0 -50
- package/dist/status-bar.d.ts +0 -19
- package/dist/tab-strip.d.ts +0 -20
- package/dist/title-bar-search.d.ts +0 -43
- package/dist/title-bar-strip.d.ts +0 -20
- package/dist/title-bar.d.ts +0 -49
- package/dist/zoom-slider.d.ts +0 -9
- /package/dist/{menu-model.d.ts → menu/menu-model.d.ts} +0 -0
- /package/dist/{smartart-svg.d.ts → smartart/smartart-svg.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
[Try the apps](https://christophervr.github.io/ooxml/) | [npm](https://www.npmjs.com/package/ooxml-ui) | [Full docs](https://christophervr.github.io/ooxml/) | [Source](https://github.com/ChristopherVR/ooxml)
|
|
10
10
|
|
|
11
11
|
Shared, format-neutral web components and styles for the Office viewers (Word, PowerPoint and
|
|
12
|
-
Excel).
|
|
13
|
-
|
|
12
|
+
Excel). Custom elements with shadow-root controls and typed events, no framework. The runtime
|
|
13
|
+
dependencies are `ooxml-core` (types and a few pure helpers) and `lit`, which every element is built on
|
|
14
|
+
(see "How the elements are built").
|
|
14
15
|
|
|
15
16
|
> **You do not install this package.** It is a regular `dependency` of every published editor
|
|
16
17
|
> package (`docx-*-viewer`, `pptx-*-viewer` and `xlsx-*-viewer`), so installing the editor of your framework pulls it
|
|
@@ -19,6 +20,50 @@ runtime dependency except `ooxml-core` (types and a few pure helpers).
|
|
|
19
20
|
> package, which registers them for you. Importing `ooxml-ui` directly is for
|
|
20
21
|
> the viewer packages themselves and for people building their own Office-style UI.
|
|
21
22
|
|
|
23
|
+
## How the elements are built
|
|
24
|
+
|
|
25
|
+
Every element is a Lit class that reads like a component, in a folder named for what it is:
|
|
26
|
+
`<name>.ts` holds the reactive properties and a `render()` template, `<name>.css` the styles (a real
|
|
27
|
+
stylesheet imported as `?raw`, tokens only). The folders are `form/` (checkbox, switch, radio, select,
|
|
28
|
+
search, zoom), `ribbon/` (button, group, stack, toolbar, tabs, section, toggle), `menu/` (menu button
|
|
29
|
+
and item, separator, context menu, command search), `dialog/` (dialog, options dialog, dialog footer),
|
|
30
|
+
`notices/` (toasts, read-only banner, paste options), `chrome/` (title bar, status bar and item, tab
|
|
31
|
+
strip, backstage, account, find bar, print preview, ruler), `presence/`, `smartart/` and `teams/`.
|
|
32
|
+
|
|
33
|
+
- **`OfficeElement`** (`base.ts`) is the base class, exported for products that build their own
|
|
34
|
+
elements. Bare `var(--office-x)` in a `.css` file gets the token's default when the sheet loads
|
|
35
|
+
(`withTokens`), so an element renders correctly with or without the installed theme.
|
|
36
|
+
- **Updates are synchronous.** Setting a property or attribute redraws the shadow DOM before the call
|
|
37
|
+
returns (the contract the earlier hand-built elements had and every test relies on). The team
|
|
38
|
+
elements keep Lit's batched updates (`static syncUpdates = false`).
|
|
39
|
+
- **Products subclass these elements** (pptx-viewer registers `pptx-ui-*` aliases that keep their own
|
|
40
|
+
event names and ids), so the base class keeps what those subclasses lean on: the shadow root exists
|
|
41
|
+
when the constructor returns, a connected element renders on first `shadowRoot` read or in a
|
|
42
|
+
microtask even if a subclass skips `super.connectedCallback()`, and a property that a product hook
|
|
43
|
+
reads as an attribute (`icon`, `command`, `launcher`, `placement`) writes the attribute through.
|
|
44
|
+
A constructor must not assign a property a subclass may override with its own accessor (it would
|
|
45
|
+
run the subclass's setter before its fields exist); such state (`state`, `groups`, ...) lives in a
|
|
46
|
+
private field behind a hand-written accessor.
|
|
47
|
+
- **Text is exact.** Text-bearing elements are written without whitespace between nodes, because
|
|
48
|
+
consumers compare `textContent`. `oxfmt` is set to `htmlWhitespaceSensitivity: "strict"` for
|
|
49
|
+
`packages/ui/src` (not `teams/`) so it never adds whitespace to a template; `glyph.ts` opts out of
|
|
50
|
+
the formatter with `// prettier-ignore` because it reflows `<svg>` regardless.
|
|
51
|
+
- **`ribbon-section` and `keytips`** keep imperative DOM on purpose: the section patches light-DOM
|
|
52
|
+
children keyed by id (so focus and a product's tags survive), and keytips attaches a badge layer to
|
|
53
|
+
a scope it does not own.
|
|
54
|
+
|
|
55
|
+
## Team workspace elements (`ooxml-ui/teams`)
|
|
56
|
+
|
|
57
|
+
The chat and meeting pieces of the open-source Teams-style workspace (logic in `ooxml-core/teams`,
|
|
58
|
+
app in the `teams-viewer` repository): `office-ui-avatar`, `-app-rail`, `-channel-list`, `-chat-list`,
|
|
59
|
+
`-chat-composer`, `-prejoin`, `-call-grid` and `-call-controls`. Properties in, bubbling `office-*`
|
|
60
|
+
events out, no data fetching; message text is always rendered as text.
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import { registerOfficeUi } from 'ooxml-ui';
|
|
64
|
+
registerOfficeUi(); // defines every element, idempotent
|
|
65
|
+
```
|
|
66
|
+
|
|
22
67
|
## Install
|
|
23
68
|
|
|
24
69
|
Applications using a viewer receive this package as a dependency. For a custom
|
|
@@ -60,40 +105,41 @@ with an incompatible build of this package.
|
|
|
60
105
|
|
|
61
106
|
## Features: elements
|
|
62
107
|
|
|
63
|
-
| Tag | Attributes / properties
|
|
64
|
-
| ----------------------------------------------------- |
|
|
65
|
-
| `office-ui-button` | `label`, `icon`, `command`, `disabled`, `pressed`, `expanded`, `icon-only`, `variant="stacked"`, `keyshortcuts`
|
|
66
|
-
| `office-ui-checkbox`, `office-ui-switch` | `checked`, `disabled`, `value`, `aria-label`; form-associated
|
|
67
|
-
| `office-ui-select` | `<option>` / `<optgroup>` children (`data-display-label`, `data-description`, font previews) or the `options` property `[{ value, label, disabled? }]`; `value`, `selectedIndex`, `disabled`, `aria-label`, `variant="ribbon-font"
|
|
68
|
-
| `office-ui-ribbon-group` | `label`, `launcher` (dialog launcher command), `launcher-disabled`; default slot
|
|
69
|
-
| `office-ui-ribbon-stack` | `orientation="horizontal"`; default slot (three-row column of small commands by default)
|
|
70
|
-
| `office-ui-menu-button` / `-menu-item` | button: `label`, `icon`, `command` (split button), `variant`, `disabled`, `keyshortcuts`; item: `command`, `label`, `icon`, `disabled`, `checked`
|
|
71
|
-
| `office-ui-toolbar` | `aria-label`, `aria-orientation`; arrow-key focus movement
|
|
72
|
-
| `office-ui-dialog` | `open`, `heading`, `dismissible="false"`, `show()`, `close()`; slots default, `footer`
|
|
73
|
-
| `office-ui-status-bar` / `-status-item` | `label`, `value`, `interactive`, `id`; controlled bar: `state` `{ items?, toggles?, views?, zoom? }` with `collaboration` and `end` slots
|
|
74
|
-
| `office-ui-zoom-slider` | `value` (percent), `min`, `max`, `step`, `disabled`, `fit` (fit button name), `label`
|
|
75
|
-
| `office-ui-tab-strip` | `tabs` `[{ id, label, title? }]`, `selected`, `label`, `previous-label`, `next-label`, `add-label`, `add-disabled`, `add-title`, `disabled`
|
|
76
|
-
| `office-ui-context-menu` / `office-ui-menu-separator` | Children mode: `label`, `openAt(x, y)`, `close()`, `open` over `office-ui-menu-item` and separator children. Controlled mode: `state` `{ x, y, label, items: [{ id, label, separatorBefore?, heading?, danger?, disabled?, checked?, icon? }], markers?, zIndex?, autoFocus? }`; arrows, Home, End and type-ahead in both
|
|
77
|
-
| `office-ui-command-search` | `commands` `[{ id, label, keywords?, description?, disabled?, title? }]`, `placeholder`, `label`, `limit` (Office's "Tell me what you want to do")
|
|
78
|
-
| `office-ui-options-dialog` | `categories` `[{ id, label, description?, disabled?, sections: [{ id, title, controls }] }]` (controls: `toggle`, `select`, `number`, `text`, each optionally `disabled` with a reason), `values`, `category`, `open`, `heading`, `show()`, `close()`
|
|
79
|
-
| `office-ui-account` | `profile` `{ displayName, avatarColor, initial? }`; slots `sign-in` and default (product sections)
|
|
80
|
-
| `office-ui-ribbon` | Tab row over tab panels. Panels are children with `data-ribbon-tab`, `data-label`, optional `data-tab-keytip`; slots `quick-access`, `search`, `end`; `selected`, `label`, `file-label`, `no-file`, `file-expanded`, `file-keytip`; `focusFile()`, `focusTab()`
|
|
81
|
-
| `office-ui-backstage` | `items` `[{ id, label, group?: 'footer', disabled?, title? }]`, `open`, `selected`, `label`, `back-label`, `show(page?)`, `close()`; pages are children with `data-backstage-page`
|
|
82
|
-
| `office-ui-find-bar` | `open`, `label`, `input-label`, `placeholder`, `maxlength`, `disabled`, `navigation-disabled`, `previous-label`, `next-label`, `close-label`; `value`, `status`, `statusTitle`, `show()`, `close()`
|
|
83
|
-
| `office-ui-ruler` | `orientation="vertical"`, `origin` (px offset of zero), `scale` (px per unit, default 96), `direction="reverse"`; decorative
|
|
84
|
-
| `office-ui-print-preview` | `pages` (rendered nodes; an inert clone of the current one is shown), `index`, `label`, `empty-label`
|
|
85
|
-
| `office-ui-radio` | `checked`, `disabled`, `value`, `name`; radios of one tag sharing a `name` form a roving-focus group; form-associated
|
|
86
|
-
| `office-ui-search` | `value`, `placeholder`, `disabled`, `aria-label`, `variant="titlebar"`; `focus()`, `select()`
|
|
87
|
-
| `office-ui-ribbon-toggle` | `label`, `checked`, `disabled`, `title`, `command` (a labelled ribbon checkbox row; static `checkboxTag` picks the inner checkbox)
|
|
88
|
-
| `office-ui-dialog-footer` | `state` `{ actions: [{ id, label, variant?, icon?, disabled?, busy?, title?, align?, testId? }] }`, `focusAction(id)`
|
|
89
|
-
| `office-ui-toasts` | `state` `{ toasts: [{ id, code?, severity, message }], overflowCount?, labels? }`; hidden when empty, host positions it
|
|
90
|
-
| `office-ui-read-only-banner` | `state` `{ kind, message, passwordPromptOpen?, passwordError?, checkingPassword?, labels? }`
|
|
91
|
-
| `office-ui-paste-options` | `state` `{ left, top, options: [{ id, label }], label? }`; fixed 4px past the pasted object
|
|
92
|
-
| `office-ui-title-bar` | `state` `{ appMark?, fileName, status?, tone?, autosave?, quickAccess?: { label, items, showLabels? }, search? }`, `placement` (`titleBar`, `belowRibbon`); slots `collaboration`, `account`; tokens `--office-title-bar-*`
|
|
93
|
-
| `office-ui-ribbon-section` | `groups` `[{ id, label, commands: [{ id, label, icon, title?, size?, badge?, disabled?, active?, compact?, hidden?, caret?, pressed?, expanded?, column? }] }]`; keyed groups and commands in the light DOM
|
|
94
|
-
| `office-ui-
|
|
95
|
-
| `office-ui-
|
|
96
|
-
| `office-ui-
|
|
108
|
+
| Tag | Attributes / properties | Events (all bubble, composed) |
|
|
109
|
+
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
110
|
+
| `office-ui-button` | `label`, `icon`, `command`, `disabled`, `pressed`, `expanded`, `icon-only`, `variant="stacked"`, `keyshortcuts` | `office-command` `{ command }` |
|
|
111
|
+
| `office-ui-checkbox`, `office-ui-switch` | `checked`, `disabled`, `value`, `aria-label`; form-associated | `input`, `change` |
|
|
112
|
+
| `office-ui-select` | `<option>` / `<optgroup>` children (`data-display-label`, `data-description`, font previews) or the `options` property `[{ value, label, disabled? }]`; `value`, `selectedIndex`, `disabled`, `aria-label`, `variant="ribbon-font" | "ribbon-icon"`, `data-font-picker`; `icon`and`custom` slots; arrows, Home, End, PageUp/PageDown, typeahead | `input`, `change` |
|
|
113
|
+
| `office-ui-ribbon-group` | `label`, `launcher` (dialog launcher command), `launcher-disabled`; default slot | launcher: `office-command` `{ command }` |
|
|
114
|
+
| `office-ui-ribbon-stack` | `orientation="horizontal"`; default slot (three-row column of small commands by default) | none |
|
|
115
|
+
| `office-ui-menu-button` / `-menu-item` | button: `label`, `icon`, `command` (split button), `variant`, `disabled`, `keyshortcuts`; item: `command`, `label`, `icon`, `disabled`, `checked` | item choice: `office-command` `{ command }` |
|
|
116
|
+
| `office-ui-toolbar` | `aria-label`, `aria-orientation`; arrow-key focus movement | none |
|
|
117
|
+
| `office-ui-dialog` | `open`, `heading`, `dismissible="false"`, `show()`, `close()`; slots default, `footer` | `office-dialog-close` `{ reason }` (cancelable) |
|
|
118
|
+
| `office-ui-status-bar` / `-status-item` | `label`, `value`, `interactive`, `id`; controlled bar: `state` `{ items?, toggles?, views?, zoom? }` with `collaboration` and `end` slots | `office-status-activate` `{ id }` |
|
|
119
|
+
| `office-ui-zoom-slider` | `value` (percent), `min`, `max`, `step`, `disabled`, `fit` (fit button name), `label` | `input`, `change`; fit: `office-command` `{ command: 'zoom-fit' }` |
|
|
120
|
+
| `office-ui-tab-strip` | `tabs` `[{ id, label, title? }]`, `selected`, `label`, `previous-label`, `next-label`, `add-label`, `add-disabled`, `add-title`, `disabled` | `office-tab-select` `{ id }` (cancelable); add: `office-command` `{ command: 'tab-add' }` |
|
|
121
|
+
| `office-ui-context-menu` / `office-ui-menu-separator` | Children mode: `label`, `openAt(x, y)`, `close()`, `open` over `office-ui-menu-item` and separator children. Controlled mode: `state` `{ x, y, label, items: [{ id, label, separatorBefore?, heading?, danger?, disabled?, checked?, icon? }], markers?, zIndex?, autoFocus? }`; arrows, Home, End and type-ahead in both | children: item `office-command` `{ command }`; controlled: `office-menu-request` `{ id }`, `office-menu-close` `{ reason }` (never closes itself) |
|
|
122
|
+
| `office-ui-command-search` | `commands` `[{ id, label, keywords?, description?, disabled?, title? }]`, `placeholder`, `label`, `limit` (Office's "Tell me what you want to do") | choice: `office-command` `{ command }` |
|
|
123
|
+
| `office-ui-options-dialog` | `categories` `[{ id, label, description?, disabled?, sections: [{ id, title, controls }] }]` (controls: `toggle`, `select`, `number`, `text`, each optionally `disabled` with a reason), `values`, `category`, `open`, `heading`, `show()`, `close()` | OK: `office-options-change` `{ values, changed }` |
|
|
124
|
+
| `office-ui-account` | `profile` `{ displayName, avatarColor, initial? }`; slots `sign-in` and default (product sections) | `office-profile-change` `{ profile }` |
|
|
125
|
+
| `office-ui-ribbon` | Tab row over tab panels. Panels are children with `data-ribbon-tab`, `data-label`, optional `data-tab-keytip`; slots `quick-access`, `search`, `end`; `selected`, `label`, `file-label`, `no-file`, `file-expanded`, `file-keytip`; `focusFile()`, `focusTab()` | `office-ribbon-select` `{ tab }` (cancelable), `office-ribbon-file` |
|
|
126
|
+
| `office-ui-backstage` | `items` `[{ id, label, group?: 'footer', disabled?, title? }]`, `open`, `selected`, `label`, `back-label`, `show(page?)`, `close()`; pages are children with `data-backstage-page` | `office-backstage-select` `{ id }` (cancelable), `office-backstage-close` `{ reason }` (cancelable) |
|
|
127
|
+
| `office-ui-find-bar` | `open`, `label`, `input-label`, `placeholder`, `maxlength`, `disabled`, `navigation-disabled`, `previous-label`, `next-label`, `close-label`; `value`, `status`, `statusTitle`, `show()`, `close()` | `office-find-input` `{ query }`, `office-find-step` `{ direction }`, `office-find-close` |
|
|
128
|
+
| `office-ui-ruler` | `orientation="vertical"`, `origin` (px offset of zero), `scale` (px per unit, default 96), `direction="reverse"`; decorative | none |
|
|
129
|
+
| `office-ui-print-preview` | `pages` (rendered nodes; an inert clone of the current one is shown), `index`, `label`, `empty-label` | `office-print-preview-page` `{ index }` |
|
|
130
|
+
| `office-ui-radio` | `checked`, `disabled`, `value`, `name`; radios of one tag sharing a `name` form a roving-focus group; form-associated | `input`, `change` |
|
|
131
|
+
| `office-ui-search` | `value`, `placeholder`, `disabled`, `aria-label`, `variant="titlebar"`; `focus()`, `select()` | `input`, `change` |
|
|
132
|
+
| `office-ui-ribbon-toggle` | `label`, `checked`, `disabled`, `title`, `command` (a labelled ribbon checkbox row; static `checkboxTag` picks the inner checkbox) | `office-toggle` `{ command, checked }` |
|
|
133
|
+
| `office-ui-dialog-footer` | `state` `{ actions: [{ id, label, variant?, icon?, disabled?, busy?, title?, align?, testId? }] }`, `focusAction(id)` | `office-dialog-footer-request` `{ id }` |
|
|
134
|
+
| `office-ui-toasts` | `state` `{ toasts: [{ id, code?, severity, message }], overflowCount?, labels? }`; hidden when empty, host positions it | `office-toasts-request` `{ id: 'dismiss', toastId }` or `{ id: 'dismissAll' }` |
|
|
135
|
+
| `office-ui-read-only-banner` | `state` `{ kind, message, passwordPromptOpen?, passwordError?, checkingPassword?, labels? }` | `office-read-only-request` (Edit anyway, Dismiss, password submit or cancel) |
|
|
136
|
+
| `office-ui-paste-options` | `state` `{ left, top, options: [{ id, label }], label? }`; fixed 4px past the pasted object | `office-paste-options-request` `{ format }`, `office-paste-options-dismiss` |
|
|
137
|
+
| `office-ui-title-bar` | `state` `{ appMark?, fileName, status?, tone?, autosave?, quickAccess?: { label, items, showLabels? }, search? }`, `placement` (`titleBar`, `belowRibbon`); slots `collaboration`, `account`; tokens `--office-title-bar-*` | `office-autosave-toggle`, `office-command` `{ command }`, `office-command-search` `{ query, command? }` |
|
|
138
|
+
| `office-ui-ribbon-section` | `groups` `[{ id, label, commands: [{ id, label, icon, title?, size?, badge?, disabled?, active?, compact?, hidden?, caret?, pressed?, expanded?, column? }] }]`; keyed groups and commands in the light DOM | the commands' own events (`office-command`) |
|
|
139
|
+
| `office-ui-gallery` | `state` `{ id, label, moreLabel?, disabled?, command?, sections: [{ title?, columns, tileWidth, tileHeight, items: [{ id, label, applied?, preview? }] }], inline? }`, `mode` (`inline`), `chevron-only`, `icon`; `open`, `disabled`, `close()`; tiles in light DOM (`data-gallery-item`), previews parsed by `parseSvgPreview` | `office-gallery-pick` `{ gallery, itemId }` |
|
|
140
|
+
| `office-ui-presence` | `participants`, `max`, `label` | `office-presence-select` `{ id }` |
|
|
141
|
+
| `office-ui-smartart` | `drawing` (core `DiagramDrawing`), `schemeColors`, `label` | `office-smartart-render` (render report) |
|
|
142
|
+
| `office-ui-icon` | `name`, `label` | none |
|
|
97
143
|
|
|
98
144
|
The local profile behind `office-ui-account` is stored on the device only, under one suite-wide
|
|
99
145
|
key (`readOfficeProfile`, `writeOfficeProfile`, `clearOfficeProfile`), so every Office viewer on
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { LitElement, type CSSResult, type PropertyDeclaration, type PropertyDeclarations } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Give every bare `var(--office-x)` in a stylesheet the token's default, so a control renders
|
|
4
|
+
* correctly with or without the installed theme (the same fallback `tok()` writes). Sheets stay
|
|
5
|
+
* plain CSS; unknown names and private `--_x` helpers are left alone.
|
|
6
|
+
*/
|
|
7
|
+
export declare function withTokens(css: string): string;
|
|
8
|
+
/** An element's style list: the shared control basics plus its own `.css` files. */
|
|
9
|
+
export declare const controlStyles: (...sheets: string[]) => CSSResult[];
|
|
10
|
+
/**
|
|
11
|
+
* A boolean attribute that reflects. A property value of `''` counts as present (`checked=""`),
|
|
12
|
+
* so frameworks that pass attribute idioms through properties keep working.
|
|
13
|
+
*/
|
|
14
|
+
export declare const flag: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
reflect: true;
|
|
17
|
+
converter: {
|
|
18
|
+
fromAttribute: (value: string | null) => boolean;
|
|
19
|
+
toAttribute: (value: unknown) => string | null;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/** A boolean attribute that is read but never written back (`icon-only`, `caret`). */
|
|
23
|
+
export declare const readFlag: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
converter: {
|
|
26
|
+
fromAttribute: (value: string | null) => boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/** `pressed="true|false"` as a tri-state: absent is `undefined`, `""` and anything but `false` is true. */
|
|
30
|
+
export declare const triState: {
|
|
31
|
+
reflect: true;
|
|
32
|
+
converter: {
|
|
33
|
+
fromAttribute: (value: string | null) => boolean | undefined;
|
|
34
|
+
toAttribute: (value: unknown) => string | null;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/** A `value` that reads `'on'` while its attribute is absent, like a native checkbox or radio. */
|
|
38
|
+
export declare const valueOn: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
converter: {
|
|
41
|
+
fromAttribute: (value: string | null) => string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type OfficeProperties = PropertyDeclarations;
|
|
45
|
+
/**
|
|
46
|
+
* Base class of the ooxml-ui elements. Products subclass these elements (they register an alias
|
|
47
|
+
* tag that keeps their own names), and the earlier hand-built elements always had their shadow DOM
|
|
48
|
+
* the moment the constructor returned. So, unlike a plain Lit element:
|
|
49
|
+
*
|
|
50
|
+
* - The shadow root exists as soon as the constructor returns, so a subclass can attach its own
|
|
51
|
+
* styles there.
|
|
52
|
+
* - Reading `shadowRoot` of an element that has not rendered yet renders it first (host writes
|
|
53
|
+
* are held back until it connects and the element re-renders), so a subclass or a host that inspects the shadow DOM right
|
|
54
|
+
* after construction, or before connecting, finds it. A
|
|
55
|
+
* microtask renders a connected element that nothing else rendered, for a subclass that
|
|
56
|
+
* overrides `connectedCallback` without calling `super`.
|
|
57
|
+
* - Updates are synchronous: setting a property or attribute has redrawn the shadow DOM before
|
|
58
|
+
* the call returns, whether or not the element is connected, the contract every consumer and
|
|
59
|
+
* test already relies on. An element that prefers Lit's batched updates sets
|
|
60
|
+
* `static syncUpdates = false`.
|
|
61
|
+
*
|
|
62
|
+
* A constructor must not assign a property a subclass may override with its own accessor (that
|
|
63
|
+
* would run the subclass's setter before its fields exist); elements keep such state in a private
|
|
64
|
+
* field behind a hand-written accessor instead.
|
|
65
|
+
*/
|
|
66
|
+
export declare class OfficeElement extends LitElement {
|
|
67
|
+
static syncUpdates: boolean;
|
|
68
|
+
private _rendering?;
|
|
69
|
+
private _ready?;
|
|
70
|
+
constructor();
|
|
71
|
+
/**
|
|
72
|
+
* Render now if the element has never rendered; a no-op afterwards or while rendering. A
|
|
73
|
+
* disconnected element may be rendered here from inside a constructor (a subclass reading
|
|
74
|
+
* `shadowRoot`), and a constructor may not add host attributes, so while it renders its host
|
|
75
|
+
* writes are queued and applied before the next write or update, or on connection.
|
|
76
|
+
*/
|
|
77
|
+
ensureRendered(): void;
|
|
78
|
+
private _detachedRender?;
|
|
79
|
+
/** True while a detached first render runs (inside a constructor, maybe): no children may be added. */
|
|
80
|
+
protected get detachedFirstRender(): boolean;
|
|
81
|
+
private _queue;
|
|
82
|
+
private _deferring?;
|
|
83
|
+
/** Write to the host element: queued (and dropped) during a detached first render, else applied at once. */
|
|
84
|
+
protected hostWrite(write: () => void): void;
|
|
85
|
+
/**
|
|
86
|
+
* Forget the host writes a detached first render queued. They are stale by the time anything
|
|
87
|
+
* else happens (replaying one would fire an attribute change that overwrites a newer property),
|
|
88
|
+
* and the render that follows connecting recomputes every host write from the current state.
|
|
89
|
+
*/
|
|
90
|
+
protected flushHost(): void;
|
|
91
|
+
setAttribute(name: string, value: string): void;
|
|
92
|
+
removeAttribute(name: string): void;
|
|
93
|
+
toggleAttribute(name: string, force?: boolean): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Reflecting properties write their attribute as soon as they are set, even before the element
|
|
96
|
+
* connects (Lit alone reflects during an update). A `flag` property also stores a real
|
|
97
|
+
* boolean whatever it is given, so a framework writing `''` (the attribute idiom for
|
|
98
|
+
* "present") reads back `true`.
|
|
99
|
+
*/
|
|
100
|
+
static createProperty(name: PropertyKey, options?: PropertyDeclaration): void;
|
|
101
|
+
/**
|
|
102
|
+
* Attributes the element reads straight from the DOM, without a property of the same name: a
|
|
103
|
+
* product subclass reads them too, and a framework that assigns properties it finds (React 19)
|
|
104
|
+
* must write the attribute instead. Changing one redraws the element.
|
|
105
|
+
*/
|
|
106
|
+
static watched: readonly string[];
|
|
107
|
+
static get observedAttributes(): string[];
|
|
108
|
+
private fromAttribute;
|
|
109
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
110
|
+
/** Write a property's value to its attribute now, unless the attribute is where it came from. */
|
|
111
|
+
protected reflectAttribute(attribute: string, value: unknown, options: PropertyDeclaration): void;
|
|
112
|
+
/** Dispatch a bubbling, composed event with `detail`. */
|
|
113
|
+
protected fire<T>(type: string, detail: T, cancelable?: boolean): boolean;
|
|
114
|
+
private get immediate();
|
|
115
|
+
connectedCallback(): void;
|
|
116
|
+
protected performUpdate(): void | Promise<unknown>;
|
|
117
|
+
requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void;
|
|
118
|
+
}
|
|
@@ -30,10 +30,4 @@ export declare function readOfficeProfile(storage?: StorageLike | undefined, key
|
|
|
30
30
|
export declare function writeOfficeProfile(profile: OfficeProfile, storage?: StorageLike | undefined, key?: string): void;
|
|
31
31
|
/** Forget the stored profile. */
|
|
32
32
|
export declare function clearOfficeProfile(storage?: StorageLike | undefined, key?: string): void;
|
|
33
|
-
/**
|
|
34
|
-
* `<office-ui-account>`: User Information with avatar, display name and avatar colour. Set or read
|
|
35
|
-
* `profile`; edits emit `office-profile-change`. `slot="sign-in"` hosts a product sign-in flow;
|
|
36
|
-
* the default slot holds product sections (theme, product information).
|
|
37
|
-
*/
|
|
38
|
-
export declare const defineAccount: import("./registry.js").Definer;
|
|
39
33
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OfficeElement } from '../base.js';
|
|
2
|
+
import { type OfficeProfile } from './account-profile.js';
|
|
3
|
+
/**
|
|
4
|
+
* `<office-ui-account>`: User Information with avatar, display name and avatar colour. Set or read
|
|
5
|
+
* `profile`; edits emit `office-profile-change`. `slot="sign-in"` hosts a product sign-in flow;
|
|
6
|
+
* the default slot holds product sections (theme, product information).
|
|
7
|
+
*/
|
|
8
|
+
export declare class OfficeUiAccount extends OfficeElement {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
private current;
|
|
11
|
+
get profile(): OfficeProfile;
|
|
12
|
+
set profile(value: OfficeProfile);
|
|
13
|
+
private change;
|
|
14
|
+
private onSwatchKey;
|
|
15
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
export declare const defineAccount: import("../registry.js").Definer;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { OfficeElement } from '../base.js';
|
|
2
|
+
/**
|
|
3
|
+
* Office's File view (backstage): a navigation column and one page per item. Generalised from
|
|
4
|
+
* pptx-viewer's `BACKSTAGE_NAV` model (render/backstage.ts) and the Visio viewer's backstage.
|
|
5
|
+
*/
|
|
6
|
+
export interface OfficeBackstageItem {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/** Items in the footer group sit at the bottom of the column (Account, Options). */
|
|
10
|
+
group?: 'footer';
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Tooltip, for example why an item is disabled. */
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
/** An item was chosen; cancelable (`preventDefault()` keeps the current page). */
|
|
16
|
+
export type OfficeBackstageSelectEvent = CustomEvent<{
|
|
17
|
+
id: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type OfficeBackstageCloseEvent = CustomEvent<{
|
|
20
|
+
reason: 'back' | 'escape' | 'api';
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* `<office-ui-backstage>`: set `items`, put one light-DOM child per page with
|
|
24
|
+
* `data-backstage-page="<id>"`, then `show(id)`. Choosing an item emits `office-backstage-select`
|
|
25
|
+
* and, unless prevented, shows its page; items without a page (Save, Close) only emit. Back and
|
|
26
|
+
* Escape emit a cancelable `office-backstage-close` and close. Attributes: `open`, `selected`,
|
|
27
|
+
* `label` (default "File"), `back-label`. Nav buttons carry `data-backstage-item`.
|
|
28
|
+
*/
|
|
29
|
+
export declare class OfficeUiBackstage extends OfficeElement {
|
|
30
|
+
static styles: import("lit").CSSResult[];
|
|
31
|
+
static properties: {
|
|
32
|
+
open: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
reflect: true;
|
|
35
|
+
converter: {
|
|
36
|
+
fromAttribute: (value: string | null) => boolean;
|
|
37
|
+
toAttribute: (value: unknown) => string | null;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
items: {
|
|
41
|
+
attribute: boolean;
|
|
42
|
+
};
|
|
43
|
+
label: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
};
|
|
46
|
+
backLabel: {
|
|
47
|
+
attribute: string;
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
};
|
|
50
|
+
selected: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
noAccessor: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
open: boolean;
|
|
56
|
+
items: readonly OfficeBackstageItem[];
|
|
57
|
+
label: string | null;
|
|
58
|
+
backLabel: string | null;
|
|
59
|
+
private picked;
|
|
60
|
+
constructor();
|
|
61
|
+
get selected(): string;
|
|
62
|
+
set selected(id: string | null);
|
|
63
|
+
/** Open on a page (default: the selected one) and focus its item. */
|
|
64
|
+
show(page?: string): void;
|
|
65
|
+
/** Close without asking (emits `office-backstage-close` with reason `api`). */
|
|
66
|
+
close(): void;
|
|
67
|
+
private page;
|
|
68
|
+
private button;
|
|
69
|
+
private choose;
|
|
70
|
+
private requestClose;
|
|
71
|
+
private onNavClick;
|
|
72
|
+
/** Exactly the selected page of the light DOM shows. */
|
|
73
|
+
private syncPages;
|
|
74
|
+
protected updated(): void;
|
|
75
|
+
private item;
|
|
76
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
77
|
+
}
|
|
78
|
+
export declare const defineBackstage: import("../registry.js").Definer;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { OfficeElement } from '../base.js';
|
|
2
|
+
export type OfficeFindInputEvent = CustomEvent<{
|
|
3
|
+
query: string;
|
|
4
|
+
}>;
|
|
5
|
+
export type OfficeFindStepEvent = CustomEvent<{
|
|
6
|
+
direction: 'next' | 'previous';
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* `<office-ui-find-bar>`: Office's on-demand Find bar under the ribbon. Shown while `open`;
|
|
10
|
+
* `show()` opens it and selects the query. Enter steps to the next result, Shift+Enter to the
|
|
11
|
+
* previous; Escape clears a query, or closes the bar when it is already empty. Attributes:
|
|
12
|
+
* `open`, `label`, `input-label`, `placeholder`, `maxlength`, `disabled`, `navigation-disabled`,
|
|
13
|
+
* `previous-label`, `next-label`, `close-label`. Properties: `value`, `status`, `statusTitle`.
|
|
14
|
+
* Events: `office-find-input` `{ query }`, `office-find-step` `{ direction }`, `office-find-close`.
|
|
15
|
+
*/
|
|
16
|
+
export declare class OfficeUiFindBar extends OfficeElement {
|
|
17
|
+
static shadowRootOptions: {
|
|
18
|
+
clonable?: boolean;
|
|
19
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
20
|
+
mode: ShadowRootMode;
|
|
21
|
+
serializable?: boolean;
|
|
22
|
+
slotAssignment?: SlotAssignmentMode;
|
|
23
|
+
delegatesFocus: boolean;
|
|
24
|
+
};
|
|
25
|
+
static styles: import("lit").CSSResult[];
|
|
26
|
+
static properties: {
|
|
27
|
+
open: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
reflect: true;
|
|
30
|
+
converter: {
|
|
31
|
+
fromAttribute: (value: string | null) => boolean;
|
|
32
|
+
toAttribute: (value: unknown) => string | null;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
disabled: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
reflect: true;
|
|
38
|
+
converter: {
|
|
39
|
+
fromAttribute: (value: string | null) => boolean;
|
|
40
|
+
toAttribute: (value: unknown) => string | null;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
navigationDisabled: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
reflect: true;
|
|
46
|
+
converter: {
|
|
47
|
+
fromAttribute: (value: string | null) => boolean;
|
|
48
|
+
toAttribute: (value: unknown) => string | null;
|
|
49
|
+
};
|
|
50
|
+
attribute: string;
|
|
51
|
+
};
|
|
52
|
+
label: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
};
|
|
55
|
+
inputLabel: {
|
|
56
|
+
attribute: string;
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
};
|
|
59
|
+
placeholder: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
};
|
|
62
|
+
maxlength: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
};
|
|
65
|
+
previousLabel: {
|
|
66
|
+
attribute: string;
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
};
|
|
69
|
+
nextLabel: {
|
|
70
|
+
attribute: string;
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
};
|
|
73
|
+
closeLabel: {
|
|
74
|
+
attribute: string;
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
};
|
|
77
|
+
value: {
|
|
78
|
+
attribute: boolean;
|
|
79
|
+
};
|
|
80
|
+
status: {
|
|
81
|
+
attribute: boolean;
|
|
82
|
+
};
|
|
83
|
+
statusTitle: {
|
|
84
|
+
attribute: boolean;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
open: boolean;
|
|
88
|
+
disabled: boolean;
|
|
89
|
+
navigationDisabled: boolean;
|
|
90
|
+
label: string | null;
|
|
91
|
+
inputLabel: string | null;
|
|
92
|
+
placeholder: string | null;
|
|
93
|
+
maxlength: string | null;
|
|
94
|
+
previousLabel: string | null;
|
|
95
|
+
nextLabel: string | null;
|
|
96
|
+
closeLabel: string | null;
|
|
97
|
+
value: string;
|
|
98
|
+
status: string;
|
|
99
|
+
statusTitle: string;
|
|
100
|
+
constructor();
|
|
101
|
+
private get input();
|
|
102
|
+
/** Open, focus the field and select its query. */
|
|
103
|
+
show(): void;
|
|
104
|
+
/** Close and emit `office-find-close`. */
|
|
105
|
+
close(): void;
|
|
106
|
+
private step;
|
|
107
|
+
private onInput;
|
|
108
|
+
private onKey;
|
|
109
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
110
|
+
}
|
|
111
|
+
export declare const defineFindBar: import("../registry.js").Definer;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type PropertyValues } from 'lit';
|
|
2
|
+
import { OfficeElement } from '../base.js';
|
|
3
|
+
export type OfficePrintPreviewPageEvent = CustomEvent<{
|
|
4
|
+
index: number;
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* `<office-ui-print-preview>`: the Print page's paper preview with page navigation. Set `pages`
|
|
8
|
+
* to rendered nodes (for example the SVG of each page); the element shows a deep clone of the
|
|
9
|
+
* current one with `tabindex` and inline `style` removed, so the preview is inert and never
|
|
10
|
+
* parses markup. `index` selects the page; the arrows emit `office-print-preview-page`.
|
|
11
|
+
* Attributes: `label` (default "Print preview"), `empty-label`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class OfficeUiPrintPreview extends OfficeElement {
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
static properties: {
|
|
16
|
+
label: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
};
|
|
19
|
+
emptyLabel: {
|
|
20
|
+
attribute: string;
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
label: string | null;
|
|
25
|
+
emptyLabel: string | null;
|
|
26
|
+
private list;
|
|
27
|
+
private current;
|
|
28
|
+
private clone;
|
|
29
|
+
constructor();
|
|
30
|
+
get pages(): readonly Node[];
|
|
31
|
+
set pages(value: readonly Node[]);
|
|
32
|
+
get index(): number;
|
|
33
|
+
set index(value: number);
|
|
34
|
+
private go;
|
|
35
|
+
/** The shown page is an inert copy: no tabindex, no inline style. */
|
|
36
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
37
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
38
|
+
}
|
|
39
|
+
export declare const definePrintPreview: import("../registry.js").Definer;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OfficeElement } from '../base.js';
|
|
2
|
+
/** Tick subdivisions per unit for a given unit length in CSS pixels, finer as it grows. */
|
|
3
|
+
export declare function rulerDivisions(unitPixels: number): number;
|
|
4
|
+
/**
|
|
5
|
+
* `<office-ui-ruler>`: a decorative Office ruler (inches by default). The product positions it
|
|
6
|
+
* and says where zero is: `origin` is the CSS-pixel offset of zero from the ruler's start edge,
|
|
7
|
+
* `scale` the CSS pixels per unit (96 at 100% for inches). `orientation="vertical"` draws a
|
|
8
|
+
* side ruler; `direction="reverse"` makes values grow toward the start edge, as Visio's
|
|
9
|
+
* vertical ruler grows upward from the page bottom. Hidden from assistive technology.
|
|
10
|
+
*/
|
|
11
|
+
export declare class OfficeUiRuler extends OfficeElement {
|
|
12
|
+
static styles: import("lit").CSSResult[];
|
|
13
|
+
static properties: {
|
|
14
|
+
orientation: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
reflect: boolean;
|
|
17
|
+
};
|
|
18
|
+
origin: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
};
|
|
21
|
+
scale: {
|
|
22
|
+
type: NumberConstructor;
|
|
23
|
+
};
|
|
24
|
+
direction: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
orientation: string;
|
|
29
|
+
origin: number;
|
|
30
|
+
scale: number;
|
|
31
|
+
direction: string;
|
|
32
|
+
private frame;
|
|
33
|
+
private observer;
|
|
34
|
+
constructor();
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
private schedule;
|
|
38
|
+
protected willUpdate(): void;
|
|
39
|
+
protected updated(): void;
|
|
40
|
+
private draw;
|
|
41
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
42
|
+
}
|
|
43
|
+
export declare const defineRuler: import("../registry.js").Definer;
|