@haiilo/catalyst 12.4.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/index.esm.js +2 -2
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-02e41ad7.entry.js +10 -0
- package/dist/catalyst/p-02e41ad7.entry.js.map +1 -0
- package/dist/catalyst/p-D80xhZLG.js +2 -0
- package/dist/catalyst/p-D80xhZLG.js.map +1 -0
- package/dist/catalyst/scss/core/_form.scss +11 -11
- package/dist/cjs/cat-alert_30.cjs.entry.js +59 -47
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-DNLT6JC9.js → index-B6viy7Jl.js} +19 -13
- package/dist/cjs/index-B6viy7Jl.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date.js +3 -3
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +2 -2
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +12 -4
- package/dist/collection/components/cat-notification/cat-notification.js +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.css +6 -2
- package/dist/collection/components/cat-select/cat-select.js +1 -1
- package/dist/collection/components/cat-tag/cat-tag.css +12 -4
- package/dist/collection/components/cat-textarea/cat-textarea.css +6 -2
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +8 -12
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/scss/core/_form.scss +11 -11
- package/dist/components/cat-date.js +3 -3
- package/dist/components/cat-date.js.map +1 -1
- package/dist/components/cat-form-group.js +2 -2
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-input2.js +1 -1
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select2.js +1 -1
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-tag.js +1 -1
- package/dist/components/cat-tag.js.map +1 -1
- package/dist/components/cat-textarea.js +1 -1
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-tooltip.js +8 -12
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/floating-ui.dom.js +41 -25
- package/dist/components/floating-ui.dom.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +17 -11
- package/dist/components/index2.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +59 -47
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/esm/{index-LJZzaWFR.js → index-D80xhZLG.js} +19 -13
- package/dist/esm/index-D80xhZLG.js.map +1 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/cat-date/cat-date.d.ts +1 -1
- package/dist/types/components/cat-notification/cat-notification.d.ts +2 -0
- package/package.json +4 -4
- package/dist/catalyst/p-2b38c9b7.entry.js +0 -10
- package/dist/catalyst/p-2b38c9b7.entry.js.map +0 -1
- package/dist/catalyst/p-LJZzaWFR.js +0 -2
- package/dist/catalyst/p-LJZzaWFR.js.map +0 -1
- package/dist/cjs/index-DNLT6JC9.js.map +0 -1
- package/dist/esm/index-LJZzaWFR.js.map +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-B6viy7Jl.js');
|
|
4
4
|
|
|
5
5
|
var toastify$1 = {exports: {}};
|
|
6
6
|
|
|
@@ -502,7 +502,7 @@ class CatNotificationService {
|
|
|
502
502
|
? `<cat-button class="cat-toastify-action cat-button-pull" size="s" variant="text" color="primary">${options.action}</cat-button>`
|
|
503
503
|
: ''}
|
|
504
504
|
</div>
|
|
505
|
-
${options?.
|
|
505
|
+
${options?.closeButton === true
|
|
506
506
|
? `<cat-button class="cat-toastify-close cat-button-pull" size="s" icon="$cat:notification-close" variant="text" icon-only="true" class="close" a11y-label="${index.catI18nRegistry.t('notification.dismiss')}"></cat-button>`
|
|
507
507
|
: ''}
|
|
508
508
|
</div>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.js","src/components/cat-notification/cat-notification.tsx","src/components/cat-select/connectors.ts"],"sourcesContent":["/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n(function(root, factory) {\n if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Toastify = factory();\n }\n})(this, function(global) {\n // Object initialization\n var Toastify = function(options) {\n // Returning a new init object\n return new Toastify.lib.init(options);\n },\n // Library version\n version = \"1.12.0\";\n\n // Set the default global options\n Toastify.defaults = {\n oldestFirst: true,\n text: \"Toastify is awesome!\",\n node: undefined,\n duration: 3000,\n selector: undefined,\n callback: function () {\n },\n destination: undefined,\n newWindow: false,\n close: false,\n gravity: \"toastify-top\",\n positionLeft: false,\n position: '',\n backgroundColor: '',\n avatar: \"\",\n className: \"\",\n stopOnFocus: true,\n onClick: function () {\n },\n offset: {x: 0, y: 0},\n escapeMarkup: true,\n ariaLive: 'polite',\n style: {background: ''}\n };\n\n // Defining the prototype of the object\n Toastify.lib = Toastify.prototype = {\n toastify: version,\n\n constructor: Toastify,\n\n // Initializing the object with required parameters\n init: function(options) {\n // Verifying and validating the input object\n if (!options) {\n options = {};\n }\n\n // Creating the options object\n this.options = {};\n\n this.toastElement = null;\n\n // Validating the options\n this.options.text = options.text || Toastify.defaults.text; // Display message\n this.options.node = options.node || Toastify.defaults.node; // Display content as node\n this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration\n this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector\n this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display\n this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination\n this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window\n this.options.close = options.close || Toastify.defaults.close; // Show toast close icon\n this.options.gravity = options.gravity === \"bottom\" ? \"toastify-bottom\" : Toastify.defaults.gravity; // toast position - top or bottom\n this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right\n this.options.position = options.position || Toastify.defaults.position; // toast position - left or right\n this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color\n this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path\n this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast\n this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus\n this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click\n this.options.offset = options.offset || Toastify.defaults.offset; // toast offset\n this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;\n this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;\n this.options.style = options.style || Toastify.defaults.style;\n if(options.backgroundColor) {\n this.options.style.background = options.backgroundColor;\n }\n\n // Returning the current object for chaining functions\n return this;\n },\n\n // Building the DOM element\n buildToast: function() {\n // Validating if the options are defined\n if (!this.options) {\n throw \"Toastify is not initialized\";\n }\n\n // Creating the DOM object\n var divElement = document.createElement(\"div\");\n divElement.className = \"toastify on \" + this.options.className;\n\n // Positioning toast to left or right or center\n if (!!this.options.position) {\n divElement.className += \" toastify-\" + this.options.position;\n } else {\n // To be depreciated in further versions\n if (this.options.positionLeft === true) {\n divElement.className += \" toastify-left\";\n console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')\n } else {\n // Default position\n divElement.className += \" toastify-right\";\n }\n }\n\n // Assigning gravity of element\n divElement.className += \" \" + this.options.gravity;\n\n if (this.options.backgroundColor) {\n // This is being deprecated in favor of using the style HTML DOM property\n console.warn('DEPRECATION NOTICE: \"backgroundColor\" is being deprecated. Please use the \"style.background\" property.');\n }\n\n // Loop through our style object and apply styles to divElement\n for (var property in this.options.style) {\n divElement.style[property] = this.options.style[property];\n }\n\n // Announce the toast to screen readers\n if (this.options.ariaLive) {\n divElement.setAttribute('aria-live', this.options.ariaLive)\n }\n\n // Adding the toast message/node\n if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {\n // If we have a valid node, we insert it\n divElement.appendChild(this.options.node)\n } else {\n if (this.options.escapeMarkup) {\n divElement.innerText = this.options.text;\n } else {\n divElement.innerHTML = this.options.text;\n }\n\n if (this.options.avatar !== \"\") {\n var avatarElement = document.createElement(\"img\");\n avatarElement.src = this.options.avatar;\n\n avatarElement.className = \"toastify-avatar\";\n\n if (this.options.position == \"left\" || this.options.positionLeft === true) {\n // Adding close icon on the left of content\n divElement.appendChild(avatarElement);\n } else {\n // Adding close icon on the right of content\n divElement.insertAdjacentElement(\"afterbegin\", avatarElement);\n }\n }\n }\n\n // Adding a close icon to the toast\n if (this.options.close === true) {\n // Create a span for close element\n var closeElement = document.createElement(\"button\");\n closeElement.type = \"button\";\n closeElement.setAttribute(\"aria-label\", \"Close\");\n closeElement.className = \"toast-close\";\n closeElement.innerHTML = \"✖\";\n\n // Triggering the removal of toast from DOM on close click\n closeElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.removeElement(this.toastElement);\n window.clearTimeout(this.toastElement.timeOutValue);\n }.bind(this)\n );\n\n //Calculating screen width\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Adding the close icon to the toast element\n // Display on the right if screen width is less than or equal to 360px\n if ((this.options.position == \"left\" || this.options.positionLeft === true) && width > 360) {\n // Adding close icon on the left of content\n divElement.insertAdjacentElement(\"afterbegin\", closeElement);\n } else {\n // Adding close icon on the right of content\n divElement.appendChild(closeElement);\n }\n }\n\n // Clear timeout while toast is focused\n if (this.options.stopOnFocus && this.options.duration > 0) {\n var self = this;\n // stop countdown\n divElement.addEventListener(\n \"mouseover\",\n function(event) {\n window.clearTimeout(divElement.timeOutValue);\n }\n )\n // add back the timeout\n divElement.addEventListener(\n \"mouseleave\",\n function() {\n divElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n self.removeElement(divElement);\n },\n self.options.duration\n )\n }\n )\n }\n\n // Adding an on-click destination path\n if (typeof this.options.destination !== \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n if (this.options.newWindow === true) {\n window.open(this.options.destination, \"_blank\");\n } else {\n window.location = this.options.destination;\n }\n }.bind(this)\n );\n }\n\n if (typeof this.options.onClick === \"function\" && typeof this.options.destination === \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.options.onClick();\n }.bind(this)\n );\n }\n\n // Adding offset\n if(typeof this.options.offset === \"object\") {\n\n var x = getAxisOffsetAValue(\"x\", this.options);\n var y = getAxisOffsetAValue(\"y\", this.options);\n\n var xOffset = this.options.position == \"left\" ? x : \"-\" + x;\n var yOffset = this.options.gravity == \"toastify-top\" ? y : \"-\" + y;\n\n divElement.style.transform = \"translate(\" + xOffset + \",\" + yOffset + \")\";\n\n }\n\n // Returning the generated element\n return divElement;\n },\n\n // Displaying the toast\n showToast: function() {\n // Creating the DOM object for the toast\n this.toastElement = this.buildToast();\n\n // Getting the root element to with the toast needs to be added\n var rootElement;\n if (typeof this.options.selector === \"string\") {\n rootElement = document.getElementById(this.options.selector);\n } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {\n rootElement = this.options.selector;\n } else {\n rootElement = document.body;\n }\n\n // Validating if root element is present in DOM\n if (!rootElement) {\n throw \"Root element is not defined\";\n }\n\n // Adding the DOM element\n var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;\n rootElement.insertBefore(this.toastElement, elementToInsert);\n\n // Repositioning the toasts in case multiple toasts are present\n Toastify.reposition();\n\n if (this.options.duration > 0) {\n this.toastElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n this.removeElement(this.toastElement);\n }.bind(this),\n this.options.duration\n ); // Binding `this` for function invocation\n }\n\n // Supporting function chaining\n return this;\n },\n\n hideToast: function() {\n if (this.toastElement.timeOutValue) {\n clearTimeout(this.toastElement.timeOutValue);\n }\n this.removeElement(this.toastElement);\n },\n\n // Removing the element from the DOM\n removeElement: function(toastElement) {\n // Hiding the element\n // toastElement.classList.remove(\"on\");\n toastElement.className = toastElement.className.replace(\" on\", \"\");\n\n // Removing the element from DOM after transition end\n window.setTimeout(\n function() {\n // remove options node if any\n if (this.options.node && this.options.node.parentNode) {\n this.options.node.parentNode.removeChild(this.options.node);\n }\n\n // Remove the element from the DOM, only when the parent node was not removed before.\n if (toastElement.parentNode) {\n toastElement.parentNode.removeChild(toastElement);\n }\n\n // Calling the callback function\n this.options.callback.call(toastElement);\n\n // Repositioning the toasts again\n Toastify.reposition();\n }.bind(this),\n 400\n ); // Binding `this` for function invocation\n },\n };\n\n // Positioning the toasts on the DOM\n Toastify.reposition = function() {\n\n // Top margins with gravity\n var topLeftOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var topRightOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var offsetSize = {\n top: 15,\n bottom: 15,\n };\n\n // Get all toast messages on the DOM\n var allToasts = document.getElementsByClassName(\"toastify\");\n\n var classUsed;\n\n // Modifying the position of each toast element\n for (var i = 0; i < allToasts.length; i++) {\n // Getting the applied gravity\n if (containsClass(allToasts[i], \"toastify-top\") === true) {\n classUsed = \"toastify-top\";\n } else {\n classUsed = \"toastify-bottom\";\n }\n\n var height = allToasts[i].offsetHeight;\n classUsed = classUsed.substr(9, classUsed.length-1)\n // Spacing between toasts\n var offset = 15;\n\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Show toast in center if screen with less than or equal to 360px\n if (width <= 360) {\n // Setting the position\n allToasts[i].style[classUsed] = offsetSize[classUsed] + \"px\";\n\n offsetSize[classUsed] += height + offset;\n } else {\n if (containsClass(allToasts[i], \"toastify-left\") === true) {\n // Setting the position\n allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + \"px\";\n\n topLeftOffsetSize[classUsed] += height + offset;\n } else {\n // Setting the position\n allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + \"px\";\n\n topRightOffsetSize[classUsed] += height + offset;\n }\n }\n }\n\n // Supporting function chaining\n return this;\n };\n\n // Helper function to get offset.\n function getAxisOffsetAValue(axis, options) {\n\n if(options.offset[axis]) {\n if(isNaN(options.offset[axis])) {\n return options.offset[axis];\n }\n else {\n return options.offset[axis] + 'px';\n }\n }\n\n return '0px';\n\n }\n\n function containsClass(elem, yourClass) {\n if (!elem || typeof yourClass !== \"string\") {\n return false;\n } else if (\n elem.className &&\n elem.className\n .trim()\n .split(/\\s+/gi)\n .indexOf(yourClass) > -1\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n // Setting up the prototype for the init object\n Toastify.lib.init.prototype = Toastify.lib;\n\n // Returning the Toastify function to be assigned to the window object/module\n return Toastify;\n});\n","import Toastify, { Options } from 'toastify-js';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ToastResult = any;\n\ninterface ToastRef {\n toast?: {\n showToast: () => void;\n hideToast: (result?: ToastResult) => void;\n };\n}\n\ntype ToastResultRef = ToastRef & { result?: ToastResult };\n\nexport interface ToastOptions {\n /** The appearance mode of the notification. (Default: `dark`) */\n mode: 'dark' | 'light';\n /** An optional icon to appear in the notification. */\n icon: string;\n /** The placement of the notification on screen. (Default: `bottom-left`) */\n placement: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\n /** Enables auto-closing of the notification. (Default: `true`) */\n autoClose: boolean;\n /** The duration in ms for the notification to be visible on screen. (Default: `3000`) */\n duration: number;\n /** An optional label for an action button. */\n action: string;\n /** Enable markup escape and sanitise HTML input. (Default: true) */\n escapeMarkup: boolean;\n /** Callback executed when the action button is clicked. Receives a reference to the notification as first argument. */\n onAction: (toast: ToastRef) => void;\n /** Callback executed when the notification is clicked. Receives a reference to the notification as first argument. */\n onClick: (toast: ToastRef) => void;\n /** Callback executed when the notification is dismissed. Receives a reference to the notification as first argument and an optional result as second argument. */\n onDismiss: (toast: ToastRef, result?: ToastResult) => void;\n}\n\n/**\n * A service to show additional information via toast notifications.\n */\nexport class CatNotificationService {\n private static instance: CatNotificationService;\n private static duration = 3000;\n\n private constructor() {\n // hide constructor\n }\n\n static getInstance(): CatNotificationService {\n if (!CatNotificationService.instance) {\n CatNotificationService.instance = new CatNotificationService();\n }\n return CatNotificationService.instance;\n }\n\n show(content: string | Node, options?: Partial<ToastOptions>): (result?: ToastResult) => void {\n const ref: ToastResultRef = {};\n const toastContent = this.getNode(content, ref, options);\n const toastOptions = this.getOptions(toastContent, ref, options);\n const toast = Toastify(toastOptions);\n ref.toast = {\n showToast: () => toast.showToast(),\n hideToast: (result?: ToastResult) => {\n ref.result = result;\n toast.hideToast();\n }\n };\n ref.toast.showToast();\n return (result?: ToastResult) => ref.toast?.hideToast(result);\n }\n\n private getNode(content: string | Node, ref: ToastResultRef, options?: Partial<ToastOptions>): HTMLElement {\n const template = document.createElement('template');\n template.innerHTML = `<div class=\"cat-toastify-wrapper\">\n ${options?.icon ? `<cat-icon class=\"cat-toastify-icon\" icon=\"${options.icon}\" size=\"l\"></cat-icon>` : ''}\n <div class=\"cat-toastify-content\">\n <div class=\"cat-toastify-inner\"></div>\n ${\n options?.action\n ? `<cat-button class=\"cat-toastify-action cat-button-pull\" size=\"s\" variant=\"text\" color=\"primary\">${options.action}</cat-button>`\n : ''\n }\n </div>\n ${\n options?.autoClose === false\n ? `<cat-button class=\"cat-toastify-close cat-button-pull\" size=\"s\" icon=\"$cat:notification-close\" variant=\"text\" icon-only=\"true\" class=\"close\" a11y-label=\"${i18n.t(\n 'notification.dismiss'\n )}\"></cat-button>`\n : ''\n }\n </div>`;\n\n const node = template.content.firstElementChild as HTMLElement;\n node.querySelector('.cat-toastify-close')?.addEventListener('click', () => ref.toast?.hideToast());\n node.querySelector('.cat-toastify-action')?.addEventListener('click', () => options?.onAction?.(ref));\n const inner = node.querySelector<HTMLDivElement>('.cat-toastify-inner');\n if (inner) {\n if (typeof content !== 'string') {\n inner.replaceChildren(content);\n } else if (options?.escapeMarkup === false) {\n inner.innerHTML = content;\n } else {\n inner.innerText = content;\n }\n }\n\n node.addEventListener('cat-close', event => {\n const { detail } = (event as CustomEvent) || {};\n ref.toast?.hideToast(detail);\n });\n\n return node;\n }\n\n private getOptions(node: Node, ref: ToastResultRef, options?: Partial<ToastOptions>): Options {\n const [gravity, position] = (options?.placement?.split('-') ?? ['bottom', 'left']) as [\n Options['gravity'],\n Options['position']\n ];\n const duration = options?.duration ?? (options?.autoClose === false ? -1 : CatNotificationService.duration);\n return {\n gravity,\n position,\n node,\n duration,\n close: false,\n className: options?.mode === 'light' ? 'cat-toastify' : 'cat-toastify cat-toastify-dark',\n stopOnFocus: true,\n onClick: () => options?.onClick?.(ref),\n callback: () => {\n const { toast, result } = ref;\n options?.onDismiss?.({ toast }, result);\n },\n offset: {\n x: '1rem',\n y: '1rem'\n }\n };\n }\n}\n\nexport const catNotificationService = CatNotificationService.getInstance();\n","import { of } from 'rxjs';\nimport { CatSelectConnector, RenderInfo } from './cat-select';\n\n/**\n * Creates a connector that resolves local object array data.\n *\n * @param data the object array to connect to\n * @returns a connector that resolves local object array data\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function objectArrayConnector<T extends { id: string } & RenderInfo = any>(data: T[]): CatSelectConnector<T> {\n return {\n resolve: ids => of(data.filter(({ id }) => ids.includes(id))),\n retrieve: term =>\n of({\n content: data.filter(({ label }) => label.toLowerCase().includes(term.toLowerCase())),\n last: true,\n totalElements: data.length\n }),\n render: item => item\n };\n}\n\n/**\n * Creates a connector that resolves local string array data.\n *\n * @param data the string array to connect to\n * @returns a connector that resolves local string array data\n */\nexport function stringArrayConnector(data: string[]): CatSelectConnector<{ id: string; label: string }> {\n const items = data.map(id => ({ id, label: id }));\n return objectArrayConnector(items);\n}\n\n/**\n * Creates a connector that resolves local string map data.\n *\n * @param data the string map to connect to\n * @returns a connector that resolves local string map data\n */\nexport function stringMapConnector(data: Map<string, string>): CatSelectConnector<{ id: string; label: string }> {\n const items = Array.from(data).map(([id, label]) => ({ id, label }));\n return objectArrayConnector(items);\n}\n"],"names":["this","i18n","of"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,EAAA,CAAC,SAAS,IAAI,EAAE,OAAO,EAAE;IACvB,IAAkC,MAAM,CAAC,OAAO,EAAE;MAChD,MAAA,CAAA,OAAA,GAAiB,OAAO,EAAE;AAC9B,KAAG,MAAM;AACT,MAAI,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE;AAC7B;AACA,GAAC,EAAEA,QAAI,EAAE,SAAS,MAAM,EAAE;AAC1B;AACA,IAAE,IAAI,QAAQ,GAAG,SAAS,OAAO,EAAE;AACnC;QACM,OAAO,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;OACtC;AACL;MACI,OAAO,GAAG,QAAQ;;AAEtB;IACE,QAAQ,CAAC,QAAQ,GAAG;MAClB,WAAW,EAAE,IAAI;MACjB,IAAI,EAAE,sBAAsB;MAC5B,IAAI,EAAE,SAAS;MACf,QAAQ,EAAE,IAAI;MACd,QAAQ,EAAE,SAAS;MACnB,QAAQ,EAAE,YAAY;OACrB;MACD,WAAW,EAAE,SAAS;MACtB,SAAS,EAAE,KAAK;MAChB,KAAK,EAAE,KAAK;MACZ,OAAO,EAAE,cAAc;MACv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.cjs.js","sources":["../node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.js","src/components/cat-notification/cat-notification.tsx","src/components/cat-select/connectors.ts"],"sourcesContent":["/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n(function(root, factory) {\n if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Toastify = factory();\n }\n})(this, function(global) {\n // Object initialization\n var Toastify = function(options) {\n // Returning a new init object\n return new Toastify.lib.init(options);\n },\n // Library version\n version = \"1.12.0\";\n\n // Set the default global options\n Toastify.defaults = {\n oldestFirst: true,\n text: \"Toastify is awesome!\",\n node: undefined,\n duration: 3000,\n selector: undefined,\n callback: function () {\n },\n destination: undefined,\n newWindow: false,\n close: false,\n gravity: \"toastify-top\",\n positionLeft: false,\n position: '',\n backgroundColor: '',\n avatar: \"\",\n className: \"\",\n stopOnFocus: true,\n onClick: function () {\n },\n offset: {x: 0, y: 0},\n escapeMarkup: true,\n ariaLive: 'polite',\n style: {background: ''}\n };\n\n // Defining the prototype of the object\n Toastify.lib = Toastify.prototype = {\n toastify: version,\n\n constructor: Toastify,\n\n // Initializing the object with required parameters\n init: function(options) {\n // Verifying and validating the input object\n if (!options) {\n options = {};\n }\n\n // Creating the options object\n this.options = {};\n\n this.toastElement = null;\n\n // Validating the options\n this.options.text = options.text || Toastify.defaults.text; // Display message\n this.options.node = options.node || Toastify.defaults.node; // Display content as node\n this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration\n this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector\n this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display\n this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination\n this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window\n this.options.close = options.close || Toastify.defaults.close; // Show toast close icon\n this.options.gravity = options.gravity === \"bottom\" ? \"toastify-bottom\" : Toastify.defaults.gravity; // toast position - top or bottom\n this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right\n this.options.position = options.position || Toastify.defaults.position; // toast position - left or right\n this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color\n this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path\n this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast\n this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus\n this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click\n this.options.offset = options.offset || Toastify.defaults.offset; // toast offset\n this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;\n this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;\n this.options.style = options.style || Toastify.defaults.style;\n if(options.backgroundColor) {\n this.options.style.background = options.backgroundColor;\n }\n\n // Returning the current object for chaining functions\n return this;\n },\n\n // Building the DOM element\n buildToast: function() {\n // Validating if the options are defined\n if (!this.options) {\n throw \"Toastify is not initialized\";\n }\n\n // Creating the DOM object\n var divElement = document.createElement(\"div\");\n divElement.className = \"toastify on \" + this.options.className;\n\n // Positioning toast to left or right or center\n if (!!this.options.position) {\n divElement.className += \" toastify-\" + this.options.position;\n } else {\n // To be depreciated in further versions\n if (this.options.positionLeft === true) {\n divElement.className += \" toastify-left\";\n console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')\n } else {\n // Default position\n divElement.className += \" toastify-right\";\n }\n }\n\n // Assigning gravity of element\n divElement.className += \" \" + this.options.gravity;\n\n if (this.options.backgroundColor) {\n // This is being deprecated in favor of using the style HTML DOM property\n console.warn('DEPRECATION NOTICE: \"backgroundColor\" is being deprecated. Please use the \"style.background\" property.');\n }\n\n // Loop through our style object and apply styles to divElement\n for (var property in this.options.style) {\n divElement.style[property] = this.options.style[property];\n }\n\n // Announce the toast to screen readers\n if (this.options.ariaLive) {\n divElement.setAttribute('aria-live', this.options.ariaLive)\n }\n\n // Adding the toast message/node\n if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {\n // If we have a valid node, we insert it\n divElement.appendChild(this.options.node)\n } else {\n if (this.options.escapeMarkup) {\n divElement.innerText = this.options.text;\n } else {\n divElement.innerHTML = this.options.text;\n }\n\n if (this.options.avatar !== \"\") {\n var avatarElement = document.createElement(\"img\");\n avatarElement.src = this.options.avatar;\n\n avatarElement.className = \"toastify-avatar\";\n\n if (this.options.position == \"left\" || this.options.positionLeft === true) {\n // Adding close icon on the left of content\n divElement.appendChild(avatarElement);\n } else {\n // Adding close icon on the right of content\n divElement.insertAdjacentElement(\"afterbegin\", avatarElement);\n }\n }\n }\n\n // Adding a close icon to the toast\n if (this.options.close === true) {\n // Create a span for close element\n var closeElement = document.createElement(\"button\");\n closeElement.type = \"button\";\n closeElement.setAttribute(\"aria-label\", \"Close\");\n closeElement.className = \"toast-close\";\n closeElement.innerHTML = \"✖\";\n\n // Triggering the removal of toast from DOM on close click\n closeElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.removeElement(this.toastElement);\n window.clearTimeout(this.toastElement.timeOutValue);\n }.bind(this)\n );\n\n //Calculating screen width\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Adding the close icon to the toast element\n // Display on the right if screen width is less than or equal to 360px\n if ((this.options.position == \"left\" || this.options.positionLeft === true) && width > 360) {\n // Adding close icon on the left of content\n divElement.insertAdjacentElement(\"afterbegin\", closeElement);\n } else {\n // Adding close icon on the right of content\n divElement.appendChild(closeElement);\n }\n }\n\n // Clear timeout while toast is focused\n if (this.options.stopOnFocus && this.options.duration > 0) {\n var self = this;\n // stop countdown\n divElement.addEventListener(\n \"mouseover\",\n function(event) {\n window.clearTimeout(divElement.timeOutValue);\n }\n )\n // add back the timeout\n divElement.addEventListener(\n \"mouseleave\",\n function() {\n divElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n self.removeElement(divElement);\n },\n self.options.duration\n )\n }\n )\n }\n\n // Adding an on-click destination path\n if (typeof this.options.destination !== \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n if (this.options.newWindow === true) {\n window.open(this.options.destination, \"_blank\");\n } else {\n window.location = this.options.destination;\n }\n }.bind(this)\n );\n }\n\n if (typeof this.options.onClick === \"function\" && typeof this.options.destination === \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.options.onClick();\n }.bind(this)\n );\n }\n\n // Adding offset\n if(typeof this.options.offset === \"object\") {\n\n var x = getAxisOffsetAValue(\"x\", this.options);\n var y = getAxisOffsetAValue(\"y\", this.options);\n\n var xOffset = this.options.position == \"left\" ? x : \"-\" + x;\n var yOffset = this.options.gravity == \"toastify-top\" ? y : \"-\" + y;\n\n divElement.style.transform = \"translate(\" + xOffset + \",\" + yOffset + \")\";\n\n }\n\n // Returning the generated element\n return divElement;\n },\n\n // Displaying the toast\n showToast: function() {\n // Creating the DOM object for the toast\n this.toastElement = this.buildToast();\n\n // Getting the root element to with the toast needs to be added\n var rootElement;\n if (typeof this.options.selector === \"string\") {\n rootElement = document.getElementById(this.options.selector);\n } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {\n rootElement = this.options.selector;\n } else {\n rootElement = document.body;\n }\n\n // Validating if root element is present in DOM\n if (!rootElement) {\n throw \"Root element is not defined\";\n }\n\n // Adding the DOM element\n var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;\n rootElement.insertBefore(this.toastElement, elementToInsert);\n\n // Repositioning the toasts in case multiple toasts are present\n Toastify.reposition();\n\n if (this.options.duration > 0) {\n this.toastElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n this.removeElement(this.toastElement);\n }.bind(this),\n this.options.duration\n ); // Binding `this` for function invocation\n }\n\n // Supporting function chaining\n return this;\n },\n\n hideToast: function() {\n if (this.toastElement.timeOutValue) {\n clearTimeout(this.toastElement.timeOutValue);\n }\n this.removeElement(this.toastElement);\n },\n\n // Removing the element from the DOM\n removeElement: function(toastElement) {\n // Hiding the element\n // toastElement.classList.remove(\"on\");\n toastElement.className = toastElement.className.replace(\" on\", \"\");\n\n // Removing the element from DOM after transition end\n window.setTimeout(\n function() {\n // remove options node if any\n if (this.options.node && this.options.node.parentNode) {\n this.options.node.parentNode.removeChild(this.options.node);\n }\n\n // Remove the element from the DOM, only when the parent node was not removed before.\n if (toastElement.parentNode) {\n toastElement.parentNode.removeChild(toastElement);\n }\n\n // Calling the callback function\n this.options.callback.call(toastElement);\n\n // Repositioning the toasts again\n Toastify.reposition();\n }.bind(this),\n 400\n ); // Binding `this` for function invocation\n },\n };\n\n // Positioning the toasts on the DOM\n Toastify.reposition = function() {\n\n // Top margins with gravity\n var topLeftOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var topRightOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var offsetSize = {\n top: 15,\n bottom: 15,\n };\n\n // Get all toast messages on the DOM\n var allToasts = document.getElementsByClassName(\"toastify\");\n\n var classUsed;\n\n // Modifying the position of each toast element\n for (var i = 0; i < allToasts.length; i++) {\n // Getting the applied gravity\n if (containsClass(allToasts[i], \"toastify-top\") === true) {\n classUsed = \"toastify-top\";\n } else {\n classUsed = \"toastify-bottom\";\n }\n\n var height = allToasts[i].offsetHeight;\n classUsed = classUsed.substr(9, classUsed.length-1)\n // Spacing between toasts\n var offset = 15;\n\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Show toast in center if screen with less than or equal to 360px\n if (width <= 360) {\n // Setting the position\n allToasts[i].style[classUsed] = offsetSize[classUsed] + \"px\";\n\n offsetSize[classUsed] += height + offset;\n } else {\n if (containsClass(allToasts[i], \"toastify-left\") === true) {\n // Setting the position\n allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + \"px\";\n\n topLeftOffsetSize[classUsed] += height + offset;\n } else {\n // Setting the position\n allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + \"px\";\n\n topRightOffsetSize[classUsed] += height + offset;\n }\n }\n }\n\n // Supporting function chaining\n return this;\n };\n\n // Helper function to get offset.\n function getAxisOffsetAValue(axis, options) {\n\n if(options.offset[axis]) {\n if(isNaN(options.offset[axis])) {\n return options.offset[axis];\n }\n else {\n return options.offset[axis] + 'px';\n }\n }\n\n return '0px';\n\n }\n\n function containsClass(elem, yourClass) {\n if (!elem || typeof yourClass !== \"string\") {\n return false;\n } else if (\n elem.className &&\n elem.className\n .trim()\n .split(/\\s+/gi)\n .indexOf(yourClass) > -1\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n // Setting up the prototype for the init object\n Toastify.lib.init.prototype = Toastify.lib;\n\n // Returning the Toastify function to be assigned to the window object/module\n return Toastify;\n});\n","import Toastify, { Options } from 'toastify-js';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ToastResult = any;\n\ninterface ToastRef {\n toast?: {\n showToast: () => void;\n hideToast: (result?: ToastResult) => void;\n };\n}\n\ntype ToastResultRef = ToastRef & { result?: ToastResult };\n\nexport interface ToastOptions {\n /** The appearance mode of the notification. (Default: `dark`) */\n mode: 'dark' | 'light';\n /** An optional icon to appear in the notification. */\n icon: string;\n /** The placement of the notification on screen. (Default: `bottom-left`) */\n placement: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\n /** Enables auto-closing of the notification. (Default: `true`) */\n autoClose: boolean;\n /** Show button to close the notification. (Default: `false`) */\n closeButton: boolean;\n /** The duration in ms for the notification to be visible on screen. (Default: `3000`) */\n duration: number;\n /** An optional label for an action button. */\n action: string;\n /** Enable markup escape and sanitise HTML input. (Default: true) */\n escapeMarkup: boolean;\n /** Callback executed when the action button is clicked. Receives a reference to the notification as first argument. */\n onAction: (toast: ToastRef) => void;\n /** Callback executed when the notification is clicked. Receives a reference to the notification as first argument. */\n onClick: (toast: ToastRef) => void;\n /** Callback executed when the notification is dismissed. Receives a reference to the notification as first argument and an optional result as second argument. */\n onDismiss: (toast: ToastRef, result?: ToastResult) => void;\n}\n\n/**\n * A service to show additional information via toast notifications.\n */\nexport class CatNotificationService {\n private static instance: CatNotificationService;\n private static duration = 3000;\n\n private constructor() {\n // hide constructor\n }\n\n static getInstance(): CatNotificationService {\n if (!CatNotificationService.instance) {\n CatNotificationService.instance = new CatNotificationService();\n }\n return CatNotificationService.instance;\n }\n\n show(content: string | Node, options?: Partial<ToastOptions>): (result?: ToastResult) => void {\n const ref: ToastResultRef = {};\n const toastContent = this.getNode(content, ref, options);\n const toastOptions = this.getOptions(toastContent, ref, options);\n const toast = Toastify(toastOptions);\n ref.toast = {\n showToast: () => toast.showToast(),\n hideToast: (result?: ToastResult) => {\n ref.result = result;\n toast.hideToast();\n }\n };\n ref.toast.showToast();\n return (result?: ToastResult) => ref.toast?.hideToast(result);\n }\n\n private getNode(content: string | Node, ref: ToastResultRef, options?: Partial<ToastOptions>): HTMLElement {\n const template = document.createElement('template');\n template.innerHTML = `<div class=\"cat-toastify-wrapper\">\n ${options?.icon ? `<cat-icon class=\"cat-toastify-icon\" icon=\"${options.icon}\" size=\"l\"></cat-icon>` : ''}\n <div class=\"cat-toastify-content\">\n <div class=\"cat-toastify-inner\"></div>\n ${\n options?.action\n ? `<cat-button class=\"cat-toastify-action cat-button-pull\" size=\"s\" variant=\"text\" color=\"primary\">${options.action}</cat-button>`\n : ''\n }\n </div>\n ${\n options?.closeButton === true\n ? `<cat-button class=\"cat-toastify-close cat-button-pull\" size=\"s\" icon=\"$cat:notification-close\" variant=\"text\" icon-only=\"true\" class=\"close\" a11y-label=\"${i18n.t(\n 'notification.dismiss'\n )}\"></cat-button>`\n : ''\n }\n </div>`;\n\n const node = template.content.firstElementChild as HTMLElement;\n node.querySelector('.cat-toastify-close')?.addEventListener('click', () => ref.toast?.hideToast());\n node.querySelector('.cat-toastify-action')?.addEventListener('click', () => options?.onAction?.(ref));\n const inner = node.querySelector<HTMLDivElement>('.cat-toastify-inner');\n if (inner) {\n if (typeof content !== 'string') {\n inner.replaceChildren(content);\n } else if (options?.escapeMarkup === false) {\n inner.innerHTML = content;\n } else {\n inner.innerText = content;\n }\n }\n\n node.addEventListener('cat-close', event => {\n const { detail } = (event as CustomEvent) || {};\n ref.toast?.hideToast(detail);\n });\n\n return node;\n }\n\n private getOptions(node: Node, ref: ToastResultRef, options?: Partial<ToastOptions>): Options {\n const [gravity, position] = (options?.placement?.split('-') ?? ['bottom', 'left']) as [\n Options['gravity'],\n Options['position']\n ];\n const duration = options?.duration ?? (options?.autoClose === false ? -1 : CatNotificationService.duration);\n return {\n gravity,\n position,\n node,\n duration,\n close: false,\n className: options?.mode === 'light' ? 'cat-toastify' : 'cat-toastify cat-toastify-dark',\n stopOnFocus: true,\n onClick: () => options?.onClick?.(ref),\n callback: () => {\n const { toast, result } = ref;\n options?.onDismiss?.({ toast }, result);\n },\n offset: {\n x: '1rem',\n y: '1rem'\n }\n };\n }\n}\n\nexport const catNotificationService = CatNotificationService.getInstance();\n","import { of } from 'rxjs';\nimport { CatSelectConnector, RenderInfo } from './cat-select';\n\n/**\n * Creates a connector that resolves local object array data.\n *\n * @param data the object array to connect to\n * @returns a connector that resolves local object array data\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function objectArrayConnector<T extends { id: string } & RenderInfo = any>(data: T[]): CatSelectConnector<T> {\n return {\n resolve: ids => of(data.filter(({ id }) => ids.includes(id))),\n retrieve: term =>\n of({\n content: data.filter(({ label }) => label.toLowerCase().includes(term.toLowerCase())),\n last: true,\n totalElements: data.length\n }),\n render: item => item\n };\n}\n\n/**\n * Creates a connector that resolves local string array data.\n *\n * @param data the string array to connect to\n * @returns a connector that resolves local string array data\n */\nexport function stringArrayConnector(data: string[]): CatSelectConnector<{ id: string; label: string }> {\n const items = data.map(id => ({ id, label: id }));\n return objectArrayConnector(items);\n}\n\n/**\n * Creates a connector that resolves local string map data.\n *\n * @param data the string map to connect to\n * @returns a connector that resolves local string map data\n */\nexport function stringMapConnector(data: Map<string, string>): CatSelectConnector<{ id: string; label: string }> {\n const items = Array.from(data).map(([id, label]) => ({ id, label }));\n return objectArrayConnector(items);\n}\n"],"names":["this","i18n","of"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,EAAA,CAAC,SAAS,IAAI,EAAE,OAAO,EAAE;IACvB,IAAkC,MAAM,CAAC,OAAO,EAAE;MAChD,MAAA,CAAA,OAAA,GAAiB,OAAO,EAAE;AAC9B,KAAG,MAAM;AACT,MAAI,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE;AAC7B;AACA,GAAC,EAAEA,QAAI,EAAE,SAAS,MAAM,EAAE;AAC1B;AACA,IAAE,IAAI,QAAQ,GAAG,SAAS,OAAO,EAAE;AACnC;QACM,OAAO,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;OACtC;AACL;MACI,OAAO,GAAG,QAAQ;;AAEtB;IACE,QAAQ,CAAC,QAAQ,GAAG;MAClB,WAAW,EAAE,IAAI;MACjB,IAAI,EAAE,sBAAsB;MAC5B,IAAI,EAAE,SAAS;MACf,QAAQ,EAAE,IAAI;MACd,QAAQ,EAAE,SAAS;MACnB,QAAQ,EAAE,YAAY;OACrB;MACD,WAAW,EAAE,SAAS;MACtB,SAAS,EAAE,KAAK;MAChB,KAAK,EAAE,KAAK;MACZ,OAAO,EAAE,cAAc;MACvB,YAAY,EAAE,KAAK;MACnB,QAAQ,EAAE,EAAE;MACZ,eAAe,EAAE,EAAE;MACnB,MAAM,EAAE,EAAE;MACV,SAAS,EAAE,EAAE;MACb,WAAW,EAAE,IAAI;MACjB,OAAO,EAAE,YAAY;OACpB;MACD,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;MACpB,YAAY,EAAE,IAAI;MAClB,QAAQ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AC,CAAC,EAAE,EAAE,EAAE,KAAK,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7D,QAAA,QAAQ,EAAE,IAAI,IACZA,mBAAE,CAAC;YACD,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACrF,YAAA,IAAI,EAAE,IAAI;YACV,aAAa,EAAE,IAAI,CAAC;SACrB,CAAC;AACJ,QAAA,MAAM,EAAE,IAAI,IAAI;KACjB;AACH;AAEA;;;;;AAKG;AACG,SAAU,oBAAoB,CAAC,IAAc,EAAA;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AACjD,IAAA,OAAO,oBAAoB,CAAC,KAAK,CAAC;AACpC;AAEA;;;;;AAKG;AACG,SAAU,kBAAkB,CAAC,IAAyB,EAAA;AAC1D,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AACpE,IAAA,OAAO,oBAAoB,CAAC,KAAK,CAAC;AACpC;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -80,7 +80,7 @@ export class CatDate {
|
|
|
80
80
|
}
|
|
81
81
|
return '';
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
componentWillLoad() {
|
|
84
84
|
const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');
|
|
85
85
|
const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(format) || [];
|
|
86
86
|
this.dateMaskOptions = {
|
|
@@ -115,14 +115,14 @@ export class CatDate {
|
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
117
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
118
|
-
return (h(Host, { key: '
|
|
118
|
+
return (h(Host, { key: '38c0f6d0b6edfcd762840f7fedcb47157b0f4a4c' }, h("cat-input", { key: '71a9ebc03ea49b1584b178ad8cb0f61306644e15', class: "cat-date-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, testId: this.testId, nativeAttributes: this.nativeAttributes, value: this.inputValue, dateMaskOptions: this.dateMaskOptions, onCatFocus: e => {
|
|
119
119
|
this.inputFocused = e.target === this.input;
|
|
120
120
|
e.stopPropagation();
|
|
121
121
|
this.catFocus.emit(e.detail);
|
|
122
122
|
}, onCatBlur: e => {
|
|
123
123
|
e.stopPropagation();
|
|
124
124
|
this.onInputBlur(e.detail);
|
|
125
|
-
} }, h("span", { key: '
|
|
125
|
+
} }, h("span", { key: 'ca8eb678246d9047ba2f5e38b0e392333cb20f70', slot: "label" }, this.label, h("span", { key: 'd72fd4de36d76793515480db04b25909b703521e', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: 'c58fd79c97821495b73ddef3311235065ff10ce3', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'f0f4b2ff2be00dfba6c93fb0218c35f0361c5c63', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'b5c78f6d0cd4a94af38f3c5d2f7aeceea02eaff5', slot: "content" }, h("cat-date-inline", { key: '71f66a073ba5e5e107defac3771064ac5d48eee9', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, hint: true, weeks: true, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
126
126
|
}
|
|
127
127
|
getTriggerA11yLabel() {
|
|
128
128
|
const date = this.locale.fromLocalISO(this.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-date.js","sourceRoot":"","sources":["../../../src/components/cat-date/cat-date.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGxE;;GAEG;AAQH,MAAM,OAAO,OAAO;IAPpB;QAQmB,aAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5B,WAAM,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAG3C,iBAAY,GAAG,KAAK,CAAC;QAM7B;;WAEG;QACK,mBAAc,GAA4E,UAAU,CAAC;QAE7G;;WAEG;QACK,eAAU,GAAG,KAAK,CAAC;QAE3B;;WAEG;QACK,iBAAY,GAAG,KAAK,CAAC;QAE7B;;WAEG;QACK,cAAS,GAAG,KAAK,CAAC;QAE1B;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAYzB;;WAEG;QACK,cAAS,GAAG,KAAK,CAAC;QAO1B;;WAEG;QACK,UAAK,GAAG,EAAE,CAAC;QAEnB;;WAEG;QACK,gBAAW,GAAG,KAAK,CAAC;QAgC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h, State } from '@stencil/core';\nimport { getLocale } from '../cat-date-inline/cat-date-locale';\nimport { clampDate } from '../cat-date-inline/cat-date-math';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { DateUnit, FormatDateOptions } from 'cleave-zen';\n\n/**\n * A date input component to select a date from a calendar in a dropdown.\n */\n@Component({\n tag: 'cat-date',\n styleUrl: 'cat-date.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatDate {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n private input?: HTMLCatInputElement;\n private dateInline?: HTMLCatDateInlineElement;\n private inputFocused = false;\n\n @Element() hostElement!: HTMLElement;\n\n @State() dateMaskOptions?: FormatDateOptions;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete = 'off';\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() min?: string;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The value of the control, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors change with the given delay in milliseconds or immediately on blur.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-end';\n\n @Watch('min')\n onMinChanged(min?: string, oldMin?: string) {\n if (min !== oldMin) {\n this.reclamp('min', min);\n }\n }\n\n @Watch('max')\n onMaxChanged(max?: string, oldMax?: string) {\n if (max !== oldMax) {\n this.reclamp('max', max);\n }\n }\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n private get inputValue() {\n const [match, year, month, day] = this.value?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n if (match) {\n const date = new Date(Number(year), Number(month) - 1, Number(day));\n const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });\n return format.format(date);\n }\n return '';\n }\n\n componentDidLoad() {\n const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(format) || [];\n this.dateMaskOptions = {\n dateMin: this.min,\n dateMax: this.max,\n delimiter: d1,\n datePattern: [p1 as DateUnit, p2 as DateUnit, p3 as DateUnit]\n };\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input?.doFocus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input?.doBlur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.input?.clear();\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n <cat-input\n class=\"cat-date-input\"\n ref={el => (this.input = el as HTMLCatInputElement)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n testId={this.testId}\n nativeAttributes={this.nativeAttributes}\n value={this.inputValue}\n dateMaskOptions={this.dateMaskOptions}\n onCatFocus={e => {\n this.inputFocused = e.target === this.input;\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.onInputBlur(e.detail);\n }}\n >\n <span slot=\"label\">\n {this.label}\n <span class=\"label-aria\"> ({this.locale.formatStr})</span>\n </span>\n <cat-dropdown\n slot=\"addon\"\n placement={this.placement}\n arrowNavigation=\"none\"\n noResize\n onCatOpen={() => this.dateInline?.resetView()}\n >\n <cat-button\n slot=\"trigger\"\n icon=\"$cat:datepicker-calendar\"\n iconOnly\n class=\"cat-date-toggle\"\n disabled={this.disabled}\n a11yLabel={this.getTriggerA11yLabel()}\n ></cat-button>\n <div slot=\"content\">\n <cat-date-inline\n ref={el => (this.dateInline = el as HTMLCatDateInlineElement)}\n min={this.min}\n max={this.max}\n value={this.value}\n hint\n weeks\n noClear\n onCatChange={this.onDateChange.bind(this)}\n ></cat-date-inline>\n </div>\n </cat-dropdown>\n </cat-input>\n </Host>\n );\n }\n\n private getTriggerA11yLabel() {\n const date = this.locale.fromLocalISO(this.value);\n return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;\n }\n\n private onInputBlur(e: FocusEvent) {\n if (!this.input || !this.inputFocused) {\n return;\n }\n this.inputFocused = false;\n const oldValue = this.value;\n const dateParsed = this.parse(this.input.value ?? '');\n const dateMin = this.locale.fromLocalISO(this.min);\n const dateMax = this.locale.fromLocalISO(this.max);\n const date = dateParsed ? clampDate(dateMin, dateParsed, dateMax) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n if (date) {\n this.dateInline?.select(date);\n } else {\n this.dateInline?.clear();\n }\n this.catChange.emit(this.value);\n }\n this.input.value = this.inputValue;\n this.catBlur.emit(e);\n }\n\n private onDateChange(e: CustomEvent<string>) {\n e.stopPropagation();\n const oldValue = this.value;\n const date = e.detail ? this.locale.fromLocalISO(e.detail) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n private parse(value: string) {\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(this.locale.formatStr) || [];\n const formatParts = [p1, p2, p3];\n const parts = value.split(d1).map(s => Number(s || 'x'));\n let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.locale.now().getFullYear();\n const month = parts[formatParts.indexOf('MM')];\n const day = parts[formatParts.indexOf('DD')];\n if (!Number.isInteger(month) || !Number.isInteger(day)) {\n return null;\n } else if (year < 100) {\n year += year < 50 ? 2000 : 1900;\n }\n return new Date(year, month - 1, day);\n }\n\n private reclamp(mode: 'min' | 'max', limit: string | undefined) {\n const oldValue = this.value;\n const oldDate = this.locale.fromLocalISO(oldValue);\n const limitDate = this.locale.fromLocalISO(limit);\n if (!oldDate || !limitDate) {\n return;\n }\n const newDate = clampDate(mode === 'min' ? limitDate : null, oldDate, mode === 'max' ? limitDate : null);\n const newValue = this.locale.toLocalISO(newDate);\n if (oldValue !== newValue) {\n this.value = newValue;\n this.catChange.emit(newValue);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cat-date.js","sourceRoot":"","sources":["../../../src/components/cat-date/cat-date.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGxE;;GAEG;AAQH,MAAM,OAAO,OAAO;IAPpB;QAQmB,aAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5B,WAAM,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAG3C,iBAAY,GAAG,KAAK,CAAC;QAM7B;;WAEG;QACK,mBAAc,GAA4E,UAAU,CAAC;QAE7G;;WAEG;QACK,eAAU,GAAG,KAAK,CAAC;QAE3B;;WAEG;QACK,iBAAY,GAAG,KAAK,CAAC;QAE7B;;WAEG;QACK,cAAS,GAAG,KAAK,CAAC;QAE1B;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAYzB;;WAEG;QACK,cAAS,GAAG,KAAK,CAAC;QAO1B;;WAEG;QACK,UAAK,GAAG,EAAE,CAAC;QAEnB;;WAEG;QACK,gBAAW,GAAG,KAAK,CAAC;QAgC5B;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAEzB;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAiBzB;;;;WAIG;QACK,gBAAW,GAAqB,CAAC,CAAC;QAc1C;;WAEG;QACK,cAAS,GAAc,YAAY,CAAC;KAgO7C;IA7NC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h, State } from '@stencil/core';\nimport { getLocale } from '../cat-date-inline/cat-date-locale';\nimport { clampDate } from '../cat-date-inline/cat-date-math';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { DateUnit, FormatDateOptions } from 'cleave-zen';\n\n/**\n * A date input component to select a date from a calendar in a dropdown.\n */\n@Component({\n tag: 'cat-date',\n styleUrl: 'cat-date.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatDate {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n private input?: HTMLCatInputElement;\n private dateInline?: HTMLCatDateInlineElement;\n private inputFocused = false;\n\n @Element() hostElement!: HTMLElement;\n\n @State() dateMaskOptions?: FormatDateOptions;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete = 'off';\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value for the date, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop() min?: string;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The value of the control, given in local ISO 8601 date format YYYY-MM-DD.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors change with the given delay in milliseconds or immediately on blur.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-end';\n\n @Watch('min')\n onMinChanged(min?: string, oldMin?: string) {\n if (min !== oldMin) {\n this.reclamp('min', min);\n }\n }\n\n @Watch('max')\n onMaxChanged(max?: string, oldMax?: string) {\n if (max !== oldMax) {\n this.reclamp('max', max);\n }\n }\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n private get inputValue() {\n const [match, year, month, day] = this.value?.match(/^(\\d{4})-(\\d{2})-(\\d{2})/) ?? [];\n if (match) {\n const date = new Date(Number(year), Number(month) - 1, Number(day));\n const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });\n return format.format(date);\n }\n return '';\n }\n\n componentWillLoad() {\n const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(format) || [];\n this.dateMaskOptions = {\n dateMin: this.min,\n dateMax: this.max,\n delimiter: d1,\n datePattern: [p1 as DateUnit, p2 as DateUnit, p3 as DateUnit]\n };\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input?.doFocus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input?.doBlur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.input?.clear();\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n <cat-input\n class=\"cat-date-input\"\n ref={el => (this.input = el as HTMLCatInputElement)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n testId={this.testId}\n nativeAttributes={this.nativeAttributes}\n value={this.inputValue}\n dateMaskOptions={this.dateMaskOptions}\n onCatFocus={e => {\n this.inputFocused = e.target === this.input;\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.onInputBlur(e.detail);\n }}\n >\n <span slot=\"label\">\n {this.label}\n <span class=\"label-aria\"> ({this.locale.formatStr})</span>\n </span>\n <cat-dropdown\n slot=\"addon\"\n placement={this.placement}\n arrowNavigation=\"none\"\n noResize\n onCatOpen={() => this.dateInline?.resetView()}\n >\n <cat-button\n slot=\"trigger\"\n icon=\"$cat:datepicker-calendar\"\n iconOnly\n class=\"cat-date-toggle\"\n disabled={this.disabled}\n a11yLabel={this.getTriggerA11yLabel()}\n ></cat-button>\n <div slot=\"content\">\n <cat-date-inline\n ref={el => (this.dateInline = el as HTMLCatDateInlineElement)}\n min={this.min}\n max={this.max}\n value={this.value}\n hint\n weeks\n noClear\n onCatChange={this.onDateChange.bind(this)}\n ></cat-date-inline>\n </div>\n </cat-dropdown>\n </cat-input>\n </Host>\n );\n }\n\n private getTriggerA11yLabel() {\n const date = this.locale.fromLocalISO(this.value);\n return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;\n }\n\n private onInputBlur(e: FocusEvent) {\n if (!this.input || !this.inputFocused) {\n return;\n }\n this.inputFocused = false;\n const oldValue = this.value;\n const dateParsed = this.parse(this.input.value ?? '');\n const dateMin = this.locale.fromLocalISO(this.min);\n const dateMax = this.locale.fromLocalISO(this.max);\n const date = dateParsed ? clampDate(dateMin, dateParsed, dateMax) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n if (date) {\n this.dateInline?.select(date);\n } else {\n this.dateInline?.clear();\n }\n this.catChange.emit(this.value);\n }\n this.input.value = this.inputValue;\n this.catBlur.emit(e);\n }\n\n private onDateChange(e: CustomEvent<string>) {\n e.stopPropagation();\n const oldValue = this.value;\n const date = e.detail ? this.locale.fromLocalISO(e.detail) : null;\n this.value = date ? this.locale.toLocalISO(date) : undefined;\n if (oldValue !== this.value) {\n this.catChange.emit(this.value);\n }\n }\n\n private parse(value: string) {\n const [, p1, d1, p2, p3] = /(\\w+)([^\\w]+)(\\w+)[^\\w]+(\\w+)/.exec(this.locale.formatStr) || [];\n const formatParts = [p1, p2, p3];\n const parts = value.split(d1).map(s => Number(s || 'x'));\n let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.locale.now().getFullYear();\n const month = parts[formatParts.indexOf('MM')];\n const day = parts[formatParts.indexOf('DD')];\n if (!Number.isInteger(month) || !Number.isInteger(day)) {\n return null;\n } else if (year < 100) {\n year += year < 50 ? 2000 : 1900;\n }\n return new Date(year, month - 1, day);\n }\n\n private reclamp(mode: 'min' | 'max', limit: string | undefined) {\n const oldValue = this.value;\n const oldDate = this.locale.fromLocalISO(oldValue);\n const limitDate = this.locale.fromLocalISO(limit);\n if (!oldDate || !limitDate) {\n return;\n }\n const newDate = clampDate(mode === 'min' ? limitDate : null, oldDate, mode === 'max' ? limitDate : null);\n const newValue = this.locale.toLocalISO(newDate);\n if (oldValue !== newValue) {\n this.value = newValue;\n this.catChange.emit(newValue);\n }\n }\n}\n"]}
|
|
@@ -24,11 +24,11 @@ export class CatFormGroup {
|
|
|
24
24
|
}
|
|
25
25
|
onHorizontalChanged(newHorizontal) {
|
|
26
26
|
this.formElements.forEach(element => {
|
|
27
|
-
element.horizontal = newHorizontal;
|
|
27
|
+
element.horizontal = element.horizontal ?? newHorizontal;
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: 'db0a498ef54f74b0db89f17ba628626576fe4410', style: { '--label-size': this.labelSize } }, h("slot", { key: '28391f2acbd06baca30aaebb57e6bd3d20ab6532', onSlotchange: this.onSlotChange.bind(this) })));
|
|
32
32
|
}
|
|
33
33
|
onSlotChange() {
|
|
34
34
|
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-form-group.js","sourceRoot":"","sources":["../../../src/components/cat-form-group/cat-form-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQzE;;GAEG;AAMH,MAAM,OAAO,YAAY;IALzB;QAMU,iBAAY,GAA8B,EAAE,CAAC;QAIrD;;;;;;WAMG;QACK,mBAAc,GAA8C,MAAM,CAAC;QAE3E;;WAEG;QACK,eAAU,GAAG,KAAK,CAAC;KA2C5B;IAnCC,uBAAuB,CAAC,iBAA4D;QAClF,MAAM,YAAY,GAAG,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC1G,IAAI,CAAC,YAAY,CAAC,OAAO,CACvB,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,YAAY,CAAC,CAC7F,CAAC;IACJ,CAAC;IAGD,mBAAmB,CAAC,aAAsB;QACxC,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CAAC;IACJ,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAC5B,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,qDAAqD,CAAC,CAC5D,CAAC;QAC/B,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAClD,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAEO,SAAS,CAAC,QAAmC;QACnD,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;QACxE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,cAAc,CAAC;QACxD,OAAO,cAAc,IAAI,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;IACpE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\ntype HTMLCatFormFieldElement =\n | HTMLCatInputElement\n | HTMLCatTextareaElement\n | HTMLCatSelectElement\n | HTMLCatDatepickerElement;\n\n/**\n * A form group component to group form fields and labels.\n */\n@Component({\n tag: 'cat-form-group',\n styleUrl: 'cat-form-group.scss',\n shadow: true\n})\nexport class CatFormGroup {\n private formElements: HTMLCatFormFieldElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * Whether the labels need a marker to shown if the forms fields are required or optional.<br /><br />\n * By default, it is set to auto, it will display the mark depending on the number of required and optional fields: <br />\n * - If there are more required, the optional will be marked.<br />\n * - If there are less required, it will mark the required.<br /><br />\n * If a form field had \"!\", the requiredMarked of the field would not change.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'auto' = 'auto';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * The space allocated to the input label\n */\n @Prop() labelSize?: string;\n\n @Watch('requiredMarker')\n onRequiredMarkerChanged(newRequiredMarker: 'none' | 'required' | 'optional' | 'auto') {\n const updateMarker = newRequiredMarker === 'auto' ? this.calculate(this.formElements) : newRequiredMarker;\n this.formElements.forEach(\n element => !element.requiredMarker?.endsWith('!') && (element.requiredMarker = updateMarker)\n );\n }\n\n @Watch('horizontal')\n onHorizontalChanged(newHorizontal: boolean) {\n this.formElements.forEach(element => {\n element.horizontal = element.horizontal ?? newHorizontal;\n });\n }\n\n render() {\n return (\n <Host style={{ '--label-size': this.labelSize }}>\n <slot onSlotchange={this.onSlotChange.bind(this)}></slot>\n </Host>\n );\n }\n\n private onSlotChange(): void {\n this.formElements = Array.from(\n this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker')\n ) as HTMLCatFormFieldElement[];\n this.onRequiredMarkerChanged(this.requiredMarker);\n this.onHorizontalChanged(this.horizontal);\n }\n\n private calculate(elements: HTMLCatFormFieldElement[]): 'optional' | 'required' {\n const optionalFields = elements.filter(value => !value.required).length;\n const requiredFields = elements.length - optionalFields;\n return requiredFields >= optionalFields ? 'optional' : 'required';\n }\n}\n"]}
|
|
@@ -631,8 +631,6 @@ button.cat-link-danger:focus-visible {
|
|
|
631
631
|
box-shadow: inset 0 0 0 1px rgb(var(--border-color));
|
|
632
632
|
transition: box-shadow 125ms linear;
|
|
633
633
|
--border-color: var(--cat-border-color-dark, 215, 219, 224);
|
|
634
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
635
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
636
634
|
}
|
|
637
635
|
.input-wrapper.input-round {
|
|
638
636
|
border-radius: 10rem;
|
|
@@ -658,9 +656,15 @@ button.cat-link-danger:focus-visible {
|
|
|
658
656
|
.input-wrapper.input-invalid {
|
|
659
657
|
--border-color: var(--cat-danger-bg, 217, 52, 13), 0.2;
|
|
660
658
|
}
|
|
659
|
+
.input-wrapper {
|
|
660
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
661
|
+
}
|
|
661
662
|
.input-wrapper:has(input:-webkit-autofill), .input-wrapper:has(input:-webkit-autofill):hover, .input-wrapper:has(input:-webkit-autofill):focus {
|
|
662
663
|
background-color: #e8f0fe;
|
|
663
664
|
}
|
|
665
|
+
.input-wrapper {
|
|
666
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
667
|
+
}
|
|
664
668
|
|
|
665
669
|
.text-prefix,
|
|
666
670
|
.text-suffix {
|
|
@@ -715,8 +719,6 @@ input {
|
|
|
715
719
|
text-overflow: ellipsis;
|
|
716
720
|
white-space: nowrap;
|
|
717
721
|
/* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
718
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
719
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
720
722
|
}
|
|
721
723
|
.input-disabled input {
|
|
722
724
|
cursor: not-allowed;
|
|
@@ -731,9 +733,15 @@ input.has-clearable.has-toggle-password {
|
|
|
731
733
|
input::placeholder {
|
|
732
734
|
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
733
735
|
}
|
|
736
|
+
input {
|
|
737
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
738
|
+
}
|
|
734
739
|
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
|
|
735
740
|
-webkit-box-shadow: 0 0 0 9999px #e8f0fe inset;
|
|
736
741
|
}
|
|
742
|
+
input {
|
|
743
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
744
|
+
}
|
|
737
745
|
|
|
738
746
|
.clearable {
|
|
739
747
|
position: absolute;
|
|
@@ -38,7 +38,7 @@ export class CatNotificationService {
|
|
|
38
38
|
? `<cat-button class="cat-toastify-action cat-button-pull" size="s" variant="text" color="primary">${options.action}</cat-button>`
|
|
39
39
|
: ''}
|
|
40
40
|
</div>
|
|
41
|
-
${options?.
|
|
41
|
+
${options?.closeButton === true
|
|
42
42
|
? `<cat-button class="cat-toastify-close cat-button-pull" size="s" icon="$cat:notification-close" variant="text" icon-only="true" class="close" a11y-label="${i18n.t('notification.dismiss')}"></cat-button>`
|
|
43
43
|
: ''}
|
|
44
44
|
</div>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-notification.js","sourceRoot":"","sources":["../../../src/components/cat-notification/cat-notification.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAqB,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"cat-notification.js","sourceRoot":"","sources":["../../../src/components/cat-notification/cat-notification.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAqB,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAuCxE;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAIjC;QACE,mBAAmB;IACrB,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC;YACrC,sBAAsB,CAAC,QAAQ,GAAG,IAAI,sBAAsB,EAAE,CAAC;QACjE,CAAC;QACD,OAAO,sBAAsB,CAAC,QAAQ,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,OAAsB,EAAE,OAA+B;QAC1D,MAAM,GAAG,GAAmB,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACzD,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACjE,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QACrC,GAAG,CAAC,KAAK,GAAG;YACV,SAAS,EAAE,G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,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC;YACtC,QAAQ,EAAE,GAAG,EAAE;gBACb,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;gBAC9B,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;YAC1C,CAAC;YACD,MAAM,EAAE;gBACN,CAAC,EAAE,MAAM;gBACT,CAAC,EAAE,MAAM;aACV;SACF,CAAC;IACJ,CAAC;;AAhGc,+BAAQ,GAAG,IAAI,CAAC;AAmGjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import Toastify, { Options } from 'toastify-js';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ToastResult = any;\n\ninterface ToastRef {\n toast?: {\n showToast: () => void;\n hideToast: (result?: ToastResult) => void;\n };\n}\n\ntype ToastResultRef = ToastRef & { result?: ToastResult };\n\nexport interface ToastOptions {\n /** The appearance mode of the notification. (Default: `dark`) */\n mode: 'dark' | 'light';\n /** An optional icon to appear in the notification. */\n icon: string;\n /** The placement of the notification on screen. (Default: `bottom-left`) */\n placement: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\n /** Enables auto-closing of the notification. (Default: `true`) */\n autoClose: boolean;\n /** Show button to close the notification. (Default: `false`) */\n closeButton: boolean;\n /** The duration in ms for the notification to be visible on screen. (Default: `3000`) */\n duration: number;\n /** An optional label for an action button. */\n action: string;\n /** Enable markup escape and sanitise HTML input. (Default: true) */\n escapeMarkup: boolean;\n /** Callback executed when the action button is clicked. Receives a reference to the notification as first argument. */\n onAction: (toast: ToastRef) => void;\n /** Callback executed when the notification is clicked. Receives a reference to the notification as first argument. */\n onClick: (toast: ToastRef) => void;\n /** Callback executed when the notification is dismissed. Receives a reference to the notification as first argument and an optional result as second argument. */\n onDismiss: (toast: ToastRef, result?: ToastResult) => void;\n}\n\n/**\n * A service to show additional information via toast notifications.\n */\nexport class CatNotificationService {\n private static instance: CatNotificationService;\n private static duration = 3000;\n\n private constructor() {\n // hide constructor\n }\n\n static getInstance(): CatNotificationService {\n if (!CatNotificationService.instance) {\n CatNotificationService.instance = new CatNotificationService();\n }\n return CatNotificationService.instance;\n }\n\n show(content: string | Node, options?: Partial<ToastOptions>): (result?: ToastResult) => void {\n const ref: ToastResultRef = {};\n const toastContent = this.getNode(content, ref, options);\n const toastOptions = this.getOptions(toastContent, ref, options);\n const toast = Toastify(toastOptions);\n ref.toast = {\n showToast: () => toast.showToast(),\n hideToast: (result?: ToastResult) => {\n ref.result = result;\n toast.hideToast();\n }\n };\n ref.toast.showToast();\n return (result?: ToastResult) => ref.toast?.hideToast(result);\n }\n\n private getNode(content: string | Node, ref: ToastResultRef, options?: Partial<ToastOptions>): HTMLElement {\n const template = document.createElement('template');\n template.innerHTML = `<div class=\"cat-toastify-wrapper\">\n ${options?.icon ? `<cat-icon class=\"cat-toastify-icon\" icon=\"${options.icon}\" size=\"l\"></cat-icon>` : ''}\n <div class=\"cat-toastify-content\">\n <div class=\"cat-toastify-inner\"></div>\n ${\n options?.action\n ? `<cat-button class=\"cat-toastify-action cat-button-pull\" size=\"s\" variant=\"text\" color=\"primary\">${options.action}</cat-button>`\n : ''\n }\n </div>\n ${\n options?.closeButton === true\n ? `<cat-button class=\"cat-toastify-close cat-button-pull\" size=\"s\" icon=\"$cat:notification-close\" variant=\"text\" icon-only=\"true\" class=\"close\" a11y-label=\"${i18n.t(\n 'notification.dismiss'\n )}\"></cat-button>`\n : ''\n }\n </div>`;\n\n const node = template.content.firstElementChild as HTMLElement;\n node.querySelector('.cat-toastify-close')?.addEventListener('click', () => ref.toast?.hideToast());\n node.querySelector('.cat-toastify-action')?.addEventListener('click', () => options?.onAction?.(ref));\n const inner = node.querySelector<HTMLDivElement>('.cat-toastify-inner');\n if (inner) {\n if (typeof content !== 'string') {\n inner.replaceChildren(content);\n } else if (options?.escapeMarkup === false) {\n inner.innerHTML = content;\n } else {\n inner.innerText = content;\n }\n }\n\n node.addEventListener('cat-close', event => {\n const { detail } = (event as CustomEvent) || {};\n ref.toast?.hideToast(detail);\n });\n\n return node;\n }\n\n private getOptions(node: Node, ref: ToastResultRef, options?: Partial<ToastOptions>): Options {\n const [gravity, position] = (options?.placement?.split('-') ?? ['bottom', 'left']) as [\n Options['gravity'],\n Options['position']\n ];\n const duration = options?.duration ?? (options?.autoClose === false ? -1 : CatNotificationService.duration);\n return {\n gravity,\n position,\n node,\n duration,\n close: false,\n className: options?.mode === 'light' ? 'cat-toastify' : 'cat-toastify cat-toastify-dark',\n stopOnFocus: true,\n onClick: () => options?.onClick?.(ref),\n callback: () => {\n const { toast, result } = ref;\n options?.onDismiss?.({ toast }, result);\n },\n offset: {\n x: '1rem',\n y: '1rem'\n }\n };\n }\n}\n\nexport const catNotificationService = CatNotificationService.getInstance();\n"]}
|
|
@@ -644,8 +644,6 @@ label.hidden {
|
|
|
644
644
|
transition: box-shadow 125ms linear;
|
|
645
645
|
padding: 0.25rem;
|
|
646
646
|
--border-color: var(--cat-border-color-dark, 215, 219, 224);
|
|
647
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
648
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
649
647
|
}
|
|
650
648
|
.select-wrapper:not(.select-disabled):hover {
|
|
651
649
|
box-shadow: inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color));
|
|
@@ -657,9 +655,15 @@ label.hidden {
|
|
|
657
655
|
.select-wrapper.select-invalid {
|
|
658
656
|
--border-color: var(--cat-danger-bg, 217, 52, 13), 0.2;
|
|
659
657
|
}
|
|
658
|
+
.select-wrapper {
|
|
659
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
660
|
+
}
|
|
660
661
|
.select-wrapper:has(input:-webkit-autofill), .select-wrapper:has(input:-webkit-autofill):hover, .select-wrapper:has(input:-webkit-autofill):focus {
|
|
661
662
|
background-color: #e8f0fe;
|
|
662
663
|
}
|
|
664
|
+
.select-wrapper {
|
|
665
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
666
|
+
}
|
|
663
667
|
|
|
664
668
|
:host(.cat-error) .select-wrapper {
|
|
665
669
|
box-shadow: 0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13));
|
|
@@ -1348,7 +1348,7 @@ export class CatSelect {
|
|
|
1348
1348
|
"Observable": {
|
|
1349
1349
|
"location": "import",
|
|
1350
1350
|
"path": "rxjs",
|
|
1351
|
-
"id": "../node_modules/.pnpm/rxjs@7.8.
|
|
1351
|
+
"id": "../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/index.d.ts::Observable"
|
|
1352
1352
|
},
|
|
1353
1353
|
"Item": {
|
|
1354
1354
|
"location": "local",
|
|
@@ -615,8 +615,6 @@ input {
|
|
|
615
615
|
text-overflow: ellipsis;
|
|
616
616
|
white-space: nowrap;
|
|
617
617
|
/* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
618
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
619
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
620
618
|
}
|
|
621
619
|
.input-disabled input {
|
|
622
620
|
cursor: not-allowed;
|
|
@@ -625,9 +623,15 @@ input {
|
|
|
625
623
|
input::placeholder {
|
|
626
624
|
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
627
625
|
}
|
|
626
|
+
input {
|
|
627
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
628
|
+
}
|
|
628
629
|
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
|
|
629
630
|
-webkit-box-shadow: 0 0 0 9999px #e8f0fe inset;
|
|
630
631
|
}
|
|
632
|
+
input {
|
|
633
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
634
|
+
}
|
|
631
635
|
|
|
632
636
|
.input-wrapper {
|
|
633
637
|
flex: 1 1 auto;
|
|
@@ -642,8 +646,6 @@ input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:foc
|
|
|
642
646
|
transition: box-shadow 125ms linear;
|
|
643
647
|
--border-color: var(--cat-border-color-dark, 215, 219, 224);
|
|
644
648
|
flex-wrap: wrap;
|
|
645
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
646
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
647
649
|
}
|
|
648
650
|
.input-wrapper.input-disabled {
|
|
649
651
|
background: #f2f4f7;
|
|
@@ -663,9 +665,15 @@ input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:foc
|
|
|
663
665
|
.input-wrapper.input-invalid {
|
|
664
666
|
--border-color: var(--cat-danger-bg, 217, 52, 13), 0.2;
|
|
665
667
|
}
|
|
668
|
+
.input-wrapper {
|
|
669
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
670
|
+
}
|
|
666
671
|
.input-wrapper:has(input:-webkit-autofill), .input-wrapper:has(input:-webkit-autofill):hover, .input-wrapper:has(input:-webkit-autofill):focus {
|
|
667
672
|
background-color: #e8f0fe;
|
|
668
673
|
}
|
|
674
|
+
.input-wrapper {
|
|
675
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
676
|
+
}
|
|
669
677
|
|
|
670
678
|
.tag-pill {
|
|
671
679
|
display: flex;
|
|
@@ -655,8 +655,6 @@ textarea {
|
|
|
655
655
|
transition: box-shadow 125ms linear;
|
|
656
656
|
resize: vertical;
|
|
657
657
|
--border-color: var(--cat-border-color-dark, 215, 219, 224);
|
|
658
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
659
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
660
658
|
}
|
|
661
659
|
textarea:disabled {
|
|
662
660
|
background: #f2f4f7;
|
|
@@ -677,6 +675,12 @@ textarea:focus {
|
|
|
677
675
|
textarea::placeholder {
|
|
678
676
|
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
679
677
|
}
|
|
678
|
+
textarea {
|
|
679
|
+
/* stylelint-disable property-no-vendor-prefix */
|
|
680
|
+
}
|
|
680
681
|
textarea:-webkit-autofill, textarea:-webkit-autofill:hover, textarea:-webkit-autofill:focus {
|
|
681
682
|
-webkit-box-shadow: 0 0 0 9999px #e8f0fe inset;
|
|
683
|
+
}
|
|
684
|
+
textarea {
|
|
685
|
+
/* stylelint-enable property-no-vendor-prefix */
|
|
682
686
|
}
|