@limetech/lime-elements 37.1.0-next.29 → 37.1.0-next.30
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/cjs/limel-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
- package/dist/cjs/limel-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +27 -0
- package/dist/collection/components/badge/badge.css +27 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +40 -2
- package/dist/collection/components/button/button.css +27 -0
- package/dist/collection/components/button-group/button-group.css +27 -0
- package/dist/collection/components/chip-set/chip-set.css +27 -0
- package/dist/collection/components/circular-progress/circular-progress.css +27 -0
- package/dist/collection/components/code-editor/code-editor.css +27 -0
- package/dist/collection/components/collapsible-section/collapsible-section.css +27 -0
- package/dist/collection/components/color-picker/color-picker-palette.css +54 -0
- package/dist/collection/components/color-picker/color-picker.css +27 -0
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +27 -0
- package/dist/collection/components/dialog/dialog.css +54 -15
- package/dist/collection/components/dialog/dialog.js +1 -1
- package/dist/collection/components/dialog/dialog.js.map +1 -1
- package/dist/collection/components/dock/dock-button/dock-button.css +27 -0
- package/dist/collection/components/dock/dock.css +27 -0
- package/dist/collection/components/form/form.css +27 -0
- package/dist/collection/components/header/header.css +27 -0
- package/dist/collection/components/icon-button/icon-button.css +38 -237
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js.map +1 -1
- package/dist/collection/components/info-tile/info-tile.css +27 -0
- package/dist/collection/components/input-field/input-field.css +27 -0
- package/dist/collection/components/list/list.css +54 -0
- package/dist/collection/components/menu-list/menu-list.css +54 -0
- package/dist/collection/components/popover-surface/popover-surface.css +27 -0
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +27 -0
- package/dist/collection/components/select/select.css +27 -0
- package/dist/collection/components/shortcut/shortcut.css +27 -0
- package/dist/collection/components/split-button/split-button.css +27 -0
- package/dist/collection/components/table/table.css +108 -0
- package/dist/collection/style/mixins.scss +61 -0
- package/dist/esm/limel-breadcrumbs.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/limel-dialog.entry.js +2 -2
- package/dist/esm/limel-dialog.entry.js.map +1 -1
- package/dist/esm/limel-icon-button.entry.js +2 -2
- package/dist/esm/limel-icon-button.entry.js.map +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-22031b5b.entry.js +2 -0
- package/dist/lime-elements/p-22031b5b.entry.js.map +1 -0
- package/dist/lime-elements/p-6933a99c.entry.js +2 -0
- package/dist/lime-elements/p-6933a99c.entry.js.map +1 -0
- package/dist/lime-elements/p-749acb43.entry.js +2 -0
- package/dist/lime-elements/{p-b70f517e.entry.js.map → p-749acb43.entry.js.map} +1 -1
- package/dist/lime-elements/{p-9f5250a0.entry.js → p-9eacc71c.entry.js} +7 -7
- package/dist/lime-elements/{p-9f5250a0.entry.js.map → p-9eacc71c.entry.js.map} +1 -1
- package/dist/lime-elements/style/mixins.scss +61 -0
- package/dist/scss/mixins.scss +61 -0
- package/package.json +2 -2
- package/dist/lime-elements/p-291abad1.entry.js +0 -2
- package/dist/lime-elements/p-291abad1.entry.js.map +0 -1
- package/dist/lime-elements/p-b70f517e.entry.js +0 -2
- package/dist/lime-elements/p-c3e428ff.entry.js +0 -2
- package/dist/lime-elements/p-c3e428ff.entry.js.map +0 -1
|
@@ -4,6 +4,41 @@
|
|
|
4
4
|
* Nothing in this file may output any CSS
|
|
5
5
|
* without being explicitly called by outside code.
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
9
|
+
* node module, for consumer projects to import.
|
|
10
|
+
* That means this file cannot import from any file that isn't
|
|
11
|
+
* also exported, keeping the same relative path.
|
|
12
|
+
*
|
|
13
|
+
* Or, just don't import anything, that works too.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* This mixin will mask out the content that is close to
|
|
17
|
+
* the edges of a scrollable area.
|
|
18
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
19
|
+
* as an argument for `$direction`.
|
|
20
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
21
|
+
* as an argument for `$direction`.
|
|
22
|
+
*
|
|
23
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
24
|
+
* the size of the fade-out edge effect is the same as the
|
|
25
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
26
|
+
* scrollable area that does not have a padding will fade out before
|
|
27
|
+
* any scrolling has been done.
|
|
28
|
+
* This is why this mixin already adds paddings, which automatically
|
|
29
|
+
* default to the size of the fade-out effect.
|
|
30
|
+
* This size defaults to `1rem`, but to override the size use
|
|
31
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
32
|
+
* when `vertically` argument is set, and use
|
|
33
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
34
|
+
* when `horizontally` argument is set.
|
|
35
|
+
* Of course you can also programmatically increase and decrease the
|
|
36
|
+
* size of these variables for each edge, based on the amount of
|
|
37
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
38
|
+
* to add a custom padding where the mixin is used, to override
|
|
39
|
+
* the paddings that are automatically added by the mixin in the
|
|
40
|
+
* compiled CSS code.
|
|
41
|
+
*/
|
|
7
42
|
/*
|
|
8
43
|
* This file is imported into every component that uses MDC!
|
|
9
44
|
*
|
|
@@ -76,7 +111,7 @@
|
|
|
76
111
|
* @prop --dialog-max-width: Max width of the dialog.
|
|
77
112
|
* @prop --dialog-max-height: Max height of the dialog.
|
|
78
113
|
* @prop --dialog-border-radius: Border radius of the dialog corners
|
|
79
|
-
* @prop --dialog-padding-top-bottom: Padding on top and bottom of dialog content. Defaults to `1.5rem`.
|
|
114
|
+
* @prop --dialog-padding-top-bottom: Padding on top and bottom of dialog content. Affects the height of fade-out effects on top and bottom edges when the content is scrollable and has overflowed out of the content area. Defaults to `1.5rem`. Note that if you use this variable and set it to numbers smaller than 1rem, you will loose the fade-out effects on the edges. If you have set these paddings to `0`, losing the fade out effects should be however fine for your use case! Because in such a case your intention is to handle the `overflow` internally in the component that is displayed in the dialog's content.
|
|
80
115
|
* @prop --dialog-padding-left-right: Padding on the sides of dialog content. Defaults to `1.25rem`.
|
|
81
116
|
*/
|
|
82
117
|
:host {
|
|
@@ -693,21 +728,25 @@
|
|
|
693
728
|
border-radius: var(--dialog-border-radius, 0.25rem);
|
|
694
729
|
}
|
|
695
730
|
.mdc-dialog .mdc-dialog__content {
|
|
731
|
+
--limel-top-edge-fade-height: var(--dialog-padding-top-bottom, 1.5rem);
|
|
732
|
+
--limel-bottom-edge-fade-height: var(
|
|
733
|
+
--dialog-padding-top-bottom,
|
|
734
|
+
1.5rem
|
|
735
|
+
);
|
|
736
|
+
--limel-overflow-mask-vertical: linear-gradient(
|
|
737
|
+
to bottom,
|
|
738
|
+
transparent 0%,
|
|
739
|
+
black calc(0% + var(--limel-top-edge-fade-height, 1rem)),
|
|
740
|
+
black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)),
|
|
741
|
+
transparent 100%
|
|
742
|
+
);
|
|
743
|
+
-webkit-mask-image: var(--limel-overflow-mask-vertical);
|
|
744
|
+
mask-image: var(--limel-overflow-mask-vertical);
|
|
745
|
+
padding-top: var(--limel-top-edge-fade-height, 1rem);
|
|
746
|
+
padding-bottom: var(--limel-bottom-edge-fade-height, 1rem);
|
|
696
747
|
color: var(--mdc-theme-on-surface);
|
|
697
|
-
padding: var(--dialog-padding-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
.scrollbox {
|
|
701
|
-
--dialog-background-color-transparent: rgba(var(--contrast-100), 0);
|
|
702
|
-
--dialog-scroll-shadow-color: rgba(var(--color-black), 0.2);
|
|
703
|
-
--dialog-scroll-shadow-color-transparent: rgba(var(--color-black), 0);
|
|
704
|
-
/* prettier-ignore */
|
|
705
|
-
background: linear-gradient(var(--dialog-background-color) 30%, var(--dialog-background-color-transparent)), linear-gradient(var(--dialog-background-color-transparent), var(--dialog-background-color) 70%) 0 100%, radial-gradient(farthest-side at 50% 0, var(--dialog-scroll-shadow-color), var(--dialog-scroll-shadow-color-transparent)), radial-gradient(farthest-side at 50% 100%, var(--dialog-scroll-shadow-color), var(--dialog-scroll-shadow-color-transparent)) 0 100%;
|
|
706
|
-
background-repeat: no-repeat;
|
|
707
|
-
background-color: var(--dialog-background-color);
|
|
708
|
-
background-size: 100% 2.5rem, 100% 2.5rem, 100% 0.875rem, 100% 0.875rem;
|
|
709
|
-
/* Opera doesn't support this in the shorthand */
|
|
710
|
-
background-attachment: local, local, scroll, scroll;
|
|
748
|
+
padding-left: var(--dialog-padding-left-right, min(1.25rem, 3vw));
|
|
749
|
+
padding-right: var(--dialog-padding-left-right, min(1.25rem, 3vw));
|
|
711
750
|
}
|
|
712
751
|
|
|
713
752
|
#initialFocusElement {
|
|
@@ -78,7 +78,7 @@ export class Dialog {
|
|
|
78
78
|
return (h("div", { class: {
|
|
79
79
|
'mdc-dialog': true,
|
|
80
80
|
'full-screen': !!this.fullscreen,
|
|
81
|
-
}, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, h("input", { hidden: true, id: "initialFocusEl" }), h("div", { class: "mdc-dialog__container" }, h("div", { class: "mdc-dialog__surface" }, h("input", { type: "text", id: "initialFocusElement" }), this.renderHeading(), h("div", { class: "mdc-dialog__content
|
|
81
|
+
}, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, h("input", { hidden: true, id: "initialFocusEl" }), h("div", { class: "mdc-dialog__container" }, h("div", { class: "mdc-dialog__surface" }, h("input", { type: "text", id: "initialFocusElement" }), this.renderHeading(), h("div", { class: "mdc-dialog__content", id: 'limel-dialog-content-' + this.id }, h("slot", null)), this.renderFooter())), h("div", { class: "mdc-dialog__scrim" })));
|
|
82
82
|
}
|
|
83
83
|
watchHandler(newValue, oldValue) {
|
|
84
84
|
if (oldValue === newValue) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,MAAM,OAAO,MAAM;EAiDf;IAFQ,eAAU,GAAG,IAAI,CAAC;;sBApCN,KAAK;gBAMX,KAAK;0BAMqB;MACpC,SAAS,EAAE,IAAI;MACf,UAAU,EAAE,IAAI;KACnB;IAwBG,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,IAAI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AI,CAAC,SAAS,CAAC,gBAAgB,GAAG,EAAE,CAAC;IACrC,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;MAChC,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;KAC7C;IAED,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,EAAE,CAAC;IACpC,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE;MAC/B,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,OAAO,CAAC;KAC5C;EACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { DialogHeading, ClosingActions } from '@limetech/lime-elements';\nimport { MDCDialog } from '@material/dialog';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { isEqual } from 'lodash-es';\nimport { dispatchResizeEvent } from '../../util/dispatch-resize-event';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * :::note\n * Regarding the `close` event: When putting other elements that emit `close`\n * events inside a dialog, those events must be caught and stopped inside the\n * dialog. If not, they will bubble to the event handler listening for `close`\n * events on the dialog, which will close the dialog too.\n *\n * See the example _Nested `close` events_.\n * :::\n *\n * :::important\n * Are you developing for\n * [Lime CRM](https://www.lime-technologies.com/en/lime-crm/)? Please note that\n * you should use the [DialogService](https://lundalogik.github.io/lime-web-components/versions/latest/#/api/dialog-service)\n * from Lime Web Components to open dialogs in Lime CRM.\n * :::\n * @exampleComponent limel-example-dialog\n * @exampleComponent limel-example-dialog-nested-close-events\n * @exampleComponent limel-example-dialog-heading\n * @exampleComponent limel-example-dialog-form\n * @exampleComponent limel-example-dialog-size\n * @exampleComponent limel-example-dialog-fullscreen\n * @exampleComponent limel-example-dialog-closing-actions\n * @exampleComponent limel-example-dialog-action-buttons\n * @slot - Content to put inside the dialog\n * @slot button - The dialog buttons\n */\n@Component({\n tag: 'limel-dialog',\n shadow: true,\n styleUrl: 'dialog.scss',\n})\nexport class Dialog {\n /**\n * The heading for the dialog, if any.\n */\n @Prop()\n public heading: string | DialogHeading;\n\n /**\n * Set to `true` to make the dialog \"fullscreen\".\n */\n @Prop({ reflect: true })\n public fullscreen = false;\n\n /**\n * `true` if the dialog is open, `false` otherwise.\n */\n @Prop({ mutable: true, reflect: true })\n public open = false;\n\n /**\n * Defines which action triggers a close-event.\n */\n @Prop({ reflect: true })\n public closingActions: ClosingActions = {\n escapeKey: true,\n scrimClick: true,\n };\n /**\n * Emitted when the dialog is closed from inside the component.\n * (*Not* emitted when the consumer sets the `open`-property to `false`.)\n */\n @Event()\n private close: EventEmitter<void>;\n\n /**\n * Emitted when the dialog is in the process of being closed.\n */\n @Event()\n private closing: EventEmitter<void>;\n\n @Element()\n private host: HTMLLimelDialogElement;\n\n private mdcDialog: MDCDialog;\n\n private id: string;\n\n private showFooter = true;\n\n constructor() {\n this.handleMdcOpened = this.handleMdcOpened.bind(this);\n this.handleMdcClosed = this.handleMdcClosed.bind(this);\n this.handleMdcClosing = this.handleMdcClosing.bind(this);\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n this.id = createRandomString();\n this.showFooter = !!this.host.querySelector('[slot=\"button\"]');\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n private initialize() {\n const element = this.host.shadowRoot.querySelector('.mdc-dialog');\n if (!element) {\n return;\n }\n\n this.mdcDialog = new MDCDialog(element);\n if (this.open) {\n this.mdcDialog.open();\n }\n\n this.mdcDialog.listen('MDCDialog:opened', this.handleMdcOpened);\n this.mdcDialog.listen('MDCDialog:closed', this.handleMdcClosed);\n this.mdcDialog.listen('MDCDialog:closing', this.handleMdcClosing);\n\n this.setClosingActions();\n }\n\n public disconnectedCallback() {\n this.mdcDialog.unlisten('MDCDialog:opened', this.handleMdcOpened);\n this.mdcDialog.unlisten('MDCDialog:closed', this.handleMdcClosed);\n this.mdcDialog.unlisten('MDCDialog:closing', this.handleMdcClosing);\n this.mdcDialog.destroy();\n }\n\n public render() {\n return (\n <div\n class={{\n 'mdc-dialog': true,\n 'full-screen': !!this.fullscreen,\n }}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby={'limel-dialog-title-' + this.id}\n aria-describedby={'limel-dialog-content-' + this.id}\n >\n <input hidden={true} id=\"initialFocusEl\" />\n <div class=\"mdc-dialog__container\">\n <div class=\"mdc-dialog__surface\">\n {/*\n The `initialFocusElement` below is needed to make\n focus trapping work. At the time of writing, the\n focusable elements inside the slots are not\n detected, so we supply our own hidden element for\n the focus trap to use. Read more here:\n https://github.com/material-components/material-components-web/tree/v11.0.0/packages/mdc-dialog#handling-focus-trapping\n */}\n <input type=\"text\" id=\"initialFocusElement\" />\n {this.renderHeading()}\n <div\n class=\"mdc-dialog__content scrollbox\"\n id={'limel-dialog-content-' + this.id}\n >\n <slot />\n </div>\n {this.renderFooter()}\n </div>\n </div>\n <div class=\"mdc-dialog__scrim\" />\n </div>\n );\n }\n\n @Watch('open')\n protected watchHandler(newValue: boolean, oldValue: boolean) {\n if (oldValue === newValue) {\n return;\n }\n\n if (!this.mdcDialog) {\n return;\n }\n\n if (newValue) {\n this.mdcDialog.open();\n } else {\n this.mdcDialog.close();\n }\n }\n\n @Watch('closingActions')\n protected closingActionsChanged(\n newValue: ClosingActions,\n oldValue: ClosingActions\n ) {\n if (isEqual(newValue, oldValue)) {\n return;\n }\n\n this.setClosingActions();\n }\n\n private handleMdcOpened() {\n // When the opening-animation has completed, dispatch a\n // resize-event so that any content that depends on\n // javascript for layout has a chance to update to the\n // final layout of the dialog. /Ads\n const waitForUiToRender = 100;\n setTimeout(dispatchResizeEvent, waitForUiToRender);\n }\n\n private handleMdcClosed() {\n if (this.open) {\n this.close.emit();\n }\n\n this.open = false;\n }\n\n private handleMdcClosing() {\n this.closing.emit();\n }\n\n private isBadgeHeading(\n heading: string | DialogHeading\n ): heading is DialogHeading {\n return typeof heading === 'object' && !!heading.title && !!heading.icon;\n }\n\n private renderHeading() {\n if (this.isBadgeHeading(this.heading)) {\n const { title, subtitle, supportingText, icon } = this.heading;\n\n return (\n <limel-header\n icon={icon}\n heading={title}\n subheading={subtitle}\n supportingText={supportingText}\n ></limel-header>\n );\n } else if (typeof this.heading === 'string') {\n return <limel-header heading={this.heading}></limel-header>;\n }\n\n return null;\n }\n\n private renderFooter() {\n if (this.showFooter) {\n return (\n <footer class=\"mdc-dialog__actions\">\n <slot name=\"button\" />\n </footer>\n );\n }\n }\n\n private setClosingActions() {\n this.mdcDialog.scrimClickAction = '';\n if (this.closingActions.scrimClick) {\n this.mdcDialog.scrimClickAction = 'close';\n }\n\n this.mdcDialog.escapeKeyAction = '';\n if (this.closingActions.escapeKey) {\n this.mdcDialog.escapeKeyAction = 'close';\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,MAAM,OAAO,MAAM;EAiDf;IAFQ,eAAU,GAAG,IAAI,CAAC;;sBApCN,KAAK;gBAMX,KAAK;0BAMqB;MACpC,SAAS,EAAE,IAAI;MACf,UAAU,EAAE,IAAI;KACnB;IAwBG,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IA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,cAAQ,KAAK,EAAC,qBAAqB;QAC/B,YAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACZ,CAAC;KACL;EACL,CAAC;EAEO,iBAAiB;IACrB,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,EAAE,CAAC;IACrC,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;MAChC,IAAI,CAAC,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC;KAC7C;IAED,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,EAAE,CAAC;IACpC,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE;MAC/B,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,OAAO,CAAC;KAC5C;EACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { DialogHeading, ClosingActions } from '@limetech/lime-elements';\nimport { MDCDialog } from '@material/dialog';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { isEqual } from 'lodash-es';\nimport { dispatchResizeEvent } from '../../util/dispatch-resize-event';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * :::note\n * Regarding the `close` event: When putting other elements that emit `close`\n * events inside a dialog, those events must be caught and stopped inside the\n * dialog. If not, they will bubble to the event handler listening for `close`\n * events on the dialog, which will close the dialog too.\n *\n * See the example _Nested `close` events_.\n * :::\n *\n * :::important\n * Are you developing for\n * [Lime CRM](https://www.lime-technologies.com/en/lime-crm/)? Please note that\n * you should use the [DialogService](https://lundalogik.github.io/lime-web-components/versions/latest/#/api/dialog-service)\n * from Lime Web Components to open dialogs in Lime CRM.\n * :::\n * @exampleComponent limel-example-dialog\n * @exampleComponent limel-example-dialog-nested-close-events\n * @exampleComponent limel-example-dialog-heading\n * @exampleComponent limel-example-dialog-form\n * @exampleComponent limel-example-dialog-size\n * @exampleComponent limel-example-dialog-fullscreen\n * @exampleComponent limel-example-dialog-closing-actions\n * @exampleComponent limel-example-dialog-action-buttons\n * @slot - Content to put inside the dialog\n * @slot button - The dialog buttons\n */\n@Component({\n tag: 'limel-dialog',\n shadow: true,\n styleUrl: 'dialog.scss',\n})\nexport class Dialog {\n /**\n * The heading for the dialog, if any.\n */\n @Prop()\n public heading: string | DialogHeading;\n\n /**\n * Set to `true` to make the dialog \"fullscreen\".\n */\n @Prop({ reflect: true })\n public fullscreen = false;\n\n /**\n * `true` if the dialog is open, `false` otherwise.\n */\n @Prop({ mutable: true, reflect: true })\n public open = false;\n\n /**\n * Defines which action triggers a close-event.\n */\n @Prop({ reflect: true })\n public closingActions: ClosingActions = {\n escapeKey: true,\n scrimClick: true,\n };\n /**\n * Emitted when the dialog is closed from inside the component.\n * (*Not* emitted when the consumer sets the `open`-property to `false`.)\n */\n @Event()\n private close: EventEmitter<void>;\n\n /**\n * Emitted when the dialog is in the process of being closed.\n */\n @Event()\n private closing: EventEmitter<void>;\n\n @Element()\n private host: HTMLLimelDialogElement;\n\n private mdcDialog: MDCDialog;\n\n private id: string;\n\n private showFooter = true;\n\n constructor() {\n this.handleMdcOpened = this.handleMdcOpened.bind(this);\n this.handleMdcClosed = this.handleMdcClosed.bind(this);\n this.handleMdcClosing = this.handleMdcClosing.bind(this);\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n this.id = createRandomString();\n this.showFooter = !!this.host.querySelector('[slot=\"button\"]');\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n private initialize() {\n const element = this.host.shadowRoot.querySelector('.mdc-dialog');\n if (!element) {\n return;\n }\n\n this.mdcDialog = new MDCDialog(element);\n if (this.open) {\n this.mdcDialog.open();\n }\n\n this.mdcDialog.listen('MDCDialog:opened', this.handleMdcOpened);\n this.mdcDialog.listen('MDCDialog:closed', this.handleMdcClosed);\n this.mdcDialog.listen('MDCDialog:closing', this.handleMdcClosing);\n\n this.setClosingActions();\n }\n\n public disconnectedCallback() {\n this.mdcDialog.unlisten('MDCDialog:opened', this.handleMdcOpened);\n this.mdcDialog.unlisten('MDCDialog:closed', this.handleMdcClosed);\n this.mdcDialog.unlisten('MDCDialog:closing', this.handleMdcClosing);\n this.mdcDialog.destroy();\n }\n\n public render() {\n return (\n <div\n class={{\n 'mdc-dialog': true,\n 'full-screen': !!this.fullscreen,\n }}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby={'limel-dialog-title-' + this.id}\n aria-describedby={'limel-dialog-content-' + this.id}\n >\n <input hidden={true} id=\"initialFocusEl\" />\n <div class=\"mdc-dialog__container\">\n <div class=\"mdc-dialog__surface\">\n {/*\n The `initialFocusElement` below is needed to make\n focus trapping work. At the time of writing, the\n focusable elements inside the slots are not\n detected, so we supply our own hidden element for\n the focus trap to use. Read more here:\n https://github.com/material-components/material-components-web/tree/v11.0.0/packages/mdc-dialog#handling-focus-trapping\n */}\n <input type=\"text\" id=\"initialFocusElement\" />\n {this.renderHeading()}\n <div\n class=\"mdc-dialog__content\"\n id={'limel-dialog-content-' + this.id}\n >\n <slot />\n </div>\n {this.renderFooter()}\n </div>\n </div>\n <div class=\"mdc-dialog__scrim\" />\n </div>\n );\n }\n\n @Watch('open')\n protected watchHandler(newValue: boolean, oldValue: boolean) {\n if (oldValue === newValue) {\n return;\n }\n\n if (!this.mdcDialog) {\n return;\n }\n\n if (newValue) {\n this.mdcDialog.open();\n } else {\n this.mdcDialog.close();\n }\n }\n\n @Watch('closingActions')\n protected closingActionsChanged(\n newValue: ClosingActions,\n oldValue: ClosingActions\n ) {\n if (isEqual(newValue, oldValue)) {\n return;\n }\n\n this.setClosingActions();\n }\n\n private handleMdcOpened() {\n // When the opening-animation has completed, dispatch a\n // resize-event so that any content that depends on\n // javascript for layout has a chance to update to the\n // final layout of the dialog. /Ads\n const waitForUiToRender = 100;\n setTimeout(dispatchResizeEvent, waitForUiToRender);\n }\n\n private handleMdcClosed() {\n if (this.open) {\n this.close.emit();\n }\n\n this.open = false;\n }\n\n private handleMdcClosing() {\n this.closing.emit();\n }\n\n private isBadgeHeading(\n heading: string | DialogHeading\n ): heading is DialogHeading {\n return typeof heading === 'object' && !!heading.title && !!heading.icon;\n }\n\n private renderHeading() {\n if (this.isBadgeHeading(this.heading)) {\n const { title, subtitle, supportingText, icon } = this.heading;\n\n return (\n <limel-header\n icon={icon}\n heading={title}\n subheading={subtitle}\n supportingText={supportingText}\n ></limel-header>\n );\n } else if (typeof this.heading === 'string') {\n return <limel-header heading={this.heading}></limel-header>;\n }\n\n return null;\n }\n\n private renderFooter() {\n if (this.showFooter) {\n return (\n <footer class=\"mdc-dialog__actions\">\n <slot name=\"button\" />\n </footer>\n );\n }\n }\n\n private setClosingActions() {\n this.mdcDialog.scrimClickAction = '';\n if (this.closingActions.scrimClick) {\n this.mdcDialog.scrimClickAction = 'close';\n }\n\n this.mdcDialog.escapeKeyAction = '';\n if (this.closingActions.escapeKey) {\n this.mdcDialog.escapeKeyAction = 'close';\n }\n }\n}\n"]}
|
|
@@ -6,6 +6,33 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Or, just don't import anything, that works too.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* This mixin will mask out the content that is close to
|
|
11
|
+
* the edges of a scrollable area.
|
|
12
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
13
|
+
* as an argument for `$direction`.
|
|
14
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
15
|
+
* as an argument for `$direction`.
|
|
16
|
+
*
|
|
17
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
18
|
+
* the size of the fade-out edge effect is the same as the
|
|
19
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
20
|
+
* scrollable area that does not have a padding will fade out before
|
|
21
|
+
* any scrolling has been done.
|
|
22
|
+
* This is why this mixin already adds paddings, which automatically
|
|
23
|
+
* default to the size of the fade-out effect.
|
|
24
|
+
* This size defaults to `1rem`, but to override the size use
|
|
25
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
26
|
+
* when `vertically` argument is set, and use
|
|
27
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
28
|
+
* when `horizontally` argument is set.
|
|
29
|
+
* Of course you can also programmatically increase and decrease the
|
|
30
|
+
* size of these variables for each edge, based on the amount of
|
|
31
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
32
|
+
* to add a custom padding where the mixin is used, to override
|
|
33
|
+
* the paddings that are automatically added by the mixin in the
|
|
34
|
+
* compiled CSS code.
|
|
35
|
+
*/
|
|
9
36
|
/*
|
|
10
37
|
* This file is imported into every component!
|
|
11
38
|
*
|
|
@@ -6,6 +6,33 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Or, just don't import anything, that works too.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* This mixin will mask out the content that is close to
|
|
11
|
+
* the edges of a scrollable area.
|
|
12
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
13
|
+
* as an argument for `$direction`.
|
|
14
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
15
|
+
* as an argument for `$direction`.
|
|
16
|
+
*
|
|
17
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
18
|
+
* the size of the fade-out edge effect is the same as the
|
|
19
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
20
|
+
* scrollable area that does not have a padding will fade out before
|
|
21
|
+
* any scrolling has been done.
|
|
22
|
+
* This is why this mixin already adds paddings, which automatically
|
|
23
|
+
* default to the size of the fade-out effect.
|
|
24
|
+
* This size defaults to `1rem`, but to override the size use
|
|
25
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
26
|
+
* when `vertically` argument is set, and use
|
|
27
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
28
|
+
* when `horizontally` argument is set.
|
|
29
|
+
* Of course you can also programmatically increase and decrease the
|
|
30
|
+
* size of these variables for each edge, based on the amount of
|
|
31
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
32
|
+
* to add a custom padding where the mixin is used, to override
|
|
33
|
+
* the paddings that are automatically added by the mixin in the
|
|
34
|
+
* compiled CSS code.
|
|
35
|
+
*/
|
|
9
36
|
/*
|
|
10
37
|
* This file is imported into every component!
|
|
11
38
|
*
|
|
@@ -643,6 +643,33 @@ limel-code-editor {
|
|
|
643
643
|
*
|
|
644
644
|
* Or, just don't import anything, that works too.
|
|
645
645
|
*/
|
|
646
|
+
/**
|
|
647
|
+
* This mixin will mask out the content that is close to
|
|
648
|
+
* the edges of a scrollable area.
|
|
649
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
650
|
+
* as an argument for `$direction`.
|
|
651
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
652
|
+
* as an argument for `$direction`.
|
|
653
|
+
*
|
|
654
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
655
|
+
* the size of the fade-out edge effect is the same as the
|
|
656
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
657
|
+
* scrollable area that does not have a padding will fade out before
|
|
658
|
+
* any scrolling has been done.
|
|
659
|
+
* This is why this mixin already adds paddings, which automatically
|
|
660
|
+
* default to the size of the fade-out effect.
|
|
661
|
+
* This size defaults to `1rem`, but to override the size use
|
|
662
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
663
|
+
* when `vertically` argument is set, and use
|
|
664
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
665
|
+
* when `horizontally` argument is set.
|
|
666
|
+
* Of course you can also programmatically increase and decrease the
|
|
667
|
+
* size of these variables for each edge, based on the amount of
|
|
668
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
669
|
+
* to add a custom padding where the mixin is used, to override
|
|
670
|
+
* the paddings that are automatically added by the mixin in the
|
|
671
|
+
* compiled CSS code.
|
|
672
|
+
*/
|
|
646
673
|
.limel-form-row--layout {
|
|
647
674
|
--limel-form-row-border-radius: 0.375rem;
|
|
648
675
|
--limel-form-row-icon-size: 1.75rem;
|
|
@@ -6,6 +6,33 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Or, just don't import anything, that works too.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* This mixin will mask out the content that is close to
|
|
11
|
+
* the edges of a scrollable area.
|
|
12
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
13
|
+
* as an argument for `$direction`.
|
|
14
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
15
|
+
* as an argument for `$direction`.
|
|
16
|
+
*
|
|
17
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
18
|
+
* the size of the fade-out edge effect is the same as the
|
|
19
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
20
|
+
* scrollable area that does not have a padding will fade out before
|
|
21
|
+
* any scrolling has been done.
|
|
22
|
+
* This is why this mixin already adds paddings, which automatically
|
|
23
|
+
* default to the size of the fade-out effect.
|
|
24
|
+
* This size defaults to `1rem`, but to override the size use
|
|
25
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
26
|
+
* when `vertically` argument is set, and use
|
|
27
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
28
|
+
* when `horizontally` argument is set.
|
|
29
|
+
* Of course you can also programmatically increase and decrease the
|
|
30
|
+
* size of these variables for each edge, based on the amount of
|
|
31
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
32
|
+
* to add a custom padding where the mixin is used, to override
|
|
33
|
+
* the paddings that are automatically added by the mixin in the
|
|
34
|
+
* compiled CSS code.
|
|
35
|
+
*/
|
|
9
36
|
/*
|
|
10
37
|
* This file is imported into every component!
|
|
11
38
|
*
|
|
@@ -6,233 +6,33 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Or, just don't import anything, that works too.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
* This
|
|
9
|
+
/**
|
|
10
|
+
* This mixin will mask out the content that is close to
|
|
11
|
+
* the edges of a scrollable area.
|
|
12
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
13
|
+
* as an argument for `$direction`.
|
|
14
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
15
|
+
* as an argument for `$direction`.
|
|
11
16
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
17
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
18
|
+
* the size of the fade-out edge effect is the same as the
|
|
19
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
20
|
+
* scrollable area that does not have a padding will fade out before
|
|
21
|
+
* any scrolling has been done.
|
|
22
|
+
* This is why this mixin already adds paddings, which automatically
|
|
23
|
+
* default to the size of the fade-out effect.
|
|
24
|
+
* This size defaults to `1rem`, but to override the size use
|
|
25
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
26
|
+
* when `vertically` argument is set, and use
|
|
27
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
28
|
+
* when `horizontally` argument is set.
|
|
29
|
+
* Of course you can also programmatically increase and decrease the
|
|
30
|
+
* size of these variables for each edge, based on the amount of
|
|
31
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
32
|
+
* to add a custom padding where the mixin is used, to override
|
|
33
|
+
* the paddings that are automatically added by the mixin in the
|
|
34
|
+
* compiled CSS code.
|
|
14
35
|
*/
|
|
15
|
-
.mdc-icon-button {
|
|
16
|
-
font-size: 24px;
|
|
17
|
-
width: 48px;
|
|
18
|
-
height: 48px;
|
|
19
|
-
padding: 12px;
|
|
20
|
-
}
|
|
21
|
-
.mdc-icon-button.mdc-icon-button--reduced-size {
|
|
22
|
-
width: 40px;
|
|
23
|
-
height: 40px;
|
|
24
|
-
padding: 8px;
|
|
25
|
-
}
|
|
26
|
-
.mdc-icon-button.mdc-icon-button--reduced-size.mdc-icon-button--touch {
|
|
27
|
-
margin-top: 4px;
|
|
28
|
-
margin-bottom: 4px;
|
|
29
|
-
margin-right: 4px;
|
|
30
|
-
margin-left: 4px;
|
|
31
|
-
}
|
|
32
|
-
.mdc-icon-button .mdc-icon-button__touch {
|
|
33
|
-
position: absolute;
|
|
34
|
-
top: 50%;
|
|
35
|
-
height: 48px;
|
|
36
|
-
/* @noflip */ /*rtl:ignore*/
|
|
37
|
-
left: 50%;
|
|
38
|
-
width: 48px;
|
|
39
|
-
transform: translate(-50%, -50%);
|
|
40
|
-
}
|
|
41
|
-
.mdc-icon-button:disabled {
|
|
42
|
-
color: rgba(0, 0, 0, 0.38);
|
|
43
|
-
/* @alternate */
|
|
44
|
-
color: var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38));
|
|
45
|
-
}
|
|
46
|
-
.mdc-icon-button svg,
|
|
47
|
-
.mdc-icon-button img {
|
|
48
|
-
width: 24px;
|
|
49
|
-
height: 24px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.mdc-icon-button {
|
|
53
|
-
display: inline-block;
|
|
54
|
-
position: relative;
|
|
55
|
-
box-sizing: border-box;
|
|
56
|
-
border: none;
|
|
57
|
-
outline: none;
|
|
58
|
-
background-color: transparent;
|
|
59
|
-
fill: currentColor;
|
|
60
|
-
color: inherit;
|
|
61
|
-
text-decoration: none;
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
user-select: none;
|
|
64
|
-
overflow: visible;
|
|
65
|
-
}
|
|
66
|
-
.mdc-icon-button .mdc-icon-button__touch {
|
|
67
|
-
position: absolute;
|
|
68
|
-
top: 50%;
|
|
69
|
-
height: 48px;
|
|
70
|
-
/* @noflip */ /*rtl:ignore*/
|
|
71
|
-
left: 50%;
|
|
72
|
-
width: 48px;
|
|
73
|
-
transform: translate(-50%, -50%);
|
|
74
|
-
}
|
|
75
|
-
.mdc-icon-button:disabled {
|
|
76
|
-
cursor: default;
|
|
77
|
-
pointer-events: none;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.mdc-icon-button--display-flex {
|
|
81
|
-
align-items: center;
|
|
82
|
-
display: inline-flex;
|
|
83
|
-
justify-content: center;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.mdc-icon-button__icon {
|
|
87
|
-
display: inline-block;
|
|
88
|
-
}
|
|
89
|
-
.mdc-icon-button__icon.mdc-icon-button__icon--on {
|
|
90
|
-
display: none;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.mdc-icon-button--touch {
|
|
94
|
-
margin-top: 0px;
|
|
95
|
-
margin-bottom: 0px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.mdc-icon-button--on .mdc-icon-button__icon {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on {
|
|
102
|
-
display: inline-block;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
@keyframes mdc-ripple-fg-radius-in {
|
|
106
|
-
from {
|
|
107
|
-
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
108
|
-
transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1);
|
|
109
|
-
}
|
|
110
|
-
to {
|
|
111
|
-
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
@keyframes mdc-ripple-fg-opacity-in {
|
|
115
|
-
from {
|
|
116
|
-
animation-timing-function: linear;
|
|
117
|
-
opacity: 0;
|
|
118
|
-
}
|
|
119
|
-
to {
|
|
120
|
-
opacity: var(--mdc-ripple-fg-opacity, 0);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
@keyframes mdc-ripple-fg-opacity-out {
|
|
124
|
-
from {
|
|
125
|
-
animation-timing-function: linear;
|
|
126
|
-
opacity: var(--mdc-ripple-fg-opacity, 0);
|
|
127
|
-
}
|
|
128
|
-
to {
|
|
129
|
-
opacity: 0;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
.mdc-icon-button {
|
|
133
|
-
--mdc-ripple-fg-size: 0;
|
|
134
|
-
--mdc-ripple-left: 0;
|
|
135
|
-
--mdc-ripple-top: 0;
|
|
136
|
-
--mdc-ripple-fg-scale: 1;
|
|
137
|
-
--mdc-ripple-fg-translate-end: 0;
|
|
138
|
-
--mdc-ripple-fg-translate-start: 0;
|
|
139
|
-
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
140
|
-
will-change: transform, opacity;
|
|
141
|
-
}
|
|
142
|
-
.mdc-icon-button .mdc-icon-button__ripple::before,
|
|
143
|
-
.mdc-icon-button .mdc-icon-button__ripple::after {
|
|
144
|
-
position: absolute;
|
|
145
|
-
border-radius: 50%;
|
|
146
|
-
opacity: 0;
|
|
147
|
-
pointer-events: none;
|
|
148
|
-
content: "";
|
|
149
|
-
}
|
|
150
|
-
.mdc-icon-button .mdc-icon-button__ripple::before {
|
|
151
|
-
transition: opacity 15ms linear, background-color 15ms linear;
|
|
152
|
-
z-index: 1;
|
|
153
|
-
/* @alternate */
|
|
154
|
-
z-index: var(--mdc-ripple-z-index, 1);
|
|
155
|
-
}
|
|
156
|
-
.mdc-icon-button .mdc-icon-button__ripple::after {
|
|
157
|
-
z-index: 0;
|
|
158
|
-
/* @alternate */
|
|
159
|
-
z-index: var(--mdc-ripple-z-index, 0);
|
|
160
|
-
}
|
|
161
|
-
.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::before {
|
|
162
|
-
transform: scale(var(--mdc-ripple-fg-scale, 1));
|
|
163
|
-
}
|
|
164
|
-
.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after {
|
|
165
|
-
top: 0;
|
|
166
|
-
/* @noflip */ /*rtl:ignore*/
|
|
167
|
-
left: 0;
|
|
168
|
-
transform: scale(0);
|
|
169
|
-
transform-origin: center center;
|
|
170
|
-
}
|
|
171
|
-
.mdc-icon-button.mdc-ripple-upgraded--unbounded .mdc-icon-button__ripple::after {
|
|
172
|
-
top: var(--mdc-ripple-top, 0);
|
|
173
|
-
/* @noflip */ /*rtl:ignore*/
|
|
174
|
-
left: var(--mdc-ripple-left, 0);
|
|
175
|
-
}
|
|
176
|
-
.mdc-icon-button.mdc-ripple-upgraded--foreground-activation .mdc-icon-button__ripple::after {
|
|
177
|
-
animation: mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards;
|
|
178
|
-
}
|
|
179
|
-
.mdc-icon-button.mdc-ripple-upgraded--foreground-deactivation .mdc-icon-button__ripple::after {
|
|
180
|
-
animation: mdc-ripple-fg-opacity-out 150ms;
|
|
181
|
-
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
|
|
182
|
-
}
|
|
183
|
-
.mdc-icon-button .mdc-icon-button__ripple::before,
|
|
184
|
-
.mdc-icon-button .mdc-icon-button__ripple::after {
|
|
185
|
-
top: calc(50% - 50%);
|
|
186
|
-
/* @noflip */ /*rtl:ignore*/
|
|
187
|
-
left: calc(50% - 50%);
|
|
188
|
-
width: 100%;
|
|
189
|
-
height: 100%;
|
|
190
|
-
}
|
|
191
|
-
.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::before,
|
|
192
|
-
.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after {
|
|
193
|
-
top: var(--mdc-ripple-top, calc(50% - 50%));
|
|
194
|
-
/* @noflip */ /*rtl:ignore*/
|
|
195
|
-
left: var(--mdc-ripple-left, calc(50% - 50%));
|
|
196
|
-
width: var(--mdc-ripple-fg-size, 100%);
|
|
197
|
-
height: var(--mdc-ripple-fg-size, 100%);
|
|
198
|
-
}
|
|
199
|
-
.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after {
|
|
200
|
-
width: var(--mdc-ripple-fg-size, 100%);
|
|
201
|
-
height: var(--mdc-ripple-fg-size, 100%);
|
|
202
|
-
}
|
|
203
|
-
.mdc-icon-button .mdc-icon-button__ripple::before, .mdc-icon-button .mdc-icon-button__ripple::after {
|
|
204
|
-
background-color: #000;
|
|
205
|
-
/* @alternate */
|
|
206
|
-
background-color: var(--mdc-ripple-color, #000);
|
|
207
|
-
}
|
|
208
|
-
.mdc-icon-button:hover .mdc-icon-button__ripple::before, .mdc-icon-button.mdc-ripple-surface--hover .mdc-icon-button__ripple::before {
|
|
209
|
-
opacity: 0.04;
|
|
210
|
-
/* @alternate */
|
|
211
|
-
opacity: var(--mdc-ripple-hover-opacity, 0.04);
|
|
212
|
-
}
|
|
213
|
-
.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__ripple::before, .mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__ripple::before {
|
|
214
|
-
transition-duration: 75ms;
|
|
215
|
-
opacity: 0.12;
|
|
216
|
-
/* @alternate */
|
|
217
|
-
opacity: var(--mdc-ripple-focus-opacity, 0.12);
|
|
218
|
-
}
|
|
219
|
-
.mdc-icon-button:not(.mdc-ripple-upgraded) .mdc-icon-button__ripple::after {
|
|
220
|
-
transition: opacity 150ms linear;
|
|
221
|
-
}
|
|
222
|
-
.mdc-icon-button:not(.mdc-ripple-upgraded):active .mdc-icon-button__ripple::after {
|
|
223
|
-
transition-duration: 75ms;
|
|
224
|
-
opacity: 0.12;
|
|
225
|
-
/* @alternate */
|
|
226
|
-
opacity: var(--mdc-ripple-press-opacity, 0.12);
|
|
227
|
-
}
|
|
228
|
-
.mdc-icon-button.mdc-ripple-upgraded {
|
|
229
|
-
--mdc-ripple-fg-opacity: var(--mdc-ripple-press-opacity, 0.12);
|
|
230
|
-
}
|
|
231
|
-
.mdc-icon-button .mdc-icon-button__ripple {
|
|
232
|
-
pointer-events: none;
|
|
233
|
-
z-index: 1;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
36
|
/**
|
|
237
37
|
* @prop --icon-background-color: Background color of the button.
|
|
238
38
|
*/
|
|
@@ -244,7 +44,8 @@
|
|
|
244
44
|
pointer-events: none;
|
|
245
45
|
}
|
|
246
46
|
|
|
247
|
-
|
|
47
|
+
button {
|
|
48
|
+
all: unset;
|
|
248
49
|
transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
249
50
|
cursor: pointer;
|
|
250
51
|
color: var(--mdc-theme-on-surface);
|
|
@@ -252,33 +53,33 @@
|
|
|
252
53
|
display: inline-flex;
|
|
253
54
|
align-items: center;
|
|
254
55
|
justify-content: center;
|
|
255
|
-
box-sizing: border-box;
|
|
256
56
|
height: 2.25rem;
|
|
257
57
|
width: 2.25rem;
|
|
258
|
-
padding: 0.125rem;
|
|
259
58
|
border-radius: 50%;
|
|
260
59
|
}
|
|
261
|
-
|
|
60
|
+
button:hover {
|
|
262
61
|
color: var(--mdc-theme-on-surface);
|
|
263
62
|
background-color: var(--lime-elevated-surface-background-color);
|
|
264
63
|
box-shadow: var(--button-shadow-hovered);
|
|
265
64
|
}
|
|
266
|
-
|
|
65
|
+
button:active {
|
|
267
66
|
box-shadow: var(--button-shadow-pressed);
|
|
268
67
|
transform: translate3d(0, 0.08rem, 0);
|
|
269
68
|
}
|
|
270
|
-
|
|
69
|
+
button:focus {
|
|
70
|
+
outline: none;
|
|
71
|
+
}
|
|
72
|
+
button:focus-visible {
|
|
73
|
+
outline: none;
|
|
74
|
+
box-shadow: var(--shadow-depth-8-focused);
|
|
75
|
+
}
|
|
76
|
+
:host([elevated]) button:not(:hover):not(:active):not(:focus-visible) {
|
|
271
77
|
box-shadow: var(--button-shadow-normal);
|
|
272
78
|
}
|
|
273
|
-
|
|
79
|
+
button:disabled {
|
|
274
80
|
color: var(--mdc-theme-text-disabled-on-background);
|
|
275
81
|
}
|
|
276
|
-
.mdc-icon-button:focus-visible {
|
|
277
|
-
box-shadow: var(--shadow-depth-8-focused);
|
|
278
|
-
border-radius: 50%;
|
|
279
|
-
}
|
|
280
82
|
|
|
281
83
|
limel-icon {
|
|
282
84
|
width: 1.25rem;
|
|
283
|
-
height: 1.25rem;
|
|
284
85
|
}
|
|
@@ -37,7 +37,7 @@ export class IconButton {
|
|
|
37
37
|
if (this.host.hasAttribute('tabindex')) {
|
|
38
38
|
buttonAttributes.tabindex = this.host.getAttribute('tabindex');
|
|
39
39
|
}
|
|
40
|
-
return (h("button", Object.assign({
|
|
40
|
+
return (h("button", Object.assign({ disabled: this.disabled, "aria-label": this.label, title: this.label }, buttonAttributes), h("limel-icon", { name: this.icon, badge: true })));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "limel-icon-button"; }
|
|
43
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACH,kBAAkB,EAClB,oBAAoB,GACvB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;GAMG;AAMH,MAAM,OAAO,UAAU;;;oBAYD,KAAK;;oBAYL,KAAK;;EAKhB,iBAAiB;IACpB,IAAI,CAAC,UAAU,EAAE,CAAC;EACtB,CAAC;EAEM,iBAAiB;IACpB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAClC,CAAC;EAEM,oBAAoB;IACvB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACpC,CAAC;EAEM,gBAAgB;IACnB,IAAI,CAAC,UAAU,EAAE,CAAC;EACtB,CAAC;EAEO,UAAU;IACd,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACvE,IAAI,CAAC,OAAO,EAAE;MACV,OAAO;KACV;EACL,CAAC;EAEM,MAAM;IACT,MAAM,gBAAgB,GAA0B,EAAE,CAAC;IACnD,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;MACpC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;KAClE;IAED,OAAO,CACH,4BACI,
|
|
1
|
+
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACH,kBAAkB,EAClB,oBAAoB,GACvB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;GAMG;AAMH,MAAM,OAAO,UAAU;;;oBAYD,KAAK;;oBAYL,KAAK;;EAKhB,iBAAiB;IACpB,IAAI,CAAC,UAAU,EAAE,CAAC;EACtB,CAAC;EAEM,iBAAiB;IACpB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAClC,CAAC;EAEM,oBAAoB;IACvB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACpC,CAAC;EAEM,gBAAgB;IACnB,IAAI,CAAC,UAAU,EAAE,CAAC;EACtB,CAAC;EAEO,UAAU;IACd,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACvE,IAAI,CAAC,OAAO,EAAE;MACV,OAAO;KACV;EACL,CAAC;EAEM,MAAM;IACT,MAAM,gBAAgB,GAA0B,EAAE,CAAC;IACnD,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;MACpC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;KAClE;IAED,OAAO,CACH,4BACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,gBACX,IAAI,CAAC,KAAK,EACtB,KAAK,EAAE,IAAI,CAAC,KAAK,IACb,gBAAgB;MAEpB,kBAAY,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,GAAI,CACvC,CACZ,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Element, h, Prop } from '@stencil/core';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from 'src/util/make-enter-clickable';\n\n/**\n * @exampleComponent limel-example-icon-button-basic\n * @exampleComponent limel-example-icon-button-disabled\n * @exampleComponent limel-example-icon-button-elevated\n * @exampleComponent limel-example-icon-button-toggle-state\n * @exampleComponent limel-example-icon-button-composite\n */\n@Component({\n tag: 'limel-icon-button',\n shadow: true,\n styleUrl: 'icon-button.scss',\n})\nexport class IconButton {\n /**\n * The icon to display.\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * Set to `true` to give the button our standard \"elevated\" look, lifting\n * it off the flat layout.\n */\n @Prop({ reflect: true })\n public elevated = false;\n\n /**\n * The text to show to screenreaders and other assistive tech.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to disable the button.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n @Element()\n private host: HTMLLimelIconButtonElement;\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n private initialize() {\n const element = this.host.shadowRoot.querySelector('.mdc-icon-button');\n if (!element) {\n return;\n }\n }\n\n public render() {\n const buttonAttributes: { tabindex?: string } = {};\n if (this.host.hasAttribute('tabindex')) {\n buttonAttributes.tabindex = this.host.getAttribute('tabindex');\n }\n\n return (\n <button\n disabled={this.disabled}\n aria-label={this.label}\n title={this.label}\n {...buttonAttributes}\n >\n <limel-icon name={this.icon} badge={true} />\n </button>\n );\n }\n}\n"]}
|