@trendyol/baklava 3.0.0-beta.25 → 3.0.0-beta.26
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/baklava-react.d.ts +16 -0
- package/dist/baklava-react.d.ts.map +1 -1
- package/dist/baklava-react.js +1 -1
- package/dist/baklava-react.js.map +3 -3
- package/dist/baklava-vue.d.ts +2 -0
- package/dist/baklava.d.ts +2 -0
- package/dist/baklava.d.ts.map +1 -1
- package/dist/baklava.js +1 -1
- package/dist/{chunk-Y3PONRYW.js → chunk-5HU4KWMX.js} +2 -2
- package/dist/chunk-CYLRPJKP.js +6 -0
- package/dist/chunk-CYLRPJKP.js.map +7 -0
- package/dist/{chunk-LPHOBDYM.js → chunk-D5MPTIGC.js} +2 -2
- package/dist/{chunk-LXYK2N4C.js → chunk-G7WWTJW4.js} +5 -5
- package/dist/chunk-G7WWTJW4.js.map +7 -0
- package/dist/chunk-KOWS266A.js +77 -0
- package/dist/chunk-KOWS266A.js.map +7 -0
- package/dist/{chunk-OB455JKN.js → chunk-N43OCCSL.js} +2 -2
- package/dist/chunk-N43OCCSL.js.map +7 -0
- package/dist/{chunk-YP2JT77B.js → chunk-P7J47Z2J.js} +10 -14
- package/dist/chunk-P7J47Z2J.js.map +7 -0
- package/dist/chunk-VU6LRFZR.js +26 -0
- package/dist/chunk-VU6LRFZR.js.map +7 -0
- package/dist/chunk-WEEGH2F4.js +2 -0
- package/dist/chunk-WEEGH2F4.js.map +7 -0
- package/dist/{chunk-P4FHU5BE.js → chunk-X2XFV2S3.js} +2 -2
- package/dist/components/button/bl-button.d.ts +1 -0
- package/dist/components/button/bl-button.d.ts.map +1 -1
- package/dist/components/button/bl-button.js +1 -1
- package/dist/components/calendar/bl-calendar.constant.d.ts +13 -0
- package/dist/components/calendar/bl-calendar.constant.d.ts.map +1 -0
- package/dist/components/calendar/bl-calendar.constant.js +2 -0
- package/dist/components/calendar/bl-calendar.constant.js.map +7 -0
- package/dist/components/calendar/bl-calendar.d.ts +81 -0
- package/dist/components/calendar/bl-calendar.d.ts.map +1 -0
- package/dist/components/calendar/bl-calendar.js +2 -0
- package/dist/components/calendar/bl-calendar.js.map +7 -0
- package/dist/components/calendar/bl-calendar.types.d.ts +15 -0
- package/dist/components/calendar/bl-calendar.types.d.ts.map +1 -0
- package/dist/components/calendar/bl-calendar.types.js +1 -0
- package/dist/components/calendar/bl-calendar.types.js.map +7 -0
- package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
- package/dist/components/dialog/bl-dialog.js +1 -1
- package/dist/components/dialog/bl-dialog.stories.d.ts +1 -0
- package/dist/components/dialog/bl-dialog.stories.d.ts.map +1 -1
- package/dist/components/dialog/bl-dialog.stories.js +25 -4
- package/dist/components/dialog/bl-dialog.stories.js.map +3 -3
- package/dist/components/drawer/bl-drawer.js +1 -1
- package/dist/components/dropdown/bl-dropdown.js +1 -1
- package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
- package/dist/components/input/bl-input.d.ts +4 -0
- package/dist/components/input/bl-input.d.ts.map +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/select/bl-select.d.ts.map +1 -1
- package/dist/components/select/bl-select.js +1 -1
- package/dist/components/spinner/bl-spinner.d.ts +34 -0
- package/dist/components/spinner/bl-spinner.d.ts.map +1 -0
- package/dist/components/spinner/bl-spinner.js +2 -0
- package/dist/components/spinner/bl-spinner.js.map +7 -0
- package/dist/components/spinner/bl-spinner.test.d.ts +2 -0
- package/dist/components/spinner/bl-spinner.test.d.ts.map +1 -0
- package/dist/components/split-button/bl-split-button.js +1 -1
- package/dist/components/table/table-cell/bl-table-cell.js +1 -1
- package/dist/components/table/table-header-cell/bl-table-header-cell.js +1 -1
- package/dist/components/table/table-row/bl-table-row.js +1 -1
- package/dist/components/textarea/bl-textarea.js +1 -1
- package/dist/custom-elements.json +226 -0
- package/package.json +1 -1
- package/dist/chunk-LXYK2N4C.js.map +0 -7
- package/dist/chunk-N6FMS7MM.js +0 -21
- package/dist/chunk-N6FMS7MM.js.map +0 -7
- package/dist/chunk-OB455JKN.js.map +0 -7
- package/dist/chunk-YP2JT77B.js.map +0 -7
- /package/dist/{chunk-Y3PONRYW.js.map → chunk-5HU4KWMX.js.map} +0 -0
- /package/dist/{chunk-LPHOBDYM.js.map → chunk-D5MPTIGC.js.map} +0 -0
- /package/dist/{chunk-P4FHU5BE.js.map → chunk-X2XFV2S3.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=\"large\"]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=\"small\"]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);/* stylelint-disable-next-line property-no-vendor-prefix */-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-left:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}:host(:not([placeholder])) .placeholder,.select-wrapper.selected .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host([label-fixed]) .label,:host(:not([label])) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-open .select-input,.select-input:focus-visible{border:solid 1px var(--border-focus-color);outline:none}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-left:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:\", \"}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-left:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:none;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);right:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:all ease-in 0.1s;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host([placeholder]) :where(.select-open, .selected) .label,:host(:not([placeholder])) .selected .label{display:none}:where(.select-open, .selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open, .selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);/* Make sure option focus doesn't overflow */box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:\"\";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:none;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:none}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, queryAll, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { autoUpdate, computePosition, flip, MiddlewareState, offset, size } from \"@floating-ui/dom\";\nimport { msg, localized } from \"@lit/localize\";\nimport { FormControlMixin, requiredValidator } from \"@open-wc/form-control\";\nimport { FormValue } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { LangKey } from \"../../localization\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { stringBooleanConverter } from \"../../utilities/string-boolean.converter\";\nimport \"../button/bl-button\";\nimport BlCheckbox from \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../icon/bl-icon\";\nimport style from \"../select/bl-select.css\";\nimport \"../select/option/bl-select-option\";\nimport type BlSelectOption from \"./option/bl-select-option\";\n\nexport interface ISelectOption<T = string> {\n value: T;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = \"medium\" | \"large\" | \"small\";\n\nexport type CleanUpFunction = () => void;\n\n/**\n * @tag bl-select\n * @summary Baklava Select component\n *\n * @cssproperty [--bl-popover-position=fixed] Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element.\n */\n@customElement(\"bl-select\")\n@localized()\nexport default class BlSelect<ValueType extends FormValue = string> extends FormControlMixin(\n LitElement\n) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = [requiredValidator];\n\n /**\n * Sets name of the select field\n */\n @property()\n name: string;\n\n private _value: ValueType | ValueType[] | null;\n\n private _initialValue: ValueType | ValueType[] | null;\n\n /**\n * Sets the value of the select\n */\n @property()\n get value(): ValueType | ValueType[] | null {\n return this._value;\n }\n\n set value(val: ValueType | ValueType[] | null) {\n this._value = val;\n\n if (Array.isArray(val)) {\n const formData = new FormData();\n\n val.forEach(option => formData.append(this.name, `${option}`));\n this.setValue(formData);\n } else {\n this.setValue(val);\n }\n\n this.setOptionsSelected();\n }\n\n shouldFormValueUpdate(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder.\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets the size value. Select component's height value will be changed accordingly\n */\n @property({ type: String, reflect: true })\n size: SelectSize = \"medium\";\n\n /**\n * When option is not selected, shows component in error state\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets whether the selected option is clearable\n */\n @property({ type: Boolean, reflect: true })\n clearable = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Views select all option in multiple select\n */\n @property({ type: Boolean, attribute: \"view-select-all\", converter: stringBooleanConverter() })\n viewSelectAll = false;\n\n /**\n * Sets select all text in multiple select\n */\n @property({ type: String, attribute: \"select-all-text\" })\n selectAllText?: string;\n\n /**\n * Enable search functionality for the options within the list\n */\n @property({ type: Boolean, attribute: \"search-bar\", reflect: true })\n searchBar = false;\n\n /**\n * Search for text variations such as \"search,\" \"searching,\" \"search by country,\" and so on\n */\n @property({ type: String, attribute: \"search-bar-placeholder\", reflect: true })\n searchBarPlaceholder?: string;\n\n /**\n * Display a loading icon in place of the search icon.\n */\n @property({\n type: Boolean,\n attribute: \"search-bar-loading-state\",\n converter: stringBooleanConverter(),\n })\n searchBarLoadingState = false;\n\n /**\n * Text to display when no search results are found.\n */\n @property({ type: String, attribute: \"search-not-found-text\", reflect: true })\n searchNotFoundText?: string;\n\n /**\n * Text to display on the clear search button.\n */\n @property({ type: String, attribute: \"popover-clear-search-text\", reflect: true })\n popoverClearSearchText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @state()\n private _searchText = \"\";\n\n @query(\".selected-options\")\n private selectedOptionsContainer!: HTMLElement;\n\n @queryAll(\".selected-options li\")\n private selectedOptionsItems!: NodeListOf<HTMLElement>;\n\n @query(\".popover\")\n private _popover: HTMLElement;\n\n @query(\".select-input\")\n private _selectInput: HTMLElement;\n\n /**\n * Fires when selection changes\n */\n @event(\"bl-select\") private _onBlSelect: EventDispatcher<\n ISelectOption<ValueType>[] | ISelectOption<ValueType>\n >;\n\n /**\n * Fires when search text changes\n */\n @event(\"bl-search\") private _onBlSearch: EventDispatcher<string>;\n\n private userLang =\n (document.querySelector(\"html\")?.getAttribute(\"lang\") as LangKey | null) || navigator.language;\n\n private _connectedOptions: BlSelectOption<ValueType>[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n private setOptionsSelected() {\n this._connectedOptions.forEach(\n option =>\n (option.selected =\n this.value === option.value ||\n (Array.isArray(this.value) && this.value.includes(option.value)))\n );\n\n this._selectedOptions = [...this.options.filter(option => option.selected)];\n }\n\n get options() {\n return this._connectedOptions;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n get noResultFound() {\n return this._searchText !== \"\" && this._connectedOptions.every(option => option.hidden);\n }\n\n @state()\n private _selectedOptions: BlSelectOption<ValueType>[] = [];\n\n @state()\n private dirty = false;\n\n get selectedOptions(): BlSelectOption<ValueType>[] {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n validityCallback(): string | void {\n if (this.customInvalidText) {\n return this.customInvalidText;\n }\n const select = document.createElement(\"select\");\n\n select.required = this.required;\n\n return select.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n resetFormControl(): void {\n this.value = this._initialValue;\n }\n\n @query(\".select-input\")\n validationTarget: HTMLElement;\n\n open() {\n if (this.searchBar) {\n setTimeout(() => {\n document.activeElement?.shadowRoot?.querySelector(\"input\")?.focus();\n }, 100);\n }\n\n this._isPopoverOpen = true;\n this._setupPopover();\n document.addEventListener(\"click\", this._interactOutsideHandler, true);\n document.addEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n close() {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n\n this._isPopoverOpen = false;\n this.focusedOptionIndex = -1;\n this._cleanUpPopover && this._cleanUpPopover();\n document.removeEventListener(\"click\", this._interactOutsideHandler, true);\n document.removeEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n private _interactOutsideHandler = (event: MouseEvent | FocusEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath?.find(el => el.tagName === \"BL-SELECT\")?.contains(this)) {\n this.close();\n }\n };\n\n private _setupPopover() {\n this._cleanUpPopover = autoUpdate(this._selectInput, this._popover, () => {\n computePosition(this._selectInput, this._popover, {\n placement: \"bottom\",\n strategy: \"fixed\",\n middleware: [\n flip(),\n offset(8),\n size({\n apply(args: MiddlewareState) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n },\n }),\n ],\n }).then(({ x, y }) => {\n this._popover.style.setProperty(\"--left\", `${x}px`);\n this._popover.style.setProperty(\"--top\", `${y}px`);\n });\n });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.form?.addEventListener(\"submit\", (e: SubmitEvent) => {\n if (!this.reportValidity()) {\n e.preventDefault();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(\n item => html`<li>${item.getAttribute(\"label\") || item.textContent}</li>`\n )}\n </ul>`;\n\n const isAllSelectedDisabled =\n this._selectedOptions.length > 0 && this._selectedOptions.every(option => option.disabled);\n const isRemoveButtonShown = !isAllSelectedDisabled && (this.clearable || this.multiple);\n const removeButton = isRemoveButtonShown\n ? html`<bl-button\n class=\"remove-all\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this._onClickRemove}\n ></bl-button>`\n : \"\";\n\n const isSearchBarVisible = this.searchBar && this.opened;\n const hasSelectedOptions = this._selectedOptions.length > 0;\n\n const isDividerShown = isSearchBarVisible || (hasSelectedOptions && isRemoveButtonShown);\n\n const searchbarPlaceholderText =\n this.searchBarPlaceholder ?? msg(\"Search\", { desc: \"bl-select: search placeholder text\" });\n\n const searchMagIcon = html`<bl-icon\n class=\"search-mag-icon\"\n name=\"search\"\n style=\"color: var(--bl-color-primary);font-size: var(--bl-font-size-s)\"\n ></bl-icon>`;\n\n const searchSpinner = html`<bl-spinner class=\"search-spinner\"></bl-spinner>`;\n\n const actionDivider = isDividerShown ? html`<div class=\"action-divider\"></div>` : \"\";\n\n const search = html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${this.disabled ? \"-1\" : 0}\"\n .autofocus=${this.autofocus}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n @click=${this.open}\n >\n <legend><span>${this.label}</span></legend>\n\n ${this._selectedOptions.length > 0 && !this.opened\n ? inputSelectedOptions\n : html`\n <input\n class=\"search-bar-input\"\n placeholder=${this.opened || this.labelFixed\n ? searchbarPlaceholderText\n : this.label || searchbarPlaceholderText}\n @input=${this._handleSearchOptions}\n @keydown=${(e: KeyboardEvent) => {\n if (e.code === \"Space\") {\n e.stopPropagation();\n }\n }}\n .value=${this._searchText}\n />\n `}\n ${!this.opened\n ? html`<span class=\"additional-selection-count\"\n >+${this._additionalSelectedOptionCount}</span\n >`\n : \"\"}\n\n <div class=\"actions\">\n ${this.opened ? (this.searchBarLoadingState ? searchSpinner : searchMagIcon) : \"\"}\n ${!this.opened ? removeButton : \"\"} ${actionDivider}\n\n <div @click=${this._togglePopover}>\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </div>\n </fieldset>`;\n\n return this.searchBar\n ? search\n : html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${ifDefined(this.disabled ? undefined : 0)}\"\n ?autofocus=${this.autofocus}\n @click=${this._togglePopover}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n <span class=\"label\">${this.label}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${removeButton} ${actionDivider}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n selectAllTemplate() {\n if (!this.multiple || !this.viewSelectAll || this.noResultFound) {\n return null;\n }\n\n const isAllRenderedOptionsSelected = this._connectedOptions\n .filter(option => !option.hidden)\n .every(option => option.selected);\n\n const isAnySelected = this._selectedOptions.filter(option => !option.hidden).length > 0;\n const selectAllText =\n this.selectAllText ?? msg(\"Select All\", { desc: \"bl-select: select all text\" });\n\n return html`<bl-checkbox\n class=\"select-all\"\n .checked=\"${isAllRenderedOptionsSelected}\"\n .indeterminate=\"${isAnySelected && !isAllRenderedOptionsSelected}\"\n role=\"option\"\n aria-selected=\"${isAllRenderedOptionsSelected}\"\n @bl-checkbox-change=\"${this._handleSelectAll}\"\n >\n ${selectAllText}\n </bl-checkbox>`;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label id=\"label\">${this.label}</label>` : \"\";\n\n const noDataText =\n this.searchNotFoundText ?? msg(\"No Data Found\", { desc: \"bl-select: search no data text\" });\n\n const clearSearchText =\n this.popoverClearSearchText ??\n msg(\"Clear Search\", { desc: \"bl-select: clear search button text\" });\n\n return html`<div\n class=${classMap({\n \"select-wrapper\": true,\n \"select-open\": this.opened,\n \"selected\": this._selectedOptions.length > 0,\n \"invalid\": !this.validity.valid,\n \"dirty\": this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : \"-1\")}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n aria-labelledby=\"label\"\n >\n ${this.selectAllTemplate()}\n <slot></slot>\n ${this.searchBar && this.noResultFound\n ? html`<div name=\"popover-clear-search-text\" class=\"popover-no-result\">\n <span>${noDataText}</span>\n <bl-button\n variant=\"tertiary\"\n @click=${() => {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n }}\n >${clearSearchText}</bl-button\n >\n </div>`\n : \"\"}\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n private lastKeyPressedTime = 0;\n private typedCharacters = \"\";\n private keyPressThreshold = 500;\n\n private handleFocusOptionByKey(key: string) {\n const currentTime = Date.now();\n const elapsedTimeSinceLastKeyPress = currentTime - this.lastKeyPressedTime;\n\n if (elapsedTimeSinceLastKeyPress > this.keyPressThreshold) {\n this.typedCharacters = \"\";\n }\n\n this.lastKeyPressedTime = currentTime;\n this.typedCharacters += key.toLowerCase();\n\n const matchingOptionIndex = this.options.findIndex(option => {\n if (option.disabled) {\n return false;\n }\n const optionText = option.innerText.trim().toLowerCase();\n\n return optionText.startsWith(this.typedCharacters);\n });\n\n if (matchingOptionIndex !== -1) {\n this.focusedOptionIndex = matchingOptionIndex;\n this.options[matchingOptionIndex].focus();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && [\"Enter\", \"Space\"].includes(event.code)) {\n this._togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === \"Escape\") {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n const activeOptions = this.options.filter(option => !option.disabled);\n\n event.code === \"ArrowDown\" && this.focusedOptionIndex++;\n event.code === \"ArrowUp\" && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, activeOptions.length - 1)\n );\n\n activeOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n } else if (this._isPopoverOpen && !this.searchBar) {\n this.handleFocusOptionByKey(event.key);\n }\n }\n\n private _togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n const options = this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n );\n\n if (!this.multiple) this._onBlSelect(options[0]);\n else this._onBlSelect(options);\n }\n\n private _handleSearchEvent() {\n this._onBlSearch(this._searchText);\n }\n\n private _handleSearchOptions(e: InputEvent): void {\n if (!this.searchBar) return;\n\n this._searchText = (e.target as HTMLInputElement).value;\n\n this._handleSearchEvent();\n\n this._connectedOptions.forEach(option => {\n const isVisible = option.textContent\n ?.toLocaleLowerCase(this.userLang)\n .includes(this._searchText.toLocaleLowerCase(this.userLang));\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n\n this._handleLastVisibleSearchedOption();\n\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-select\": BlSelect;\n }\n}\n"],
|
|
5
|
+
"mappings": "qgBACO,IAAMA,EAASC,8hOACfC,EAAQF,ECFf,IAAAG,EAsCqBC,EAArB,cAA4EC,EAC1EC,CACF,CAAE,CAFF,kCAgEE,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,eAAY,GAMZ,cAAW,GAMX,eAAY,GAMZ,gBAAa,GAkBb,mBAAgB,GAYhB,eAAY,GAgBZ,2BAAwB,GAgBxB,KAAQ,eAAiB,GAGzB,KAAQ,+BAAiC,EAGzC,KAAQ,YAAc,GA0BtB,KAAQ,WACLH,EAAA,SAAS,cAAc,MAAM,IAA7B,YAA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EAAuB,CACpC,CAAC,GAjJkB9D,EAkJnB,qCAMA6D,EAAA,CADCxC,EAAS,CAAE,KAAM,OAAQ,UAAW,wBAAyB,QAAS,EAAK,CAAC,GAvJ1DrB,EAwJnB,kCAMA6D,EAAA,CADCxC,EAAS,CAAE,KAAM,OAAQ,UAAW,4BAA6B,QAAS,EAAK,CAAC,GA7J9DrB,EA8JnB,sCAIQ6D,EAAA,CADPE,EAAM,GAjKY/D,EAkKX,8BAGA6D,EAAA,CADPE,EAAM,GApKY/D,EAqKX,8CAGA6D,EAAA,CADPE,EAAM,GAvKY/D,EAwKX,2BAGA6D,EAAA,CADPG,EAAM,mBAAmB,GA1KPhE,EA2KX,wCAGA6D,EAAA,CADPxC,EAAS,sBAAsB,GA7KbrB,EA8KX,oCAGA6D,EAAA,CADPG,EAAM,UAAU,GAhLEhE,EAiLX,wBAGA6D,EAAA,CADPG,EAAM,eAAe,GAnLHhE,EAoLX,4BAKoB6D,EAAA,CAA3B1D,EAAM,WAAW,GAzLCH,EAyLS,2BAOA6D,EAAA,CAA3B1D,EAAM,WAAW,GAhMCH,EAgMS,2BAiCpB6D,EAAA,CADPE,EAAM,GAhOY/D,EAiOX,gCAGA6D,EAAA,CADPE,EAAM,GAnOY/D,EAoOX,qBA+BR6D,EAAA,CADCG,EAAM,eAAe,GAlQHhE,EAmQnB,gCAnQmBA,EAArB6D,EAAA,CAFCxC,EAAc,WAAW,EACzB4C,EAAU,GACUjE",
|
|
6
|
+
"names": ["styles", "i", "bl_select_default", "_a", "BlSelect", "FormControlMixin", "s", "event", "eventPath", "el", "bl_select_default", "val", "formData", "option", "select", "_b", "_c", "autoUpdate", "computePosition", "flip", "offset", "size", "args", "x", "y", "e", "inputSelectedOptions", "item", "isRemoveButtonShown", "removeButton", "isSearchBarVisible", "hasSelectedOptions", "isDividerShown", "searchbarPlaceholderText", "msg", "searchMagIcon", "searchSpinner", "actionDivider", "search", "o", "l", "isAllRenderedOptionsSelected", "isAnySelected", "selectAllText", "invalidMessage", "helpMessage", "label", "noDataText", "clearSearchText", "key", "currentTime", "matchingOptionIndex", "activeOptions", "options", "isVisible", "lastVisibleOption", "optionItem", "selectAllEl", "checked", "isAllUnselectedDisabled", "checkbox", "selectedDisabledOptions", "firstNonVisibleItemIndex", "_changedProperties", "requiredValidator", "__decorateClass", "stringBooleanConverter", "t", "i", "localized"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{a as f}from"./chunk-6LT7O7T2.js";import{a as n}from"./chunk-DINNT5P2.js";import{a as y}from"./chunk-GRL4DWKG.js";import{a as v,b as e,c as m,e as g}from"./chunk-5MOOXA2X.js";import{a as u,b as a,f as p}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var _=l=>{if(!(!l.noValidate&&!l.reportValidity())){let b=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});l.dispatchEvent(b),b.defaultPrevented||l.submit()}};var z=u`:host{display:var(--bl-button-display, inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-highlight);--text-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify, center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);border:solid 1px var(--border-color);border-radius:var(--bl-border-radius-m);text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button,:host(:hover) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size="small"]) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size="large"]) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:none}.button:focus-visible{position:relative;outline:none}.button:focus-visible::after{border:2px solid var(--bl-button-focus-border-color, var(--main-color));border-radius:var(--bl-border-radius-l);content:"";position:absolute;inset:-4px}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host([loading]) ::slotted(bl-icon){display:none}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant="secondary"]) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant="tertiary"]) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind="neutral"]) .button{--main-color:var(--bl-color-neutral-darker);--main-hover-color:var(--bl-color-neutral-darkest)}:host([kind="success"]) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-highlight)}:host([kind="danger"]) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-highlight)}:host([disabled]){cursor:not-allowed}:host([loading]){cursor:wait}:host .button[aria-disabled="true"]{--main-color:var(--bl-color-neutral-lightest);--main-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-lighter);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant="tertiary"]) .button[aria-disabled="true"]{--main-color:transparent}:host([variant="secondary"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled="false"],:host([variant="secondary"]:hover) .button[aria-disabled="false"]{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant="tertiary"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled="false"],:host([variant="tertiary"]:hover) .button[aria-disabled="false"]{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant="secondary"]) .active.button{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant="tertiary"]) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-neutral-lightest);--border-color:transparent}`,x=z;var t=class extends p{constructor(){super(...arguments);this.variant="primary";this.kind="default";this.size="medium";this.loading=!1;this.disabled=!1;this.target="_self";this.dropdown=!1;this.autofocus=!1;this.active=!1}static get styles(){return[x]}get _isActive(){return this.active}connectedCallback(){super.connectedCallback()}caretTemplate(){return a` <bl-icon class="open" name="arrow_up"></bl-icon>
|
|
2
|
+
<bl-icon class="close" name="arrow_down"></bl-icon>`}_handleClick(){if(this.type==="submit"){let r;this.form instanceof HTMLFormElement?r=this.form:typeof this.form=="string"?r=document.getElementById(this.form):r=this.closest("form"),r&&_(r)}this.onClick("Click event fired!")}focus(){this.button.focus()}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}get _hasDefaultSlot(){return[...this.childNodes].some(i=>{var c;let s=i.nodeType;return s===i.TEXT_NODE&&((c=i.textContent)==null?void 0:c.trim())!==""||s===i.ELEMENT_NODE&&!i.hasAttribute("slot")})}render(){let r=this.loading||this.disabled,i=this.loading&&this.loadingLabel?this.loadingLabel:a`<slot></slot>`,s=!!this.href,c=this.icon?a`<bl-icon name=${this.icon}></bl-icon>`:"",T=a`<bl-spinner
|
|
3
|
+
class="loading-spinner"
|
|
4
|
+
?disabled="${r}"
|
|
5
|
+
size="${this.size}"
|
|
6
|
+
></bl-spinner>`,d=a`<slot name="icon">${this.loading?T:c}</slot>
|
|
7
|
+
<span class="label">${i}</span>`,E=this.dropdown?this.caretTemplate():"",h=f({button:!0,"has-icon":this.icon||this._hasIconSlot,"has-content":this._hasDefaultSlot,active:!s&&this._isActive});return s?a`<a
|
|
8
|
+
class=${h}
|
|
9
|
+
?autofocus=${this.autofocus}
|
|
10
|
+
aria-disabled="${n(r)}"
|
|
11
|
+
aria-label="${n(this.label)}"
|
|
12
|
+
href=${n(this.href)}
|
|
13
|
+
target=${n(this.target)}
|
|
14
|
+
role="button"
|
|
15
|
+
>${d}
|
|
16
|
+
</a>`:a`<button
|
|
17
|
+
class=${h}
|
|
18
|
+
?autofocus=${this.autofocus}
|
|
19
|
+
aria-disabled="${n(r)}"
|
|
20
|
+
aria-label="${n(this.label)}"
|
|
21
|
+
?disabled=${r}
|
|
22
|
+
@click="${this._handleClick}"
|
|
23
|
+
>
|
|
24
|
+
${d} ${E}
|
|
25
|
+
</button>`}};o([e({type:String,reflect:!0})],t.prototype,"variant",2),o([e({type:String,reflect:!0})],t.prototype,"kind",2),o([e({type:String,reflect:!0})],t.prototype,"size",2),o([e({type:String})],t.prototype,"label",2),o([e({type:String,attribute:"loading-label"})],t.prototype,"loadingLabel",2),o([e({type:Boolean,reflect:!0})],t.prototype,"loading",2),o([e({type:Boolean,reflect:!0})],t.prototype,"disabled",2),o([e({type:String})],t.prototype,"href",2),o([e({type:String})],t.prototype,"icon",2),o([e({type:String})],t.prototype,"target",2),o([e({type:String})],t.prototype,"type",2),o([e({type:Boolean})],t.prototype,"dropdown",2),o([e({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),o([e({type:String})],t.prototype,"form",2),o([m({})],t.prototype,"active",2),o([g(".button")],t.prototype,"button",2),o([y("bl-click")],t.prototype,"onClick",2),t=o([v("bl-button")],t);export{_ as a,t as b};
|
|
26
|
+
//# sourceMappingURL=chunk-VU6LRFZR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@open-wc/form-helpers/src/index.ts", "../src/components/button/bl-button.css", "../src/components/button/bl-button.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Implicitly submit a form by first validating all controls. If the form\n * is valid, issue a submit event and if that event is not prevented, manually\n * call the form's submit method.\n *\n * @param form {HTMLFormElement} - A form to implicitly submit\n */\nexport const submit = (form: HTMLFormElement): void => {\n if (!form.noValidate && !form.reportValidity()) {\n return;\n } else {\n const submitEvent = new SubmitEvent('submit', {\n bubbles: true,\n cancelable: true\n });\n form.dispatchEvent(submitEvent);\n if (!submitEvent.defaultPrevented) {\n form.submit();\n }\n }\n};\n\nexport type FormValue = string|FormData|File|FormValue[];\n\n/**\n * Parse a form and return a set of values based on the name/value pair.\n * If multiple controls of a similar name exist, return an array for those values;\n * otherwise return a single value.\n *\n * @param form {HTMLFormElement} - The form to parse for values\n * @returns {Record<string, any>} - An object representing the form's current values\n */\nexport const formValues = (form: HTMLFormElement): Record<string, FormValue> => {\n const formData = new FormData(form);\n const values: Record<string, FormValue> = {};\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore This does exist in all browsers. TypeScript is wrong\n for (const [key, value] of formData.entries()) {\n if (!values.hasOwnProperty(key)) {\n values[key] = value;\n } else if (Array.isArray(values[key])) {\n const pointer = values[key] as FormValue[];\n pointer.push(value);\n } else {\n values[key] = [values[key], value];\n }\n }\n\n return values;\n};\n\n/**\n * This method takes a form and parses it as an object. If any form control has a `.`\n * in its name, this utility will evaluate that name as a deep key for an object;\n * in other words, if a form has a named control, `name.first` and another, `name.last`\n * it will report back a nested object, name, with first and last properties\n * representing those controls' values.\n *\n * This can be useful when you have a complex model that you are attempting to represent\n * in declaratively in HTML.\n *\n * @param form {HTMLFormElement} - The form to grab values from\n * @returns {Object<string, FormValue>} - An object representation of the form\n */\nexport const parseFormAsObject = (form: HTMLFormElement): Record<string, FormValue> => {\n const data = formValues(form);\n const output: Record<string, FormValue> = {};\n\n Object.entries(data).forEach(([key, value]) => {\n /** If the key has a '.', parse it as an object */\n if (key.includes('.')) {\n const path = key.split('.');\n const destination: string | undefined = path.pop();\n let pointer = output;\n\n while (path.length) {\n const key = path.shift();\n pointer[key as string] = pointer[key as string] || ({} as FormValue);\n pointer = pointer[key as string] as unknown as Record<string, FormValue>;\n }\n\n pointer[destination as string] = value;\n } else {\n output[key] = data[key];\n }\n });\n\n return output;\n};\n", "import {css} from 'lit';\nexport const styles = css`:host{display:var(--bl-button-display, inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-highlight);--text-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify, center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);border:solid 1px var(--border-color);border-radius:var(--bl-border-radius-m);text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button,:host(:hover) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size=\"small\"]) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size=\"large\"]) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:none}.button:focus-visible{position:relative;outline:none}.button:focus-visible::after{border:2px solid var(--bl-button-focus-border-color, var(--main-color));border-radius:var(--bl-border-radius-l);content:\"\";position:absolute;inset:-4px}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host([loading]) ::slotted(bl-icon){display:none}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant=\"secondary\"]) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant=\"tertiary\"]) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind=\"neutral\"]) .button{--main-color:var(--bl-color-neutral-darker);--main-hover-color:var(--bl-color-neutral-darkest)}:host([kind=\"success\"]) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-highlight)}:host([kind=\"danger\"]) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-highlight)}:host([disabled]){cursor:not-allowed}:host([loading]){cursor:wait}:host .button[aria-disabled=\"true\"]{--main-color:var(--bl-color-neutral-lightest);--main-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-lighter);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant=\"tertiary\"]) .button[aria-disabled=\"true\"]{--main-color:transparent}:host([variant=\"secondary\"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled=\"false\"],:host([variant=\"secondary\"]:hover) .button[aria-disabled=\"false\"]{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant=\"tertiary\"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled=\"false\"],:host([variant=\"tertiary\"]:hover) .button[aria-disabled=\"false\"]{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant=\"secondary\"]) .active.button{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant=\"tertiary\"]) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-neutral-lightest);--border-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, state, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { submit } from \"@open-wc/form-helpers\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../icon/bl-icon\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport \"../spinner/bl-spinner\";\nimport style from \"./bl-button.css\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\";\nexport type ButtonKind = \"default\" | \"neutral\" | \"success\" | \"danger\";\nexport type ButtonSize = \"small\" | \"medium\" | \"large\";\nexport type TargetType = \"_blank\" | \"_parent\" | \"_self\" | \"_top\";\n\n/**\n * @tag bl-button\n * @summary Baklava Button component\n *\n * @cssproperty [--bl-button-display=inline-block] Sets the display property of button\n * @cssproperty [--bl-button-justify=center] Sets the justify-content property of button\n *\n */\n@customElement(\"bl-button\")\nexport default class BlButton extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the button variant\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = \"primary\";\n\n /**\n * Sets the button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = \"default\";\n\n /**\n * Sets the button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"medium\";\n\n /**\n * Sets the button label. Used for accessibility.\n */\n @property({ type: String })\n label: string;\n\n /**\n * Sets the button label for loading status.\n */\n @property({ type: String, attribute: \"loading-label\" })\n loadingLabel: string;\n\n /**\n * Sets loading state of button\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Set link url. If set, button will be rendered as anchor tag.\n */\n @property({ type: String })\n href?: string;\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n @property({ type: String })\n icon?: BaklavaIcon;\n\n /**\n * Sets the anchor target. Used when `href` is set.\n */\n @property({ type: String })\n target?: TargetType = \"_self\";\n\n /**\n * Sets the type of the button. Set `submit` to use button as the submitter of parent form.\n */\n @property({ type: String })\n type: \"submit\";\n\n /**\n * Sets button type to dropdown\n */\n @property({ type: Boolean })\n dropdown = false;\n\n /**\n * Sets button to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the associated form of the button. Use when `type` is set to `submit` and button is not inside the target form.\n */\n @property({ type: String })\n form: HTMLFormElement | string;\n\n /**\n * Active state\n */\n @state({})\n active = false;\n\n @query(\".button\")\n private button: HTMLAnchorElement | HTMLButtonElement;\n\n /**\n * Fires when button clicked\n */\n @event(\"bl-click\") private onClick: EventDispatcher<string>;\n\n private get _isActive() {\n return this.active;\n }\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n private caretTemplate(): TemplateResult {\n return html` <bl-icon class=\"open\" name=\"arrow_up\"></bl-icon>\n <bl-icon class=\"close\" name=\"arrow_down\"></bl-icon>`;\n }\n\n private _handleClick() {\n if (this.type === \"submit\") {\n let targetForm: HTMLFormElement;\n\n if (this.form instanceof HTMLFormElement) {\n targetForm = this.form;\n } else if (typeof this.form === \"string\") {\n targetForm = document.getElementById(this.form) as HTMLFormElement;\n } else {\n targetForm = this.closest(\"form\") as HTMLFormElement;\n }\n\n if (targetForm) {\n submit(targetForm);\n }\n }\n\n this.onClick(\"Click event fired!\");\n }\n\n focus() {\n this.button.focus();\n }\n\n get _hasIconSlot() {\n return this.querySelector(':scope > [slot=\"icon\"]') !== null;\n }\n\n get _hasDefaultSlot() {\n const childNodes = [...this.childNodes];\n\n return childNodes.some(node => {\n const nodeType = node.nodeType;\n\n // has only text node.\n if (nodeType === node.TEXT_NODE && node.textContent?.trim() !== \"\") {\n return true;\n }\n // has element node, it should not have slot attribute.\n if (nodeType === node.ELEMENT_NODE) {\n if (!(node as HTMLElement).hasAttribute(\"slot\")) {\n return true;\n }\n }\n return false;\n });\n }\n\n render(): TemplateResult {\n const isDisabled = this.loading || this.disabled;\n const label = this.loading && this.loadingLabel ? this.loadingLabel : html`<slot></slot>`;\n const isAnchor = !!this.href;\n const icon = this.icon ? html`<bl-icon name=${this.icon}></bl-icon>` : \"\";\n const loadingIcon = html`<bl-spinner\n class=\"loading-spinner\"\n ?disabled=\"${isDisabled}\"\n size=\"${this.size}\"\n ></bl-spinner>`;\n const slots = html`<slot name=\"icon\">${this.loading ? loadingIcon : icon}</slot>\n <span class=\"label\">${label}</span>`;\n const caret = this.dropdown ? this.caretTemplate() : \"\";\n const classes = classMap({\n \"button\": true,\n \"has-icon\": this.icon || this._hasIconSlot,\n \"has-content\": this._hasDefaultSlot,\n \"active\": !isAnchor && this._isActive,\n });\n\n return isAnchor\n ? html`<a\n class=${classes}\n ?autofocus=${this.autofocus}\n aria-disabled=\"${ifDefined(isDisabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n href=${ifDefined(this.href)}\n target=${ifDefined(this.target)}\n role=\"button\"\n >${slots}\n </a>`\n : html`<button\n class=${classes}\n ?autofocus=${this.autofocus}\n aria-disabled=\"${ifDefined(isDisabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n ?disabled=${isDisabled}\n @click=\"${this._handleClick}\"\n >\n ${slots} ${caret}\n </button>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-button\": BlButton;\n }\n}\n"],
|
|
5
|
+
"mappings": "mRAOO,IAAMA,EAAUC,GAA+B,CACpD,GAAI,GAACA,EAAK,YAAc,CAACA,EAAK,eAAc,GAErC,CACL,IAAMC,EAAc,IAAI,YAAY,SAAU,CAC5C,QAAS,GACT,WAAY,GACb,EACDD,EAAK,cAAcC,CAAW,EACzBA,EAAY,kBACfD,EAAK,OAAM,EAGjB,ECnBO,IAAME,EAASC,u9HACfC,EAAQF,ECuBf,IAAqBG,EAArB,cAAsCC,CAAW,CAAjD,kCASE,aAAyB,UAMzB,UAAmB,UAMnB,UAAmB,SAkBnB,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C,GA9DPnB,EA+DnB,sBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GApEPnB,EAqEnB,oBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA1ERnB,EA2EnB,wBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAhFvBnB,EAiFnB,yBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GAtFPnB,EAuFnB,oBAMAmB,EAAA,CADCC,EAAM,CAAC,CAAC,GA5FUpB,EA6FnB,sBAGQmB,EAAA,CADPE,EAAM,SAAS,GA/FGrB,EAgGX,sBAKmBmB,EAAA,CAA1BG,EAAM,UAAU,GArGEtB,EAqGQ,uBArGRA,EAArBmB,EAAA,CADCI,EAAc,WAAW,GACLvB",
|
|
6
|
+
"names": ["submit", "form", "submitEvent", "styles", "i", "bl_button_default", "BlButton", "s", "bl_button_default", "x", "targetForm", "submit", "node", "_a", "nodeType", "isDisabled", "label", "isAnchor", "icon", "loadingIcon", "slots", "caret", "classes", "o", "l", "__decorateClass", "t", "i", "event", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/calendar/bl-calendar.constant.ts"],
|
|
4
|
+
"sourcesContent": ["export const FIRST_MONTH_INDEX = 0;\nexport const LAST_MONTH_INDEX = 11;\n\nexport enum CALENDAR_VIEWS {\n DAYS = \"days\",\n MONTHS = \"months\",\n YEARS = \"years\",\n}\n\nexport enum CALENDAR_TYPES {\n SINGLE = \"single\",\n MULTIPLE = \"multiple\",\n RANGE = \"range\",\n}\n"],
|
|
5
|
+
"mappings": "AAAO,IAAMA,EAAoB,EACpBC,EAAmB,GAEpBC,OACVA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,MAAQ,QAHEA,OAAA,IAMAC,OACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,MAAQ,QAHEA,OAAA",
|
|
6
|
+
"names": ["FIRST_MONTH_INDEX", "LAST_MONTH_INDEX", "CALENDAR_VIEWS", "CALENDAR_TYPES"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-5HU4KWMX.js";import{a as u}from"./chunk-DINNT5P2.js";import{a as b,b as p}from"./chunk-5MOOXA2X.js";import{a as d,b as i,f as h}from"./chunk-4OT5AMS5.js";import{d as a}from"./chunk-IZ2LK5GK.js";var f=d`:host{--header-cell-width:var(--bl-table-header-cell-width, auto);--header-cell-min-width:var(--bl-table-header-cell-min-width, auto);display:table-cell;border:1px solid var(--bl-color-neutral-lighter);background-color:var(--bl-color-neutral-lightest);padding:var(--bl-size-m);font:var(--bl-font-title-3-medium);color:var(--bl-color-neutral-darker);box-sizing:border-box;vertical-align:middle;white-space:normal;width:var(--header-cell-width);min-width:var(--header-cell-min-width);background-clip:padding-box}.table-header-cell{display:flex;align-items:center}.table-header-cell.shadow-right::before{content:"";position:absolute;right:-1px;top:0;width:16px;height:100%;z-index:-1;border-right:1px solid var(--bl-color-neutral-lighter);box-shadow:8px 0 16px 0 rgb(39 49 66 / 10%)}.table-header-cell.shadow-left::before{content:"";position:absolute;left:-1px;top:0;width:16px;height:100%;z-index:-1;border-left:1px solid var(--bl-color-neutral-lighter);box-shadow:-8px 0 16px 0 rgb(39 49 66 / 10%)}bl-checkbox{margin-right:var(--bl-size-m)}.sort-icons-wrapper{all:unset;width:100%;display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-4xs);cursor:pointer}.sort-icons-wrapper:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:2px;border-radius:var(--bl-border-radius-xs)}.sort-icons-wrapper bl-icon{font-size:var(--bl-font-size-m);color:var(--bl-color-neutral-darker)}`,g=f;var x="bl-table-header-cell",r=class extends h{constructor(){super(...arguments);this.sortKey=""}static get styles(){return[g]}get _table(){return this.closest("bl-table")}get _tableRow(){return this.closest("bl-table-row")}get selectable(){var e;return this.index===0&&!!((e=this._table)!=null&&e.isSelectable(!0))}get sortable(){var e;return!!((e=this._table)!=null&&e.sortable)&&!!this.sortKey}get index(){let e=this.parentNode;return e?[...e.children].indexOf(this):-1}get checked(){var e;return!!((e=this._table)!=null&&e.isAllSelected())}get indeterminate(){var e;return!!((e=this._table)!=null&&e.isAnySelected())}get isAllUnselectedDisabled(){var e;return!!((e=this._table)!=null&&e.isAllUnselectedDisabled())}get sortDirection(){var e,t;return((e=this._table)==null?void 0:e.sortKey)===this.sortKey&&((t=this._table)==null?void 0:t.sortDirection)||""}get sortIconName(){return this.sortDirection==="asc"?"sorting_asc":this.sortDirection==="desc"?"sorting_desc":"sorting"}get shadowRight(){var e;return!!((e=this._tableRow)!=null&&e.stickyFirstColumn)&&this.index===0}get shadowLeft(){var e;return!!((e=this._tableRow)!=null&&e.stickyLastColumn)&&this.nextElementSibling===null}connectedCallback(){super.connectedCallback(),this.closest(m)||console.warn("bl-table-header-cell is designed to be used inside a bl-table-row",this)}onChange(e){var o,l;let t=(o=this.shadowRoot)==null?void 0:o.querySelector(".select-all");if(e.detail&&this.isAllUnselectedDisabled){setTimeout(()=>{var c;let s=(c=t==null?void 0:t.shadowRoot)==null?void 0:c.querySelector("input");s==null||s.click()},0);return}(l=this._table)==null||l.onSelectionChange(!0,e.detail,""),setTimeout(()=>{t.checked=this.checked,t.indeterminate=this.indeterminate})}onSort(){var t;let e="asc";this.sortDirection==="asc"?e="desc":this.sortDirection==="desc"&&(e=""),(t=this._table)==null||t.onSortChange(this.sortKey,e)}_renderCheckbox(){return this.selectable?i`<bl-checkbox
|
|
2
2
|
class="select-all"
|
|
3
3
|
value="all"
|
|
4
4
|
.indeterminate="${this.indeterminate}"
|
|
@@ -13,4 +13,4 @@ import{a as m}from"./chunk-Y3PONRYW.js";import{a as u}from"./chunk-DINNT5P2.js";
|
|
|
13
13
|
</button>`:i` <slot></slot>`;return i`<div class="table-header-cell ${o}" aria-sort=${u(n)}>
|
|
14
14
|
${this._renderCheckbox()} ${l}
|
|
15
15
|
</div> `}};a([p({type:String,reflect:!0,attribute:"sort-key"})],r.prototype,"sortKey",2),r=a([b(x)],r);export{x as a,r as b};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-X2XFV2S3.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSResultGroup, LitElement, TemplateResult } from "lit";
|
|
2
2
|
import "../icon/bl-icon";
|
|
3
3
|
import { BaklavaIcon } from "../icon/icon-list";
|
|
4
|
+
import "../spinner/bl-spinner";
|
|
4
5
|
export type ButtonVariant = "primary" | "secondary" | "tertiary";
|
|
5
6
|
export type ButtonKind = "default" | "neutral" | "success" | "danger";
|
|
6
7
|
export type ButtonSize = "small" | "medium" | "large";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/bl-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAMvE,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"bl-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/bl-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAMvE,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,uBAAuB,CAAC;AAG/B,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AACtE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AAC;KACvB;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"../../chunk-
|
|
1
|
+
import{b as a}from"../../chunk-VU6LRFZR.js";import"../../chunk-CYLRPJKP.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-U752J5IG.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-button.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const FIRST_MONTH_INDEX = 0;
|
|
2
|
+
export declare const LAST_MONTH_INDEX = 11;
|
|
3
|
+
export declare enum CALENDAR_VIEWS {
|
|
4
|
+
DAYS = "days",
|
|
5
|
+
MONTHS = "months",
|
|
6
|
+
YEARS = "years"
|
|
7
|
+
}
|
|
8
|
+
export declare enum CALENDAR_TYPES {
|
|
9
|
+
SINGLE = "single",
|
|
10
|
+
MULTIPLE = "multiple",
|
|
11
|
+
RANGE = "range"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=bl-calendar.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bl-calendar.constant.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/bl-calendar.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement } from "lit";
|
|
2
|
+
import "../button/bl-button";
|
|
3
|
+
import "../icon/bl-icon";
|
|
4
|
+
import { Calendar, CalendarDate, CalendarType, CalendarView, DayValues } from "./bl-calendar.types";
|
|
5
|
+
/**
|
|
6
|
+
* @tag bl-calendar
|
|
7
|
+
* @summary Baklava Calendar component
|
|
8
|
+
**/
|
|
9
|
+
export default class BlCalendar extends LitElement {
|
|
10
|
+
/**
|
|
11
|
+
* Defines the calendar types, available types are single, multiple and range
|
|
12
|
+
*/
|
|
13
|
+
type: CalendarType;
|
|
14
|
+
/**
|
|
15
|
+
* Defines the minimum date value for the calendar
|
|
16
|
+
*/
|
|
17
|
+
minDate: Date;
|
|
18
|
+
/**
|
|
19
|
+
* Defines the maximum date value for the calendar
|
|
20
|
+
*/
|
|
21
|
+
maxDate: Date;
|
|
22
|
+
/**
|
|
23
|
+
* Defines the start day of the calendar (1 defines monday)
|
|
24
|
+
*/
|
|
25
|
+
startOfWeek: DayValues;
|
|
26
|
+
/**
|
|
27
|
+
* Defines the unselectable dates for calendar
|
|
28
|
+
*/
|
|
29
|
+
disabledDates: Date[];
|
|
30
|
+
/**
|
|
31
|
+
* Defines the calendar language
|
|
32
|
+
*/
|
|
33
|
+
locale: string;
|
|
34
|
+
private _selectedDates;
|
|
35
|
+
private _selectedRangeDates;
|
|
36
|
+
private today;
|
|
37
|
+
private _calendarMonth;
|
|
38
|
+
private _calendarYear;
|
|
39
|
+
private _calendarView;
|
|
40
|
+
private _calendarYears;
|
|
41
|
+
private _calendarDays;
|
|
42
|
+
private _defaultValue;
|
|
43
|
+
/**
|
|
44
|
+
* Defines the default selected date value for the calendar
|
|
45
|
+
*/
|
|
46
|
+
get defaultValue(): Date | Date[];
|
|
47
|
+
set defaultValue(defaultValue: Date | Date[]);
|
|
48
|
+
get months(): {
|
|
49
|
+
name: string;
|
|
50
|
+
value: number;
|
|
51
|
+
}[];
|
|
52
|
+
get days(): {
|
|
53
|
+
name: string;
|
|
54
|
+
value: number;
|
|
55
|
+
}[];
|
|
56
|
+
/**
|
|
57
|
+
* Fires when date selection changes
|
|
58
|
+
*/
|
|
59
|
+
private _onBlCalendarChange;
|
|
60
|
+
static get styles(): CSSResultGroup;
|
|
61
|
+
getDayNumInAMonth(year: number, month: number): number;
|
|
62
|
+
getWeekDayOfDate(year: number, month: number): number;
|
|
63
|
+
setPreviousCalendarView(): void;
|
|
64
|
+
setNextCalendarView(): void;
|
|
65
|
+
setCurrentCalendarView(view: CalendarView): void;
|
|
66
|
+
setMonthAndCalendarView(month: number): void;
|
|
67
|
+
setYearAndCalendarView(year: number): void;
|
|
68
|
+
generateSurroundingYears(): void;
|
|
69
|
+
clearRangePickerStyles(): void;
|
|
70
|
+
handleDate(date: CalendarDate): void;
|
|
71
|
+
handleSingleSelectCalendar(calendarDate: CalendarDate): void;
|
|
72
|
+
handleMultipleSelectCalendar(calendarDate: CalendarDate): void;
|
|
73
|
+
handleRangeSelectCalendar(calendarDate: CalendarDate): void;
|
|
74
|
+
checkIfSelectedDate(calendarDate: CalendarDate): boolean;
|
|
75
|
+
checkIfDateIsToday(calendarDate: CalendarDate): boolean;
|
|
76
|
+
checkIfDateIsDisabled(calendarDate: CalendarDate): boolean;
|
|
77
|
+
setHoverClass(): void;
|
|
78
|
+
createCalendarDays(): Calendar;
|
|
79
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=bl-calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bl-calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/bl-calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AAQzB,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EAEZ,SAAS,EAEV,MAAM,qBAAqB,CAAC;AAE7B;;;IAGI;AAEJ,MAAM,CAAC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,CAAC,YAAY,EAAE,YAAY;IAIrD,4BAA4B,CAAC,YAAY,EAAE,YAAY;IAYvD,yBAAyB,CAAC,YAAY,EAAE,YAAY;IA4BpD,mBAAmB,CAAC,YAAY,EAAE,YAAY;IAO9C,kBAAkB,CAAC,YAAY,EAAE,YAAY;IAS7C,qBAAqB,CAAC,YAAY,EAAE,YAAY;IAkBhD,aAAa;IAmCb,kBAAkB;IAyElB,MAAM;CA0HP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../../chunk-KOWS266A.js";import"../../chunk-WEEGH2F4.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-CYLRPJKP.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-U752J5IG.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
|
+
//# sourceMappingURL=bl-calendar.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CALENDAR_TYPES, CALENDAR_VIEWS } from "./bl-calendar.constant";
|
|
2
|
+
export type DayValues = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
export type CalendarView = CALENDAR_VIEWS;
|
|
4
|
+
export type CalendarType = CALENDAR_TYPES;
|
|
5
|
+
export type CalendarDay = {
|
|
6
|
+
value: number;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export type CalendarDate = Date;
|
|
10
|
+
export type RangePickerDates = {
|
|
11
|
+
startDate?: CalendarDate;
|
|
12
|
+
endDate?: CalendarDate;
|
|
13
|
+
};
|
|
14
|
+
export type Calendar = Map<string, CalendarDate[]>;
|
|
15
|
+
//# sourceMappingURL=bl-calendar.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bl-calendar.types.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/bl-calendar.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExE,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC;AAEhC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=bl-calendar.types.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as a,d as b,e as c}from"../../chunk-IWBCUOHE.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-
|
|
1
|
+
import{c as a,d as b,e as c}from"../../chunk-IWBCUOHE.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-U752J5IG.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{b as blChangeEventName,a as blCheckboxGroupTag,c as default};
|
|
2
2
|
//# sourceMappingURL=bl-checkbox-group.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../../../chunk-IWBCUOHE.js";import"../../../chunk-EG7U7PM3.js";import"../../../chunk-
|
|
1
|
+
import{a,b}from"../../../chunk-IWBCUOHE.js";import"../../../chunk-EG7U7PM3.js";import"../../../chunk-XDUIVR6I.js";import"../../../chunk-HZ6A5QFC.js";import"../../../chunk-AYJMIZZ3.js";import"../../../chunk-6LT7O7T2.js";import"../../../chunk-DINNT5P2.js";import"../../../chunk-U752J5IG.js";import"../../../chunk-GRL4DWKG.js";import"../../../chunk-3USCFSFQ.js";import"../../../chunk-7GK5LKBV.js";import"../../../chunk-5MOOXA2X.js";import"../../../chunk-4OT5AMS5.js";import"../../../chunk-IZ2LK5GK.js";export{a as blCheckboxTag,b as default};
|
|
2
2
|
//# sourceMappingURL=bl-checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-N43OCCSL.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-CYLRPJKP.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-U752J5IG.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-dialog.js.map
|
|
@@ -25,5 +25,6 @@ export declare const DialogWithFocusedAction: Story;
|
|
|
25
25
|
export declare const DialogWithFocusedInput: Story;
|
|
26
26
|
export declare const DialogWithFullWidthAction: Story;
|
|
27
27
|
export declare const DialogWithFullWidthActions: Story;
|
|
28
|
+
export declare const DialogWithTabGroup: Story;
|
|
28
29
|
export declare const CriticalDialog: Story;
|
|
29
30
|
//# sourceMappingURL=bl-dialog.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-dialog.stories.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/bl-dialog.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAOhE,QAAA,MAAM,IAAI,EAAE,IA4BX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"bl-dialog.stories.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/bl-dialog.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAOhE,QAAA,MAAM,IAAI,EAAE,IA4BX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAoJlC,eAAO,MAAM,UAAU,EAAE,KAWxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KASpC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAS1B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAYrC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAUpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KASvC,CAAC;AAGF,eAAO,MAAM,0BAA0B,EAAE,KAUxC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAWhC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAU5B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c}from"../../chunk-HSVSMABT.js";import{a as n}from"../../chunk-DINNT5P2.js";import{b as l}from"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import{b as e}from"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";var m={title:"Components/Dialog",component:"bl-dialog",parameters:{chromatic:{viewports:[1e3]},controls:{exclude:["id"]}},decorators:[c],argTypes:{open:{control:"boolean"},polyfilled:{control:"boolean"},caption:{control:"text"},content:{control:"text"}}},
|
|
1
|
+
import{a as c}from"../../chunk-HSVSMABT.js";import{a as n}from"../../chunk-DINNT5P2.js";import{b as l}from"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import{b as e}from"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";var m={title:"Components/Dialog",component:"bl-dialog",parameters:{chromatic:{viewports:[1e3]},controls:{exclude:["id"]}},decorators:[c],argTypes:{open:{control:"boolean"},polyfilled:{control:"boolean"},caption:{control:"text"},content:{control:"text"}}},A=m,t=i=>async()=>{let a=document.getElementById(i);a.open=!0},o=i=>e`
|
|
2
2
|
<bl-button @bl-click="${t(i.id)}" variant="secondary">Open Dialog</bl-button>
|
|
3
3
|
|
|
4
4
|
<bl-dialog
|
|
@@ -14,9 +14,9 @@ import{a as c}from"../../chunk-HSVSMABT.js";import{a as n}from"../../chunk-DINNT
|
|
|
14
14
|
<bl-button slot="secondary-action" variant="secondary" ?autofocus=${i.focusSecondary} size="large">${i.secondaryAction}</bl-button>`:""}${i.tertiaryAction?e`
|
|
15
15
|
<bl-button slot="tertiary-action" variant="tertiary" ?autofocus=${i.focusTertiary} size="large">${i.tertiaryAction}</bl-button>`:""}
|
|
16
16
|
${i.closeAction?e`
|
|
17
|
-
<bl-button slot="primary-action" variant="primary" ?autofocus=${i.focusSecondary} size="large" @click=${a=>{var
|
|
17
|
+
<bl-button slot="primary-action" variant="primary" ?autofocus=${i.focusSecondary} size="large" @click=${a=>{var r;return(r=a.target.closest("bl-dialog"))==null?void 0:r.toggleAttribute("open")}}>${i.closeAction}</bl-button>`:""}
|
|
18
18
|
</bl-dialog>
|
|
19
|
-
`,
|
|
19
|
+
`,s=i=>e`
|
|
20
20
|
<style>
|
|
21
21
|
bl-dialog.full-width-actions bl-button {
|
|
22
22
|
--bl-button-display: block;
|
|
@@ -100,5 +100,26 @@ a Latin professor at Hampden-Sydney College in Virginia, looked up one of the mo
|
|
|
100
100
|
of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum"
|
|
101
101
|
(The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum,
|
|
102
102
|
"Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>`})}
|
|
103
|
-
`,
|
|
103
|
+
`,p=i=>e`
|
|
104
|
+
<style>
|
|
105
|
+
.tab-dialog-content {
|
|
106
|
+
height:50px;
|
|
107
|
+
margin-top: 20px;
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
110
|
+
|
|
111
|
+
${o({...i,content:`
|
|
112
|
+
<bl-tab-group>
|
|
113
|
+
<bl-tab name="test-1" slot="tabs" caption="Caption">Tab 1</bl-tab>
|
|
114
|
+
<bl-tab name="test-2" slot="tabs">Tab 2</bl-tab>
|
|
115
|
+
<bl-tab name="test-3" slot="tabs" disabled caption="Caption">Tab 3</bl-tab>
|
|
116
|
+
</bl-tab-group>
|
|
117
|
+
<p class="tab-dialog-content">
|
|
118
|
+
Normal dialog contents has default padding in bl-dialog component. But bl-tab-group has full width in bl-dialog component.
|
|
119
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
|
|
120
|
+
when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
121
|
+
</p>
|
|
122
|
+
|
|
123
|
+
`})}
|
|
124
|
+
`,q={args:{id:"dl-basic",caption:"Use location service?",content:"Let us help determine location. This means sending anonymous location data to us.",primaryAction:"Agree",secondaryAction:"Disagree",tertiaryAction:"Cancel"},render:o,play:t("dl-basic")},v={args:{id:"dl-sticky-footer",caption:"Terms And Conditions",primaryAction:"Agree",secondaryAction:"Disagree"},render:d,play:t("dl-sticky-footer")},L={args:{id:"dl-sizing",primaryAction:"Agree",secondaryAction:"Disagree",tertiaryAction:"Cancel"},render:u,play:t("dl-sizing")},k={args:{id:"dl-focused-action",caption:"Use location service?",content:"Let us help determine location. This means sending anonymous location data to us.",primaryAction:"Agree",secondaryAction:"Disagree",focusSecondary:!0,tertiaryAction:"Cancel"},render:o,play:t("dl-focused-action")},w={args:{id:"dl-focused-input",caption:"Name your file",content:'<p>Please provide a name for your file</p><bl-input placeholder="filename.pdf" autofocus></bl-input>',primaryAction:"OK",tertiaryAction:"Cancel"},render:o,play:t("dl-focused-input")},D={args:{id:"dl-full-width-action",caption:"Action completed",content:"<p>Your process is done!</p>",primaryAction:"OK"},render:s,play:t("dl-full-width-action")},T={args:{id:"dl-full-width-actions",caption:"Are you sure to delete?",content:"<p>Do you want to really delete the file?</p>",primaryAction:"Delete",secondaryAction:"Cancel"},render:s,play:t("dl-full-width-actions")},$={args:{id:"dl-tab-group",caption:"Use location service?",content:"Let us help determine location. This means sending anonymous location data to us.",primaryAction:"Agree",secondaryAction:"Disagree",tertiaryAction:"Cancel"},render:p,play:t("dl-tab-group")},S={args:{id:"dl-critical",caption:"Critical Action Required",content:"<p>This action is irreversible. Please confirm to proceed.</p>",closeAction:"Confirm",critical:!0},render:s,play:t("dl-critical")};export{q as BasicUsage,S as CriticalDialog,L as DialogSizing,k as DialogWithFocusedAction,w as DialogWithFocusedInput,D as DialogWithFullWidthAction,T as DialogWithFullWidthActions,v as DialogWithStickyFooter,$ as DialogWithTabGroup,A as default};
|
|
104
125
|
//# sourceMappingURL=bl-dialog.stories.js.map
|