@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A design system for Inglorious Web with render-function components and customizable themes",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -280,25 +280,27 @@
|
|
|
280
280
|
"**/*.css"
|
|
281
281
|
],
|
|
282
282
|
"peerDependencies": {
|
|
283
|
-
"@inglorious/charts": "
|
|
284
|
-
"@inglorious/
|
|
285
|
-
"@inglorious/
|
|
283
|
+
"@inglorious/charts": "5.0.1",
|
|
284
|
+
"@inglorious/web": "5.0.1",
|
|
285
|
+
"@inglorious/utils": "3.8.0"
|
|
286
286
|
},
|
|
287
287
|
"devDependencies": {
|
|
288
288
|
"@fontsource/material-symbols-outlined": "^5.2.36",
|
|
289
289
|
"@fortawesome/fontawesome-free": "^7.2.0",
|
|
290
|
-
"@storybook/addon-docs": "^10.
|
|
291
|
-
"@storybook/web-components-vite": "^10.
|
|
290
|
+
"@storybook/addon-docs": "^10.3.3",
|
|
291
|
+
"@storybook/web-components-vite": "^10.3.3",
|
|
292
292
|
"happy-dom": "^15.11.0",
|
|
293
293
|
"jsdom": "^25.0.0",
|
|
294
294
|
"lucide": "^0.575.0",
|
|
295
295
|
"prettier": "^3.6.2",
|
|
296
|
-
"storybook": "^10.
|
|
296
|
+
"storybook": "^10.3.3",
|
|
297
297
|
"vite": "^7.3.1",
|
|
298
298
|
"vitest": "^4.0.15",
|
|
299
299
|
"@inglorious/eslint-config": "1.1.2",
|
|
300
|
-
"@inglorious/
|
|
301
|
-
"@inglorious/web": "
|
|
300
|
+
"@inglorious/vite-plugin-jsx": "2.0.0",
|
|
301
|
+
"@inglorious/web": "5.0.1",
|
|
302
|
+
"@inglorious/store": "10.0.0",
|
|
303
|
+
"@inglorious/vite-plugin-vue": "1.0.1"
|
|
302
304
|
},
|
|
303
305
|
"engines": {
|
|
304
306
|
"node": ">= 22"
|
|
@@ -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 { Button } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Controls/Button",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Button),
|
|
10
10
|
argTypes: {
|
|
11
11
|
children: {
|
|
12
12
|
control: "text",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonGroup } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/ButtonGroup",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(ButtonGroup),
|
|
8
8
|
argTypes: {
|
|
9
9
|
value: {
|
|
10
10
|
control: "object",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { classMap, html, ref } from "@inglorious/web"
|
|
7
7
|
|
|
8
8
|
import { applyElementProps } from "../../shared/applyElementProps.js"
|
|
9
|
-
import {
|
|
9
|
+
import { Button } from "../button/index.js"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Renders a grouped set of buttons with optional single or multi selection.
|
|
@@ -69,7 +69,7 @@ export function render(props) {
|
|
|
69
69
|
? value === itemValue
|
|
70
70
|
: false
|
|
71
71
|
|
|
72
|
-
return
|
|
72
|
+
return Button.render({
|
|
73
73
|
children: html`
|
|
74
74
|
${icon ? html`<span class="iw-button-icon">${icon}</span>` : null}
|
|
75
75
|
${children ?? label}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Checkbox } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Checkbox",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Checkbox),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Label text." },
|
|
10
10
|
name: { control: "text", description: "Native HTML name attribute." },
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createEntityRender,
|
|
3
3
|
notifyActionArgType,
|
|
4
4
|
} from "../../stories/notifyStory.js"
|
|
5
|
-
import {
|
|
5
|
+
import { Combobox } from "./index.js"
|
|
6
6
|
|
|
7
7
|
const options = [
|
|
8
8
|
{ label: "Italy", value: "it" },
|
|
@@ -14,7 +14,7 @@ const options = [
|
|
|
14
14
|
export default {
|
|
15
15
|
title: "Controls/Combobox",
|
|
16
16
|
tags: ["autodocs"],
|
|
17
|
-
render: createEntityRender({
|
|
17
|
+
render: createEntityRender({ Combobox }),
|
|
18
18
|
argTypes: {
|
|
19
19
|
...notifyActionArgType,
|
|
20
20
|
label: { control: "text", description: "Field label." },
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
59
59
|
export const SingleClosed = {}
|
|
60
60
|
SingleClosed.args = {
|
|
61
61
|
id: "combobox",
|
|
62
|
-
type: "
|
|
62
|
+
type: "Combobox",
|
|
63
63
|
label: "Country",
|
|
64
64
|
selectedValue: "it",
|
|
65
65
|
isMulti: false,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as handlers from "./handlers.js"
|
|
2
2
|
import * as helpers from "./helpers.js"
|
|
3
|
-
import {
|
|
3
|
+
import { Combobox as renderers } from "./template.js"
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const Combobox = {
|
|
6
6
|
...handlers,
|
|
7
7
|
...renderers,
|
|
8
8
|
render(entity, api) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { classMap, html, ref, repeat, when } from "@inglorious/web"
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Chip } from "../../data-display/chip/index.js"
|
|
10
10
|
import {
|
|
11
11
|
filterOptions,
|
|
12
12
|
formatOption,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
|
|
18
18
|
const NO_FOCUSED_INDEX = -1
|
|
19
19
|
|
|
20
|
-
export const
|
|
20
|
+
export const Combobox = {
|
|
21
21
|
/**
|
|
22
22
|
* Main entrypoint for the combobox control. It renders the wrapper, label, control, and dropdown when open.
|
|
23
23
|
* Comboboxes support search, single or multi-select values, and clearable selection.
|
|
@@ -158,7 +158,7 @@ export const combobox = {
|
|
|
158
158
|
class="iw-combobox-multi-value-tag"
|
|
159
159
|
@click=${(event) => event.stopPropagation()}
|
|
160
160
|
>
|
|
161
|
-
${
|
|
161
|
+
${Chip.render({
|
|
162
162
|
id: tagId,
|
|
163
163
|
children: option ? getOptionLabel(option) : String(value),
|
|
164
164
|
isRemovable: true,
|
|
@@ -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 { Fab } from "."
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Controls/Fab",
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
render: createRender(
|
|
9
|
+
render: createRender(Fab),
|
|
10
10
|
argTypes: {
|
|
11
11
|
children: { control: "text", description: "Content of the FAB." },
|
|
12
12
|
color: {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { html } from "@inglorious/web"
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Button } from "../button/index.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Renders a floating action button for primary contextual actions.
|
|
@@ -22,7 +22,7 @@ export function render(props) {
|
|
|
22
22
|
...rest
|
|
23
23
|
} = props
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return Button.render({
|
|
26
26
|
...rest,
|
|
27
27
|
shape: isExtended ? "pill" : "round",
|
|
28
28
|
className:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { IconButton } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/IconButton",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(IconButton),
|
|
8
8
|
argTypes: {
|
|
9
9
|
icon: { control: "text", description: "Leading icon content." },
|
|
10
10
|
label: { control: "text", description: "Optional button label." },
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { html } from "@inglorious/web"
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Button } from "../button/index.js"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Renders a button optimized for icons with optional label and icon placement.
|
|
@@ -33,7 +33,7 @@ export function render(props) {
|
|
|
33
33
|
</span>
|
|
34
34
|
`
|
|
35
35
|
|
|
36
|
-
return
|
|
36
|
+
return Button.render({
|
|
37
37
|
...props,
|
|
38
38
|
children,
|
|
39
39
|
onClick,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Input } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Input",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Input),
|
|
8
8
|
argTypes: {
|
|
9
9
|
// ...notifyActionArgType,
|
|
10
10
|
label: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { RadioGroup } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/RadioGroup",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(RadioGroup),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Fieldset label." },
|
|
10
10
|
name: { control: "text", description: "Native radio input name." },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Rating } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Rating",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Rating),
|
|
8
8
|
argTypes: {
|
|
9
9
|
value: { control: "number", description: "Current rating value." },
|
|
10
10
|
max: { control: "number", description: "Maximum rating value." },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Select } from "./index.js"
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Select",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Select),
|
|
8
8
|
argTypes: {
|
|
9
9
|
name: {
|
|
10
10
|
control: "text",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Slider } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Slider",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Slider),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Field label." },
|
|
10
10
|
name: { control: "text", description: "Native input name." },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Switch } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Controls/Switch",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Switch),
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: { control: "text", description: "Label text." },
|
|
10
10
|
name: { control: "text", description: "Native input name." },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Avatar } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/Avatar",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Avatar),
|
|
8
8
|
argTypes: {
|
|
9
9
|
src: {
|
|
10
10
|
control: "text",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Badge } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/Badge",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Badge),
|
|
8
8
|
argTypes: {
|
|
9
9
|
children: { control: "text", description: "Badge content." },
|
|
10
10
|
color: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRender } from "../../stories/notifyStory.js"
|
|
2
|
-
import {
|
|
2
|
+
import { Chip } from "."
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Data Display/Chip",
|
|
6
6
|
tags: ["autodocs"],
|
|
7
|
-
render: createRender(
|
|
7
|
+
render: createRender(Chip),
|
|
8
8
|
argTypes: {
|
|
9
9
|
children: { control: "text", description: "Chip label content." },
|
|
10
10
|
isRemovable: {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createEntityRender,
|
|
3
3
|
notifyActionArgType,
|
|
4
4
|
} from "../../stories/notifyStory.js"
|
|
5
|
-
import {
|
|
5
|
+
import { DataGrid } from "."
|
|
6
6
|
|
|
7
7
|
const baseRows = [
|
|
8
8
|
{ id: 1, name: "Charlie", age: 35, active: true, role: "Admin" },
|
|
@@ -57,7 +57,7 @@ function createRows(count) {
|
|
|
57
57
|
export default {
|
|
58
58
|
title: "Data Display/DataGrid",
|
|
59
59
|
tags: ["autodocs"],
|
|
60
|
-
render: createEntityRender({
|
|
60
|
+
render: createEntityRender({ DataGrid }),
|
|
61
61
|
argTypes: {
|
|
62
62
|
...notifyActionArgType,
|
|
63
63
|
id: { control: "text", description: "Optional grid id" },
|
|
@@ -75,7 +75,7 @@ export default {
|
|
|
75
75
|
export const Default = {
|
|
76
76
|
args: {
|
|
77
77
|
id: "dataGrid",
|
|
78
|
-
type: "
|
|
78
|
+
type: "DataGrid",
|
|
79
79
|
rows: baseRows,
|
|
80
80
|
columns: baseColumns,
|
|
81
81
|
search: {},
|
|
@@ -130,7 +130,7 @@ export const FlexibleWidths = {
|
|
|
130
130
|
export const Virtualized = {
|
|
131
131
|
args: {
|
|
132
132
|
id: "virtualizedGrid",
|
|
133
|
-
type: "
|
|
133
|
+
type: "DataGrid",
|
|
134
134
|
rows: createRows(1000),
|
|
135
135
|
columns: baseColumns,
|
|
136
136
|
search: null,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { choose, html } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { InputFilter } from "./input.js"
|
|
4
|
+
import { RangeFilter } from "./range.js"
|
|
5
|
+
import { SelectFilter } from "./select.js"
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const Filters = {
|
|
8
8
|
render(entity, column) {
|
|
9
9
|
return html`${choose(
|
|
10
10
|
column.filter.type,
|
|
11
11
|
[
|
|
12
|
-
["range", () =>
|
|
13
|
-
["date", () =>
|
|
14
|
-
["time", () =>
|
|
15
|
-
["datetime", () =>
|
|
16
|
-
["select", () =>
|
|
12
|
+
["range", () => RangeFilter.render(entity, column)],
|
|
13
|
+
["date", () => RangeFilter.render(entity, column)],
|
|
14
|
+
["time", () => RangeFilter.render(entity, column)],
|
|
15
|
+
["datetime", () => RangeFilter.render(entity, column)],
|
|
16
|
+
["select", () => SelectFilter.render(entity, column)],
|
|
17
17
|
],
|
|
18
|
-
() =>
|
|
18
|
+
() => InputFilter.render(entity, column),
|
|
19
19
|
)}`
|
|
20
20
|
},
|
|
21
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Input } from "../../../controls/input"
|
|
2
2
|
import { format } from "./helpers"
|
|
3
3
|
|
|
4
4
|
const DEFAULT_PLACEHOLDER = {
|
|
@@ -6,9 +6,9 @@ const DEFAULT_PLACEHOLDER = {
|
|
|
6
6
|
text: "Contains...",
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const
|
|
9
|
+
export const InputFilter = {
|
|
10
10
|
render(entity, column) {
|
|
11
|
-
return
|
|
11
|
+
return Input.render({
|
|
12
12
|
name: column.id,
|
|
13
13
|
inputType: column.filter.type,
|
|
14
14
|
placeholder:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from "@inglorious/web"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Input } from "../../../controls/input"
|
|
4
4
|
import { format } from "./helpers"
|
|
5
5
|
|
|
6
6
|
const RANGE_TYPE = {
|
|
@@ -10,10 +10,10 @@ const RANGE_TYPE = {
|
|
|
10
10
|
datetime: "datetime-local",
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const RangeFilter = {
|
|
14
14
|
render(entity, column) {
|
|
15
15
|
return html`<div class="iw-data-grid-filter-range">
|
|
16
|
-
${
|
|
16
|
+
${Input.render({
|
|
17
17
|
name: `${column.id}Min`,
|
|
18
18
|
inputType: RANGE_TYPE[column.filter.type],
|
|
19
19
|
placeholder: column.filter.placeholder ?? "≥",
|
|
@@ -28,7 +28,7 @@ export const rangeFilter = {
|
|
|
28
28
|
})
|
|
29
29
|
},
|
|
30
30
|
})}
|
|
31
|
-
${
|
|
31
|
+
${Input.render({
|
|
32
32
|
name: `${column.id}Max`,
|
|
33
33
|
inputType: RANGE_TYPE[column.filter.type],
|
|
34
34
|
placeholder: column.filter.placeholder ?? "≤",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Select } from "../../../controls/select"
|
|
2
2
|
import { format } from "./helpers"
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const SelectFilter = {
|
|
5
5
|
render(entity, column) {
|
|
6
|
-
return
|
|
6
|
+
return Select.render({
|
|
7
7
|
name: column.id,
|
|
8
8
|
size: "sm",
|
|
9
9
|
isFullWidth: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as handlers from "./handlers.js"
|
|
2
2
|
import * as helpers from "./helpers.js"
|
|
3
|
-
import {
|
|
3
|
+
import { DataGrid as renderers } from "./template.js"
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const DataGrid = {
|
|
6
6
|
...handlers,
|
|
7
7
|
...renderers,
|
|
8
8
|
render(entity, api) {
|