igniteui-webcomponents 6.2.1 → 6.3.0-RC.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/components/accordion/accordion.js +3 -4
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.js +3 -4
- package/components/avatar/avatar.js.map +1 -1
- package/components/badge/badge.js +3 -4
- package/components/badge/badge.js.map +1 -1
- package/components/banner/banner.js +3 -4
- package/components/banner/banner.js.map +1 -1
- package/components/button/button-base.js +1 -1
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.js +3 -4
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.js +3 -4
- package/components/button/icon-button.js.map +1 -1
- package/components/button-group/button-group.js +3 -4
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/toggle-button.js +4 -3
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/calendar.js +3 -4
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.js +4 -3
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/months-view/months-view.js +4 -3
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/years-view/years-view.js +4 -3
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/card.actions.js +3 -4
- package/components/card/card.actions.js.map +1 -1
- package/components/card/card.content.js +3 -4
- package/components/card/card.content.js.map +1 -1
- package/components/card/card.header.js +3 -4
- package/components/card/card.header.js.map +1 -1
- package/components/card/card.js +3 -4
- package/components/card/card.js.map +1 -1
- package/components/card/card.media.js +3 -4
- package/components/card/card.media.js.map +1 -1
- package/components/carousel/carousel-indicator-container.js +3 -4
- package/components/carousel/carousel-indicator-container.js.map +1 -1
- package/components/carousel/carousel-indicator.js +3 -4
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.js +3 -4
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.js +3 -4
- package/components/carousel/carousel.js.map +1 -1
- package/components/chat/chat-input.d.ts +91 -0
- package/components/chat/chat-input.js +263 -0
- package/components/chat/chat-input.js.map +1 -0
- package/components/chat/chat-message.d.ts +48 -0
- package/components/chat/chat-message.js +199 -0
- package/components/chat/chat-message.js.map +1 -0
- package/components/chat/chat-state.d.ts +130 -0
- package/components/chat/chat-state.js +180 -0
- package/components/chat/chat-state.js.map +1 -0
- package/components/chat/chat.d.ts +151 -0
- package/components/chat/chat.js +325 -0
- package/components/chat/chat.js.map +1 -0
- package/components/chat/extras/markdown-renderer.d.ts +26 -0
- package/components/chat/extras/markdown-renderer.js +49 -0
- package/components/chat/extras/markdown-renderer.js.map +1 -0
- package/components/chat/message-attachments.d.ts +56 -0
- package/components/chat/message-attachments.js +132 -0
- package/components/chat/message-attachments.js.map +1 -0
- package/components/chat/themes/attachments.d.ts +2 -0
- package/components/chat/themes/attachments.js +14 -0
- package/components/chat/themes/attachments.js.map +1 -0
- package/components/chat/themes/chat.base.css.d.ts +1 -0
- package/components/chat/themes/chat.base.css.js +3 -0
- package/components/chat/themes/chat.base.css.js.map +1 -0
- package/components/chat/themes/dark/chat.bootstrap.css.d.ts +1 -0
- package/components/chat/themes/dark/chat.bootstrap.css.js +3 -0
- package/components/chat/themes/dark/chat.bootstrap.css.js.map +1 -0
- package/components/chat/themes/dark/chat.fluent.css.d.ts +1 -0
- package/components/chat/themes/dark/chat.fluent.css.js +3 -0
- package/components/chat/themes/dark/chat.fluent.css.js.map +1 -0
- package/components/chat/themes/dark/chat.indigo.css.d.ts +1 -0
- package/components/chat/themes/dark/chat.indigo.css.js +3 -0
- package/components/chat/themes/dark/chat.indigo.css.js.map +1 -0
- package/components/chat/themes/dark/chat.material.css.d.ts +1 -0
- package/components/chat/themes/dark/chat.material.css.js +3 -0
- package/components/chat/themes/dark/chat.material.css.js.map +1 -0
- package/components/chat/themes/input.base.css.d.ts +1 -0
- package/components/chat/themes/input.base.css.js +3 -0
- package/components/chat/themes/input.base.css.js.map +1 -0
- package/components/chat/themes/input.d.ts +2 -0
- package/components/chat/themes/input.js +35 -0
- package/components/chat/themes/input.js.map +1 -0
- package/components/chat/themes/light/chat.bootstrap.css.d.ts +1 -0
- package/components/chat/themes/light/chat.bootstrap.css.js +3 -0
- package/components/chat/themes/light/chat.bootstrap.css.js.map +1 -0
- package/components/chat/themes/light/chat.fluent.css.d.ts +1 -0
- package/components/chat/themes/light/chat.fluent.css.js +3 -0
- package/components/chat/themes/light/chat.fluent.css.js.map +1 -0
- package/components/chat/themes/light/chat.indigo.css.d.ts +1 -0
- package/components/chat/themes/light/chat.indigo.css.js +3 -0
- package/components/chat/themes/light/chat.indigo.css.js.map +1 -0
- package/components/chat/themes/light/chat.material.css.d.ts +1 -0
- package/components/chat/themes/light/chat.material.css.js +3 -0
- package/components/chat/themes/light/chat.material.css.js.map +1 -0
- package/components/chat/themes/light/chat.shared.css.d.ts +1 -0
- package/components/chat/themes/light/chat.shared.css.js +3 -0
- package/components/chat/themes/light/chat.shared.css.js.map +1 -0
- package/components/chat/themes/message-attachments.base.css.d.ts +1 -0
- package/components/chat/themes/message-attachments.base.css.js +3 -0
- package/components/chat/themes/message-attachments.base.css.js.map +1 -0
- package/components/chat/themes/message.base.css.d.ts +1 -0
- package/components/chat/themes/message.base.css.js +3 -0
- package/components/chat/themes/message.base.css.js.map +1 -0
- package/components/chat/themes/message.d.ts +2 -0
- package/components/chat/themes/message.js +28 -0
- package/components/chat/themes/message.js.map +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.bootstrap.css.d.ts +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.bootstrap.css.js +3 -0
- package/components/chat/themes/shared/chat-message/chat-message.bootstrap.css.js.map +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.common.css.d.ts +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.common.css.js +3 -0
- package/components/chat/themes/shared/chat-message/chat-message.common.css.js.map +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.fluent.css.d.ts +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.fluent.css.js +3 -0
- package/components/chat/themes/shared/chat-message/chat-message.fluent.css.js.map +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.indigo.css.d.ts +1 -0
- package/components/chat/themes/shared/chat-message/chat-message.indigo.css.js +3 -0
- package/components/chat/themes/shared/chat-message/chat-message.indigo.css.js.map +1 -0
- package/components/chat/themes/shared/chat.bootstrap.css.d.ts +1 -0
- package/components/chat/themes/shared/chat.bootstrap.css.js +3 -0
- package/components/chat/themes/shared/chat.bootstrap.css.js.map +1 -0
- package/components/chat/themes/shared/chat.common.css.d.ts +1 -0
- package/components/chat/themes/shared/chat.common.css.js +3 -0
- package/components/chat/themes/shared/chat.common.css.js.map +1 -0
- package/components/chat/themes/shared/chat.fluent.css.d.ts +1 -0
- package/components/chat/themes/shared/chat.fluent.css.js +3 -0
- package/components/chat/themes/shared/chat.fluent.css.js.map +1 -0
- package/components/chat/themes/shared/chat.indigo.css.d.ts +1 -0
- package/components/chat/themes/shared/chat.indigo.css.js +3 -0
- package/components/chat/themes/shared/chat.indigo.css.js.map +1 -0
- package/components/chat/themes/shared/input/input.bootstrap.css.d.ts +1 -0
- package/components/chat/themes/shared/input/input.bootstrap.css.js +3 -0
- package/components/chat/themes/shared/input/input.bootstrap.css.js.map +1 -0
- package/components/chat/themes/shared/input/input.common.css.d.ts +1 -0
- package/components/chat/themes/shared/input/input.common.css.js +3 -0
- package/components/chat/themes/shared/input/input.common.css.js.map +1 -0
- package/components/chat/themes/shared/input/input.fluent.css.d.ts +1 -0
- package/components/chat/themes/shared/input/input.fluent.css.js +3 -0
- package/components/chat/themes/shared/input/input.fluent.css.js.map +1 -0
- package/components/chat/themes/shared/input/input.indigo.css.d.ts +1 -0
- package/components/chat/themes/shared/input/input.indigo.css.js +3 -0
- package/components/chat/themes/shared/input/input.indigo.css.js.map +1 -0
- package/components/chat/themes/shared/input/input.material.css.d.ts +1 -0
- package/components/chat/themes/shared/input/input.material.css.js +3 -0
- package/components/chat/themes/shared/input/input.material.css.js.map +1 -0
- package/components/chat/themes/shared/message-attachments/message-attachments.common.css.d.ts +1 -0
- package/components/chat/themes/shared/message-attachments/message-attachments.common.css.js +3 -0
- package/components/chat/themes/shared/message-attachments/message-attachments.common.css.js.map +1 -0
- package/components/chat/themes/shared/message-attachments/message-attachments.indigo.css.d.ts +1 -0
- package/components/chat/themes/shared/message-attachments/message-attachments.indigo.css.js +3 -0
- package/components/chat/themes/shared/message-attachments/message-attachments.indigo.css.js.map +1 -0
- package/components/chat/themes/themes.d.ts +2 -0
- package/components/chat/themes/themes.js +49 -0
- package/components/chat/themes/themes.js.map +1 -0
- package/components/chat/types.d.ts +149 -0
- package/components/chat/types.js +2 -0
- package/components/chat/types.js.map +1 -0
- package/components/chat/utils.d.ts +16 -0
- package/components/chat/utils.js +82 -0
- package/components/chat/utils.js.map +1 -0
- package/components/checkbox/checkbox-base.d.ts +1 -1
- package/components/checkbox/checkbox.js +3 -4
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +3 -4
- package/components/checkbox/switch.js.map +1 -1
- package/components/checkbox/themes/checkbox.base.css.js +1 -1
- package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
- package/components/checkbox/themes/switch.base.css.js +1 -1
- package/components/checkbox/themes/switch.base.css.js.map +1 -1
- package/components/chip/chip.js +3 -4
- package/components/chip/chip.js.map +1 -1
- package/components/combo/combo-header.js +3 -4
- package/components/combo/combo-header.js.map +1 -1
- package/components/combo/combo-item.js +3 -4
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo-list.js +2 -3
- package/components/combo/combo-list.js.map +1 -1
- package/components/combo/combo.js +4 -3
- package/components/combo/combo.js.map +1 -1
- package/components/common/context.d.ts +8 -1
- package/components/common/context.js +3 -1
- package/components/common/context.js.map +1 -1
- package/components/common/controllers/focus-ring.js +5 -5
- package/components/common/controllers/focus-ring.js.map +1 -1
- package/components/common/controllers/key-bindings.js +4 -4
- package/components/common/controllers/key-bindings.js.map +1 -1
- package/components/common/definitions/defineAllComponents.js +2 -0
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/common/i18n/chat.resources.d.ts +11 -0
- package/components/common/i18n/chat.resources.js +11 -0
- package/components/common/i18n/chat.resources.js.map +1 -0
- package/components/common/mixins/forms/associated.js +1 -1
- package/components/common/mixins/forms/associated.js.map +1 -1
- package/components/common/mixins/forms/form-value.js +1 -1
- package/components/common/mixins/forms/form-value.js.map +1 -1
- package/components/common/part-map.d.ts +1 -1
- package/components/common/util.d.ts +3 -0
- package/components/common/util.js +27 -0
- package/components/common/util.js.map +1 -1
- package/components/date-picker/date-picker.js +5 -4
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-range-picker/date-range-picker.js +5 -4
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.js +3 -4
- package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
- package/components/date-time-input/date-time-input.js +2 -3
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/date-util.js +11 -11
- package/components/date-time-input/date-util.js.map +1 -1
- package/components/dialog/dialog.js +3 -4
- package/components/dialog/dialog.js.map +1 -1
- package/components/divider/divider.js +3 -4
- package/components/divider/divider.js.map +1 -1
- package/components/dropdown/dropdown-group.js +3 -4
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.js +3 -4
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.js +3 -4
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.js +4 -3
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/expansion-panel/expansion-panel.js +3 -4
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/file-input/file-input.js +9 -10
- package/components/file-input/file-input.js.map +1 -1
- package/components/focus-trap/focus-trap.js +7 -8
- package/components/focus-trap/focus-trap.js.map +1 -1
- package/components/icon/icon-references.js +208 -0
- package/components/icon/icon-references.js.map +1 -1
- package/components/icon/icon-state.broadcast.js +1 -1
- package/components/icon/icon-state.broadcast.js.map +1 -1
- package/components/icon/icon.js +3 -4
- package/components/icon/icon.js.map +1 -1
- package/components/icon/internal-icons-lib.js +105 -0
- package/components/icon/internal-icons-lib.js.map +1 -1
- package/components/input/input-base.js +4 -3
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.js +2 -3
- package/components/input/input.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/list/list-header.js +3 -4
- package/components/list/list-header.js.map +1 -1
- package/components/list/list-item.js +3 -4
- package/components/list/list-item.js.map +1 -1
- package/components/list/list.js +3 -4
- package/components/list/list.js.map +1 -1
- package/components/list/themes/dark/container/list.indigo.css.js +1 -1
- package/components/list/themes/dark/container/list.indigo.css.js.map +1 -1
- package/components/list/themes/dark/header/list-header.indigo.css.js +1 -1
- package/components/list/themes/dark/header/list-header.indigo.css.js.map +1 -1
- package/components/list/themes/dark/item/list-item.indigo.css.js +1 -1
- package/components/list/themes/dark/item/list-item.indigo.css.js.map +1 -1
- package/components/list/themes/item.base.css.js +1 -1
- package/components/list/themes/item.base.css.js.map +1 -1
- package/components/list/themes/light/container/list.indigo.css.js +1 -1
- package/components/list/themes/light/container/list.indigo.css.js.map +1 -1
- package/components/list/themes/light/header/list-header.indigo.css.js +1 -1
- package/components/list/themes/light/header/list-header.indigo.css.js.map +1 -1
- package/components/list/themes/light/item/list-item.indigo.css.js +1 -1
- package/components/list/themes/light/item/list-item.indigo.css.js.map +1 -1
- package/components/mask-input/mask-input.js +2 -3
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/nav-drawer/nav-drawer-header-item.js +3 -4
- package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer-item.js +3 -4
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.js +3 -4
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/navbar/navbar.js +3 -4
- package/components/navbar/navbar.js.map +1 -1
- package/components/popover/popover.js +9 -10
- package/components/popover/popover.js.map +1 -1
- package/components/progress/circular-gradient.js +2 -3
- package/components/progress/circular-gradient.js.map +1 -1
- package/components/progress/circular-progress.js +3 -4
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.js +3 -4
- package/components/progress/linear-progress.js.map +1 -1
- package/components/radio/radio.js +3 -4
- package/components/radio/radio.js.map +1 -1
- package/components/radio-group/radio-group.js +3 -4
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating-symbol.js +3 -4
- package/components/rating/rating-symbol.js.map +1 -1
- package/components/rating/rating.js +3 -4
- package/components/rating/rating.js.map +1 -1
- package/components/resize-container/resize-container.js +3 -4
- package/components/resize-container/resize-container.js.map +1 -1
- package/components/ripple/ripple.js +3 -4
- package/components/ripple/ripple.js.map +1 -1
- package/components/select/select-group.js +3 -4
- package/components/select/select-group.js.map +1 -1
- package/components/select/select-header.js +3 -4
- package/components/select/select-header.js.map +1 -1
- package/components/select/select-item.js +3 -4
- package/components/select/select-item.js.map +1 -1
- package/components/select/select.js +4 -3
- package/components/select/select.js.map +1 -1
- package/components/slider/range-slider.js +2 -3
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.js +1 -1
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider-label.js +7 -8
- package/components/slider/slider-label.js.map +1 -1
- package/components/slider/slider.js +2 -3
- package/components/slider/slider.js.map +1 -1
- package/components/snackbar/snackbar.js +3 -4
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/snackbar/themes/snackbar.base.css.js +1 -1
- package/components/snackbar/themes/snackbar.base.css.js.map +1 -1
- package/components/stepper/step.js +3 -4
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.js +3 -4
- package/components/stepper/stepper.js.map +1 -1
- package/components/tabs/tab-dom.js +1 -1
- package/components/tabs/tab-dom.js.map +1 -1
- package/components/tabs/tab.js +4 -5
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.js +3 -4
- package/components/tabs/tabs.js.map +1 -1
- package/components/textarea/textarea.js +4 -3
- package/components/textarea/textarea.js.map +1 -1
- package/components/tile-manager/themes/tile-manager.base.css.js +1 -1
- package/components/tile-manager/themes/tile-manager.base.css.js.map +1 -1
- package/components/tile-manager/tile-manager.js +4 -3
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.js +3 -4
- package/components/tile-manager/tile.js.map +1 -1
- package/components/toast/toast.js +3 -4
- package/components/toast/toast.js.map +1 -1
- package/components/tooltip/controller.js +4 -4
- package/components/tooltip/controller.js.map +1 -1
- package/components/tooltip/tooltip.js +3 -4
- package/components/tooltip/tooltip.js.map +1 -1
- package/components/tree/tree-item.js +3 -4
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.js +4 -3
- package/components/tree/tree.js.map +1 -1
- package/components/validation-container/validation-container.js +3 -4
- package/components/validation-container/validation-container.js.map +1 -1
- package/custom-elements.json +35498 -33667
- package/extras/index.d.ts +1 -0
- package/extras/index.js +2 -0
- package/extras/index.js.map +1 -0
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +4 -0
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +6 -2
- package/web-types.json +2 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { styles as bootstrapDark } from './dark/chat.bootstrap.css.js';
|
|
3
|
+
import { styles as fluentDark } from './dark/chat.fluent.css.js';
|
|
4
|
+
import { styles as indigoDark } from './dark/chat.indigo.css.js';
|
|
5
|
+
import { styles as materialDark } from './dark/chat.material.css.js';
|
|
6
|
+
import { styles as bootstrapLight } from './light/chat.bootstrap.css.js';
|
|
7
|
+
import { styles as fluentLight } from './light/chat.fluent.css.js';
|
|
8
|
+
import { styles as indigoLight } from './light/chat.indigo.css.js';
|
|
9
|
+
import { styles as materialLight } from './light/chat.material.css.js';
|
|
10
|
+
import { styles as shared } from './light/chat.shared.css.js';
|
|
11
|
+
import { styles as bootstrap } from './shared/chat.bootstrap.css.js';
|
|
12
|
+
import { styles as fluent } from './shared/chat.fluent.css.js';
|
|
13
|
+
import { styles as indigo } from './shared/chat.indigo.css.js';
|
|
14
|
+
const light = {
|
|
15
|
+
shared: css `
|
|
16
|
+
${shared}
|
|
17
|
+
`,
|
|
18
|
+
bootstrap: css `
|
|
19
|
+
${bootstrap} ${bootstrapLight}
|
|
20
|
+
`,
|
|
21
|
+
material: css `
|
|
22
|
+
${materialLight}
|
|
23
|
+
`,
|
|
24
|
+
fluent: css `
|
|
25
|
+
${fluent} ${fluentLight}
|
|
26
|
+
`,
|
|
27
|
+
indigo: css `
|
|
28
|
+
${indigo} ${indigoLight}
|
|
29
|
+
`,
|
|
30
|
+
};
|
|
31
|
+
const dark = {
|
|
32
|
+
shared: css `
|
|
33
|
+
${shared}
|
|
34
|
+
`,
|
|
35
|
+
bootstrap: css `
|
|
36
|
+
${bootstrap} ${bootstrapDark}
|
|
37
|
+
`,
|
|
38
|
+
material: css `
|
|
39
|
+
${materialDark}
|
|
40
|
+
`,
|
|
41
|
+
fluent: css `
|
|
42
|
+
${fluent} ${fluentDark}
|
|
43
|
+
`,
|
|
44
|
+
indigo: css `
|
|
45
|
+
${indigo} ${indigoDark}
|
|
46
|
+
`,
|
|
47
|
+
};
|
|
48
|
+
export const all = { light, dark };
|
|
49
|
+
//# sourceMappingURL=themes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../src/components/chat/themes/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,UA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,IAAI,UAAU;GACvB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nimport type { Themes } from '../../../theming/types.js';\n// Dark Overrides\nimport { styles as bootstrapDark } from './dark/chat.bootstrap.css.js';\nimport { styles as fluentDark } from './dark/chat.fluent.css.js';\nimport { styles as indigoDark } from './dark/chat.indigo.css.js';\nimport { styles as materialDark } from './dark/chat.material.css.js';\n// Light Overrides\nimport { styles as bootstrapLight } from './light/chat.bootstrap.css.js';\nimport { styles as fluentLight } from './light/chat.fluent.css.js';\nimport { styles as indigoLight } from './light/chat.indigo.css.js';\nimport { styles as materialLight } from './light/chat.material.css.js';\n// Shared Styles\nimport { styles as shared } from './light/chat.shared.css.js';\nimport { styles as bootstrap } from './shared/chat.bootstrap.css.js';\nimport { styles as fluent } from './shared/chat.fluent.css.js';\nimport { styles as indigo } from './shared/chat.indigo.css.js';\n\nconst light = {\n shared: css`\n ${shared}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapLight}\n `,\n material: css`\n ${materialLight}\n `,\n fluent: css`\n ${fluent} ${fluentLight}\n `,\n indigo: css`\n ${indigo} ${indigoLight}\n `,\n};\n\nconst dark = {\n shared: css`\n ${shared}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapDark}\n `,\n material: css`\n ${materialDark}\n `,\n fluent: css`\n ${fluent} ${fluentDark}\n `,\n indigo: css`\n ${indigo} ${indigoDark}\n `,\n};\n\nexport const all: Themes = { light, dark };\n"]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type IgcChatComponent from './chat.js';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a single chat message in the conversation.
|
|
4
|
+
*/
|
|
5
|
+
export interface IgcChatMessage {
|
|
6
|
+
/**
|
|
7
|
+
* A unique identifier for the message.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The textual content of the message.
|
|
12
|
+
*/
|
|
13
|
+
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* The identifier or name of the sender of the message.
|
|
16
|
+
*/
|
|
17
|
+
sender: string;
|
|
18
|
+
/**
|
|
19
|
+
* The timestamp indicating when the message was sent.
|
|
20
|
+
*/
|
|
21
|
+
timestamp?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional list of attachments associated with the message,
|
|
24
|
+
* such as images, files, or links.
|
|
25
|
+
*/
|
|
26
|
+
attachments?: IgcChatMessageAttachment[];
|
|
27
|
+
/**
|
|
28
|
+
* Optional list of reactions associated with the message.
|
|
29
|
+
*/
|
|
30
|
+
reactions?: string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Represents an attachment associated with a chat message.
|
|
34
|
+
*/
|
|
35
|
+
export interface IgcChatMessageAttachment {
|
|
36
|
+
/**
|
|
37
|
+
* A unique identifier for the attachment.
|
|
38
|
+
*/
|
|
39
|
+
id: string;
|
|
40
|
+
/**
|
|
41
|
+
* The display name of the attachment (e.g. file name).
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* The URL from which the attachment can be downloaded or viewed.
|
|
46
|
+
* Typically used for attachments stored on a server or CDN.
|
|
47
|
+
*/
|
|
48
|
+
url?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The actual File object, if the attachment was provided locally (e.g. via upload).
|
|
51
|
+
*/
|
|
52
|
+
file?: File;
|
|
53
|
+
/**
|
|
54
|
+
* The MIME type or a custom type identifier for the attachment (e.g. "image/png", "pdf", "audio").
|
|
55
|
+
*/
|
|
56
|
+
type?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Optional URL to a thumbnail preview of the attachment (e.g. for images or videos).
|
|
59
|
+
*/
|
|
60
|
+
thumbnail?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Configuration options for customizing the behavior and appearance of the chat component.
|
|
64
|
+
*/
|
|
65
|
+
export type IgcChatOptions = {
|
|
66
|
+
/**
|
|
67
|
+
* The ID of the current user. Used to differentiate between incoming and outgoing messages.
|
|
68
|
+
*/
|
|
69
|
+
currentUserId?: string;
|
|
70
|
+
/**
|
|
71
|
+
* If `true`, prevents the chat from automatically scrolling to the latest message.
|
|
72
|
+
*/
|
|
73
|
+
disableAutoScroll?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* If `true`, disables the ability to upload and send attachments.
|
|
76
|
+
* Defaults to `false`.
|
|
77
|
+
*/
|
|
78
|
+
disableInputAttachments?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Indicates whether the other user is currently typing a message.
|
|
81
|
+
*/
|
|
82
|
+
isTyping?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The accepted files that could be attached.
|
|
85
|
+
* Defines the file types as a list of comma-separated values (e.g. "image/*,.pdf") that the file input should accept.
|
|
86
|
+
*/
|
|
87
|
+
acceptedFiles?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Optional header text to display at the top of the chat component.
|
|
90
|
+
*/
|
|
91
|
+
headerText?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Optional placeholder text for the chat input area.
|
|
94
|
+
* Provides a hint to the user about what they can type (e.g. "Type a message...").
|
|
95
|
+
*/
|
|
96
|
+
inputPlaceholder?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Suggested text snippets or quick replies that can be shown as user-selectable options.
|
|
99
|
+
*/
|
|
100
|
+
suggestions?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* Controls the position of the chat suggestions within the component layout.
|
|
103
|
+
*
|
|
104
|
+
* - `"below-input"`: Renders suggestions below the chat input area.
|
|
105
|
+
* - `"below-messages"`: Renders suggestions below the chat messages area.
|
|
106
|
+
*
|
|
107
|
+
* Default is `"below-messages"`.
|
|
108
|
+
*/
|
|
109
|
+
suggestionsPosition?: 'below-input' | 'below-messages';
|
|
110
|
+
/**
|
|
111
|
+
* Time in milliseconds to wait before dispatching a stop typing event.
|
|
112
|
+
* Default is `3000`.
|
|
113
|
+
*/
|
|
114
|
+
stopTypingDelay?: number;
|
|
115
|
+
renderers?: Partial<ChatRenderers>;
|
|
116
|
+
};
|
|
117
|
+
export type ChatRenderers = {
|
|
118
|
+
attachment?: ChatTemplateRenderer<ChatAttachmentRenderContext>;
|
|
119
|
+
attachmentContent?: ChatTemplateRenderer<ChatAttachmentRenderContext>;
|
|
120
|
+
attachmentHeader?: ChatTemplateRenderer<ChatAttachmentRenderContext>;
|
|
121
|
+
fileUploadButton?: ChatTemplateRenderer<ChatRenderContext>;
|
|
122
|
+
input?: ChatTemplateRenderer<ChatInputRenderContext>;
|
|
123
|
+
inputActions?: ChatTemplateRenderer<ChatRenderContext>;
|
|
124
|
+
inputActionsEnd?: ChatTemplateRenderer<ChatRenderContext>;
|
|
125
|
+
inputActionsStart?: ChatTemplateRenderer<ChatRenderContext>;
|
|
126
|
+
inputAttachments?: ChatTemplateRenderer<ChatInputRenderContext>;
|
|
127
|
+
message?: ChatTemplateRenderer<ChatMessageRenderContext>;
|
|
128
|
+
messageActions?: ChatTemplateRenderer<ChatMessageRenderContext>;
|
|
129
|
+
messageAttachments?: ChatTemplateRenderer<ChatMessageRenderContext>;
|
|
130
|
+
messageContent?: ChatTemplateRenderer<ChatMessageRenderContext>;
|
|
131
|
+
messageHeader?: ChatTemplateRenderer<ChatMessageRenderContext>;
|
|
132
|
+
typingIndicator?: ChatTemplateRenderer<ChatRenderContext>;
|
|
133
|
+
sendButton?: ChatTemplateRenderer<ChatRenderContext>;
|
|
134
|
+
suggestionPrefix?: ChatTemplateRenderer<ChatRenderContext>;
|
|
135
|
+
};
|
|
136
|
+
export type ChatTemplateRenderer<T> = (ctx: T) => unknown;
|
|
137
|
+
export interface ChatRenderContext {
|
|
138
|
+
instance: IgcChatComponent;
|
|
139
|
+
}
|
|
140
|
+
export interface ChatInputRenderContext extends ChatRenderContext {
|
|
141
|
+
attachments: IgcChatMessageAttachment[];
|
|
142
|
+
value: string;
|
|
143
|
+
}
|
|
144
|
+
export interface ChatMessageRenderContext extends ChatRenderContext {
|
|
145
|
+
message: IgcChatMessage;
|
|
146
|
+
}
|
|
147
|
+
export interface ChatAttachmentRenderContext extends ChatMessageRenderContext {
|
|
148
|
+
attachment: IgcChatMessageAttachment;
|
|
149
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/chat/types.ts"],"names":[],"mappings":"","sourcesContent":["import type IgcChatComponent from './chat.js';\n\n/**\n * Represents a single chat message in the conversation.\n */\nexport interface IgcChatMessage {\n /**\n * A unique identifier for the message.\n */\n id: string;\n\n /**\n * The textual content of the message.\n */\n text: string;\n\n /**\n * The identifier or name of the sender of the message.\n */\n sender: string;\n\n /**\n * The timestamp indicating when the message was sent.\n */\n timestamp?: string;\n\n /**\n * Optional list of attachments associated with the message,\n * such as images, files, or links.\n */\n attachments?: IgcChatMessageAttachment[];\n\n /**\n * Optional list of reactions associated with the message.\n */\n reactions?: string[];\n}\n\n/**\n * Represents an attachment associated with a chat message.\n */\nexport interface IgcChatMessageAttachment {\n /**\n * A unique identifier for the attachment.\n */\n id: string;\n\n /**\n * The display name of the attachment (e.g. file name).\n */\n name: string;\n\n /**\n * The URL from which the attachment can be downloaded or viewed.\n * Typically used for attachments stored on a server or CDN.\n */\n url?: string;\n\n /**\n * The actual File object, if the attachment was provided locally (e.g. via upload).\n */\n file?: File;\n\n /**\n * The MIME type or a custom type identifier for the attachment (e.g. \"image/png\", \"pdf\", \"audio\").\n */\n type?: string;\n\n /**\n * Optional URL to a thumbnail preview of the attachment (e.g. for images or videos).\n */\n thumbnail?: string;\n}\n\n/**\n * Configuration options for customizing the behavior and appearance of the chat component.\n */\nexport type IgcChatOptions = {\n /**\n * The ID of the current user. Used to differentiate between incoming and outgoing messages.\n */\n currentUserId?: string;\n /**\n * If `true`, prevents the chat from automatically scrolling to the latest message.\n */\n disableAutoScroll?: boolean;\n /**\n * If `true`, disables the ability to upload and send attachments.\n * Defaults to `false`.\n */\n disableInputAttachments?: boolean;\n /**\n * Indicates whether the other user is currently typing a message.\n */\n isTyping?: boolean;\n /**\n * The accepted files that could be attached.\n * Defines the file types as a list of comma-separated values (e.g. \"image/*,.pdf\") that the file input should accept.\n */\n acceptedFiles?: string;\n /**\n * Optional header text to display at the top of the chat component.\n */\n headerText?: string;\n /**\n * Optional placeholder text for the chat input area.\n * Provides a hint to the user about what they can type (e.g. \"Type a message...\").\n */\n inputPlaceholder?: string;\n /**\n * Suggested text snippets or quick replies that can be shown as user-selectable options.\n */\n suggestions?: string[];\n /**\n * Controls the position of the chat suggestions within the component layout.\n *\n * - `\"below-input\"`: Renders suggestions below the chat input area.\n * - `\"below-messages\"`: Renders suggestions below the chat messages area.\n *\n * Default is `\"below-messages\"`.\n */\n suggestionsPosition?: 'below-input' | 'below-messages';\n /**\n * Time in milliseconds to wait before dispatching a stop typing event.\n * Default is `3000`.\n */\n stopTypingDelay?: number;\n\n renderers?: Partial<ChatRenderers>;\n};\n\nexport type ChatRenderers = {\n attachment?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n attachmentContent?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n attachmentHeader?: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n fileUploadButton?: ChatTemplateRenderer<ChatRenderContext>;\n input?: ChatTemplateRenderer<ChatInputRenderContext>;\n inputActions?: ChatTemplateRenderer<ChatRenderContext>;\n inputActionsEnd?: ChatTemplateRenderer<ChatRenderContext>;\n inputActionsStart?: ChatTemplateRenderer<ChatRenderContext>;\n inputAttachments?: ChatTemplateRenderer<ChatInputRenderContext>;\n message?: ChatTemplateRenderer<ChatMessageRenderContext>;\n messageActions?: ChatTemplateRenderer<ChatMessageRenderContext>;\n messageAttachments?: ChatTemplateRenderer<ChatMessageRenderContext>;\n messageContent?: ChatTemplateRenderer<ChatMessageRenderContext>;\n messageHeader?: ChatTemplateRenderer<ChatMessageRenderContext>;\n typingIndicator?: ChatTemplateRenderer<ChatRenderContext>;\n sendButton?: ChatTemplateRenderer<ChatRenderContext>;\n suggestionPrefix?: ChatTemplateRenderer<ChatRenderContext>;\n};\n\nexport type ChatTemplateRenderer<T> = (ctx: T) => unknown;\n\nexport interface ChatRenderContext {\n instance: IgcChatComponent;\n}\n\nexport interface ChatInputRenderContext extends ChatRenderContext {\n attachments: IgcChatMessageAttachment[];\n value: string;\n}\n\nexport interface ChatMessageRenderContext extends ChatRenderContext {\n message: IgcChatMessage;\n}\n\nexport interface ChatAttachmentRenderContext extends ChatMessageRenderContext {\n attachment: IgcChatMessageAttachment;\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type IgcChatMessageComponent from './chat-message.js';
|
|
2
|
+
import type { IgcChatMessageAttachment } from './types.js';
|
|
3
|
+
export type ChatAcceptedFileTypes = {
|
|
4
|
+
extensions: Set<string>;
|
|
5
|
+
mimeTypes: Set<string>;
|
|
6
|
+
wildcardTypes: Set<string>;
|
|
7
|
+
};
|
|
8
|
+
export declare const ChatFileTypeIcons: Map<string, string>;
|
|
9
|
+
export declare function parseAcceptedFileTypes(fileTypes: string): ChatAcceptedFileTypes;
|
|
10
|
+
export declare function isAcceptedFileType(file: File, accepted: ChatAcceptedFileTypes | null): boolean;
|
|
11
|
+
export declare function getChatAcceptedFiles(event: DragEvent, accepted: ChatAcceptedFileTypes | null): File[];
|
|
12
|
+
export declare function getIconName(fileType?: string): "attach_document" | "attach_image";
|
|
13
|
+
export declare function createAttachmentURL(attachment: IgcChatMessageAttachment): string;
|
|
14
|
+
export declare function getFileExtension(name: string): string;
|
|
15
|
+
export declare function isImageAttachment(attachment: IgcChatMessageAttachment | File): boolean;
|
|
16
|
+
export declare function chatMessageAdoptPageStyles(message: IgcChatMessageComponent): void;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { adoptStyles } from 'lit';
|
|
2
|
+
import { last } from '../common/util.js';
|
|
3
|
+
export const ChatFileTypeIcons = new Map(Object.entries({
|
|
4
|
+
css: 'file_css',
|
|
5
|
+
csv: 'file_csv',
|
|
6
|
+
doc: 'file_doc',
|
|
7
|
+
docx: 'file_doc',
|
|
8
|
+
htm: 'file_htm',
|
|
9
|
+
html: 'file_html',
|
|
10
|
+
js: 'file_js',
|
|
11
|
+
json: 'file_json',
|
|
12
|
+
pdf: 'file_pdf',
|
|
13
|
+
rtf: 'file_rtf',
|
|
14
|
+
svg: 'file_svg',
|
|
15
|
+
txt: 'file_txt',
|
|
16
|
+
url: 'file_link',
|
|
17
|
+
xls: 'file_xls',
|
|
18
|
+
xlsx: 'file_xls',
|
|
19
|
+
xml: 'file_xml',
|
|
20
|
+
zip: 'file_zip',
|
|
21
|
+
default: 'file_generic',
|
|
22
|
+
}));
|
|
23
|
+
export function parseAcceptedFileTypes(fileTypes) {
|
|
24
|
+
const types = fileTypes.split(',').map((each) => each.trim().toLowerCase());
|
|
25
|
+
return {
|
|
26
|
+
extensions: new Set(types.filter((t) => t.startsWith('.'))),
|
|
27
|
+
mimeTypes: new Set(types.filter((t) => !t.startsWith('.') && !t.endsWith('/*'))),
|
|
28
|
+
wildcardTypes: new Set(types.filter((t) => t.endsWith('/*')).map((t) => t.slice(0, -2))),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function isAcceptedFileType(file, accepted) {
|
|
32
|
+
if (!(accepted && file)) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
const { extensions, mimeTypes, wildcardTypes } = accepted;
|
|
36
|
+
const fileType = file.type.toLowerCase();
|
|
37
|
+
const fileExtension = `.${last(file.name.split('.'))?.toLowerCase()}`;
|
|
38
|
+
const [fileBaseType] = fileType.split('/');
|
|
39
|
+
return (extensions.has(fileExtension) ||
|
|
40
|
+
mimeTypes.has(fileType) ||
|
|
41
|
+
wildcardTypes.has(fileBaseType));
|
|
42
|
+
}
|
|
43
|
+
export function getChatAcceptedFiles(event, accepted) {
|
|
44
|
+
return Array.from(event.dataTransfer?.items ?? [])
|
|
45
|
+
.filter((item) => item.kind === 'file' && isAcceptedFileType(item.getAsFile(), accepted))
|
|
46
|
+
.map((item) => item.getAsFile());
|
|
47
|
+
}
|
|
48
|
+
export function getIconName(fileType) {
|
|
49
|
+
return fileType?.startsWith('image') ? 'attach_image' : 'attach_document';
|
|
50
|
+
}
|
|
51
|
+
export function createAttachmentURL(attachment) {
|
|
52
|
+
if (attachment.file) {
|
|
53
|
+
return URL.createObjectURL(attachment.file);
|
|
54
|
+
}
|
|
55
|
+
return attachment.url || '';
|
|
56
|
+
}
|
|
57
|
+
export function getFileExtension(name) {
|
|
58
|
+
const parts = name.split('.');
|
|
59
|
+
return parts.length > 1 ? last(parts) : '';
|
|
60
|
+
}
|
|
61
|
+
export function isImageAttachment(attachment) {
|
|
62
|
+
if (attachment instanceof File) {
|
|
63
|
+
return attachment.type.startsWith('image/');
|
|
64
|
+
}
|
|
65
|
+
return Boolean(attachment.type === 'image' || attachment.file?.type.startsWith('image/'));
|
|
66
|
+
}
|
|
67
|
+
export function chatMessageAdoptPageStyles(message) {
|
|
68
|
+
const sheets = [];
|
|
69
|
+
for (const sheet of document.styleSheets) {
|
|
70
|
+
try {
|
|
71
|
+
const constructed = new CSSStyleSheet();
|
|
72
|
+
for (const rule of sheet.cssRules) {
|
|
73
|
+
constructed.insertRule(rule.cssText);
|
|
74
|
+
}
|
|
75
|
+
sheets.push(constructed);
|
|
76
|
+
}
|
|
77
|
+
catch { }
|
|
78
|
+
}
|
|
79
|
+
const ctor = message.constructor;
|
|
80
|
+
adoptStyles(message.shadowRoot, [...ctor.elementStyles, ...sheets]);
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/chat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAA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B,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,WAAW,CAAC,OAAO,CAAC,UAAW,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import { adoptStyles, type LitElement } from 'lit';\nimport { last } from '../common/util.js';\nimport type IgcChatMessageComponent from './chat-message.js';\nimport type { IgcChatMessageAttachment } from './types.js';\n\nexport type ChatAcceptedFileTypes = {\n extensions: Set<string>;\n mimeTypes: Set<string>;\n wildcardTypes: Set<string>;\n};\n\nexport const ChatFileTypeIcons = new Map(\n Object.entries({\n css: 'file_css',\n csv: 'file_csv',\n doc: 'file_doc',\n docx: 'file_doc',\n htm: 'file_htm',\n html: 'file_html',\n js: 'file_js',\n json: 'file_json',\n pdf: 'file_pdf',\n rtf: 'file_rtf',\n svg: 'file_svg',\n txt: 'file_txt',\n url: 'file_link',\n xls: 'file_xls',\n xlsx: 'file_xls',\n xml: 'file_xml',\n zip: 'file_zip',\n default: 'file_generic',\n })\n);\n\nexport function parseAcceptedFileTypes(\n fileTypes: string\n): ChatAcceptedFileTypes {\n const types = fileTypes.split(',').map((each) => each.trim().toLowerCase());\n return {\n extensions: new Set(types.filter((t) => t.startsWith('.'))),\n mimeTypes: new Set(\n types.filter((t) => !t.startsWith('.') && !t.endsWith('/*'))\n ),\n wildcardTypes: new Set(\n types.filter((t) => t.endsWith('/*')).map((t) => t.slice(0, -2))\n ),\n };\n}\n\nexport function isAcceptedFileType(\n file: File,\n accepted: ChatAcceptedFileTypes | null\n): boolean {\n if (!(accepted && file)) {\n return true;\n }\n\n const { extensions, mimeTypes, wildcardTypes } = accepted;\n const fileType = file.type.toLowerCase();\n const fileExtension = `.${last(file.name.split('.'))?.toLowerCase()}`;\n const [fileBaseType] = fileType.split('/');\n\n return (\n extensions.has(fileExtension) ||\n mimeTypes.has(fileType) ||\n wildcardTypes.has(fileBaseType)\n );\n}\n\nexport function getChatAcceptedFiles(\n event: DragEvent,\n accepted: ChatAcceptedFileTypes | null\n): File[] {\n return Array.from(event.dataTransfer?.items ?? [])\n .filter(\n (item) =>\n item.kind === 'file' && isAcceptedFileType(item.getAsFile()!, accepted)\n )\n .map((item) => item.getAsFile()!);\n}\n\nexport function getIconName(fileType?: string) {\n return fileType?.startsWith('image') ? 'attach_image' : 'attach_document';\n}\n\nexport function createAttachmentURL(\n attachment: IgcChatMessageAttachment\n): string {\n if (attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n\n return attachment.url || '';\n}\n\nexport function getFileExtension(name: string): string {\n const parts = name.split('.');\n return parts.length > 1 ? last(parts) : '';\n}\n\nexport function isImageAttachment(\n attachment: IgcChatMessageAttachment | File\n): boolean {\n if (attachment instanceof File) {\n return attachment.type.startsWith('image/');\n }\n\n return Boolean(\n attachment.type === 'image' || attachment.file?.type.startsWith('image/')\n );\n}\n\n// REVIEW: Maybe put that behind a configuration flag as this is nasty.\nexport function chatMessageAdoptPageStyles(\n message: IgcChatMessageComponent\n): void {\n const sheets: CSSStyleSheet[] = [];\n\n for (const sheet of document.styleSheets) {\n try {\n const constructed = new CSSStyleSheet();\n for (const rule of sheet.cssRules) {\n constructed.insertRule(rule.cssText);\n }\n sheets.push(constructed);\n } catch {}\n }\n\n const ctor = message.constructor as typeof LitElement;\n adoptStyles(message.shadowRoot!, [...ctor.elementStyles, ...sheets]);\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export interface IgcCheckboxComponentEventMap {
|
|
|
13
13
|
declare const IgcCheckboxBaseComponent_base: Constructor<import("../common/mixins/forms/types.js").FormRequiredInterface & import("../common/mixins/forms/types.js").FormAssociatedCheckboxElementInterface> & Constructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcCheckboxComponentEventMap>> & Constructor<LitElement>;
|
|
14
14
|
export declare class IgcCheckboxBaseComponent extends IgcCheckboxBaseComponent_base {
|
|
15
15
|
protected get __validators(): import("../common/validators.js").Validator<IgcCheckboxBaseComponent>[];
|
|
16
|
-
protected readonly _slots: import("../common/controllers/slot.js").SlotController<"invalid" | "
|
|
16
|
+
protected readonly _slots: import("../common/controllers/slot.js").SlotController<"invalid" | "helper-text" | "[default]" | "value-missing" | "custom-error">;
|
|
17
17
|
protected readonly _focusRingManager: import("../common/controllers/focus-ring.js").KeyboardFocusRingController;
|
|
18
18
|
protected readonly _formValue: import("../common/mixins/forms/form-value.js").FormValue<boolean>;
|
|
19
19
|
protected _value: string;
|
|
@@ -17,7 +17,7 @@ import { styles } from './themes/checkbox.base.css.js';
|
|
|
17
17
|
import { all } from './themes/checkbox-themes.js';
|
|
18
18
|
import { styles as shared } from './themes/shared/checkbox/checkbox.common.css.js';
|
|
19
19
|
let nextId = 1;
|
|
20
|
-
class IgcCheckboxComponent extends IgcCheckboxBaseComponent {
|
|
20
|
+
export default class IgcCheckboxComponent extends IgcCheckboxBaseComponent {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
23
|
this._themes = addThemingController(this, all);
|
|
@@ -25,6 +25,8 @@ class IgcCheckboxComponent extends IgcCheckboxBaseComponent {
|
|
|
25
25
|
this._labelId = `checkbox-label-${this._inputId}`;
|
|
26
26
|
this.indeterminate = false;
|
|
27
27
|
}
|
|
28
|
+
static { this.tagName = 'igc-checkbox'; }
|
|
29
|
+
static { this.styles = [styles, shared]; }
|
|
28
30
|
static register() {
|
|
29
31
|
registerComponent(IgcCheckboxComponent, IgcValidationContainerComponent);
|
|
30
32
|
}
|
|
@@ -99,9 +101,6 @@ class IgcCheckboxComponent extends IgcCheckboxBaseComponent {
|
|
|
99
101
|
`;
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
IgcCheckboxComponent.tagName = 'igc-checkbox';
|
|
103
|
-
IgcCheckboxComponent.styles = [styles, shared];
|
|
104
|
-
export default IgcCheckboxComponent;
|
|
105
104
|
__decorate([
|
|
106
105
|
property({ type: Boolean, reflect: true })
|
|
107
106
|
], IgcCheckboxComponent.prototype, "indeterminate", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,+BAA+B,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,iDAAiD,CAAC;AAEnF,IAAI,MAAM,GAAG,CAAC,CAAC;AAoBf,
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAA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;AA5EM;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2DACd","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { partMap } from '../common/part-map.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { IgcCheckboxBaseComponent } from './checkbox-base.js';\nimport { styles } from './themes/checkbox.base.css.js';\nimport { all } from './themes/checkbox-themes.js';\nimport { styles as shared } from './themes/shared/checkbox/checkbox.common.css.js';\n\nlet nextId = 1;\n\n/**\n * A check box allowing single values to be selected/deselected.\n *\n * @element igc-checkbox\n *\n * @slot - The checkbox label.\n * @slot helper-text - Renders content below the input.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcChange - Emitted when the control's checked state changes.\n *\n * @csspart base - The base wrapper of the checkbox.\n * @csspart control - The checkbox input element.\n * @csspart label - The checkbox label.\n * @csspart indicator - The checkbox indicator icon.\n */\nexport default class IgcCheckboxComponent extends IgcCheckboxBaseComponent {\n public static readonly tagName = 'igc-checkbox';\n protected static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcCheckboxComponent, IgcValidationContainerComponent);\n }\n\n private readonly _themes = addThemingController(this, all);\n\n private readonly _inputId = `checkbox-${nextId++}`;\n private readonly _labelId = `checkbox-label-${this._inputId}`;\n\n /**\n * Draws the checkbox in indeterminate state.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n protected override _handleClick(event: PointerEvent): void {\n this.indeterminate = false;\n super._handleClick(event);\n }\n\n protected _renderValidatorContainer(): TemplateResult {\n return IgcValidationContainerComponent.create(this);\n }\n\n protected _renderStandard() {\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M4.1,12.7 9,17.6 20.3,6.3\" />\n </svg>\n `;\n }\n\n protected _renderIndigo() {\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <rect width=\"18\" height=\"4\" x=\"3\" y=\"10\" rx=\"1.85\" />\n <path\n d=\"M19.033 5a1.966 1.966 0 0 0-1.418.586l-8.479 8.577-2.753-2.77a1.971 1.971 0 0 0-2.8 0 1.998 1.998 0 0 0 0 2.822l4.155 4.196a1.955 1.955 0 0 0 2.8 0l9.879-9.99a1.998 1.998 0 0 0 0-2.821 1.966 1.966 0 0 0-1.384-.6Z\"\n />\n </svg>\n `;\n }\n\n protected override render() {\n const labelledBy = this.getAttribute('aria-labelledby');\n const describedBy = this._slots.hasAssignedElements('helper-text')\n ? 'helper-text'\n : nothing;\n const checked = this.checked;\n\n return html`\n <label\n part=${partMap({\n base: true,\n checked,\n focused: this._focusRingManager.focused,\n })}\n for=${this._inputId}\n >\n <input\n id=${this._inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n .checked=${live(checked)}\n .indeterminate=${live(this.indeterminate)}\n aria-labelledby=${labelledBy ? labelledBy : this._labelId}\n aria-describedby=${describedBy}\n @click=${this._handleClick}\n @blur=${this._handleBlur}\n />\n <span part=${partMap({ control: true, checked })}>\n <span part=${partMap({ indicator: true, checked })}>\n ${this._themes.theme === 'indigo'\n ? this._renderIndigo()\n : this._renderStandard()}\n </span>\n </span>\n <span\n id=${this._labelId}\n part=${partMap({ label: true, checked })}\n ?hidden=${this._hideLabel}\n ><slot></slot>\n </span>\n </label>\n ${this._renderValidatorContainer()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-checkbox': IgcCheckboxComponent;\n }\n}\n"]}
|
|
@@ -9,7 +9,9 @@ import { styles as shared } from './themes/shared/switch/switch.common.css.js';
|
|
|
9
9
|
import { styles } from './themes/switch.base.css.js';
|
|
10
10
|
import { all } from './themes/switch-themes.js';
|
|
11
11
|
let nextId = 1;
|
|
12
|
-
class IgcSwitchComponent extends IgcCheckboxBaseComponent {
|
|
12
|
+
export default class IgcSwitchComponent extends IgcCheckboxBaseComponent {
|
|
13
|
+
static { this.tagName = 'igc-switch'; }
|
|
14
|
+
static { this.styles = [styles, shared]; }
|
|
13
15
|
static register() {
|
|
14
16
|
registerComponent(IgcSwitchComponent);
|
|
15
17
|
}
|
|
@@ -56,7 +58,4 @@ class IgcSwitchComponent extends IgcCheckboxBaseComponent {
|
|
|
56
58
|
`;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
|
-
IgcSwitchComponent.tagName = 'igc-switch';
|
|
60
|
-
IgcSwitchComponent.styles = [styles, shared];
|
|
61
|
-
export default IgcSwitchComponent;
|
|
62
61
|
//# sourceMappingURL=switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/components/checkbox/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO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BAAiB,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,OAAO,IAAI,CAAA;oBACK,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,QAAQ,IAAI,CAAC,QAAQ;;eAE1D,IAAI,CAAC,QAAQ;;iBAEX,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;kBACnB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;sBACjB,IAAI,CAAC,QAAQ;sBACb,IAAI,CAAC,QAAQ;qBACd,IAAI,CAAC,OAAO,CAAC;4BACN,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ;mBAChD,IAAI,CAAC,YAAY;kBAClB,IAAI,CAAC,WAAW;;;iBAGjB,OAAO,CAAC;YACb,OAAO,EAAE,IAAI;YACb,OAAO;YACP,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,OAAO;SACxC,CAAC;;uBAEW,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;;eAGzC,IAAI,CAAC,QAAQ;iBACX,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oBAC9B,IAAI,CAAC,UAAU;;;;;KAK9B,CAAC;IACJ,CAAC","sourcesContent":["import { html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { partMap } from '../common/part-map.js';\nimport { IgcCheckboxBaseComponent } from './checkbox-base.js';\nimport { styles as shared } from './themes/shared/switch/switch.common.css.js';\nimport { styles } from './themes/switch.base.css.js';\nimport { all } from './themes/switch-themes.js';\n\nlet nextId = 1;\n\n/**\n * Similar to a checkbox, a switch controls the state of a single setting on or off.\n *\n * @element igc-switch\n *\n * @slot - The switch label.\n *\n * @fires igcChange - Emitted when the control's checked state changes.\n *\n * @csspart base - The base wrapper of the switch.\n * @csspart control - The switch input element.\n * @csspart thumb - The position indicator of the switch.\n * @csspart label - The switch label.\n */\nexport default class IgcSwitchComponent extends IgcCheckboxBaseComponent {\n public static readonly tagName = 'igc-switch';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcSwitchComponent);\n }\n\n private readonly _inputId = `switch-${nextId++}`;\n private readonly _labelId = `switch-label-${this._inputId}`;\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n protected override render() {\n const labelledBy = this.getAttribute('aria-labelledby');\n const checked = this.checked;\n\n return html`\n <label part=${partMap({ base: true, checked })} for=${this._inputId}>\n <input\n id=${this._inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n .checked=${live(checked)}\n aria-labelledby=${labelledBy ? labelledBy : this._labelId}\n @click=${this._handleClick}\n @blur=${this._handleBlur}\n />\n <span\n part=${partMap({\n control: true,\n checked,\n focused: this._focusRingManager.focused,\n })}\n >\n <span part=${partMap({ thumb: true, checked })}></span>\n </span>\n <span\n id=${this._labelId}\n part=${partMap({ label: true, checked })}\n ?hidden=${this._hideLabel}\n >\n <slot></slot>\n </span>\n </label>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-switch': IgcSwitchComponent;\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=control]{--size: 1.25rem;width:var(--size);height:var(--size);min-width:var(--size);position:relative;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=control]::after{position:absolute;content:"";left:50%;top:50%;transform:translate(-50%, -50%);width:var(--size);height:var(--size);transition:all .15s ease-in}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;
|
|
2
|
+
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=control]{--size: 1.25rem;width:var(--size);height:var(--size);min-width:var(--size);position:relative;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=control]::after{position:absolute;content:"";left:50%;top:50%;transform:translate(-50%, -50%);width:var(--size);height:var(--size);transition:all .15s ease-in}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-all;transition:color .2s ease-in-out}[part~=base]{gap:.5rem}[part~=indicator]{--indicator-size: 1.125rem;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;stroke-linecap:square;stroke-width:var(--mark-stroke, 3);stroke-dasharray:24;stroke-dashoffset:24;fill:none;opacity:0;z-index:1;transform-origin:center}[part~=indicator] svg{width:var(--indicator-size);height:var(--indicator-size)}label{display:flex;align-items:center;cursor:pointer;flex-flow:row nowrap}[part="indicator checked"]{transition:all .2s ease-out;stroke-dashoffset:0;opacity:1}:host([indeterminate]) [part~=indicator]{stroke-dashoffset:41;opacity:1;transform:rotate(45deg) scale(0.45) translateX(-0.25rem)}:host([indeterminate]) [part~=indicator] svg{width:100%;height:100%}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}:host([label-position=before]) [part~=label]{order:-1}`;
|
|
3
3
|
//# sourceMappingURL=checkbox.base.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/checkbox.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"checkbox.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/checkbox.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,+pFAA+pF,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=control]{--size: 1.25rem;width:var(--size);height:var(--size);min-width:var(--size);position:relative;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=control]::after{position:absolute;content:\"\";left:50%;top:50%;transform:translate(-50%, -50%);width:var(--size);height:var(--size);transition:all .15s ease-in}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-all;transition:color .2s ease-in-out}[part~=base]{gap:.5rem}[part~=indicator]{--indicator-size: 1.125rem;display:flex;align-items:center;justify-content:center;position:absolute;inset:0;stroke-linecap:square;stroke-width:var(--mark-stroke, 3);stroke-dasharray:24;stroke-dashoffset:24;fill:none;opacity:0;z-index:1;transform-origin:center}[part~=indicator] svg{width:var(--indicator-size);height:var(--indicator-size)}label{display:flex;align-items:center;cursor:pointer;flex-flow:row nowrap}[part=\"indicator checked\"]{transition:all .2s ease-out;stroke-dashoffset:0;opacity:1}:host([indeterminate]) [part~=indicator]{stroke-dashoffset:41;opacity:1;transform:rotate(45deg) scale(0.45) translateX(-0.25rem)}:host([indeterminate]) [part~=indicator] svg{width:100%;height:100%}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}:host([label-position=before]) [part~=label]{order:-1}`;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=base]{display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;gap:var(--label-gap)}[part~=control]{display:flex;flex-shrink:0;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=thumb]{position:relative;animation-duration:.2s;animation-fill-mode:none}[part~=control],[part~=thumb]{transition:all .2s ease-in-out}[part~=thumb][part~=checked]{animation-duration:.2s;animation-fill-mode:forwards}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;
|
|
2
|
+
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=base]{display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;gap:var(--label-gap)}[part~=control]{display:flex;flex-shrink:0;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=thumb]{position:relative;animation-duration:.2s;animation-fill-mode:none}[part~=control],[part~=thumb]{transition:all .2s ease-in-out}[part~=thumb][part~=checked]{animation-duration:.2s;animation-fill-mode:forwards}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-word}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;cursor:initial}:host([label-position=before]) [part~=label]{order:-1}@keyframes thumb-on{from{margin-inline-start:var(--thumb-offset)}to{margin-inline-start:calc(var(--size) - var(--thumb-size))}}@keyframes thumb-off{from{margin-inline-start:calc(var(--size) - var(--thumb-size))}to{margin-inline-start:var(--thumb-offset)}}`;
|
|
3
3
|
//# sourceMappingURL=switch.base.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/switch.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"switch.base.css.js","sourceRoot":"","sources":["../../../../src/components/checkbox/themes/switch.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,yvEAAyvE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:inline-flex;flex-direction:column;font-family:var(--ig-font-family)}input[type=checkbox]{position:absolute;width:1px;height:1px;margin:-1px;border:none;clip:rect(0, 0, 0, 0);outline:0;pointer-events:none;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}[part~=base]{display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;gap:var(--label-gap)}[part~=control]{display:flex;flex-shrink:0;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part~=thumb]{position:relative;animation-duration:.2s;animation-fill-mode:none}[part~=control],[part~=thumb]{transition:all .2s ease-in-out}[part~=thumb][part~=checked]{animation-duration:.2s;animation-fill-mode:forwards}[part~=label]{display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow-wrap:break-word}:host([disabled]),:host(:disabled){-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;cursor:initial}:host([label-position=before]) [part~=label]{order:-1}@keyframes thumb-on{from{margin-inline-start:var(--thumb-offset)}to{margin-inline-start:calc(var(--size) - var(--thumb-size))}}@keyframes thumb-off{from{margin-inline-start:calc(var(--size) - var(--thumb-size))}to{margin-inline-start:var(--thumb-offset)}}`;\n"]}
|
package/components/chip/chip.js
CHANGED
|
@@ -16,7 +16,9 @@ import IgcIconComponent from '../icon/icon.js';
|
|
|
16
16
|
import { styles } from './themes/chip.base.css.js';
|
|
17
17
|
import { styles as shared } from './themes/shared/chip.common.css.js';
|
|
18
18
|
import { all } from './themes/themes.js';
|
|
19
|
-
class IgcChipComponent extends EventEmitterMixin(LitElement) {
|
|
19
|
+
export default class IgcChipComponent extends EventEmitterMixin(LitElement) {
|
|
20
|
+
static { this.tagName = 'igc-chip'; }
|
|
21
|
+
static { this.styles = [styles, shared]; }
|
|
20
22
|
static register() {
|
|
21
23
|
registerComponent(IgcChipComponent, IgcIconComponent);
|
|
22
24
|
}
|
|
@@ -108,9 +110,6 @@ class IgcChipComponent extends EventEmitterMixin(LitElement) {
|
|
|
108
110
|
`;
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
|
-
IgcChipComponent.tagName = 'igc-chip';
|
|
112
|
-
IgcChipComponent.styles = [styles, shared];
|
|
113
|
-
export default IgcChipComponent;
|
|
114
113
|
__decorate([
|
|
115
114
|
property({ type: Boolean, reflect: true })
|
|
116
115
|
], IgcChipComponent.prototype, "disabled", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../src/components/chip/chip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAA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E,IAAI,EAAE,CAAC;oDACjB;AAQnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACnB;AAOjB;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACE","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { addKeybindings } from '../common/controllers/key-bindings.js';\nimport { addSlotController, setSlots } from '../common/controllers/slot.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport type { StyleVariant } from '../types.js';\nimport { styles } from './themes/chip.base.css.js';\nimport { styles as shared } from './themes/shared/chip.common.css.js';\nimport { all } from './themes/themes.js';\n\nexport interface IgcChipComponentEventMap {\n igcRemove: CustomEvent<boolean>;\n igcSelect: CustomEvent<boolean>;\n}\n\n/**\n * Chips help people enter information, make selections, filter content, or trigger actions.\n *\n * @element igc-chip\n *\n * @slot - Renders content in the default slot of the chip.\n * @slot prefix - Renders content at the start of the chip, before the default content.\n * @slot suffix - Renders content at the end of the chip after the default content.\n * @slot select - Content to render when the chip in selected state.\n * @slot remove - Content to override the default remove chip icon.\n *\n * @fires igcRemove - Emits an event when the chip component is removed. Returns the removed chip component.\n * @fires igcSelect - Emits event when the chip component is selected/deselected and any related animations and transitions also end.\n *\n * @csspart base - The base wrapper of the chip.\n * @csspart prefix - The prefix container of the chip.\n * @csspart suffix - The suffix container of the chip.\n */\nexport default class IgcChipComponent extends EventEmitterMixin<\n IgcChipComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-chip';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcChipComponent, IgcIconComponent);\n }\n\n private readonly _removePartRef = createRef<HTMLSlotElement>();\n\n private readonly _slots = addSlotController(this, {\n slots: setSlots('prefix', 'suffix', 'start', 'end', 'select', 'remove'),\n });\n\n /**\n * Sets the disabled state for the chip.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n /**\n * Defines if the chip is removable or not.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public removable = false;\n\n /**\n * Defines if the chip is selectable or not.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public selectable = false;\n\n /* @tsTwoWayProperty(true, \"igcSelect\", \"detail\", false) */\n /**\n * Defines if the chip is selected or not.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /**\n * A property that sets the color variant of the chip component.\n * @attr\n */\n @property({ reflect: true })\n public variant!: StyleVariant;\n\n constructor() {\n super();\n\n addThemingController(this, all);\n\n addKeybindings(this, {\n ref: this._removePartRef,\n bindingDefaults: { triggers: ['keyup'] },\n }).setActivateHandler(this._handleRemove);\n }\n\n protected _handleSelect(): void {\n if (this.selectable) {\n this.selected = !this.selected;\n this.emitEvent('igcSelect', { detail: this.selected });\n }\n }\n\n protected _handleRemove(event: Event): void {\n event.stopPropagation();\n this.emitEvent('igcRemove');\n }\n\n protected _renderPrefix() {\n const isVisible =\n this._slots.hasAssignedElements('prefix') ||\n this._slots.hasAssignedElements('start');\n\n const selectSlot =\n this.selectable && this.selected\n ? html`\n <slot name=\"select\">\n <igc-icon name=\"selected\" collection=\"default\"></igc-icon>\n </slot>\n `\n : nothing;\n\n return html`\n <span part=\"prefix\" ?hidden=${!isVisible && !this.selected}>\n ${selectSlot}\n <slot name=\"start\"></slot>\n <slot name=\"prefix\"></slot>\n </span>\n `;\n }\n\n protected _renderSuffix() {\n const isVisible =\n this._slots.hasAssignedElements('suffix') ||\n this._slots.hasAssignedElements('end');\n\n const removeSlot =\n this.removable && !this.disabled\n ? html`\n <slot\n ${ref(this._removePartRef)}\n name=\"remove\"\n @click=${this._handleRemove}\n >\n <igc-icon\n name=\"remove\"\n collection=\"default\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=\"Remove\"\n ></igc-icon>\n </slot>\n `\n : nothing;\n\n return html`\n <span part=\"suffix\" ?hidden=${!isVisible && !this.removable}>\n <slot name=\"end\"></slot>\n <slot name=\"suffix\"></slot>\n ${removeSlot}\n </span>\n `;\n }\n\n protected override render() {\n const ariaPressed = this.selectable ? this.selected.toString() : null;\n\n return html`\n <button\n part=\"base\"\n .ariaPressed=${ariaPressed}\n ?disabled=${this.disabled}\n @click=${this._handleSelect}\n >\n ${this._renderPrefix()}\n <slot></slot>\n ${this._renderSuffix()}\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-chip': IgcChipComponent;\n }\n}\n"]}
|
|
@@ -4,7 +4,9 @@ import { registerComponent } from '../common/definitions/register.js';
|
|
|
4
4
|
import { all } from '../dropdown/themes/header.js';
|
|
5
5
|
import { styles as shared } from '../dropdown/themes/shared/header/dropdown-header.common.css.js';
|
|
6
6
|
import { styles } from './themes/combo-header.base.css.js';
|
|
7
|
-
class IgcComboHeaderComponent extends LitElement {
|
|
7
|
+
export default class IgcComboHeaderComponent extends LitElement {
|
|
8
|
+
static { this.tagName = 'igc-combo-header'; }
|
|
9
|
+
static { this.styles = [styles, shared]; }
|
|
8
10
|
static register() {
|
|
9
11
|
registerComponent(IgcComboHeaderComponent);
|
|
10
12
|
}
|
|
@@ -16,7 +18,4 @@ class IgcComboHeaderComponent extends LitElement {
|
|
|
16
18
|
return html `<slot></slot>`;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
|
-
IgcComboHeaderComponent.tagName = 'igc-combo-header';
|
|
20
|
-
IgcComboHeaderComponent.styles = [styles, shared];
|
|
21
|
-
export default IgcComboHeaderComponent;
|
|
22
21
|
//# sourceMappingURL=combo-header.js.map
|