@redvars/peacock 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseButton-BNFAYn-S.js +219 -0
- package/dist/BaseButton-BNFAYn-S.js.map +1 -0
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js +65 -0
- package/dist/BaseHyperlinkMixin-BNuwbiEf.js.map +1 -0
- package/dist/BaseInput-14YmcfK7.js +27 -0
- package/dist/BaseInput-14YmcfK7.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/banner.js +14 -30
- package/dist/banner.js.map +1 -1
- package/dist/{button-DMN1dPAg.js → button-colors-Ccys3hvS.js} +5 -468
- package/dist/button-colors-Ccys3hvS.js.map +1 -0
- package/dist/button-group.js +228 -8
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +294 -8
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +634 -0
- package/dist/calendar-column-view.js.map +1 -0
- package/dist/calendar-event-BrQ_SEKD.js +199 -0
- package/dist/calendar-event-BrQ_SEKD.js.map +1 -0
- package/dist/calendar-month-view.js +376 -0
- package/dist/calendar-month-view.js.map +1 -0
- package/dist/calendar.js +339 -0
- package/dist/calendar.js.map +1 -0
- package/dist/canvas.js +361 -0
- package/dist/canvas.js.map +1 -0
- package/dist/card.js +18 -73
- package/dist/card.js.map +1 -1
- package/dist/cb-compound-expression.js +125 -0
- package/dist/cb-compound-expression.js.map +1 -0
- package/dist/cb-divider.js +150 -0
- package/dist/cb-divider.js.map +1 -0
- package/dist/cb-expression.js +75 -0
- package/dist/cb-expression.js.map +1 -0
- package/dist/cb-predicate.js +137 -0
- package/dist/cb-predicate.js.map +1 -0
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-doughnut.js +2 -2
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +2 -2
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js.map +1 -1
- package/dist/code-editor.js +2 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +2 -1
- package/dist/code-highlighter.js.map +1 -1
- package/dist/condition-builder.js +58 -0
- package/dist/condition-builder.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +10860 -5567
- package/dist/custom-elements.json +16180 -7996
- package/dist/dropdown-button.js +216 -0
- package/dist/dropdown-button.js.map +1 -0
- package/dist/event-manager-D-QCmUgR.js +113 -0
- package/dist/event-manager-D-QCmUgR.js.map +1 -0
- package/dist/fab.js +421 -9
- package/dist/fab.js.map +1 -1
- package/dist/flow-designer-dZnLJOQT.js +1656 -0
- package/dist/flow-designer-dZnLJOQT.js.map +1 -0
- package/dist/flow-designer-node-XMe-jlKg.js +548 -0
- package/dist/flow-designer-node-XMe-jlKg.js.map +1 -0
- package/dist/flow-designer-node.js +4 -0
- package/dist/flow-designer-node.js.map +1 -0
- package/dist/flow-designer.js +16 -0
- package/dist/flow-designer.js.map +1 -0
- package/dist/html-editor.js +358 -0
- package/dist/html-editor.js.map +1 -0
- package/dist/icon-button-CK1ZuE-2.js +247 -0
- package/dist/icon-button-CK1ZuE-2.js.map +1 -0
- package/dist/index.js +31 -8
- package/dist/index.js.map +1 -1
- package/dist/{is-dark-mode-DicqGkCJ.js → is-dark-mode-DOcaw4Yq.js} +2 -27
- package/dist/is-dark-mode-DOcaw4Yq.js.map +1 -0
- package/dist/modal.js +418 -0
- package/dist/modal.js.map +1 -0
- package/dist/{select-4pl4XBj7.js → navigation-rail-DyO0oAZU.js} +2000 -2767
- package/dist/navigation-rail-DyO0oAZU.js.map +1 -0
- package/dist/notification-manager.js +268 -0
- package/dist/notification-manager.js.map +1 -0
- package/dist/notification.js +3 -2
- package/dist/notification.js.map +1 -1
- package/dist/peacock-loader.js +102 -14
- package/dist/peacock-loader.js.map +1 -1
- package/dist/popover-NC7b1lTq.js +1971 -0
- package/dist/popover-NC7b1lTq.js.map +1 -0
- package/dist/popover-content.js +125 -0
- package/dist/popover-content.js.map +1 -0
- package/dist/popover.js +4 -0
- package/dist/popover.js.map +1 -0
- package/dist/search.js +4 -0
- package/dist/search.js.map +1 -1
- package/dist/split-button.js +388 -0
- package/dist/split-button.js.map +1 -0
- package/dist/src/__controllers/floating-controller.d.ts +35 -0
- package/dist/src/__mixins/BaseButtonMixin.d.ts +20 -0
- package/dist/src/__mixins/BaseHyperlinkMixin.d.ts +18 -0
- package/dist/src/__mixins/MixinConstructor.d.ts +1 -0
- package/dist/src/banner/banner.d.ts +0 -4
- package/dist/src/button/BaseButton.d.ts +4 -47
- package/dist/src/button/button/button.d.ts +32 -3
- package/dist/src/button/button-group/button-group.d.ts +2 -2
- package/dist/src/button/icon-button/icon-button.d.ts +33 -8
- package/dist/src/calendar/base-event.d.ts +10 -0
- package/dist/src/calendar/calendar-column-view.d.ts +41 -0
- package/dist/src/calendar/calendar-event.d.ts +7 -0
- package/dist/src/calendar/calendar-month-view.d.ts +31 -0
- package/dist/src/calendar/calendar.d.ts +65 -0
- package/dist/src/calendar/event-manager.d.ts +17 -0
- package/dist/src/calendar/index.d.ts +4 -0
- package/dist/src/calendar/types.d.ts +13 -0
- package/dist/src/calendar/utils.d.ts +31 -0
- package/dist/src/canvas/canvas.d.ts +92 -0
- package/dist/src/canvas/index.d.ts +2 -0
- package/dist/src/card/card.d.ts +4 -15
- package/dist/src/condition-builder/cb-compound-expression.d.ts +31 -0
- package/dist/src/condition-builder/cb-divider.d.ts +26 -0
- package/dist/src/condition-builder/cb-expression.d.ts +31 -0
- package/dist/src/condition-builder/cb-predicate.d.ts +30 -0
- package/dist/src/condition-builder/condition-builder.d.ts +27 -0
- package/dist/src/condition-builder/index.d.ts +5 -0
- package/dist/src/dropdown-button/dropdown-button.d.ts +68 -0
- package/dist/src/dropdown-button/index.d.ts +1 -0
- package/dist/src/fab/fab.d.ts +4 -35
- package/dist/src/flow-designer/commands.d.ts +66 -0
- package/dist/src/flow-designer/flow-designer-node.d.ts +46 -0
- package/dist/src/flow-designer/flow-designer.d.ts +133 -0
- package/dist/src/flow-designer/index.d.ts +7 -0
- package/dist/src/flow-designer/layout.d.ts +30 -0
- package/dist/src/flow-designer/types.d.ts +142 -0
- package/dist/src/flow-designer/validation.d.ts +43 -0
- package/dist/src/flow-designer/workflow-utils.d.ts +40 -0
- package/dist/src/focus-ring/focus-ring.d.ts +11 -5
- package/dist/src/html-editor/html-editor.d.ts +56 -0
- package/dist/src/html-editor/index.d.ts +2 -0
- package/dist/src/index.d.ts +16 -1
- package/dist/src/link/link.d.ts +1 -1
- package/dist/src/menu/menu/menu.d.ts +5 -7
- package/dist/src/menu/menu-item/menu-item.d.ts +14 -13
- package/dist/src/modal/index.d.ts +1 -0
- package/dist/src/modal/modal.d.ts +63 -0
- package/dist/src/navigation-rail/index.d.ts +2 -0
- package/dist/src/navigation-rail/navigation-rail-item.d.ts +55 -0
- package/dist/src/navigation-rail/navigation-rail.d.ts +71 -0
- package/dist/src/notification-manager/index.d.ts +1 -0
- package/dist/src/notification-manager/notification-manager.d.ts +44 -0
- package/dist/src/popover/index.d.ts +2 -0
- package/dist/src/popover/popover-content.d.ts +29 -0
- package/dist/src/popover/popover.d.ts +62 -0
- package/dist/src/sidebar-menu/index.d.ts +3 -0
- package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +58 -0
- package/dist/src/sidebar-menu/sidebar-menu.d.ts +38 -0
- package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +35 -0
- package/dist/src/split-button/index.d.ts +1 -0
- package/dist/src/split-button/split-button.d.ts +72 -0
- package/dist/src/toolbar/toolbar.d.ts +10 -10
- package/dist/src/tooltip/tooltip.d.ts +5 -15
- package/dist/src/url-field/index.d.ts +1 -0
- package/dist/src/url-field/url-field.d.ts +48 -0
- package/dist/test/flow-designer.test.d.ts +1 -0
- package/dist/test/sidebar-menu.test.d.ts +1 -0
- package/dist/toolbar.js +10 -10
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/readme.md +73 -65
- package/scss/mixin.scss +16 -0
- package/src/__controllers/floating-controller.ts +237 -0
- package/src/__mixins/BaseButtonMixin.ts +83 -0
- package/src/__mixins/BaseHyperlinkMixin.ts +68 -0
- package/src/__mixins/MixinConstructor.ts +1 -0
- package/src/{__base_element → __mixins}/README.md +2 -2
- package/src/banner/banner.scss +20 -25
- package/src/banner/banner.ts +1 -7
- package/src/button/BaseButton.ts +11 -100
- package/src/button/button/button-sizes.scss +4 -2
- package/src/button/button/button.ts +77 -23
- package/src/button/button-group/button-group.ts +2 -2
- package/src/button/icon-button/icon-button.ts +75 -33
- package/src/calendar/base-event.ts +49 -0
- package/src/calendar/calendar-column-view.scss +326 -0
- package/src/calendar/calendar-column-view.ts +392 -0
- package/src/calendar/calendar-event.ts +20 -0
- package/src/calendar/calendar-month-view.scss +192 -0
- package/src/calendar/calendar-month-view.ts +244 -0
- package/src/calendar/calendar.scss +71 -0
- package/src/calendar/calendar.ts +298 -0
- package/src/calendar/event-manager.ts +117 -0
- package/src/calendar/index.ts +4 -0
- package/src/calendar/types.ts +14 -0
- package/src/calendar/utils.ts +180 -0
- package/src/canvas/canvas.scss +60 -0
- package/src/canvas/canvas.ts +391 -0
- package/src/canvas/index.ts +2 -0
- package/src/card/card.ts +11 -71
- package/src/chart-bar/chart-bar.ts +9 -14
- package/src/chart-bar/chart-stacked-bar.ts +12 -18
- package/src/chart-doughnut/chart-doughnut.ts +23 -27
- package/src/chart-pie/chart-pie.ts +19 -23
- package/src/checkbox/checkbox.scss +17 -34
- package/src/checkbox/checkbox.ts +3 -1
- package/src/code-highlighter/code-highlighter.scss +1 -0
- package/src/code-highlighter/code-highlighter.ts +1 -1
- package/src/condition-builder/cb-compound-expression.scss +37 -0
- package/src/condition-builder/cb-compound-expression.ts +80 -0
- package/src/condition-builder/cb-divider.scss +93 -0
- package/src/condition-builder/cb-divider.ts +56 -0
- package/src/condition-builder/cb-expression.scss +14 -0
- package/src/condition-builder/cb-expression.ts +49 -0
- package/src/condition-builder/cb-predicate.scss +35 -0
- package/src/condition-builder/cb-predicate.ts +102 -0
- package/src/condition-builder/condition-builder.scss +13 -0
- package/src/condition-builder/condition-builder.ts +38 -0
- package/src/condition-builder/index.ts +5 -0
- package/src/date-picker/date-picker.ts +1 -1
- package/src/dropdown-button/demo/index.html +110 -0
- package/src/dropdown-button/dropdown-button.scss +22 -0
- package/src/dropdown-button/dropdown-button.ts +206 -0
- package/src/dropdown-button/index.ts +1 -0
- package/src/elevation/elevation.scss +5 -5
- package/src/fab/fab.ts +29 -100
- package/src/flow-designer/DEMO.md +239 -0
- package/src/flow-designer/commands.ts +278 -0
- package/src/flow-designer/flow-designer-node.ts +172 -0
- package/src/flow-designer/flow-designer.scss +457 -0
- package/src/flow-designer/flow-designer.ts +611 -0
- package/src/flow-designer/index.ts +41 -0
- package/src/flow-designer/layout.ts +357 -0
- package/src/flow-designer/types.ts +166 -0
- package/src/flow-designer/validation.ts +284 -0
- package/src/flow-designer/workflow-utils.ts +282 -0
- package/src/focus-ring/focus-ring.ts +47 -40
- package/src/html-editor/html-editor.scss +146 -0
- package/src/html-editor/html-editor.ts +276 -0
- package/src/html-editor/index.ts +3 -0
- package/src/index.ts +28 -1
- package/src/input/input.ts +3 -1
- package/src/link/link.ts +2 -2
- package/src/menu/menu/menu.scss +2 -2
- package/src/menu/menu/menu.ts +91 -101
- package/src/menu/menu-item/menu-item.scss +4 -0
- package/src/menu/menu-item/menu-item.ts +85 -79
- package/src/modal/index.ts +1 -0
- package/src/modal/modal.scss +206 -0
- package/src/modal/modal.ts +201 -0
- package/src/navigation-rail/index.ts +2 -0
- package/src/navigation-rail/navigation-rail-item.scss +216 -0
- package/src/navigation-rail/navigation-rail-item.ts +223 -0
- package/src/navigation-rail/navigation-rail.scss +72 -0
- package/src/navigation-rail/navigation-rail.ts +149 -0
- package/src/notification/notification.ts +3 -2
- package/src/notification-manager/index.ts +1 -0
- package/src/notification-manager/notification-manager.scss +113 -0
- package/src/notification-manager/notification-manager.ts +199 -0
- package/src/number-field/number-field.ts +6 -4
- package/src/pagination/pagination.ts +6 -4
- package/src/peacock-loader.ts +93 -5
- package/src/popover/index.ts +2 -0
- package/src/popover/popover-content.scss +69 -0
- package/src/popover/popover-content.ts +51 -0
- package/src/popover/popover.scss +7 -0
- package/src/popover/popover.ts +170 -0
- package/src/search/search.ts +4 -0
- package/src/sidebar-menu/demo/index.html +68 -0
- package/src/sidebar-menu/index.ts +3 -0
- package/src/sidebar-menu/sidebar-menu-item.scss +102 -0
- package/src/sidebar-menu/sidebar-menu-item.ts +151 -0
- package/src/{tree-view/tree-view.scss → sidebar-menu/sidebar-menu.scss} +1 -1
- package/src/sidebar-menu/sidebar-menu.ts +182 -0
- package/src/sidebar-menu/sidebar-sub-menu.scss +130 -0
- package/src/sidebar-menu/sidebar-sub-menu.ts +160 -0
- package/src/skeleton/skeleton.scss +18 -24
- package/src/snackbar/snackbar.ts +1 -1
- package/src/split-button/index.ts +1 -0
- package/src/split-button/split-button-colors.scss +56 -0
- package/src/split-button/split-button-sizes.scss +28 -0
- package/src/split-button/split-button.scss +79 -0
- package/src/split-button/split-button.ts +236 -0
- package/src/table/table.ts +2 -2
- package/src/tabs/tab.ts +4 -3
- package/src/text/text.css-component.scss +7 -1
- package/src/time-picker/time-picker.ts +1 -1
- package/src/toolbar/toolbar.ts +10 -10
- package/src/tooltip/tooltip.scss +4 -3
- package/src/tooltip/tooltip.ts +64 -98
- package/src/url-field/index.ts +1 -0
- package/src/url-field/url-field.scss +50 -0
- package/src/url-field/url-field.ts +239 -0
- package/dist/button-DMN1dPAg.js.map +0 -1
- package/dist/button-group-CX9CUUXk.js +0 -435
- package/dist/button-group-CX9CUUXk.js.map +0 -1
- package/dist/fab-C5Nzxk0E.js +0 -497
- package/dist/fab-C5Nzxk0E.js.map +0 -1
- package/dist/is-dark-mode-DicqGkCJ.js.map +0 -1
- package/dist/select-4pl4XBj7.js.map +0 -1
- package/dist/spread-B5cgadZl.js +0 -32
- package/dist/spread-B5cgadZl.js.map +0 -1
- package/dist/src/__base_element/BaseHyperlink.d.ts +0 -20
- package/dist/src/menu/menu/MenuSurfaceController.d.ts +0 -18
- package/dist/src/tree-view/index.d.ts +0 -2
- package/dist/src/tree-view/tree-node.d.ts +0 -69
- package/dist/src/tree-view/tree-view.d.ts +0 -40
- package/dist/src/tree-view/wc-tree-view.d.ts +0 -6
- package/dist/test/tree-view.test.d.ts +0 -1
- package/dist/throttle-C7ZAPqtu.js +0 -24
- package/dist/throttle-C7ZAPqtu.js.map +0 -1
- package/src/__base_element/BaseHyperlink.ts +0 -42
- package/src/menu/menu/MenuSurfaceController.ts +0 -61
- package/src/tree-view/demo/index.html +0 -57
- package/src/tree-view/index.ts +0 -2
- package/src/tree-view/tree-node.scss +0 -101
- package/src/tree-view/tree-node.ts +0 -268
- package/src/tree-view/tree-view.ts +0 -182
- package/src/tree-view/wc-tree-view.ts +0 -9
package/dist/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as FlowDesigner, I as Icon } from './flow-designer-dZnLJOQT.js';
|
|
2
|
+
export { A as Accordion, a as Avatar, B as Badge, b as Breadcrumb, c as BreadcrumbItem, C as Checkbox, d as Chip, e as CircularProgress, f as Container, D as DatePicker, g as Divider, E as Elevation, h as EmptyState, F as Field, i as FocusRing, I as Image, j as Input, L as LinearProgress, k as Link, M as Menu, l as MenuItem, N as NavigationRail, m as NavigationRailItem, n as NumberField, P as Pagination, R as Radio, o as Ripple, S as SegmentedButton, p as SegmentedButtonGroup, q as Select, r as SelectOptionElement, s as SidebarMenu, t as SidebarMenuItem, u as SidebarSubMenu, v as Skeleton, w as Slider, x as Snackbar, y as Spinner, z as SubMenu, G as Switch, T as Tab, H as TabGroup, J as TabPanel, K as Table, O as Tabs, Q as Tag, U as Textarea, V as TimePicker, W as Tooltip, X as UrlField } from './navigation-rail-DyO0oAZU.js';
|
|
2
3
|
export { Clock } from './clock.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { Button } from './button.js';
|
|
5
|
+
export { ButtonGroup } from './button-group.js';
|
|
6
|
+
export { I as IconButton } from './icon-button-CK1ZuE-2.js';
|
|
7
|
+
export { Fab } from './fab.js';
|
|
8
|
+
export { SplitButton } from './split-button.js';
|
|
9
|
+
export { DropdownButton } from './dropdown-button.js';
|
|
6
10
|
export { NumberCounter } from './number-counter.js';
|
|
11
|
+
export { P as Popover } from './popover-NC7b1lTq.js';
|
|
12
|
+
export { PopoverContent } from './popover-content.js';
|
|
7
13
|
export { CodeHighlighter } from './code-highlighter.js';
|
|
8
14
|
export { default as CodeEditor } from './code-editor.js';
|
|
15
|
+
export { HtmlEditor } from './html-editor.js';
|
|
9
16
|
export { ChartDoughnut } from './chart-doughnut.js';
|
|
10
17
|
export { ChartPie } from './chart-pie.js';
|
|
11
18
|
export { ChartBar } from './chart-bar.js';
|
|
@@ -14,25 +21,41 @@ export { Card } from './card.js';
|
|
|
14
21
|
import './card-content.js';
|
|
15
22
|
export { Banner } from './banner.js';
|
|
16
23
|
export { Notification } from './notification.js';
|
|
24
|
+
export { NotificationManager } from './notification-manager.js';
|
|
25
|
+
export { Modal } from './modal.js';
|
|
17
26
|
export { BottomSheet } from './bottom-sheet.js';
|
|
18
27
|
export { SideSheet } from './side-sheet.js';
|
|
19
28
|
export { Search } from './search.js';
|
|
20
29
|
export { Toolbar } from './toolbar.js';
|
|
30
|
+
export { Calendar } from './calendar.js';
|
|
31
|
+
export { CalendarColumnView } from './calendar-column-view.js';
|
|
32
|
+
export { CalendarMonthView } from './calendar-month-view.js';
|
|
33
|
+
export { Canvas } from './canvas.js';
|
|
34
|
+
export { F as FlowDesignerNode } from './flow-designer-node-XMe-jlKg.js';
|
|
35
|
+
export { ConditionBuilder } from './condition-builder.js';
|
|
36
|
+
export { CbPredicate } from './cb-predicate.js';
|
|
37
|
+
export { CbCompoundExpression } from './cb-compound-expression.js';
|
|
38
|
+
export { CbExpression } from './cb-expression.js';
|
|
39
|
+
export { CbDivider } from './cb-divider.js';
|
|
21
40
|
import './IndividualComponent-DUINtMGK.js';
|
|
22
41
|
import './property-1psGvXOq.js';
|
|
23
42
|
import './state-DwbEjqVk.js';
|
|
43
|
+
import './query-QBcUV-L_.js';
|
|
24
44
|
import './directive-ZPhl09Yt.js';
|
|
25
45
|
import './unsafe-html-BsGUjx94.js';
|
|
26
46
|
import './class-map-YU7g0o3B.js';
|
|
27
47
|
import './observe-slot-change-BGJfgg2E.js';
|
|
28
|
-
import './
|
|
48
|
+
import './BaseHyperlinkMixin-BNuwbiEf.js';
|
|
29
49
|
import './style-map-DVmWOuYy.js';
|
|
30
50
|
import './dispatch-event-utils-CuEqjlPT.js';
|
|
31
|
-
import './
|
|
32
|
-
import './
|
|
33
|
-
import './
|
|
51
|
+
import './BaseButton-BNFAYn-S.js';
|
|
52
|
+
import './BaseInput-14YmcfK7.js';
|
|
53
|
+
import './is-dark-mode-DOcaw4Yq.js';
|
|
54
|
+
import './button-colors-Ccys3hvS.js';
|
|
34
55
|
import './transform-DSwFSqzD.js';
|
|
35
56
|
import './pie-Dz0IDiPt.js';
|
|
36
57
|
import './array-D5vjT2Xm.js';
|
|
37
58
|
import './chart-bar-cn6rrna-.js';
|
|
59
|
+
import './calendar-event-BrQ_SEKD.js';
|
|
60
|
+
import './event-manager-D-QCmUgR.js';
|
|
38
61
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
import { _ as __decorate, i } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
-
import { n } from './property-1psGvXOq.js';
|
|
3
|
-
|
|
4
|
-
class BaseInput extends i {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.disabled = false;
|
|
8
|
-
this.readonly = false;
|
|
9
|
-
this.required = false;
|
|
10
|
-
this.skeleton = false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
__decorate([
|
|
14
|
-
n({ type: Boolean, reflect: true })
|
|
15
|
-
], BaseInput.prototype, "disabled", void 0);
|
|
16
|
-
__decorate([
|
|
17
|
-
n({ type: Boolean, reflect: true })
|
|
18
|
-
], BaseInput.prototype, "readonly", void 0);
|
|
19
|
-
__decorate([
|
|
20
|
-
n({ type: Boolean, reflect: true })
|
|
21
|
-
], BaseInput.prototype, "required", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
n({ type: Boolean, reflect: true })
|
|
24
|
-
], BaseInput.prototype, "skeleton", void 0);
|
|
25
|
-
|
|
26
1
|
const observeThemeChange = (() => {
|
|
27
2
|
const callbacks = new Set();
|
|
28
3
|
const observer = new MutationObserver((records) => {
|
|
@@ -52,5 +27,5 @@ function isDarkMode() {
|
|
|
52
27
|
return document.documentElement.dataset.theme === 'dark';
|
|
53
28
|
}
|
|
54
29
|
|
|
55
|
-
export {
|
|
56
|
-
//# sourceMappingURL=is-dark-mode-
|
|
30
|
+
export { isDarkMode as i, observeThemeChange as o };
|
|
31
|
+
//# sourceMappingURL=is-dark-mode-DOcaw4Yq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-dark-mode-DOcaw4Yq.js","sources":["../../src/__utils/observe-theme-change.ts","../../src/__utils/is-dark-mode.ts"],"sourcesContent":["type ThemeChangeCallback = () => void;\n\nexport const observeThemeChange = (() => {\n const callbacks = new Set<ThemeChangeCallback>();\n\n const observer = new MutationObserver((records) => {\n const changed = records.some(\n (r) => r.type === \"attributes\" && r.attributeName === \"data-theme\"\n );\n if (!changed) return;\n\n for (const callback of callbacks) {\n try {\n callback();\n } catch (err) {\n console.error(\"[observeThemeChange] callback threw:\", err);\n }\n }\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\"],\n });\n\n return (callback: ThemeChangeCallback): (() => void) => {\n callbacks.add(callback);\n return () => callbacks.delete(callback);\n };\n})();","export function isDarkMode() {\n return document.documentElement.dataset.theme === 'dark';\n}"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAG,CAAC,MAAK;AACtC,IAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB;IAEhD,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,OAAO,KAAI;QAChD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAC1B,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,aAAa,KAAK,YAAY,CACnE;AACD,QAAA,IAAI,CAAC,OAAO;YAAE;AAEd,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,IAAI;AACF,gBAAA,QAAQ,EAAE;YACZ;YAAE,OAAO,GAAG,EAAE;AACZ,gBAAA,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC;YAC5D;QACF;AACF,IAAA,CAAC,CAAC;AAEF,IAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;AACzC,QAAA,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,CAAC,YAAY,CAAC;AAChC,KAAA,CAAC;IAEF,OAAO,CAAC,QAA6B,KAAkB;AACrD,QAAA,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC;QACvB,OAAO,MAAM,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC;AACzC,IAAA,CAAC;AACH,CAAC;;SC7Be,UAAU,GAAA;IACxB,OAAO,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,KAAK,MAAM;AAC1D;;;;"}
|
package/dist/modal.js
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { a as i, _ as __decorate, I as IndividualComponent, i as i$1, A, b } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
+
import { n } from './property-1psGvXOq.js';
|
|
3
|
+
import { r } from './state-DwbEjqVk.js';
|
|
4
|
+
import { e } from './class-map-YU7g0o3B.js';
|
|
5
|
+
import './directive-ZPhl09Yt.js';
|
|
6
|
+
|
|
7
|
+
var css_248z = i`@charset "UTF-8";
|
|
8
|
+
* {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.screen-reader-only {
|
|
13
|
+
display: none !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host {
|
|
17
|
+
display: contents;
|
|
18
|
+
--modal-container-color: var(--color-surface-container-high, #ece6f0);
|
|
19
|
+
--modal-scrim-color: rgba(0, 0, 0, 0.32);
|
|
20
|
+
--modal-shape: var(--shape-corner-extra-large, 28px);
|
|
21
|
+
--modal-min-width: 280px;
|
|
22
|
+
--modal-max-width: 560px;
|
|
23
|
+
--modal-max-height: 90dvh;
|
|
24
|
+
--modal-transition-duration: var(--duration-medium2, 300ms);
|
|
25
|
+
--modal-transition-easing: var(--easing-emphasized, cubic-bezier(0.2, 0, 0, 1));
|
|
26
|
+
--modal-heading-color: var(--color-on-surface, #1c1b1f);
|
|
27
|
+
--modal-subheading-color: var(--color-on-surface-variant, #49454f);
|
|
28
|
+
--modal-content-color: var(--color-on-surface-variant, #49454f);
|
|
29
|
+
--modal-divider-color: var(--color-outline-variant, #cac4d0);
|
|
30
|
+
--modal-elevation: var(--elevation-level3, 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Scrim backdrop */
|
|
34
|
+
.scrim {
|
|
35
|
+
background-color: var(--modal-scrim-color);
|
|
36
|
+
inset: 0;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
position: fixed;
|
|
40
|
+
transition: opacity var(--modal-transition-duration) var(--modal-transition-easing);
|
|
41
|
+
z-index: 1000;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.scrim.visible {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
pointer-events: auto;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Dialog wrapper — centres the dialog on screen */
|
|
50
|
+
.dialog-wrapper {
|
|
51
|
+
align-items: center;
|
|
52
|
+
display: flex;
|
|
53
|
+
inset: 0;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
padding: var(--spacing-400, 2rem) var(--spacing-200, 1rem);
|
|
57
|
+
position: fixed;
|
|
58
|
+
z-index: 1001;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Dialog container */
|
|
62
|
+
.dialog {
|
|
63
|
+
background-color: var(--modal-container-color);
|
|
64
|
+
border-radius: var(--modal-shape);
|
|
65
|
+
box-shadow: var(--modal-elevation);
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
max-height: var(--modal-max-height);
|
|
69
|
+
max-width: var(--modal-max-width);
|
|
70
|
+
min-width: var(--modal-min-width);
|
|
71
|
+
opacity: 0;
|
|
72
|
+
outline: none;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
position: relative;
|
|
75
|
+
transform: scale(0.9);
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
.dialog.open {
|
|
79
|
+
animation: modal-enter var(--modal-transition-duration) var(--modal-transition-easing) forwards;
|
|
80
|
+
}
|
|
81
|
+
.dialog:not(.open) {
|
|
82
|
+
animation: modal-exit var(--modal-transition-duration) var(--modal-transition-easing) forwards;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Sizes */
|
|
86
|
+
.dialog.size-xs {
|
|
87
|
+
--modal-max-width: 320px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.dialog.size-sm {
|
|
91
|
+
--modal-max-width: 420px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.dialog.size-md {
|
|
95
|
+
--modal-max-width: 560px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.dialog.size-lg {
|
|
99
|
+
--modal-max-width: 800px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dialog.size-fullscreen {
|
|
103
|
+
--modal-max-width: 100%;
|
|
104
|
+
--modal-max-height: 100%;
|
|
105
|
+
border-radius: 0;
|
|
106
|
+
max-height: 100dvh;
|
|
107
|
+
max-width: 100vw;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.dialog-wrapper:has(.dialog.size-fullscreen) {
|
|
111
|
+
padding: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Header */
|
|
115
|
+
.dialog-header {
|
|
116
|
+
align-items: flex-start;
|
|
117
|
+
display: flex;
|
|
118
|
+
gap: var(--spacing-200, 1rem);
|
|
119
|
+
padding: var(--spacing-300, 1.5rem) var(--spacing-300, 1.5rem) var(--spacing-200, 1rem);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dialog-heading-section {
|
|
123
|
+
flex: 1;
|
|
124
|
+
min-width: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.dialog-subheading {
|
|
128
|
+
color: var(--modal-subheading-color);
|
|
129
|
+
font-family: var(--typography-label-medium-font-family, sans-serif);
|
|
130
|
+
font-size: var(--typography-label-medium-font-size, 0.75rem);
|
|
131
|
+
font-weight: var(--typography-label-medium-font-weight, 500);
|
|
132
|
+
letter-spacing: var(--typography-label-medium-letter-spacing, 0.05em);
|
|
133
|
+
line-height: var(--typography-label-medium-line-height, 1.25rem);
|
|
134
|
+
margin: 0 0 var(--spacing-050, 0.25rem);
|
|
135
|
+
text-transform: uppercase;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.dialog-heading {
|
|
139
|
+
color: var(--modal-heading-color);
|
|
140
|
+
font-family: var(--typography-headline-small-font-family, sans-serif);
|
|
141
|
+
font-size: var(--typography-headline-small-font-size, 1.5rem);
|
|
142
|
+
font-weight: var(--typography-headline-small-font-weight, 400);
|
|
143
|
+
letter-spacing: var(--typography-headline-small-letter-spacing, 0);
|
|
144
|
+
line-height: var(--typography-headline-small-line-height, 2rem);
|
|
145
|
+
margin: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.dialog-close {
|
|
149
|
+
flex-shrink: 0;
|
|
150
|
+
margin-block-start: -0.25rem;
|
|
151
|
+
margin-inline-end: -0.25rem;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Body content */
|
|
155
|
+
.dialog-content {
|
|
156
|
+
color: var(--modal-content-color);
|
|
157
|
+
flex: 1 1 auto;
|
|
158
|
+
overflow-y: auto;
|
|
159
|
+
padding: 0 var(--spacing-300, 1.5rem) var(--spacing-300, 1.5rem);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* When there is no header */
|
|
163
|
+
.dialog:not(:has(.dialog-header)) .dialog-content {
|
|
164
|
+
padding-top: var(--spacing-300, 1.5rem);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Footer */
|
|
168
|
+
.dialog-footer {
|
|
169
|
+
border-top: 1px solid transparent;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.dialog-footer:has(slot:not(:empty)),
|
|
173
|
+
.dialog-footer slot::slotted(*) {
|
|
174
|
+
border-top-color: var(--modal-divider-color);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Loading overlay */
|
|
178
|
+
.dialog-loader {
|
|
179
|
+
align-items: center;
|
|
180
|
+
display: flex;
|
|
181
|
+
inset: 0;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
position: absolute;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.dialog-loader-scrim {
|
|
187
|
+
background-color: var(--modal-container-color);
|
|
188
|
+
inset: 0;
|
|
189
|
+
opacity: 0.72;
|
|
190
|
+
position: absolute;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Animations */
|
|
194
|
+
@keyframes modal-enter {
|
|
195
|
+
from {
|
|
196
|
+
opacity: 0;
|
|
197
|
+
transform: scale(0.9);
|
|
198
|
+
}
|
|
199
|
+
to {
|
|
200
|
+
opacity: 1;
|
|
201
|
+
transform: scale(1);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
@keyframes modal-exit {
|
|
205
|
+
from {
|
|
206
|
+
opacity: 1;
|
|
207
|
+
transform: scale(1);
|
|
208
|
+
}
|
|
209
|
+
to {
|
|
210
|
+
opacity: 0;
|
|
211
|
+
transform: scale(0.9);
|
|
212
|
+
}
|
|
213
|
+
}`;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @label Modal
|
|
217
|
+
* @tag wc-modal
|
|
218
|
+
* @rawTag modal-wc
|
|
219
|
+
* @summary A Material Design 3 dialog/modal for displaying content in a layer above the page, with optional header, body, and footer slots.
|
|
220
|
+
*
|
|
221
|
+
* @cssprop --modal-container-color - Background color of the dialog container.
|
|
222
|
+
* @cssprop --modal-scrim-color - Color of the scrim backdrop.
|
|
223
|
+
* @cssprop --modal-shape - Corner radius of the dialog container.
|
|
224
|
+
* @cssprop --modal-min-width - Minimum width of the dialog.
|
|
225
|
+
* @cssprop --modal-max-width - Maximum width of the dialog.
|
|
226
|
+
* @cssprop --modal-max-height - Maximum height of the dialog.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```html
|
|
230
|
+
* <wc-modal open heading="Confirm Action">
|
|
231
|
+
* <p>Are you sure you want to continue?</p>
|
|
232
|
+
* <div slot="footer">
|
|
233
|
+
* <wc-button variant="text">Cancel</wc-button>
|
|
234
|
+
* <wc-button>Confirm</wc-button>
|
|
235
|
+
* </div>
|
|
236
|
+
* </wc-modal>
|
|
237
|
+
* ```
|
|
238
|
+
* @tags overlay, dialog, feedback
|
|
239
|
+
*/
|
|
240
|
+
let Modal = class Modal extends i$1 {
|
|
241
|
+
constructor() {
|
|
242
|
+
super(...arguments);
|
|
243
|
+
/** Whether the modal is open. */
|
|
244
|
+
this.open = false;
|
|
245
|
+
/** Heading text shown in the modal header. */
|
|
246
|
+
this.heading = '';
|
|
247
|
+
/** Optional subheading / label text shown above the heading. */
|
|
248
|
+
this.subheading = '';
|
|
249
|
+
/**
|
|
250
|
+
* Size of the modal dialog.
|
|
251
|
+
* - `"xs"`: Extra-small.
|
|
252
|
+
* - `"sm"`: Small.
|
|
253
|
+
* - `"md"`: Medium (default).
|
|
254
|
+
* - `"lg"`: Large.
|
|
255
|
+
* - `"fullscreen"`: Full-screen dialog.
|
|
256
|
+
*/
|
|
257
|
+
this.size = 'md';
|
|
258
|
+
/** When true, hides the close button in the header. */
|
|
259
|
+
this.hideClose = false;
|
|
260
|
+
/** When true, renders a loading overlay inside the modal. */
|
|
261
|
+
this.showLoader = false;
|
|
262
|
+
/** When true, clicking the scrim will not close the modal. */
|
|
263
|
+
this.noScrimClose = false;
|
|
264
|
+
this._visible = false;
|
|
265
|
+
this._handleKeydown = (e) => {
|
|
266
|
+
if (e.key === 'Escape') {
|
|
267
|
+
this._close('escape');
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
show() {
|
|
272
|
+
this.open = true;
|
|
273
|
+
}
|
|
274
|
+
hide() {
|
|
275
|
+
this._close('programmatic');
|
|
276
|
+
}
|
|
277
|
+
_close(reason) {
|
|
278
|
+
if (!this.open)
|
|
279
|
+
return;
|
|
280
|
+
this.open = false;
|
|
281
|
+
this.dispatchEvent(new CustomEvent('modal-close', {
|
|
282
|
+
detail: { reason },
|
|
283
|
+
bubbles: true,
|
|
284
|
+
composed: true,
|
|
285
|
+
}));
|
|
286
|
+
}
|
|
287
|
+
_handleScrimClick() {
|
|
288
|
+
if (!this.noScrimClose) {
|
|
289
|
+
this._close('scrim');
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
_handleCloseClick() {
|
|
293
|
+
this._close('close-button');
|
|
294
|
+
}
|
|
295
|
+
updated(changedProperties) {
|
|
296
|
+
if (changedProperties.has('open')) {
|
|
297
|
+
if (this.open) {
|
|
298
|
+
this._visible = true;
|
|
299
|
+
document.body.style.overflow = 'hidden';
|
|
300
|
+
document.addEventListener('keydown', this._handleKeydown);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
document.body.style.overflow = '';
|
|
304
|
+
document.removeEventListener('keydown', this._handleKeydown);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
disconnectedCallback() {
|
|
309
|
+
super.disconnectedCallback();
|
|
310
|
+
document.body.style.overflow = '';
|
|
311
|
+
document.removeEventListener('keydown', this._handleKeydown);
|
|
312
|
+
}
|
|
313
|
+
_handleAnimationEnd(e) {
|
|
314
|
+
if (e.animationName === 'modal-exit') {
|
|
315
|
+
this._visible = false;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
render() {
|
|
319
|
+
if (!this.open && !this._visible)
|
|
320
|
+
return A;
|
|
321
|
+
const hasHeader = this.heading || this.subheading || !this.hideClose;
|
|
322
|
+
return b `
|
|
323
|
+
<div
|
|
324
|
+
class=${e({ scrim: true, visible: this.open })}
|
|
325
|
+
@click=${this._handleScrimClick}
|
|
326
|
+
aria-hidden="true"
|
|
327
|
+
></div>
|
|
328
|
+
|
|
329
|
+
<div class="dialog-wrapper" role="presentation">
|
|
330
|
+
<div
|
|
331
|
+
class=${e({
|
|
332
|
+
dialog: true,
|
|
333
|
+
open: this.open,
|
|
334
|
+
[`size-${this.size}`]: true,
|
|
335
|
+
'show-loader': this.showLoader,
|
|
336
|
+
})}
|
|
337
|
+
role="dialog"
|
|
338
|
+
aria-modal="true"
|
|
339
|
+
aria-labelledby=${this.heading ? 'modal-heading' : A}
|
|
340
|
+
@animationend=${this._handleAnimationEnd}
|
|
341
|
+
>
|
|
342
|
+
${hasHeader
|
|
343
|
+
? b `
|
|
344
|
+
<div class="dialog-header">
|
|
345
|
+
<div class="dialog-heading-section">
|
|
346
|
+
${this.subheading
|
|
347
|
+
? b `<p class="dialog-subheading">${this.subheading}</p>`
|
|
348
|
+
: A}
|
|
349
|
+
${this.heading
|
|
350
|
+
? b `<h2 id="modal-heading" class="dialog-heading">
|
|
351
|
+
${this.heading}
|
|
352
|
+
</h2>`
|
|
353
|
+
: A}
|
|
354
|
+
</div>
|
|
355
|
+
${!this.hideClose
|
|
356
|
+
? b `<wc-icon-button
|
|
357
|
+
class="dialog-close"
|
|
358
|
+
variant="text"
|
|
359
|
+
aria-label="Close dialog"
|
|
360
|
+
@click=${this._handleCloseClick}
|
|
361
|
+
>
|
|
362
|
+
<wc-icon name="close"></wc-icon>
|
|
363
|
+
</wc-icon-button>`
|
|
364
|
+
: A}
|
|
365
|
+
</div>
|
|
366
|
+
`
|
|
367
|
+
: A}
|
|
368
|
+
|
|
369
|
+
<div class="dialog-content">
|
|
370
|
+
<slot></slot>
|
|
371
|
+
</div>
|
|
372
|
+
|
|
373
|
+
<div class="dialog-footer">
|
|
374
|
+
<slot name="footer"></slot>
|
|
375
|
+
</div>
|
|
376
|
+
|
|
377
|
+
${this.showLoader
|
|
378
|
+
? b `<div class="dialog-loader" aria-hidden="true">
|
|
379
|
+
<div class="dialog-loader-scrim"></div>
|
|
380
|
+
<wc-spinner></wc-spinner>
|
|
381
|
+
</div>`
|
|
382
|
+
: A}
|
|
383
|
+
</div>
|
|
384
|
+
</div>
|
|
385
|
+
`;
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
Modal.styles = [css_248z];
|
|
389
|
+
__decorate([
|
|
390
|
+
n({ type: Boolean, reflect: true })
|
|
391
|
+
], Modal.prototype, "open", void 0);
|
|
392
|
+
__decorate([
|
|
393
|
+
n({ type: String, reflect: true })
|
|
394
|
+
], Modal.prototype, "heading", void 0);
|
|
395
|
+
__decorate([
|
|
396
|
+
n({ type: String, reflect: true })
|
|
397
|
+
], Modal.prototype, "subheading", void 0);
|
|
398
|
+
__decorate([
|
|
399
|
+
n({ type: String, reflect: true })
|
|
400
|
+
], Modal.prototype, "size", void 0);
|
|
401
|
+
__decorate([
|
|
402
|
+
n({ type: Boolean, reflect: true, attribute: 'hide-close' })
|
|
403
|
+
], Modal.prototype, "hideClose", void 0);
|
|
404
|
+
__decorate([
|
|
405
|
+
n({ type: Boolean, reflect: true, attribute: 'show-loader' })
|
|
406
|
+
], Modal.prototype, "showLoader", void 0);
|
|
407
|
+
__decorate([
|
|
408
|
+
n({ type: Boolean, attribute: 'no-scrim-close' })
|
|
409
|
+
], Modal.prototype, "noScrimClose", void 0);
|
|
410
|
+
__decorate([
|
|
411
|
+
r()
|
|
412
|
+
], Modal.prototype, "_visible", void 0);
|
|
413
|
+
Modal = __decorate([
|
|
414
|
+
IndividualComponent
|
|
415
|
+
], Modal);
|
|
416
|
+
|
|
417
|
+
export { Modal };
|
|
418
|
+
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sources":["../../src/modal/modal.ts"],"sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport IndividualComponent from '../IndividualComponent.js';\nimport styles from './modal.scss';\n\ntype ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'fullscreen';\n\n/**\n * @label Modal\n * @tag wc-modal\n * @rawTag modal-wc\n * @summary A Material Design 3 dialog/modal for displaying content in a layer above the page, with optional header, body, and footer slots.\n *\n * @cssprop --modal-container-color - Background color of the dialog container.\n * @cssprop --modal-scrim-color - Color of the scrim backdrop.\n * @cssprop --modal-shape - Corner radius of the dialog container.\n * @cssprop --modal-min-width - Minimum width of the dialog.\n * @cssprop --modal-max-width - Maximum width of the dialog.\n * @cssprop --modal-max-height - Maximum height of the dialog.\n *\n * @example\n * ```html\n * <wc-modal open heading=\"Confirm Action\">\n * <p>Are you sure you want to continue?</p>\n * <div slot=\"footer\">\n * <wc-button variant=\"text\">Cancel</wc-button>\n * <wc-button>Confirm</wc-button>\n * </div>\n * </wc-modal>\n * ```\n * @tags overlay, dialog, feedback\n */\n@IndividualComponent\nexport class Modal extends LitElement {\n static styles = [styles];\n\n /** Whether the modal is open. */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** Heading text shown in the modal header. */\n @property({ type: String, reflect: true }) heading = '';\n\n /** Optional subheading / label text shown above the heading. */\n @property({ type: String, reflect: true }) subheading = '';\n\n /**\n * Size of the modal dialog.\n * - `\"xs\"`: Extra-small.\n * - `\"sm\"`: Small.\n * - `\"md\"`: Medium (default).\n * - `\"lg\"`: Large.\n * - `\"fullscreen\"`: Full-screen dialog.\n */\n @property({ type: String, reflect: true }) size: ModalSize = 'md';\n\n /** When true, hides the close button in the header. */\n @property({ type: Boolean, reflect: true, attribute: 'hide-close' })\n hideClose = false;\n\n /** When true, renders a loading overlay inside the modal. */\n @property({ type: Boolean, reflect: true, attribute: 'show-loader' })\n showLoader = false;\n\n /** When true, clicking the scrim will not close the modal. */\n @property({ type: Boolean, attribute: 'no-scrim-close' }) noScrimClose = false;\n\n @state() private _visible = false;\n\n show() {\n this.open = true;\n }\n\n hide() {\n this._close('programmatic');\n }\n\n private _close(reason: string) {\n if (!this.open) return;\n this.open = false;\n this.dispatchEvent(\n new CustomEvent('modal-close', {\n detail: { reason },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _handleScrimClick() {\n if (!this.noScrimClose) {\n this._close('scrim');\n }\n }\n\n private _handleCloseClick() {\n this._close('close-button');\n }\n\n private readonly _handleKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n this._close('escape');\n }\n };\n\n protected updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('open')) {\n if (this.open) {\n this._visible = true;\n document.body.style.overflow = 'hidden';\n document.addEventListener('keydown', this._handleKeydown);\n } else {\n document.body.style.overflow = '';\n document.removeEventListener('keydown', this._handleKeydown);\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n document.body.style.overflow = '';\n document.removeEventListener('keydown', this._handleKeydown);\n }\n\n private _handleAnimationEnd(e: AnimationEvent) {\n if (e.animationName === 'modal-exit') {\n this._visible = false;\n }\n }\n\n render() {\n if (!this.open && !this._visible) return nothing;\n\n const hasHeader = this.heading || this.subheading || !this.hideClose;\n\n return html`\n <div\n class=${classMap({ scrim: true, visible: this.open })}\n @click=${this._handleScrimClick}\n aria-hidden=\"true\"\n ></div>\n\n <div class=\"dialog-wrapper\" role=\"presentation\">\n <div\n class=${classMap({\n dialog: true,\n open: this.open,\n [`size-${this.size}`]: true,\n 'show-loader': this.showLoader,\n })}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=${this.heading ? 'modal-heading' : nothing}\n @animationend=${this._handleAnimationEnd}\n >\n ${hasHeader\n ? html`\n <div class=\"dialog-header\">\n <div class=\"dialog-heading-section\">\n ${this.subheading\n ? html`<p class=\"dialog-subheading\">${this.subheading}</p>`\n : nothing}\n ${this.heading\n ? html`<h2 id=\"modal-heading\" class=\"dialog-heading\">\n ${this.heading}\n </h2>`\n : nothing}\n </div>\n ${!this.hideClose\n ? html`<wc-icon-button\n class=\"dialog-close\"\n variant=\"text\"\n aria-label=\"Close dialog\"\n @click=${this._handleCloseClick}\n >\n <wc-icon name=\"close\"></wc-icon>\n </wc-icon-button>`\n : nothing}\n </div>\n `\n : nothing}\n\n <div class=\"dialog-content\">\n <slot></slot>\n </div>\n\n <div class=\"dialog-footer\">\n <slot name=\"footer\"></slot>\n </div>\n\n ${this.showLoader\n ? html`<div class=\"dialog-loader\" aria-hidden=\"true\">\n <div class=\"dialog-loader-scrim\"></div>\n <wc-spinner></wc-spinner>\n </div>`\n : nothing}\n </div>\n </div>\n `;\n }\n}\n"],"names":["LitElement","nothing","html","classMap","styles","property","state"],"mappings":";;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