@inglorious/ui 1.0.2 → 2.0.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/package.json +11 -9
- package/src/controls/button/button.stories.js +2 -2
- package/src/controls/button/index.js +1 -1
- package/src/controls/button-group/button-group.stories.js +2 -2
- package/src/controls/button-group/index.js +1 -1
- package/src/controls/button-group/template.js +2 -2
- package/src/controls/checkbox/checkbox.stories.js +2 -2
- package/src/controls/checkbox/index.js +1 -1
- package/src/controls/combobox/combobox.stories.js +3 -3
- package/src/controls/combobox/index.js +2 -2
- package/src/controls/combobox/template.js +3 -3
- package/src/controls/fab/fab.stories.js +2 -2
- package/src/controls/fab/index.js +1 -1
- package/src/controls/fab/template.js +2 -2
- package/src/controls/icon-button/icon-button.stories.js +2 -2
- package/src/controls/icon-button/index.js +1 -1
- package/src/controls/icon-button/template.js +2 -2
- package/src/controls/input/index.js +1 -1
- package/src/controls/input/input.stories.js +2 -2
- package/src/controls/radio-group/index.js +1 -1
- package/src/controls/radio-group/radio-group.stories.js +2 -2
- package/src/controls/rating/index.js +1 -1
- package/src/controls/rating/rating.stories.js +2 -2
- package/src/controls/select/index.js +1 -1
- package/src/controls/select/select.stories.js +2 -2
- package/src/controls/slider/index.js +1 -1
- package/src/controls/slider/slider.stories.js +2 -2
- package/src/controls/switch/index.js +1 -1
- package/src/controls/switch/switch.stories.js +2 -2
- package/src/data-display/avatar/avatar.stories.js +2 -2
- package/src/data-display/avatar/index.js +1 -1
- package/src/data-display/badge/badge.stories.js +2 -2
- package/src/data-display/badge/index.js +1 -1
- package/src/data-display/chip/chip.stories.js +2 -2
- package/src/data-display/chip/index.js +1 -1
- package/src/data-display/data-grid/data-grid.stories.js +4 -4
- package/src/data-display/data-grid/filters/index.js +10 -10
- package/src/data-display/data-grid/filters/input.js +3 -3
- package/src/data-display/data-grid/filters/range.js +4 -4
- package/src/data-display/data-grid/filters/select.js +3 -3
- package/src/data-display/data-grid/index.js +2 -2
- package/src/data-display/data-grid/template.js +16 -16
- package/src/data-display/divider/divider.stories.js +2 -2
- package/src/data-display/divider/index.js +1 -1
- package/src/data-display/icon/icon-implementations.mdx +4 -4
- package/src/data-display/icon/icon-utf8.stories.js +9 -9
- package/src/data-display/icon/icon.stories.js +2 -2
- package/src/data-display/icon/index.js +1 -1
- package/src/data-display/list/index.js +2 -2
- package/src/data-display/list/list.stories.js +2 -2
- package/src/data-display/list/template.js +8 -8
- package/src/data-display/material-icon/index.js +1 -1
- package/src/data-display/material-icon/material-icon.stories.js +2 -2
- package/src/data-display/table/index.js +1 -1
- package/src/data-display/table/table.stories.js +2 -2
- package/src/data-display/table/template.js +1 -1
- package/src/data-display/tooltip/index.js +1 -1
- package/src/data-display/tooltip/tooltip.stories.js +2 -2
- package/src/data-display/typography/index.js +1 -1
- package/src/data-display/typography/typography.stories.js +2 -2
- package/src/data-display/virtual-list/index.js +1 -1
- package/src/examples/dashboard/app-drawer.js +15 -15
- package/src/examples/dashboard/app-header.js +33 -33
- package/src/examples/dashboard/dashboard-jsx.jsx +76 -0
- package/src/examples/dashboard/dashboard-vue.vue +68 -0
- package/src/examples/dashboard/dashboard.js +43 -42
- package/src/examples/dashboard/dashboard.stories.js +46 -16
- package/src/examples/dashboard/mode.js +1 -1
- package/src/examples/dashboard/primitive-content.js +248 -248
- package/src/examples/dashboard/primitive-section.js +25 -25
- package/src/examples/dashboard/router.js +1 -1
- package/src/examples/dashboard/social-card.js +14 -14
- package/src/examples/dashboard/stat-card.js +12 -12
- package/src/examples/dashboard/theme.js +1 -1
- package/src/examples/dashboard/traffic-card.js +22 -22
- package/src/examples/dashboard/traffic-sales-card.js +39 -39
- package/src/feedback/alert/alert.stories.js +2 -2
- package/src/feedback/alert/index.js +2 -2
- package/src/feedback/backdrop/backdrop.stories.js +2 -2
- package/src/feedback/backdrop/index.js +2 -2
- package/src/feedback/dialog/dialog.stories.js +2 -2
- package/src/feedback/dialog/index.js +2 -2
- package/src/feedback/progress/index.js +1 -1
- package/src/feedback/progress/progress.stories.js +2 -2
- package/src/feedback/progress/template.js +1 -1
- package/src/feedback/skeleton/index.js +2 -2
- package/src/feedback/skeleton/skeleton.stories.js +2 -2
- package/src/feedback/snackbar/index.js +2 -2
- package/src/feedback/snackbar/snackbar.stories.js +2 -2
- package/src/index.js +45 -45
- package/src/layout/container/container.stories.js +3 -3
- package/src/layout/container/index.js +1 -1
- package/src/layout/flex/flex.stories.js +2 -2
- package/src/layout/flex/index.js +1 -1
- package/src/layout/grid/grid.stories.js +2 -2
- package/src/layout/grid/index.js +1 -1
- package/src/navigation/bottom-navigation/bottom-navigation.stories.js +2 -2
- package/src/navigation/bottom-navigation/index.js +1 -1
- package/src/navigation/bottom-navigation/template.js +2 -2
- package/src/navigation/breadcrumbs/breadcrumbs.stories.js +2 -2
- package/src/navigation/breadcrumbs/index.js +1 -1
- package/src/navigation/breadcrumbs/template.js +2 -2
- package/src/navigation/drawer/drawer.stories.js +2 -2
- package/src/navigation/drawer/index.js +1 -1
- package/src/navigation/drawer/template.js +13 -13
- package/src/navigation/link/index.js +2 -2
- package/src/navigation/link/link.stories.js +2 -2
- package/src/navigation/menu/index.js +1 -1
- package/src/navigation/menu/menu.stories.js +2 -2
- package/src/navigation/menu/template.js +1 -1
- package/src/navigation/pagination/index.js +1 -1
- package/src/navigation/pagination/pagination.stories.js +2 -2
- package/src/navigation/pagination/template.js +4 -4
- package/src/navigation/speed-dial/index.js +1 -1
- package/src/navigation/speed-dial/speed-dial.stories.js +2 -2
- package/src/navigation/speed-dial/template.js +1 -1
- package/src/navigation/stepper/index.js +1 -1
- package/src/navigation/stepper/stepper.stories.js +2 -2
- package/src/navigation/stepper/template.js +1 -1
- package/src/navigation/tabs/index.js +1 -1
- package/src/navigation/tabs/tabs.stories.js +2 -2
- package/src/navigation/tabs/template.js +1 -1
- package/src/surfaces/accordion/accordion.stories.js +2 -2
- package/src/surfaces/accordion/index.js +1 -1
- package/src/surfaces/accordion/template.js +1 -1
- package/src/surfaces/app-bar/app-bar.stories.js +2 -2
- package/src/surfaces/app-bar/index.js +1 -1
- package/src/surfaces/card/card.stories.js +2 -2
- package/src/surfaces/card/index.js +1 -1
- package/src/surfaces/card/template.js +1 -1
- package/src/surfaces/paper/index.js +2 -2
- package/src/surfaces/paper/paper.stories.js +3 -3
- package/types/controls/button-group.d.ts +1 -1
- package/types/controls/button.d.ts +2 -2
- package/types/controls/checkbox.d.ts +1 -1
- package/types/controls/combobox.d.ts +1 -1
- package/types/controls/fab.d.ts +1 -1
- package/types/controls/icon-button.d.ts +1 -1
- package/types/controls/input.d.ts +1 -1
- package/types/controls/radio-group.d.ts +1 -1
- package/types/controls/rating.d.ts +1 -1
- package/types/controls/select.d.ts +1 -1
- package/types/controls/slider.d.ts +1 -1
- package/types/controls/switch.d.ts +1 -1
- package/types/data-display/avatar.d.ts +1 -1
- package/types/data-display/badge.d.ts +1 -1
- package/types/data-display/chip.d.ts +1 -1
- package/types/data-display/divider.d.ts +1 -1
- package/types/data-display/icon.d.ts +1 -1
- package/types/data-display/list.d.ts +1 -1
- package/types/data-display/material-icon.d.ts +1 -1
- package/types/data-display/table.d.ts +1 -1
- package/types/data-display/tooltip.d.ts +1 -1
- package/types/data-display/typography.d.ts +1 -1
- package/types/data-display/virtual-list.d.ts +1 -1
- package/types/feedback/alert.d.ts +1 -1
- package/types/feedback/backdrop.d.ts +1 -1
- package/types/feedback/dialog.d.ts +1 -1
- package/types/feedback/progress.d.ts +1 -1
- package/types/feedback/skeleton.d.ts +1 -1
- package/types/feedback/snackbar.d.ts +1 -1
- package/types/layout/container.d.ts +1 -1
- package/types/layout/flex.d.ts +1 -1
- package/types/layout/grid.d.ts +1 -1
- package/types/navigation/bottom-navigation.d.ts +1 -1
- package/types/navigation/breadcrumbs.d.ts +1 -1
- package/types/navigation/drawer.d.ts +1 -1
- package/types/navigation/link.d.ts +1 -1
- package/types/navigation/menu.d.ts +1 -1
- package/types/navigation/pagination.d.ts +1 -1
- package/types/navigation/speed-dial.d.ts +1 -1
- package/types/navigation/stepper.d.ts +1 -1
- package/types/navigation/tabs.d.ts +1 -1
- package/types/surfaces/accordion.d.ts +1 -1
- package/types/surfaces/app-bar.d.ts +1 -1
- package/types/surfaces/card.d.ts +1 -1
- package/types/surfaces/paper.d.ts +1 -1
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import { classMap, html, repeat, when } from "@inglorious/web"
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { Input } from "../../controls/input/index.js"
|
|
11
|
+
import { Select } from "../../controls/select/index.js"
|
|
12
|
+
import { Pagination } from "../../navigation/pagination/index.js"
|
|
13
|
+
import { VirtualList } from "../virtual-list/index.js"
|
|
14
|
+
import { Filters } from "./filters"
|
|
15
15
|
import {
|
|
16
16
|
getPaginationInfo,
|
|
17
17
|
getRowKeyValue,
|
|
@@ -25,7 +25,7 @@ const PRETTY_PAGE = 1
|
|
|
25
25
|
const FIRST_PAGE = 0
|
|
26
26
|
const LAST_PAGE = 1
|
|
27
27
|
|
|
28
|
-
export const
|
|
28
|
+
export const DataGrid = {
|
|
29
29
|
/**
|
|
30
30
|
* Main entrypoint for the data grid template. It delegates to the base grid renderer so overrides can still reuse it.
|
|
31
31
|
* Data grids support sorting, filtering, selection, pagination, and optional virtualization.
|
|
@@ -108,7 +108,7 @@ export const dataGrid = {
|
|
|
108
108
|
${column.title} ${getSortIcon(getSortDirection(props, column.id))}
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
|
-
${column.isFilterable &&
|
|
111
|
+
${column.isFilterable && Filters.render(props, column)}
|
|
112
112
|
|
|
113
113
|
<div
|
|
114
114
|
class="iw-data-grid-column-resizer"
|
|
@@ -130,7 +130,7 @@ export const dataGrid = {
|
|
|
130
130
|
*/
|
|
131
131
|
renderSearchbar(props) {
|
|
132
132
|
return html`<div class="iw-data-grid-searchbar">
|
|
133
|
-
${
|
|
133
|
+
${Input.render({
|
|
134
134
|
size: "sm",
|
|
135
135
|
isFullWidth: true,
|
|
136
136
|
name: "search",
|
|
@@ -164,7 +164,7 @@ export const dataGrid = {
|
|
|
164
164
|
const virtualState = getVirtualizationState(props, rows.length)
|
|
165
165
|
const virtualEntity = {
|
|
166
166
|
id: props.id,
|
|
167
|
-
type: "
|
|
167
|
+
type: "DataGridVirtualRows",
|
|
168
168
|
items: rows,
|
|
169
169
|
className: "iw-data-grid-body",
|
|
170
170
|
scrollTop: virtualState.scrollTop,
|
|
@@ -190,7 +190,7 @@ export const dataGrid = {
|
|
|
190
190
|
}),
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
return
|
|
193
|
+
return VirtualList.render(virtualEntity, virtualApi)
|
|
194
194
|
},
|
|
195
195
|
|
|
196
196
|
/**
|
|
@@ -300,7 +300,7 @@ export const dataGrid = {
|
|
|
300
300
|
*/
|
|
301
301
|
renderPagination(props, paginationInfo) {
|
|
302
302
|
return html`<div class="iw-data-grid-row">
|
|
303
|
-
${
|
|
303
|
+
${Pagination.renderControl(
|
|
304
304
|
{
|
|
305
305
|
buttonSize: "sm",
|
|
306
306
|
buttonVariant: "outline",
|
|
@@ -313,7 +313,7 @@ export const dataGrid = {
|
|
|
313
313
|
onChange: () => props.onPageChange?.(FIRST_PAGE),
|
|
314
314
|
},
|
|
315
315
|
)}
|
|
316
|
-
${
|
|
316
|
+
${Pagination.renderControl(
|
|
317
317
|
{
|
|
318
318
|
buttonSize: "sm",
|
|
319
319
|
buttonVariant: "outline",
|
|
@@ -326,7 +326,7 @@ export const dataGrid = {
|
|
|
326
326
|
onChange: () => props.onPagePrev?.(),
|
|
327
327
|
},
|
|
328
328
|
)}
|
|
329
|
-
${
|
|
329
|
+
${Input.render({
|
|
330
330
|
name: "page",
|
|
331
331
|
size: "sm",
|
|
332
332
|
inputType: "number",
|
|
@@ -337,7 +337,7 @@ export const dataGrid = {
|
|
|
337
337
|
})}
|
|
338
338
|
/
|
|
339
339
|
<span>${paginationInfo.totalPages}</span>
|
|
340
|
-
${
|
|
340
|
+
${Pagination.renderControl(
|
|
341
341
|
{
|
|
342
342
|
buttonSize: "sm",
|
|
343
343
|
buttonVariant: "outline",
|
|
@@ -350,7 +350,7 @@ export const dataGrid = {
|
|
|
350
350
|
onChange: () => props.onPageNext?.(),
|
|
351
351
|
},
|
|
352
352
|
)}
|
|
353
|
-
${
|
|
353
|
+
${Pagination.renderControl(
|
|
354
354
|
{
|
|
355
355
|
buttonSize: "sm",
|
|
356
356
|
buttonVariant: "outline",
|
|
@@ -370,7 +370,7 @@ export const dataGrid = {
|
|
|
370
370
|
renderPageSize(props, pagination) {
|
|
371
371
|
return html`<div class="iw-data-grid-footer-row">
|
|
372
372
|
<div>Page size:</div>
|
|
373
|
-
${
|
|
373
|
+
${Select.render({
|
|
374
374
|
size: "sm",
|
|
375
375
|
value: pagination.pageSize,
|
|
376
376
|
options: pagination.pageSizes,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { render } from "@inglorious/web/test"
|
|
2
2
|
|
|
3
3
|
import { createRender } from "../../stories/notifyStory.js"
|
|
4
|
-
import {
|
|
4
|
+
import { Divider } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Data Display/Divider",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Divider),
|
|
10
10
|
argTypes: {
|
|
11
11
|
orientation: {
|
|
12
12
|
control: "select",
|
|
@@ -83,13 +83,13 @@ Use this page as a quick reference for supported icon strategies in `@inglorious
|
|
|
83
83
|
<div className="iw-icon-tab-panels">
|
|
84
84
|
<section className="iw-icon-tab-panel iw-icon-tab-panel-generic">
|
|
85
85
|
<p>Use <code>@inglorious/ui/icon</code> for glyphs, emoji, and simple symbols. Reference: <a href="/?path=/story/data-display-icon--unicode">UTF-8 Icons</a></p>
|
|
86
|
-
<pre><code>{`
|
|
86
|
+
<pre><code>{`Icon.render({ children: "★", size: "md", color: "primary" })`}</code></pre>
|
|
87
87
|
<div className="iw-icon-example">★ ⚑ ♫</div>
|
|
88
88
|
</section>
|
|
89
89
|
|
|
90
90
|
<section className="iw-icon-tab-panel iw-icon-tab-panel-svg">
|
|
91
91
|
<p>Use inline SVG when you want a custom icon pack without font dependencies.</p>
|
|
92
|
-
<pre><code>{`
|
|
92
|
+
<pre><code>{`Icon.render({
|
|
93
93
|
children: html\`<svg viewBox="0 0 24 24" ...>...</svg>\`,
|
|
94
94
|
size: "md",
|
|
95
95
|
})`}</code></pre>
|
|
@@ -109,7 +109,7 @@ Use this page as a quick reference for supported icon strategies in `@inglorious
|
|
|
109
109
|
|
|
110
110
|
<section className="iw-icon-tab-panel iw-icon-tab-panel-material">
|
|
111
111
|
<p>Use <code>@inglorious/ui/material-icon</code> when Material Symbols fonts are loaded. Reference: <a href="https://fonts.google.com/icons?icon.set=Material+Icons" target="_blank">Material Icons</a></p>
|
|
112
|
-
<pre><code>{`
|
|
112
|
+
<pre><code>{`MaterialIcon.render({ name: "home", filled: true, size: "md" })`}</code></pre>
|
|
113
113
|
<div className="iw-icon-example">
|
|
114
114
|
<span className="iw-material-symbol" aria-hidden="true">home</span>
|
|
115
115
|
<span className="iw-material-symbol" aria-hidden="true">settings</span>
|
|
@@ -119,7 +119,7 @@ Use this page as a quick reference for supported icon strategies in `@inglorious
|
|
|
119
119
|
|
|
120
120
|
<section className="iw-icon-tab-panel iw-icon-tab-panel-fa">
|
|
121
121
|
<p>Load Font Awesome CSS globally, then pass an icon element as <code>children</code>. Reference: <a href="https://fontawesome.com/search" target="_blank">Font Awesome Icons</a></p>
|
|
122
|
-
<pre><code>{`
|
|
122
|
+
<pre><code>{`Icon.render({
|
|
123
123
|
children: html\`<i class="fa-solid fa-user" aria-hidden="true"></i>\`,
|
|
124
124
|
})`}</code></pre>
|
|
125
125
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VirtualList } from "@inglorious/ui/virtual-list"
|
|
2
2
|
import { html, repeat } from "@inglorious/web"
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Button } from "../../controls/button"
|
|
5
5
|
import {
|
|
6
6
|
createEntityRender,
|
|
7
7
|
notifyActionArgType,
|
|
8
8
|
} from "../../stories/notifyStory.js"
|
|
9
|
-
import {
|
|
9
|
+
import { Icon } from "."
|
|
10
10
|
|
|
11
11
|
const unicodeList = {
|
|
12
|
-
...
|
|
12
|
+
...VirtualList,
|
|
13
13
|
|
|
14
14
|
create(entity) {
|
|
15
|
-
|
|
15
|
+
VirtualList.create(entity)
|
|
16
16
|
|
|
17
17
|
const items = []
|
|
18
18
|
let rowIndex = 0
|
|
@@ -35,7 +35,7 @@ const unicodeList = {
|
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
render(entity, api) {
|
|
38
|
-
return
|
|
38
|
+
return VirtualList.render(entity, {
|
|
39
39
|
...api,
|
|
40
40
|
getType: () => unicodeList,
|
|
41
41
|
})
|
|
@@ -64,7 +64,7 @@ const unicodeList = {
|
|
|
64
64
|
.toUpperCase()
|
|
65
65
|
.padStart(4, "0")}`
|
|
66
66
|
|
|
67
|
-
return
|
|
67
|
+
return Button.render({
|
|
68
68
|
id: code,
|
|
69
69
|
variant: "ghost",
|
|
70
70
|
color: "default",
|
|
@@ -72,7 +72,7 @@ const unicodeList = {
|
|
|
72
72
|
shape: "square",
|
|
73
73
|
ariaLabel: label,
|
|
74
74
|
onClick: () => copyGlyph(glyph),
|
|
75
|
-
children:
|
|
75
|
+
children: Icon.render({
|
|
76
76
|
children: glyph,
|
|
77
77
|
size,
|
|
78
78
|
color: "current",
|
|
@@ -128,7 +128,7 @@ export default {
|
|
|
128
128
|
export const Unicode = {
|
|
129
129
|
args: {
|
|
130
130
|
id: "unicodeList",
|
|
131
|
-
type: "
|
|
131
|
+
type: "UnicodeList",
|
|
132
132
|
start: 0,
|
|
133
133
|
end: 129799,
|
|
134
134
|
columns: 20,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/Icon",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Icon),
|
|
8
8
|
argTypes: {
|
|
9
9
|
children: { control: "text", description: "Icon glyph or inline content." },
|
|
10
10
|
size: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { List } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/List",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(List),
|
|
8
8
|
argTypes: {
|
|
9
9
|
items: {
|
|
10
10
|
control: "object",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
|
|
22
22
|
import { classMap, html, ref, repeat, when } from "@inglorious/web"
|
|
23
23
|
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { IconButton } from "../../controls/icon-button"
|
|
25
|
+
import { Flex } from "../../layout/flex"
|
|
26
26
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
27
27
|
|
|
28
28
|
const PRETTY_INDEX = 1
|
|
29
29
|
|
|
30
|
-
export const
|
|
30
|
+
export const List = {
|
|
31
31
|
/**
|
|
32
32
|
* Main entrypoint for the list component. It delegates to the base list renderer so overrides can reuse it.
|
|
33
33
|
* Lists support ordered/unordered modes, nested items, and optional dividers.
|
|
@@ -158,7 +158,7 @@ export const list = {
|
|
|
158
158
|
.filter(Boolean)
|
|
159
159
|
.join(" ")
|
|
160
160
|
|
|
161
|
-
return
|
|
161
|
+
return Flex.render({
|
|
162
162
|
element: "li",
|
|
163
163
|
padding: "sm",
|
|
164
164
|
direction: "column",
|
|
@@ -170,12 +170,12 @@ export const list = {
|
|
|
170
170
|
props.onItemClick?.(raw ?? item, path)
|
|
171
171
|
},
|
|
172
172
|
children: [
|
|
173
|
-
|
|
173
|
+
Flex.render({
|
|
174
174
|
align: "center",
|
|
175
175
|
gap: "sm",
|
|
176
176
|
children: [
|
|
177
177
|
when(icon, () =>
|
|
178
|
-
|
|
178
|
+
IconButton.render({
|
|
179
179
|
icon,
|
|
180
180
|
size: "sm",
|
|
181
181
|
color: "secondary",
|
|
@@ -184,7 +184,7 @@ export const list = {
|
|
|
184
184
|
className: "iw-list-item-icon",
|
|
185
185
|
}),
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
Flex.render({
|
|
188
188
|
direction: "column",
|
|
189
189
|
gap: "sm",
|
|
190
190
|
className: "iw-list-item-content",
|
|
@@ -204,7 +204,7 @@ export const list = {
|
|
|
204
204
|
() =>
|
|
205
205
|
html`<span class="iw-list-item-trailing">
|
|
206
206
|
${when(hasChildren, () =>
|
|
207
|
-
|
|
207
|
+
IconButton.render({
|
|
208
208
|
variant: "ghost",
|
|
209
209
|
color: "secondary",
|
|
210
210
|
size: "sm",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html, repeat } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { MaterialIcon } from "."
|
|
4
4
|
|
|
5
5
|
const materialIcons = [
|
|
6
6
|
"search",
|
|
@@ -87,7 +87,7 @@ export const Gallery = {
|
|
|
87
87
|
materialIcons,
|
|
88
88
|
(name) => name,
|
|
89
89
|
(name) =>
|
|
90
|
-
|
|
90
|
+
MaterialIcon.render({
|
|
91
91
|
name,
|
|
92
92
|
size,
|
|
93
93
|
isFilled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Table } from "./template.js"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Table } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/Table",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Table),
|
|
8
8
|
argTypes: {
|
|
9
9
|
columns: { control: "object", description: "Column definitions." },
|
|
10
10
|
rows: { control: "object", description: "Row records." },
|
|
@@ -11,7 +11,7 @@ import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
|
11
11
|
const EVEN_ROW_DIVISOR = 2
|
|
12
12
|
const STRIPED_OFFSET = 1
|
|
13
13
|
|
|
14
|
-
export const
|
|
14
|
+
export const Table = {
|
|
15
15
|
/**
|
|
16
16
|
* Main entrypoint for the table component. It delegates to the base table renderer so overrides can reuse it.
|
|
17
17
|
* Tables render columns and rows and can be striped or full width.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { html } from "@inglorious/web"
|
|
2
2
|
|
|
3
3
|
import { createRender } from "../../stories/notifyStory.js"
|
|
4
|
-
import {
|
|
4
|
+
import { Tooltip } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Data Display/Tooltip",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Tooltip),
|
|
10
10
|
argTypes: {
|
|
11
11
|
content: { control: "text", description: "Tooltip text." },
|
|
12
12
|
position: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Typography } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/Typography",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Typography),
|
|
8
8
|
argTypes: {
|
|
9
9
|
children: { control: "text", description: "Text content." },
|
|
10
10
|
variant: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { html } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
export const
|
|
3
|
+
import { Avatar } from "../../data-display/avatar"
|
|
4
|
+
import { Badge } from "../../data-display/badge"
|
|
5
|
+
import { List } from "../../data-display/list"
|
|
6
|
+
import { MaterialIcon } from "../../data-display/material-icon"
|
|
7
|
+
import { Flex } from "../../layout/flex"
|
|
8
|
+
import { Drawer } from "../../navigation/drawer"
|
|
9
|
+
|
|
10
|
+
export const AppDrawer = {
|
|
11
11
|
create(entity) {
|
|
12
12
|
entity.items ??= getDefaultItems()
|
|
13
13
|
},
|
|
@@ -32,23 +32,23 @@ export const appDrawer = {
|
|
|
32
32
|
render(entity, api) {
|
|
33
33
|
const items = mapItemsForRender(entity.items ?? [], api)
|
|
34
34
|
|
|
35
|
-
return
|
|
35
|
+
return Drawer.render({
|
|
36
36
|
...entity,
|
|
37
37
|
anchor: "left",
|
|
38
38
|
onClose: () => api.notify(`#${entity.id}:toggle`),
|
|
39
39
|
onCollapseToggle: () => api.notify(`#${entity.id}:collapseToggle`),
|
|
40
|
-
title:
|
|
40
|
+
title: Flex.render({
|
|
41
41
|
align: "center",
|
|
42
42
|
gap: "sm",
|
|
43
43
|
padding: "md",
|
|
44
44
|
className: "iw-dashboard-brand",
|
|
45
45
|
children: [
|
|
46
|
-
|
|
46
|
+
Avatar.render({ src: "/transparent.png", shape: "square" }),
|
|
47
47
|
html`<span class="iw-dashboard-brand-title">Inglorious UI</span>`,
|
|
48
48
|
],
|
|
49
49
|
}),
|
|
50
50
|
children: html`
|
|
51
|
-
${
|
|
51
|
+
${List.render({
|
|
52
52
|
isInset: true,
|
|
53
53
|
padding: "sm",
|
|
54
54
|
items,
|
|
@@ -67,18 +67,18 @@ function mapItemsForRender(items, api) {
|
|
|
67
67
|
const mappedItem = { ...item }
|
|
68
68
|
|
|
69
69
|
if (item.icon) {
|
|
70
|
-
mappedItem.icon =
|
|
70
|
+
mappedItem.icon = MaterialIcon.render({ name: item.icon, size: "lg" })
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
if (item.badge) {
|
|
74
|
-
mappedItem.action =
|
|
74
|
+
mappedItem.action = Badge.render(item.badge)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
if (item.href) {
|
|
78
78
|
mappedItem.onClick = () => api.notify("#router:navigate", item.href)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
if (router
|
|
81
|
+
if (router?.path === item.href) {
|
|
82
82
|
mappedItem.isSelected = true
|
|
83
83
|
}
|
|
84
84
|
|