@tectra-ng/ui 0.1.2 → 0.1.4
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 +36 -19
- package/accordion/README.md +61 -0
- package/analog-clock/README.md +31 -0
- package/breadcrumb/README.md +57 -0
- package/countdown/README.md +45 -0
- package/datepicker/README.md +109 -0
- package/export/README.md +79 -0
- package/export-font/OFL.txt +93 -0
- package/export-font/README.md +7 -0
- package/fesm2022/tectra-ng-ui-accordion.mjs +980 -0
- package/fesm2022/tectra-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +386 -0
- package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +2 -2
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs +382 -0
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chips-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +2 -2
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-countdown.mjs +513 -0
- package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-datepicker.mjs +2640 -0
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-export-font.mjs +7 -0
- package/fesm2022/tectra-ng-ui-export-font.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-export.mjs +2574 -0
- package/fesm2022/tectra-ng-ui-export.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-file-upload.mjs +1452 -0
- package/fesm2022/tectra-ng-ui-file-upload.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-label.mjs +4 -4
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-listbox.mjs +2 -2
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-menubar.mjs +742 -0
- package/fesm2022/tectra-ng-ui-menubar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +601 -0
- package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +2 -2
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +610 -0
- package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs +319 -0
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-sparkline.mjs +240 -0
- package/fesm2022/tectra-ng-ui-sparkline.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-splitter.mjs +750 -0
- package/fesm2022/tectra-ng-ui-splitter.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +661 -0
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-stepper.mjs +1166 -0
- package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +195 -71
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tabs.mjs +1218 -0
- package/fesm2022/tectra-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs +4 -1
- package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-timeline.mjs +407 -0
- package/fesm2022/tectra-ng-ui-timeline.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toolbar.mjs +348 -0
- package/fesm2022/tectra-ng-ui-toolbar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +80 -2
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
- package/field/README.md +1 -1
- package/file-upload/README.md +85 -0
- package/menubar/README.md +51 -0
- package/month-calendar/README.md +46 -0
- package/package.json +80 -4
- package/panel-menu/README.md +45 -0
- package/scroll-panel/README.md +35 -0
- package/sparkline/README.md +27 -0
- package/splitter/README.md +62 -0
- package/stat-tiles/README.md +53 -0
- package/stepper/README.md +66 -0
- package/table/README.md +1 -1
- package/tabs/README.md +69 -0
- package/timeline/README.md +42 -0
- package/toolbar/README.md +35 -0
- package/types/tectra-ng-ui-accordion.d.ts +304 -0
- package/types/tectra-ng-ui-accordion.d.ts.map +1 -0
- package/types/tectra-ng-ui-analog-clock.d.ts +127 -0
- package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -0
- package/types/tectra-ng-ui-breadcrumb.d.ts +157 -0
- package/types/tectra-ng-ui-breadcrumb.d.ts.map +1 -0
- package/types/tectra-ng-ui-countdown.d.ts +150 -0
- package/types/tectra-ng-ui-countdown.d.ts.map +1 -0
- package/types/tectra-ng-ui-datepicker.d.ts +801 -0
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -0
- package/types/tectra-ng-ui-export-font.d.ts +5 -0
- package/types/tectra-ng-ui-export-font.d.ts.map +1 -0
- package/types/tectra-ng-ui-export.d.ts +427 -0
- package/types/tectra-ng-ui-export.d.ts.map +1 -0
- package/types/tectra-ng-ui-file-upload.d.ts +527 -0
- package/types/tectra-ng-ui-file-upload.d.ts.map +1 -0
- package/types/tectra-ng-ui-menubar.d.ts +201 -0
- package/types/tectra-ng-ui-menubar.d.ts.map +1 -0
- package/types/tectra-ng-ui-month-calendar.d.ts +287 -0
- package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -0
- package/types/tectra-ng-ui-panel-menu.d.ts +244 -0
- package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -0
- package/types/tectra-ng-ui-scroll-panel.d.ts +94 -0
- package/types/tectra-ng-ui-scroll-panel.d.ts.map +1 -0
- package/types/tectra-ng-ui-sparkline.d.ts +80 -0
- package/types/tectra-ng-ui-sparkline.d.ts.map +1 -0
- package/types/tectra-ng-ui-splitter.d.ts +226 -0
- package/types/tectra-ng-ui-splitter.d.ts.map +1 -0
- package/types/tectra-ng-ui-stat-tiles.d.ts +287 -0
- package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -0
- package/types/tectra-ng-ui-stepper.d.ts +446 -0
- package/types/tectra-ng-ui-stepper.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +2 -4
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tabs.d.ts +420 -0
- package/types/tectra-ng-ui-tabs.d.ts.map +1 -0
- package/types/tectra-ng-ui-textarea.d.ts +1 -0
- package/types/tectra-ng-ui-textarea.d.ts.map +1 -1
- package/types/tectra-ng-ui-timeline.d.ts +129 -0
- package/types/tectra-ng-ui-timeline.d.ts.map +1 -0
- package/types/tectra-ng-ui-toolbar.d.ts +85 -0
- package/types/tectra-ng-ui-toolbar.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree-table.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,44 @@
|
|
|
1
1
|
# @tectra-ng/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular components of tectra — standalone, signals, OnPush, accessible, themable with design tokens. One npm package, one entry point per component: `import { TxSelect } from '@tectra-ng/ui/select'` puts only the select into the bundle.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
npm i @tectra-ng/ui
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
`@tectra-ng/core`, `@tectra-ng/themes`, `@tectra-ng/tokens` and `@tectra-ng/icons` come with it as peer dependencies; `@angular/cdk`, `@angular/forms` and `@angular/common` are needed too, `@angular/router` only for router links.
|
|
6
10
|
|
|
11
|
+
```ts
|
|
12
|
+
// app.config.ts
|
|
13
|
+
import { provideTectra } from '@tectra-ng/core/config';
|
|
14
|
+
import { Tectra } from '@tectra-ng/themes';
|
|
15
|
+
|
|
16
|
+
export const appConfig = { providers: [provideTectra({ preset: Tectra })] };
|
|
7
17
|
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
select-option.directive.ts template slots (#option, #empty, …)
|
|
13
|
-
select.tokens.ts component tokens → docs "Theming" tab
|
|
14
|
-
select.types.ts public types
|
|
15
|
-
index.ts public API of the entry point
|
|
16
|
-
ng-package.json makes it @tectra-ng/ui/select
|
|
17
|
-
README.md descriptions → docs "API" tab
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { TxButton } from '@tectra-ng/ui/button';
|
|
21
|
+
import { TxDatePicker } from '@tectra-ng/ui/datepicker';
|
|
18
22
|
```
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
Every component takes `dt` (design tokens of this instance), `pt` / `ptOptions` (classes and styles of its parts) and `unstyled`; form fields work with reactive forms, `ngModel` and signal forms. Docs, examples and the API of each entry point: [tectra-ng.com](https://tectra-ng.com).
|
|
25
|
+
|
|
26
|
+
## Entry points
|
|
27
|
+
|
|
28
|
+
| Group | `@tectra-ng/ui/…` |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Form | `autocomplete`, `cascade-select`, `checkbox`, `chips-input`, `color-picker`, `country-select`, `datepicker`, `email-suggestion`, `field`, `icon-field`, `input`, `input-group`, `input-mask`, `input-number`, `input-otp`, `key-filter`, `knob`, `label`, `listbox`, `mention-textarea`, `multiselect`, `password`, `password-generator`, `radio-button`, `rating`, `select`, `slider`, `textarea`, `toggle-button`, `toggle-switch`, `tree-select` |
|
|
31
|
+
| Actions | `button`, `button-group`, `speed-dial`, `split-button` |
|
|
32
|
+
| Data | `data-view`, `export`, `month-calendar`, `paginator`, `sparkline`, `stat-tiles`, `table`, `timeline`, `tree`, `tree-table`, `virtual-scroller` |
|
|
33
|
+
| Overlay | `confirm`, `dialog`, `drawer`, `menu`, `popover`, `toast`, `tooltip` |
|
|
34
|
+
| Display | `amount`, `avatar`, `badge`, `chip`, `country`, `highlight-text`, `link`, `overlay-badge`, `pill`, `status-icon`, `tag` |
|
|
35
|
+
| Feedback | `message`, `progress-bar`, `progress-spinner`, `skeleton` |
|
|
36
|
+
| Layout | `card`, `divider`, `fieldset`, `panel` |
|
|
37
|
+
| Misc | `analog-clock`, `countdown` |
|
|
38
|
+
| Assets | `export-font` — Onest (SIL Open Font License, see `export-font/OFL.txt`) for PDF export, loaded by `@tectra-ng/ui/export` on the first PDF export |
|
|
39
|
+
|
|
40
|
+
Each entry point has its own `README.md` with the inputs, outputs, slots and keyboard map.
|
|
41
|
+
|
|
42
|
+
## License
|
|
26
43
|
|
|
27
|
-
|
|
44
|
+
MIT. The Onest font in `export-font` is © The Onest Project Authors, SIL Open Font License 1.1.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Accordion
|
|
2
|
+
|
|
3
|
+
A list of collapsible sections in a bordered box — FAQ blocks, grouped details, long settings. Build it from panels, or pass an array of items with header and content templates.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-accordion [(value)]="open">
|
|
7
|
+
<tx-accordion-panel value="dns">
|
|
8
|
+
<tx-accordion-header>DNS</tx-accordion-header>
|
|
9
|
+
<tx-accordion-content>Records of the zone</tx-accordion-content>
|
|
10
|
+
</tx-accordion-panel>
|
|
11
|
+
</tx-accordion>
|
|
12
|
+
|
|
13
|
+
<tx-accordion [items]="sections" [(value)]="open" (opened)="load($event.index)">
|
|
14
|
+
<ng-template txAccordionHeader let-item>{{ item.header }}</ng-template>
|
|
15
|
+
<ng-template txAccordionContent let-item>{{ item.content }}</ng-template>
|
|
16
|
+
</tx-accordion>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`TxAccordionItem`: `header`, `content`, `value` (the index when empty), `tone` (`info`, `success`, `warn`, `danger` — a coloured bar on the left of the header), `disabled`, plus any fields you need in the templates.
|
|
20
|
+
|
|
21
|
+
## Inputs
|
|
22
|
+
| Name | Description |
|
|
23
|
+
|---|---|
|
|
24
|
+
| value | Two-way: the open panels — an array of values, or one value / `null` when `multiple` is off |
|
|
25
|
+
| multiple | Several panels can be open at once (on by default) |
|
|
26
|
+
| items | Panels as an array of `TxAccordionItem` |
|
|
27
|
+
| expandIcon | Icon of a closed panel instead of the chevron |
|
|
28
|
+
| collapseIcon | Icon of an open panel instead of the chevron |
|
|
29
|
+
| selectOnFocus | The arrow keys open the header they land on |
|
|
30
|
+
| headingLevel | `tx-accordion-header`: wraps the header in a heading of this level |
|
|
31
|
+
| tone | `tx-accordion-panel`: `info`, `success`, `warn` or `danger` |
|
|
32
|
+
| disabled | `tx-accordion-panel`: the panel cannot be opened |
|
|
33
|
+
| dt | Design tokens of this instance (`accordion`) |
|
|
34
|
+
| pt | Classes and styles of the parts: `root`, `panel`, `header`, `headerContent`, `toggleIcon`, `content`, `contentInner` |
|
|
35
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
36
|
+
| unstyled | Removes the tectra styles |
|
|
37
|
+
|
|
38
|
+
`tx-accordion-panel` takes a required `value`.
|
|
39
|
+
|
|
40
|
+
## Outputs
|
|
41
|
+
| Name | Description |
|
|
42
|
+
|---|---|
|
|
43
|
+
| valueChange | The open panels changed |
|
|
44
|
+
| opened | A panel was opened: `{ value, index, item }` |
|
|
45
|
+
| closed | A panel was closed: `{ value, index, item }` |
|
|
46
|
+
|
|
47
|
+
## Slots
|
|
48
|
+
| Name | Description |
|
|
49
|
+
|---|---|
|
|
50
|
+
| tx-accordion-panel | A panel with a `tx-accordion-header` and a `tx-accordion-content` |
|
|
51
|
+
| txAccordionHeader | `<ng-template txAccordionHeader let-item let-index="index" let-active="active">` — header of each item |
|
|
52
|
+
| txAccordionContent | `<ng-template txAccordionContent let-item>` — content of each item, or lazy content inside `tx-accordion-content`; created on the first open |
|
|
53
|
+
| txAccordionToggleIcon | `<ng-template txAccordionToggleIcon let-active>` — own toggle icon |
|
|
54
|
+
|
|
55
|
+
## Keyboard
|
|
56
|
+
| Key | Action |
|
|
57
|
+
|---|---|
|
|
58
|
+
| Tab | Moves between the headers and the content of open panels |
|
|
59
|
+
| Down / Up arrow | Next / previous header; disabled panels are skipped |
|
|
60
|
+
| Home / End | First / last header |
|
|
61
|
+
| Enter / Space | Opens or closes the panel |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Analog clock
|
|
2
|
+
|
|
3
|
+
A clock face with hour and minute hands (and an optional second hand) that shows the time of an IANA time zone — for "local time of the client / office" blocks. The `txAnalogClockHands` pipe gives the same time as `HH:mm` and the hand angles for an own display.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-analog-clock timezone="Europe/Kyiv" ariaLabel="Kyiv office" />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
| Name | Description |
|
|
11
|
+
|---|---|
|
|
12
|
+
| timezone | IANA time zone such as `Europe/Kyiv`; empty or unknown is the local time |
|
|
13
|
+
| time | A fixed time (`Date` or ms) instead of the running clock |
|
|
14
|
+
| showSeconds | Adds a second hand; the clock then updates every second instead of every minute |
|
|
15
|
+
| ariaLabel | Text before the time in the accessible name, e.g. the city |
|
|
16
|
+
| dt | Design tokens of this instance (`analogClock`) |
|
|
17
|
+
| pt | Classes and styles of the parts: `root`, `face`, `tick`, `hourHand`, `minuteHand`, `secondHand`, `pin` |
|
|
18
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
19
|
+
| unstyled | Removes the tectra styles |
|
|
20
|
+
|
|
21
|
+
## Keyboard
|
|
22
|
+
| Key | Action |
|
|
23
|
+
|---|---|
|
|
24
|
+
| — | Not focusable |
|
|
25
|
+
|
|
26
|
+
## Notes
|
|
27
|
+
|
|
28
|
+
- The face is `role="img"` named by the time (`14:30`, after `ariaLabel` when set).
|
|
29
|
+
- Hands turn with a soft spring and always forward — from :59 to :00 they go on, not back around the face; with reduced motion they jump.
|
|
30
|
+
- The clock updates at the start of each minute (or second), so it stays exact without polling.
|
|
31
|
+
- `txAnalogClockHands` (pipe) and `clockHands(ms, timezone)` return `{ time, hourAngle, minuteAngle, secondAngle }`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Breadcrumb
|
|
2
|
+
|
|
3
|
+
Shows where the current page sits in the hierarchy: a row of links to the parent pages, ending with the current page. Items come from a `model` array and can be router links, URLs or commands.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-breadcrumb [home]="home" [model]="items" />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
home: TxBreadcrumbItem = { icon: 'home', routerLink: '/', ariaLabel: 'Home' };
|
|
11
|
+
items: TxBreadcrumbItem[] = [{ label: 'Projects', routerLink: '/projects' }, { label: 'Website' }];
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Inputs
|
|
15
|
+
| Name | Description |
|
|
16
|
+
|---|---|
|
|
17
|
+
| model | The items, `TxBreadcrumbItem[]`; the last one is the current page |
|
|
18
|
+
| home | First item, usually a home icon |
|
|
19
|
+
| separator | `chevron` (default) or `slash` |
|
|
20
|
+
| ariaLabel | Label of the navigation landmark ("Breadcrumb" by default, translated) |
|
|
21
|
+
| dt | Design tokens of this instance (`breadcrumb`) |
|
|
22
|
+
| pt | Classes and styles of the parts: `root`, `list`, `item`, `link`, `icon`, `label`, `separator` |
|
|
23
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
24
|
+
| unstyled | Removes the tectra styles |
|
|
25
|
+
|
|
26
|
+
## Outputs
|
|
27
|
+
| Name | Description |
|
|
28
|
+
|---|---|
|
|
29
|
+
| itemClick | An item link or command was clicked: `{ originalEvent, item }` |
|
|
30
|
+
|
|
31
|
+
## Slots
|
|
32
|
+
| Name | Description |
|
|
33
|
+
|---|---|
|
|
34
|
+
| txBreadcrumbItem | `<ng-template txBreadcrumbItem let-item let-current="current">` — own content of an item (the link stays) |
|
|
35
|
+
| txBreadcrumbSeparator | `<ng-template txBreadcrumbSeparator>` — own separator |
|
|
36
|
+
|
|
37
|
+
## Item
|
|
38
|
+
| Field | Description |
|
|
39
|
+
|---|---|
|
|
40
|
+
| label | Text |
|
|
41
|
+
| icon | Icon name (or a CSS class) before the label |
|
|
42
|
+
| routerLink, queryParams, fragment | Router navigation |
|
|
43
|
+
| url, target | Plain link |
|
|
44
|
+
| command | Called with `{ originalEvent, item }` on click; an item with only a command is a button |
|
|
45
|
+
| disabled | Shown dimmed, not clickable |
|
|
46
|
+
| title, ariaLabel, id | Tooltip, accessible name (needed for an icon-only item), element id |
|
|
47
|
+
|
|
48
|
+
## Keyboard
|
|
49
|
+
| Key | Action |
|
|
50
|
+
|---|---|
|
|
51
|
+
| Tab | Moves through the links; the current page and disabled items are not focusable |
|
|
52
|
+
| Enter | Follows the focused link |
|
|
53
|
+
| Enter / Space | Runs the command of a command item |
|
|
54
|
+
|
|
55
|
+
## Accessibility
|
|
56
|
+
|
|
57
|
+
A `nav` landmark with a label, an ordered list of items, separators hidden from screen readers and `aria-current="page"` on the last item.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Countdown
|
|
2
|
+
|
|
3
|
+
Counts down to zero — a number of seconds, minutes, hours or days, or the time left to a date — and fires `completed` once at zero. For "redirect in 5 s", "auto-apply in 30 s", "offer ends in 02:14:09" or "3 days left". The `txRemainingTime` pipe formats any remaining milliseconds the same way.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-countdown [value]="5" unit="seconds" suffix="s" (completed)="redirect()" />
|
|
7
|
+
<tx-countdown [target]="offerEndsAt" [endingSoon]="60000" />
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
| Name | Description |
|
|
12
|
+
|---|---|
|
|
13
|
+
| value | Number of `unit`s to count down from; a new value starts again |
|
|
14
|
+
| unit | `seconds`, `minutes`, `hours` or `days` |
|
|
15
|
+
| target | A date (`Date`, ISO string or ms) to count down to, instead of `value` |
|
|
16
|
+
| suffix | Text after the value, e.g. `s` or a translated unit |
|
|
17
|
+
| format | `number` — whole units left (default with `value`), `clock` — `mm:ss` or `h:mm:ss` (default with `target`) |
|
|
18
|
+
| endingSoon | Milliseconds before zero when the countdown turns to the "ending" colour (`tx-countdown--ending`); `0` never |
|
|
19
|
+
| paused | Stops the countdown and keeps the time left; it goes on from there |
|
|
20
|
+
| ariaLive | `off` (default — a ticking timer would talk every second), `polite` or `assertive` |
|
|
21
|
+
| dt | Design tokens of this instance (`countdown`) |
|
|
22
|
+
| pt | Classes and styles of the root |
|
|
23
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
24
|
+
| unstyled | Removes the tectra styles |
|
|
25
|
+
|
|
26
|
+
## Outputs
|
|
27
|
+
| Name | Description |
|
|
28
|
+
|---|---|
|
|
29
|
+
| completed | Zero was reached; fires once per start |
|
|
30
|
+
| tick | The time left in milliseconds, whenever the shown value changes |
|
|
31
|
+
|
|
32
|
+
## Slots
|
|
33
|
+
| Name | Description |
|
|
34
|
+
|---|---|
|
|
35
|
+
| txCountdownValue | `<ng-template txCountdownValue let-ms let-days="days" let-hours="hours" let-minutes="minutes" let-seconds="seconds" let-expired="expired">` — own display |
|
|
36
|
+
|
|
37
|
+
## Keyboard
|
|
38
|
+
| Key | Action |
|
|
39
|
+
|---|---|
|
|
40
|
+
| — | Not focusable |
|
|
41
|
+
|
|
42
|
+
## Notes
|
|
43
|
+
|
|
44
|
+
- The countdown is a `role="timer"` region. It follows the clock, not the number of ticks, so a background tab or a slow device does not make it drift; it updates only when the shown value changes (every second for `clock`, every unit for `number`).
|
|
45
|
+
- `txRemainingTime` (pipe) and `formatRemaining(ms)` give `mm:ss` below an hour and `h:mm:ss` above; `splitRemaining(ms)` gives days, hours, minutes and seconds.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Date picker
|
|
2
|
+
|
|
3
|
+
A date field with a calendar panel — one date, several dates or a range, with or without time, typed or picked, in a popup, a touch dialog or inline. Works with `formControl`, `ngModel` and signal forms.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-datepicker [formControl]="period" selectionMode="range" dateFormat="dd.mm.yy" [showIcon]="true" [showClear]="true" placeholder="Period" />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
| Name | Description |
|
|
11
|
+
|---|---|
|
|
12
|
+
| selectionMode | `single`, `multiple` or `range` (the value is `[start, end]`, `end` is `null` until picked; while the end is not picked, the days up to the hovered or focused day are highlighted) |
|
|
13
|
+
| dateFormat | Format of the field: `d` / `dd` day, `o` / `oo` day of the year, `D` / `DD` weekday name, `m` / `mm` month, `M` / `MM` month name, `y` / `yy` year, `@` Unix ms, `!` ticks, `'text'` literal; locale default (`mm/dd/yy` us, `dd.mm.yy` ua) |
|
|
14
|
+
| placeholder | Text of the empty field |
|
|
15
|
+
| inputId | Id of the input, for an outside `<label for>` |
|
|
16
|
+
| name | Name of the input |
|
|
17
|
+
| ariaLabel | Accessible name of the field and the panel |
|
|
18
|
+
| ariaLabelledBy | Id of the element that names the field |
|
|
19
|
+
| iconAriaLabel | Accessible name of the icon button; "Choose date" by default |
|
|
20
|
+
| inline | Shows the calendar in place, without a field |
|
|
21
|
+
| showIcon | Shows the calendar icon |
|
|
22
|
+
| iconDisplay | `button` — a button joined to the field, `input` — an icon inside the field |
|
|
23
|
+
| icon | Icon name |
|
|
24
|
+
| showClear | Shows a clear button in the field when it has a value |
|
|
25
|
+
| showButtonBar | Today and Clear buttons under the calendar |
|
|
26
|
+
| showOtherMonths | Shows days of the previous / next month |
|
|
27
|
+
| selectOtherMonths | Lets those days be picked; on by default (off in PrimeNG) |
|
|
28
|
+
| showWeek | Week numbers (ISO) |
|
|
29
|
+
| startWeekFromFirstDayOfYear | Counts week 1 from January 1 |
|
|
30
|
+
| showTime | Hours and minutes under the calendar |
|
|
31
|
+
| timeOnly | Only the time picker |
|
|
32
|
+
| hourFormat | `24` or `12` (with AM / PM) |
|
|
33
|
+
| showSeconds | Seconds in the time picker |
|
|
34
|
+
| stepHour | Hours per click |
|
|
35
|
+
| stepMinute | Minutes per click |
|
|
36
|
+
| stepSecond | Seconds per click |
|
|
37
|
+
| timeSeparator | Between hours, minutes and seconds; `:` by default |
|
|
38
|
+
| view | `date`, `month` (pick a month) or `year` (pick a year) |
|
|
39
|
+
| numberOfMonths | Months side by side |
|
|
40
|
+
| responsiveOptions | `[{ breakpoint: '768px', numberOfMonths: 1 }]` — fewer months on narrow screens |
|
|
41
|
+
| firstDayOfWeek | 0 Sunday … 6 Saturday; locale default |
|
|
42
|
+
| minDate | Earliest date |
|
|
43
|
+
| maxDate | Latest date |
|
|
44
|
+
| disabledDates | Dates that cannot be picked |
|
|
45
|
+
| disabledDays | Weekdays that cannot be picked (0 Sunday … 6 Saturday) |
|
|
46
|
+
| maxDateCount | Most dates in `multiple` mode |
|
|
47
|
+
| defaultDate | Month shown and time used while there is no value |
|
|
48
|
+
| readonlyInput | The field takes no typing, only the calendar |
|
|
49
|
+
| keepInvalid | Keeps text that is not a valid date after blur |
|
|
50
|
+
| hideOnDateTimeSelect | Closes the panel once the date (or the range end) is picked; not with time |
|
|
51
|
+
| showOnFocus | Opens the panel when the field gets focus or a click |
|
|
52
|
+
| touchUI | Opens the calendar as a centred dialog with a mask, for touch screens |
|
|
53
|
+
| dataType | `date` — `Date` values, `string` — strings in `dateFormat` |
|
|
54
|
+
| multipleSeparator | Between dates in `multiple` mode; `,` |
|
|
55
|
+
| rangeSeparator | Between the start and the end; `-` |
|
|
56
|
+
| shortYearCutoff | Two-digit years up to this one are this century (`+10` = ten years ahead) |
|
|
57
|
+
| size | `small`, `medium` or `large` |
|
|
58
|
+
| variant | `outlined` or `filled` |
|
|
59
|
+
| fluid | Takes the full width (also inside `<tx-fluid>`) |
|
|
60
|
+
| invalid | Marks the field invalid; also taken from the form control |
|
|
61
|
+
| disabled | Disables the field |
|
|
62
|
+
| readonly | Shows the value without changes |
|
|
63
|
+
| required | Sets `required` on the input |
|
|
64
|
+
| dt | Design tokens of this instance (`datePicker`) |
|
|
65
|
+
| pt | Classes and styles of the parts: `root`, `input`, `dropdown`, `inputIcon`, `clear`, `panel`, `header`, `title`, `previous`, `next`, `selectMonth`, `selectYear`, `calendar`, `table`, `weekday`, `weekNumber`, `day`, `monthView`, `month`, `yearView`, `year`, `timePicker`, `buttonbar` |
|
|
66
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
67
|
+
| unstyled | Removes the tectra styles |
|
|
68
|
+
|
|
69
|
+
## Outputs
|
|
70
|
+
| Name | Description |
|
|
71
|
+
|---|---|
|
|
72
|
+
| selected | A date was picked in the calendar |
|
|
73
|
+
| cleared | The value was cleared |
|
|
74
|
+
| todayClicked | The Today button was clicked |
|
|
75
|
+
| clearClicked | The Clear button was clicked |
|
|
76
|
+
| monthChange | The calendar moved to another month: `{ month, year }` (month 1–12) |
|
|
77
|
+
| yearChange | The calendar moved to another year |
|
|
78
|
+
| opened | The panel opened |
|
|
79
|
+
| closed | The panel closed |
|
|
80
|
+
| focused | The field got focus |
|
|
81
|
+
| blurred | The field lost focus |
|
|
82
|
+
| typed | The text in the field changed |
|
|
83
|
+
|
|
84
|
+
## Slots
|
|
85
|
+
| Name | Description |
|
|
86
|
+
|---|---|
|
|
87
|
+
| txDatePickerDate | `<ng-template txDatePickerDate let-day let-selected="selected">` — content of a day: `day`, `month`, `year`, `today`, `otherMonth`, `selectable` |
|
|
88
|
+
| txDatePickerHeader | `<ng-template txDatePickerHeader>` — content above the calendar |
|
|
89
|
+
| txDatePickerFooter | `<ng-template txDatePickerFooter>` — content under the calendar |
|
|
90
|
+
| txDatePickerDecade | `<ng-template txDatePickerDecade let-years>` — title of the year view |
|
|
91
|
+
| txDatePickerButtonBar | `<ng-template txDatePickerButtonBar let-today="today" let-clear="clear">` — own button bar |
|
|
92
|
+
| txDatePickerTriggerIcon | `<ng-template txDatePickerTriggerIcon>` — content of the icon button |
|
|
93
|
+
| txDatePickerInputIcon | `<ng-template txDatePickerInputIcon let-toggle>` — icon inside the field |
|
|
94
|
+
|
|
95
|
+
## Keyboard
|
|
96
|
+
| Key | Action |
|
|
97
|
+
|---|---|
|
|
98
|
+
| ArrowDown / Alt + ArrowDown | Field — opens the panel and moves focus to the date |
|
|
99
|
+
| Enter | Field — applies the typed text and closes the panel |
|
|
100
|
+
| Escape | Closes the panel and returns to the field |
|
|
101
|
+
| Tab | Field — applies the text, closes the panel and moves on; panel — moves between its buttons and the grid (focus stays in the panel) |
|
|
102
|
+
| Arrow keys | Grid — previous / next day or week; month and year views — previous / next item or row |
|
|
103
|
+
| Home / End | First / last day of the week |
|
|
104
|
+
| PageUp / PageDown | Previous / next month; with Shift — year |
|
|
105
|
+
| Enter / Space | Picks the focused day, month or year |
|
|
106
|
+
|
|
107
|
+
## Accessibility
|
|
108
|
+
|
|
109
|
+
The field is a `combobox` with `aria-haspopup="dialog"`; the panel is a `dialog` (`aria-modal`) with a focus trap, or a `group` when inline. Days are a `grid` with one focusable cell (roving focus), full date names, `aria-selected` for the picked dates and the range, `aria-disabled`, `aria-current="date"` for today. A picked date is announced. Previous / next, month, year and time buttons are labelled in the current locale.
|
package/export/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Export
|
|
2
|
+
|
|
3
|
+
Saves rows as a file in the browser — CSV, Excel (`.xlsx`), Word (`.docx`), PDF, JSON, HTML, Markdown — copies them as a table or prints them, without any third-party library. The Excel and Word files are written by the kit itself (zip + Office XML); the PDF embeds only the glyphs it uses from the Onest font (Latin and Cyrillic, loaded from `@tectra-ng/ui/export-font` on the first PDF export), so its text is real and searchable.
|
|
4
|
+
|
|
5
|
+
Each format has its own icon button — `<tx-export-csv>`, `<tx-export-excel>`, `<tx-export-word>`, `<tx-export-pdf>`, or `<tx-export-button format="…">` for any of them — and `<tx-export>` is one "Export" split button with a menu of formats. They all take the same `fields`, `data` / `fetchData` and `options`.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<tx-export-excel [data]="users()" [fields]="exportFields" filename="users" />
|
|
9
|
+
<tx-export [fields]="exportFields" [fetchData]="loadAllUsers" title="Users" />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
exportFields: TxExportField<User>[] = [
|
|
14
|
+
{ field: 'number', title: '#', width: 6 },
|
|
15
|
+
{ field: 'name', title: 'Name', width: 28 },
|
|
16
|
+
{ field: 'balance', title: 'Balance', type: 'number', format: '#,##0.00' },
|
|
17
|
+
{ field: 'createdAt', title: 'Created', type: 'date' },
|
|
18
|
+
{ field: 'notes', title: 'Notes', formats: ['excel', 'csv'] },
|
|
19
|
+
];
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
| Name | Description |
|
|
24
|
+
|---|---|
|
|
25
|
+
| data | Rows to export; two-way, replaced by the result of `fetchData` |
|
|
26
|
+
| fields | Columns in order (`TxExportField`): `field` (a key or a path like `team.title`), `title`, `aggregator(value, row, index)`, `type` (`text`, `number`, `date`, `datetime`, `boolean`; guessed from the values), `width` (in characters, all formats), `align` (`start`, `center`, `end`), `format` (Excel number format such as `#,##0.00` or `dd.mm.yyyy`), `formats` (only in these formats). A `number` or `place` field without an aggregator gets the row number |
|
|
27
|
+
| fetchData | `() => Promise<rows \| null>` called on click before the export, e.g. to load every page from the server; `null` cancels |
|
|
28
|
+
| options | `TxExportOptions` — `filename`, `title`, `subtitle`, `showDate`, `locale` and one object per format: `csv`, `excel`, `word`, `pdf`, `json`, `html`, `markdown`, `copy`, `print` (see below); merged over `provideTxExport()` |
|
|
29
|
+
| filename | File name, with or without the extension; `ExportedData` by default |
|
|
30
|
+
| title | Title of the PDF, Word, HTML and printed documents and of the Excel file |
|
|
31
|
+
| format | `tx-export-button` — `csv`, `excel`, `word`, `pdf`, `json`, `html`, `markdown`, `copy` or `print` |
|
|
32
|
+
| formats | `tx-export` — formats in the menu, in order; the main button runs the first one |
|
|
33
|
+
| loading | Shows the spinner; the button also spins by itself while an export runs |
|
|
34
|
+
| disabled | Disables the button |
|
|
35
|
+
| label | Text of the button; empty shows an icon-only button named by the tooltip (`tx-export` shows "Export") |
|
|
36
|
+
| tooltip | Own tooltip; defaults to the translated "Export to CSV", "Copy table"… |
|
|
37
|
+
| severity | Button severity |
|
|
38
|
+
| variant | Button variant: `outlined`, `text` or `link` |
|
|
39
|
+
| size | Button size |
|
|
40
|
+
| pt | Classes and styles of the parts: `root`, `button` |
|
|
41
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
42
|
+
| unstyled | Removes the tectra styles of the button |
|
|
43
|
+
|
|
44
|
+
## Outputs
|
|
45
|
+
| Name | Description |
|
|
46
|
+
|---|---|
|
|
47
|
+
| exported | Done: `{ format, filename, rows, data }` (`filename` is `null` for copy and print) |
|
|
48
|
+
| failed | `fetchData`, the writer or the clipboard threw; the button is ready for the next click |
|
|
49
|
+
| dataChange | The rows changed after `fetchData` |
|
|
50
|
+
|
|
51
|
+
## Keyboard
|
|
52
|
+
| Key | Action |
|
|
53
|
+
|---|---|
|
|
54
|
+
| Enter / Space | Runs the export of the focused button |
|
|
55
|
+
| Alt + ArrowDown | `tx-export` — opens the menu of formats (see split button) |
|
|
56
|
+
|
|
57
|
+
## Options per format
|
|
58
|
+
|
|
59
|
+
| Format | Options |
|
|
60
|
+
|---|---|
|
|
61
|
+
| csv | `separator` (`,`), `bom` (true — spreadsheet apps read non-Latin text), `lineEnding` (`\r\n`), `header`, `quoteAll`, `formulaGuard` (true — cells starting with `=`, `+`, `-`, `@` get a leading `'`; signed numbers stay) |
|
|
62
|
+
| excel | `sheetName`, `header`, `freezeHeader`, `autoFilter`, `autoWidth`, `minWidth` / `maxWidth` (characters), `headerBold`, `headerBackground` / `headerColor` (hex or `none`), `wrapText`, `numberFormat`, `dateFormat`, `dateTimeFormat`, `title`, `author`, `compress` |
|
|
63
|
+
| word, pdf | `title`, `subtitle`, `showDate`, `header`, `pageSize` (`a3`, `a4`, `a5`, `letter`, `legal` or `[width, height]` in points), `orientation` (`auto` — landscape above 5 columns, `portrait`, `landscape`), `margin` (points or `[top, right, bottom, left]`), `fontSize`, `pageNumbers`, `repeatHeader`, `striped`, `gridlines`, `headerBackground`, `stripeBackground`, `borderColor`, `textColor`, `mutedColor`, `compress`; PDF also `font` (own TrueType loader), `lineHeight`, `cellPadding`, `author` |
|
|
64
|
+
| json | `keys` (`field` or `title`), `indent` |
|
|
65
|
+
| html | `title`, `subtitle`, `showDate`, `header`, `styles` (own CSS) |
|
|
66
|
+
| markdown | `title`, `header` |
|
|
67
|
+
| copy | `header`, `html` (also puts an HTML table on the clipboard so it pastes as a table) |
|
|
68
|
+
| print | `title`, `subtitle`, `showDate`, `header`, `pageSize`, `orientation`, `margin`, `styles` |
|
|
69
|
+
|
|
70
|
+
`provideTxExport(options)` sets defaults for the app or for one component subtree.
|
|
71
|
+
|
|
72
|
+
## Accessibility
|
|
73
|
+
|
|
74
|
+
Icon-only buttons are named by their tooltip. While an export runs the button spins, has `aria-busy` and ignores more clicks. After copying, the button shows a check, its name becomes "Table copied" and the text is announced.
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
|
|
78
|
+
- `TxExportService.export({ format, rows, fields, options })` runs an export from code; `buildExportTable`, `writeCsv`, `writeXlsx`, `writeDocx`, `writePdf`, `writeJson`, `writeHtml`, `writeMarkdown` and `zip` are exported for own flows. `tx-table` `exportCSV()` uses the same CSV writer.
|
|
79
|
+
- PDF uses a TrueType font without shaping, so scripts that need it (Arabic, Indic) need their own font through `pdf.font`, and right-to-left text is not reordered.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2021 The Onest Project Authors (https://github.com/googlefonts/onest)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Export font
|
|
2
|
+
|
|
3
|
+
Onest Regular and SemiBold (Latin and Cyrillic) for `tx-export` PDF files, as base64 strings: `TX_EXPORT_FONT`. The PDF writer loads this entry point only on the first PDF export, keeps only the glyphs a file uses and embeds them, so the text in the PDF is real, selectable and searchable.
|
|
4
|
+
|
|
5
|
+
Onest is © The Onest Project Authors, licensed under the SIL Open Font License 1.1 — see `OFL.txt` next to this file. Regenerate with `npm run export-font -- <folder of an Onest release>`.
|
|
6
|
+
|
|
7
|
+
To use another font (another script, a brand font), give the PDF options a loader: `{ pdf: { font: () => fetch('/fonts/brand.ttf').then((response) => response.arrayBuffer()).then((regular) => ({ regular })) } }`. TrueType outlines (`.ttf`) only.
|