@govtechsg/sgds-web-component 3.20.0-rc.2 → 3.20.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Badge/badge.js +1 -1
- package/components/Badge/index.umd.min.js +4 -4
- package/components/Badge/index.umd.min.js.map +1 -1
- package/components/Badge/sgds-badge.js +6 -9
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +10 -10
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +1 -1
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.js +1 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Modal/index.umd.min.js +6 -6
- package/components/Modal/index.umd.min.js.map +1 -1
- package/components/Modal/modal.js +1 -1
- package/components/SystemBanner/index.umd.min.js +1 -1
- package/components/SystemBanner/index.umd.min.js.map +1 -1
- package/components/SystemBanner/system-banner-item.js +1 -1
- package/components/Table/index.umd.min.js +1 -1
- package/components/Table/index.umd.min.js.map +1 -1
- package/components/Table/sgds-table.js +4 -4
- package/components/Table/sgds-table.js.map +1 -1
- package/components/index.umd.min.js +7 -7
- package/components/index.umd.min.js.map +1 -1
- package/custom-elements.json +9 -5
- package/index.umd.min.js +56 -56
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Badge/badge.cjs.js +1 -1
- package/react/components/Badge/badge.js +1 -1
- package/react/components/Badge/sgds-badge.cjs.js +6 -9
- package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
- package/react/components/Badge/sgds-badge.js +6 -9
- package/react/components/Badge/sgds-badge.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js +1 -1
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/Modal/modal.cjs.js +1 -1
- package/react/components/Modal/modal.js +1 -1
- package/react/components/SystemBanner/system-banner-item.cjs.js +1 -1
- package/react/components/SystemBanner/system-banner-item.js +1 -1
- package/react/components/Table/sgds-table.cjs.js +4 -4
- package/react/components/Table/sgds-table.cjs.js.map +1 -1
- package/react/components/Table/sgds-table.js +4 -4
- package/react/components/Table/sgds-table.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-datepicker.js","sources":["../../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { format, parse } from \"date-fns\";\nimport { html, PropertyValueMap } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { type SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport dropdownMenuStyle from \"../Dropdown/dropdown-menu.css\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport datepickerStyle from \"./datepicker.css\";\nimport { ViewEnum } from \"./types\";\nimport SgdsIconButton from \"../IconButton/sgds-icon-button\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n * @event sgds-invalid - Emitted when the combo box's invalid state is set to true.\n * @event sgds-valid - Emitted when the combo box's invalid state is set to false.\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends SgdsFormValidatorMixin(DropdownElement) implements SgdsFormControl {\n static styles = [...DropdownElement.styles, dropdownMenuStyle, datepickerStyle];\n /**@internal */\n static dependencies = {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader,\n \"sgds-button\": SgdsButton,\n \"sgds-icon-button\": SgdsIconButton\n };\n\n constructor() {\n super();\n this.floatingOpts = {\n placement: \"bottom-end\"\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Disables native and sgds validation for the datepicker. */\n @property({ type: Boolean, reflect: true }) noValidate = false;\n\n /** Sets the initial value of the datepicker. Replaces deprecated `initialValue`.\n * Pass in dates in this format `dd/mm/yyyy` for single mode and `dd/mm/yyyy - dd/mm/yyyy` for range mode\n * For example, `value=\"22/12/2023\"` for single mode or `value=\"22/12/2023 - 25/12/2023\"` for range mode\n */\n @property({ type: String, reflect: true }) value = \"\";\n\n /**\n * Deprecated since v3.3.0 in favour of `value`.\n * The initial value of DatePicker on first load for single &\n * range mode as array of string. eg.'[\"22/12/2023\"]' for single &\n * '[\"22/12/2023\",\"25/12/2023\"]' for range respectively @deprecated\n * */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n private dateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback: string;\n\n /** Allows invalidFeedback and invalid styles to be visible with the input */\n @property({ type: Boolean, reflect: true }) hasFeedback = false;\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n\n /**Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue()\n defaultValue = \"\";\n\n /** Marks the component as invalid. Replace the pseudo :invalid selector. */\n @property({ type: Boolean, reflect: true }) invalid = false;\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n private isValueEmpty() {\n return this.value === \"\" || this.value === \"DD/MM/YYYY\" || this.value === \"DD/MM/YYYY - DD/MM/YYYY\";\n }\n\n private initialDisplayDate: Date = new Date();\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n\n /**\n * Programmatically sets the invalid state of the datepicker.\n * Use together with `noValidate` (or `novalidate` on the parent `<form>`) and `invalidFeedback`\n * to integrate 3rd-party or custom validation logic.\n */\n public setInvalid(bool: boolean) {\n this.invalid = bool;\n if (this.datepickerInput) {\n this.datepickerInput.setInvalid(bool);\n }\n }\n\n /**\n * Checks for validity without any native error popup message\n */\n public setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void {\n return this._mixinSetValidity(flags, message, anchor);\n }\n\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.addEventListener(\"sgds-show\", this._handleOpenMenu);\n this.addEventListener(\"blur\", this._mixinCheckValidity);\n\n this.initialValue = this.value ? this.value.split(\" - \").map(v => v.trim()) : this.initialValue;\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n\n const input = await this.datepickerInputAsync;\n input.setInvalid(this.invalid);\n }\n\n async firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n await this.updateFloatingPosition();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\", { waitUntilFirstUpdate: true })\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n }\n\n private async _handleCloseMenu() {\n //return focus to input when menu closes\n const input = await this.datepickerInputAsync;\n input.focus();\n\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n private async _handleOpenMenu() {\n const cal = await this.calendar;\n const input = await this.datepickerInputAsync;\n cal.focusOnCalendar(input);\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n this._manageInternalsValid();\n }\n\n private async _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n await this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n if (this._mixinShouldSkipSgdsValidation()) return;\n\n this.invalid = true;\n this._manageInternalsBadInput();\n }\n private async _handleEmptyInput() {\n if (this.required) {\n this._manageEmptyInput();\n }\n return;\n }\n private async _resetDatepicker(resetValue = \"\") {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = resetValue;\n this.view = \"days\";\n const input = await this.datepickerInputAsync;\n input.setInvalid(this.invalid);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._mixinResetValidity(input);\n if (this.isValueEmpty()) {\n this._handleEmptyInput();\n }\n }\n\n private _manageInternalsBadInput() {\n this._mixinSetValidity(\n {\n badInput: true\n },\n \"Invalid date input\",\n this.datepickerInput\n );\n }\n /**\n * Even though element internals handles the required constraint validation. This custom one is still needed as\n * datepicker input has a special case where the default input mask \"DD/MM/YYYY\" means an empty input.\n * However, the required constraint validation sees \"DD/MM/YYYY\" as a non-empty input.\n */\n private _manageEmptyInput() {\n this._mixinSetValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this.datepickerInput\n );\n }\n\n /**\n * Called when a valid date is entered via input or selected by calendar\n * 1. sets validity state to valid\n * 2. updates invalid prop\n * 3. sets the form value of datepicker\n */\n private _manageInternalsValid() {\n if (this._mixinShouldSkipSgdsValidation()) return;\n\n this._mixinSetValidity({});\n\n this.invalid = this.datepickerInput.invalid = false;\n this._mixinSetFormValue();\n }\n\n /**\n * Handles the form \"reset\" event\n */\n private async _mixinResetFormControl() {\n this._resetDatepicker(this.defaultValue);\n }\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n\n if (this.isValueEmpty()) {\n this._resetDatepicker();\n }\n }\n\n private _dialogAriaLabels = {\n days: \"Choose date\",\n months: \"Choose month\",\n years: \"Choose year\"\n };\n render() {\n return html`\n <div class=\"datepicker-container m-width-160\">\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=${this.mode === \"single\" ? \"DD/MM/YYYY\" : \"DD/MM/YYYY - DD/MM/YYYY\"}\n mode=${this.mode}\n invalidFeedback=${ifDefined(this.invalidFeedback ? this.invalidFeedback : this._mixinGetValidationMessage())}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n ?invalid=${this.invalid}\n hasFeedback=${ifDefined(this.hasFeedback ? \"both\" : undefined)}\n ?readonly=${this.readonly}\n >\n <sgds-icon-button\n slot=\"calendar-btn\"\n ${ref(this.myDropdown)}\n tone=\"neutral\"\n class=${classMap({\n \"calendar-btn\": true,\n \"with-hint-text\": this.hintText || this.invalid,\n \"with-label\": this.label\n })}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n ariaLabel=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled || this.readonly}\n ?active=${this.menuIsOpen}\n variant=\"outline\"\n name=\"calendar\"\n >\n </sgds-icon-button>\n </sgds-datepicker-input>\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n aria-label=${this._dialogAriaLabels[this.view]}\n @click=${(event: MouseEvent) => event.stopPropagation()}\n ${ref(this.menuRef)}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["dropdownMenuStyle","datepickerStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;;;;;;;AAUG;MACU,cAAe,SAAQ,sBAAsB,CAAC,eAAe,CAAC,CAAA;AAWzE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;;QAOkC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGjB,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;AAE/D;;;AAGG;QACwC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;AAEtD;;;;;AAKK;QACqC,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;QAE9D,IAAU,CAAA,UAAA,GAAG,YAAY,CAAC;;QAGN,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGb,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGE,IAAI,CAAA,IAAA,GAAuB,QAAQ,CAAC;;QAMnC,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAGnC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAQ,CAAA,QAAA,GAAG,EAAE,CAAC;;QAI3C,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAIf,IAAI,CAAA,IAAA,GAAkB,MAAM,CAA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AAA,oBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-datepicker.js","sources":["../../../../src/components/Datepicker/sgds-datepicker.ts"],"sourcesContent":["import { format, parse } from \"date-fns\";\nimport { html, PropertyValueMap } from \"lit\";\nimport { property, query, queryAsync, state } from \"lit/decorators.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { DropdownElement } from \"../../base/dropdown-element\";\nimport { type SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { DATE_PATTERNS, setTimeToNoon } from \"../../utils/time\";\nimport { watch } from \"../../utils/watch\";\nimport { SgdsButton } from \"../Button/sgds-button\";\nimport dropdownMenuStyle from \"../Dropdown/dropdown-menu.css\";\nimport { DatepickerCalendar } from \"./datepicker-calendar\";\nimport { DatepickerHeader } from \"./datepicker-header\";\nimport DatepickerInput from \"./datepicker-input\";\nimport datepickerStyle from \"./datepicker.css\";\nimport { ViewEnum } from \"./types\";\nimport SgdsIconButton from \"../IconButton/sgds-icon-button\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\n\nexport type DateFormat = \"MM/DD/YYYY\" | \"DD/MM/YYYY\" | \"YYYY/MM/DD\";\n\n/**\n * @summary The `DatePicker` Component is built using `Dropdown`, `Input` and `Button` components. By default, the Calendar points to today's date and input has no value. Users can either pick dates from the calendar or type dates through the input\n *\n * @event sgds-change-date - Emitted when the state of datepicker's input changes during first load, close button reset click & date click. Date values can be accessed via event.target.value\n * @event sgds-invalid - Emitted when the combo box's invalid state is set to true.\n * @event sgds-valid - Emitted when the combo box's invalid state is set to false.\n *\n * @description displayDate sets the month, year views of the calendar while focusedDate follows the focus which also directly changes\n * displayDate on certain occasions. Example, when keyboard moves up to the next month, it updates displayDate which then affect the current\n * date view of the calendar\n */\nexport class SgdsDatepicker extends SgdsFormValidatorMixin(DropdownElement) implements SgdsFormControl {\n static styles = [...DropdownElement.styles, dropdownMenuStyle, datepickerStyle];\n /**@internal */\n static dependencies = {\n \"sgds-datepicker-input\": DatepickerInput,\n \"sgds-datepicker-calendar\": DatepickerCalendar,\n \"sgds-datepicker-header\": DatepickerHeader,\n \"sgds-button\": SgdsButton,\n \"sgds-icon-button\": SgdsIconButton\n };\n\n constructor() {\n super();\n this.floatingOpts = {\n placement: \"bottom-end\"\n };\n }\n\n /** When true, adds required attribute to input element */\n @property({ type: Boolean, reflect: true }) required = false;\n /**The datepicker input's name attribute */\n @property({ reflect: true }) name: string;\n /** When true, adds disabled attribute to input and button element */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Disables native and sgds validation for the datepicker. */\n @property({ type: Boolean, reflect: true }) noValidate = false;\n\n /** Sets the initial value of the datepicker. Replaces deprecated `initialValue`.\n * Pass in dates in this format `dd/mm/yyyy` for single mode and `dd/mm/yyyy - dd/mm/yyyy` for range mode\n * For example, `value=\"22/12/2023\"` for single mode or `value=\"22/12/2023 - 25/12/2023\"` for range mode\n */\n @property({ type: String, reflect: true }) value = \"\";\n\n /**\n * Deprecated since v3.3.0 in favour of `value`.\n * The initial value of DatePicker on first load for single &\n * range mode as array of string. eg.'[\"22/12/2023\"]' for single &\n * '[\"22/12/2023\",\"25/12/2023\"]' for range respectively @deprecated\n * */\n @property({ type: Array, reflect: true }) initialValue: string[] = [];\n\n private dateFormat = \"DD/MM/YYYY\";\n\n /** ISO date string to set the lowest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) minDate = \"\";\n\n /** ISO date string to set the highest allowable date value. e.g. \"2016-05-19T12:00:00.000Z\" */\n @property({ type: String }) maxDate = \"\";\n\n /** Changes DatePicker to single date selection or range date selection */\n @property({ type: String, reflect: true }) mode: \"single\" | \"range\" = \"single\";\n\n /**Feedback text for error state when date input is invalid */\n @property({ type: String, reflect: true }) invalidFeedback: string;\n\n /** Allows invalidFeedback and invalid styles to be visible with the input */\n @property({ type: Boolean, reflect: true }) hasFeedback = false;\n\n /** The datepicker input's label */\n @property({ reflect: true }) label = \"\";\n\n /** The datepicker input's hint text below the label */\n @property({ reflect: true }) hintText = \"\";\n\n /** Controls auto-flipping of menu */\n @property({ type: Boolean, reflect: true, state: false })\n noFlip = false;\n\n /** The drop position of menu relative to the toggle button */\n @property({ type: String, reflect: true, state: false })\n drop: \"up\" | \"down\" = \"down\";\n\n /** Provides the date context for Calendar to present the appropriate view. Defaults to today's date */\n @property({ attribute: false }) displayDate: Date;\n\n /**Gets or sets the default value used to reset this element. The initial value corresponds to the one originally specified in the HTML that created this element. */\n @defaultValue()\n defaultValue = \"\";\n\n /** Marks the component as invalid. Replace the pseudo :invalid selector. */\n @property({ type: Boolean, reflect: true }) invalid = false;\n\n @state()\n private view: ViewEnum = \"days\";\n\n @state() private selectedDateRange: Date[] = [];\n\n @state() private focusedDate: Date;\n\n @state() private focusedTabIndex = 3;\n\n private isValueEmpty() {\n return this.value === \"\" || this.value === \"DD/MM/YYYY\" || this.value === \"DD/MM/YYYY - DD/MM/YYYY\";\n }\n\n private initialDisplayDate: Date = new Date();\n\n @queryAsync(\"sgds-datepicker-calendar\")\n private calendar: Promise<DatepickerCalendar>;\n\n @queryAsync(\"sgds-datepicker-input\")\n private datepickerInputAsync: Promise<DatepickerInput>;\n\n @query(\"sgds-datepicker-input\")\n private datepickerInput: DatepickerInput;\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n\n /**\n * Programmatically sets the invalid state of the datepicker.\n * Use together with `noValidate` (or `novalidate` on the parent `<form>`) and `invalidFeedback`\n * to integrate 3rd-party or custom validation logic.\n */\n public setInvalid(bool: boolean) {\n this.invalid = bool;\n if (this.datepickerInput) {\n this.datepickerInput.setInvalid(bool);\n }\n }\n\n /**\n * Checks for validity without any native error popup message\n */\n public setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void {\n return this._mixinSetValidity(flags, message, anchor);\n }\n\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n async connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"sgds-view\", this._handleViewChanged);\n this.addEventListener(\"sgds-change-calendar\", this._handleDateChanged);\n this.addEventListener(\"sgds-update-focus\", this._handleFocusDateChanged);\n this.addEventListener(\"sgds-selectmonth\", this._handleSelectMonth);\n this.addEventListener(\"sgds-selectyear\", this._handleSelectYear);\n this.addEventListener(\"sgds-selectdates\", this._handleSelectDatesAndClose);\n this.addEventListener(\"sgds-selectdates-input\", this._handleSelectDatesInput);\n this.addEventListener(\"sgds-empty-input\", this._handleEmptyInput);\n this.addEventListener(\"keydown\", this._handleTab);\n this.addEventListener(\"sgds-hide\", this._handleCloseMenu);\n this.addEventListener(\"sgds-show\", this._handleOpenMenu);\n this.addEventListener(\"blur\", this._mixinCheckValidity);\n\n this.initialValue = this.value ? this.value.split(\" - \").map(v => v.trim()) : this.initialValue;\n this.initialDisplayDate = this.displayDate || new Date();\n if (this.initialValue && this.initialValue.length > 0) {\n // Validate initialValue against the dateFormat regex\n const dateFormatRegex = new RegExp(this._getDateFormatRegex());\n // const startDateString = this.initialValue[0];\n const invalidDates = this.initialValue.filter(v => !dateFormatRegex.test(v));\n if (invalidDates.length > 0) {\n return console.error(\"Invalid date format in initialValue:\", invalidDates);\n } else {\n const initialSelectedDates = this.initialValue.map(v =>\n setTimeToNoon(parse(v, DATE_PATTERNS[this.dateFormat].fnsPattern, new Date()))\n );\n this._handleSelectDates(initialSelectedDates);\n }\n } else {\n this.displayDate = this.initialDisplayDate;\n }\n\n const input = await this.datepickerInputAsync;\n input.setInvalid(this.invalid);\n }\n\n async firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n if (this.menuIsOpen) {\n const input = await this.datepickerInputAsync;\n await this.updateFloatingPosition();\n const cal = await this.calendar;\n cal.focusOnCalendar(input);\n }\n }\n\n /** @internal */\n private _getDateFormatRegex(): string {\n // validate date strings and adhere to the specified date format\n return (\n this.dateFormat\n // Replace any special characters with their escaped version using \"\\\\$&\"\n .replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n // Replace 'MM' with '\\\\d{2}', which matches two digits representing the month (e.g., 01, 12)\n .replace(\"MM\", \"\\\\d{2}\")\n // Replace 'DD' with '\\\\d{2}', which matches two digits representing the day (e.g., 01, 31)\n .replace(\"DD\", \"\\\\d{2}\")\n // Replace 'YYYY' with '\\\\d{4}', which matches four digits representing the year (e.g., 2021)\n .replace(\"YYYY\", \"\\\\d{4}\")\n // Replace '/' with '\\\\/', which matches the forward slash character\n .replace(\"/\", \"\\\\/\")\n );\n }\n private _handleTab(event: KeyboardEvent) {\n if (!this.menuIsOpen) {\n return;\n }\n const tabIndexArray = Array(4);\n if (event.shiftKey && event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex - 1 + tabIndexArray.length) % tabIndexArray.length;\n } else if (event.key === \"Tab\") {\n event.preventDefault();\n this.focusedTabIndex = (this.focusedTabIndex + 1 + tabIndexArray.length) % tabIndexArray.length;\n }\n }\n\n @watch(\"value\", { waitUntilFirstUpdate: true })\n _handleValueChange() {\n this.emit(\"sgds-change-date\");\n }\n\n private async _handleCloseMenu() {\n //return focus to input when menu closes\n const input = await this.datepickerInputAsync;\n input.focus();\n\n if (this.selectedDateRange.length === 0) {\n this.displayDate = this.initialDisplayDate;\n } else {\n const selectedDatesLength = this.selectedDateRange.length;\n this.displayDate = this.selectedDateRange[selectedDatesLength - 1];\n const calendar = await this.calendar;\n calendar._updateFocusedDate();\n }\n }\n private async _handleOpenMenu() {\n const cal = await this.calendar;\n const input = await this.datepickerInputAsync;\n cal.focusOnCalendar(input);\n }\n\n private _makeInputValueString = (startDate: Date, endDate: Date, dateFormat: string) => {\n if (!startDate && !endDate) return this.value;\n const formatDate = (date: Date) => format(date, DATE_PATTERNS[dateFormat].fnsPattern);\n switch (this.mode) {\n case \"single\": {\n if (startDate) {\n this.value = formatDate(startDate);\n }\n break;\n }\n case \"range\": {\n if (startDate && endDate) {\n this.value = `${formatDate(startDate)} - ${formatDate(endDate)}`;\n }\n if (startDate && !endDate) {\n this.value = `${formatDate(startDate)} - ${this.dateFormat}`;\n }\n break;\n }\n }\n return this.value;\n };\n private _handleSelectDatesInput(event: CustomEvent<Date[]>) {\n this._handleSelectDates(event.detail);\n }\n private async _handleSelectDates(newSelectedDates: Date[]) {\n newSelectedDates.sort((a: Date, b: Date) => a.getTime() - b.getTime());\n this.displayDate = newSelectedDates[0];\n this.focusedDate = newSelectedDates[0];\n this.selectedDateRange = newSelectedDates;\n // Get the formattedDate value for the selected dates\n const formattedDate = this._makeInputValueString(\n this.selectedDateRange[0],\n this.selectedDateRange[1],\n this.dateFormat\n );\n\n // Set formattedDate value as the new value for sgds-input\n this.value = formattedDate;\n const input = await this.datepickerInputAsync;\n input.updateMaskValue();\n this._manageInternalsValid();\n }\n\n private async _handleSelectDatesAndClose(event: CustomEvent<Date[]>) {\n await this._handleSelectDates(event.detail);\n\n if (this.mode === \"range\" && this.selectedDateRange.length === 2) {\n this.hideMenu();\n } else if (this.mode === \"single\" && this.selectedDateRange.length === 1) {\n this.hideMenu();\n }\n }\n\n /** update latest view state from datepicker-header */\n private _handleViewChanged(event: CustomEvent<string>) {\n this.view = event.detail as ViewEnum;\n }\n\n private _handleDateChanged(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private _handleFocusDateChanged(event: CustomEvent<Date>) {\n this.focusedDate = event.detail;\n }\n\n private _handleSelectMonth(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n\n private _handleSelectYear(event: CustomEvent<Date>) {\n this.displayDate = event.detail;\n }\n private async _handleInvalidInput() {\n this.selectedDateRange = [];\n this.displayDate = this.initialDisplayDate;\n if (this._mixinShouldSkipSgdsValidation()) return;\n\n this.invalid = true;\n this._manageInternalsBadInput();\n }\n private async _handleEmptyInput() {\n if (this.required) {\n this._manageEmptyInput();\n }\n return;\n }\n private async _resetDatepicker(resetValue = \"\") {\n this.displayDate = this.initialDisplayDate;\n this.selectedDateRange = [];\n this.value = resetValue;\n this.view = \"days\";\n const input = await this.datepickerInputAsync;\n input.setInvalid(this.invalid);\n input.destroyInputMask();\n await input.applyInputMask();\n\n this._mixinResetValidity(input);\n if (this.isValueEmpty()) {\n this._handleEmptyInput();\n }\n }\n\n private _manageInternalsBadInput() {\n this._mixinSetValidity(\n {\n badInput: true\n },\n \"Invalid date input\",\n this.datepickerInput\n );\n }\n /**\n * Even though element internals handles the required constraint validation. This custom one is still needed as\n * datepicker input has a special case where the default input mask \"DD/MM/YYYY\" means an empty input.\n * However, the required constraint validation sees \"DD/MM/YYYY\" as a non-empty input.\n */\n private _manageEmptyInput() {\n this._mixinSetValidity(\n {\n valueMissing: true\n },\n \"Please fill in this field\",\n this.datepickerInput\n );\n }\n\n /**\n * Called when a valid date is entered via input or selected by calendar\n * 1. sets validity state to valid\n * 2. updates invalid prop\n * 3. sets the form value of datepicker\n */\n private _manageInternalsValid() {\n this._mixinSetFormValue();\n if (this._mixinShouldSkipSgdsValidation()) return;\n\n this._mixinSetValidity({});\n\n this.invalid = this.datepickerInput.invalid = false;\n }\n\n /**\n * Handles the form \"reset\" event\n */\n private async _mixinResetFormControl() {\n this._resetDatepicker(this.defaultValue);\n }\n private async _handleInputMaskChange(e: CustomEvent) {\n this.value = e.detail;\n\n if (this.isValueEmpty()) {\n this._resetDatepicker();\n }\n }\n\n private _dialogAriaLabels = {\n days: \"Choose date\",\n months: \"Choose month\",\n years: \"Choose year\"\n };\n render() {\n return html`\n <div class=\"datepicker-container m-width-160\">\n <sgds-datepicker-input\n .value=${live(this.value)}\n ?required=${this.required}\n ?disabled=${this.disabled}\n placeholder=${this.mode === \"single\" ? \"DD/MM/YYYY\" : \"DD/MM/YYYY - DD/MM/YYYY\"}\n mode=${this.mode}\n invalidFeedback=${ifDefined(this.invalidFeedback ? this.invalidFeedback : this._mixinGetValidationMessage())}\n @sgds-mask-input-change=${this._handleInputMaskChange}\n @sgds-invalid-input=${this._handleInvalidInput}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n label=${this.label}\n hintText=${this.hintText}\n name=${this.name}\n ?invalid=${this.invalid}\n hasFeedback=${ifDefined(this.hasFeedback ? \"both\" : undefined)}\n ?readonly=${this.readonly}\n >\n <sgds-icon-button\n slot=\"calendar-btn\"\n ${ref(this.myDropdown)}\n tone=\"neutral\"\n class=${classMap({\n \"calendar-btn\": true,\n \"with-hint-text\": this.hintText || this.invalid,\n \"with-label\": this.label\n })}\n aria-expanded=\"${this.menuIsOpen}\"\n aria-haspopup=\"dialog\"\n aria-controls=${this.dropdownMenuId}\n @click=${() => this.toggleMenu()}\n ariaLabel=${this.menuIsOpen ? \"Close Calendar\" : \"Open Calendar\"}\n ?disabled=${this.disabled || this.readonly}\n ?active=${this.menuIsOpen}\n variant=\"outline\"\n name=\"calendar\"\n >\n </sgds-icon-button>\n </sgds-datepicker-input>\n <ul\n id=${this.dropdownMenuId}\n class=\"sgds datepicker dropdown-menu\"\n role=\"dialog\"\n aria-label=${this._dialogAriaLabels[this.view]}\n @click=${(event: MouseEvent) => event.stopPropagation()}\n ${ref(this.menuRef)}\n >\n <sgds-datepicker-header\n .view=${this.view}\n .displayDate=${this.displayDate}\n .focusedDate=${this.focusedDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-header>\n <sgds-datepicker-calendar\n .show=${this.menuIsOpen}\n .view=${this.view}\n .displayDate=${this.displayDate}\n .mode=${this.mode}\n minDate=${this.minDate}\n maxDate=${this.maxDate}\n .selectedDate=${this.selectedDateRange}\n .focusedTabIndex=${this.focusedTabIndex}\n ></sgds-datepicker-calendar>\n </ul>\n </div>\n `;\n }\n}\n\nexport default SgdsDatepicker;\n"],"names":["dropdownMenuStyle","datepickerStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;;;;;;;AAUG;MACU,cAAe,SAAQ,sBAAsB,CAAC,eAAe,CAAC,CAAA;AAWzE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;;QAOkC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAIjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGjB,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;AAE/D;;;AAGG;QACwC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;AAEtD;;;;;AAKK;QACqC,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;QAE9D,IAAU,CAAA,UAAA,GAAG,YAAY,CAAC;;QAGN,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGb,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;;QAGE,IAAI,CAAA,IAAA,GAAuB,QAAQ,CAAC;;QAMnC,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAGnC,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGX,IAAQ,CAAA,QAAA,GAAG,EAAE,CAAC;;QAI3C,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAIf,IAAI,CAAA,IAAA,GAAkB,MAAM,CAAC;;QAO7B,IAAY,CAAA,YAAA,GAAG,EAAE,CAAC;;QAG0B,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;QAGpD,IAAI,CAAA,IAAA,GAAa,MAAM,CAAC;QAEf,IAAiB,CAAA,iBAAA,GAAW,EAAE,CAAC;QAI/B,IAAe,CAAA,eAAA,GAAG,CAAC,C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AA,CAAA;AAGpD,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;AACwB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEf,UAAA,CAAA;AAAhB,IAAA,KAAK,EAAE;AAAwC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAE/B,UAAA,CAAA;AAAhB,IAAA,KAAK,EAAE;AAA2B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAElB,UAAA,CAAA;AAAhB,IAAA,KAAK,EAAE;AAA6B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAS7B,UAAA,CAAA;IADP,UAAU,CAAC,0BAA0B,CAAC;AACO,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGtC,UAAA,CAAA;IADP,UAAU,CAAC,uBAAuB,CAAC;AACmB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG/C,UAAA,CAAA;IADP,KAAK,CAAC,uBAAuB,CAAC;AACU,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA+HzC,UAAA,CAAA;IADC,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAG9C,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var lit = require('lit');
|
|
7
7
|
|
|
8
|
-
var css_248z = lit.css`:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=xl]) .modal-panel{max-width:var(--sgds-dimension-1280)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:var(--sgds-z-index-modal)}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:auto;max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));width:100%;z-index:2}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-2-xl);max-height:calc(100% - var(--sgds-margin-2-xl) - var(--sgds-margin-2-xl))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-4-xl) var(--sgds-margin-lg);max-height:calc(100% - var(--sgds-margin-4-xl) - var(--sgds-margin-4-xl));max-width:var(--sgds-dimension-888)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1168)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1312)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-24)!important;gap:1rem;line-height:var(--sgds-line-height-40)!important;margin:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-24);margin:var(--sgds-margin-none)!important}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;
|
|
8
|
+
var css_248z = lit.css`:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=xl]) .modal-panel{max-width:var(--sgds-dimension-1280)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl) var(--sgds-margin-lg)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:var(--sgds-z-index-modal)}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:auto;max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));width:100%;z-index:2}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-2-xl);max-height:calc(100% - var(--sgds-margin-2-xl) - var(--sgds-margin-2-xl))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-4-xl) var(--sgds-margin-lg);max-height:calc(100% - var(--sgds-margin-4-xl) - var(--sgds-margin-4-xl));max-width:var(--sgds-dimension-888)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1168)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1312)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-24)!important;gap:1rem;line-height:var(--sgds-line-height-40)!important;margin:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-24);margin:var(--sgds-margin-none)!important}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;
|
|
9
9
|
|
|
10
10
|
exports["default"] = css_248z;
|
|
11
11
|
//# sourceMappingURL=modal.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { css } from 'lit';
|
|
3
3
|
|
|
4
|
-
var css_248z = css`:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=xl]) .modal-panel{max-width:var(--sgds-dimension-1280)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:var(--sgds-z-index-modal)}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:auto;max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));width:100%;z-index:2}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-2-xl);max-height:calc(100% - var(--sgds-margin-2-xl) - var(--sgds-margin-2-xl))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-4-xl) var(--sgds-margin-lg);max-height:calc(100% - var(--sgds-margin-4-xl) - var(--sgds-margin-4-xl));max-width:var(--sgds-dimension-888)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1168)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1312)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-24)!important;gap:1rem;line-height:var(--sgds-line-height-40)!important;margin:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-24);margin:var(--sgds-margin-none)!important}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;
|
|
4
|
+
var css_248z = css`:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=xl]) .modal-panel{max-width:var(--sgds-dimension-1280)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl) var(--sgds-margin-lg)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:var(--sgds-z-index-modal)}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:auto;max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));width:100%;z-index:2}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-2-xl);max-height:calc(100% - var(--sgds-margin-2-xl) - var(--sgds-margin-2-xl))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-4-xl) var(--sgds-margin-lg);max-height:calc(100% - var(--sgds-margin-4-xl) - var(--sgds-margin-4-xl));max-width:var(--sgds-dimension-888)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1168)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1312)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-24)!important;gap:1rem;line-height:var(--sgds-line-height-40)!important;margin:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-24);margin:var(--sgds-margin-none)!important}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;
|
|
5
5
|
|
|
6
6
|
export { css_248z as default };
|
|
7
7
|
//# sourceMappingURL=modal.js.map
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var lit = require('lit');
|
|
7
7
|
|
|
8
|
-
var css_248z = lit.css`:host{display:block;font-size:var(--sgds-font-size-14,14px);font-style:normal;font-weight:var(--sgds-font-weight-regular,400);letter-spacing:var(--sgds-letter-spacing-normal,0);line-height:var(--sgds-line-height-20,20px);width:inherit}::slotted(:not(sgds-icon)){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;line-height:var(--sgds-line-height-20,20px)!important}.banner-item{color:var(--sgds-color-fixed-light);display:flex;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-2-xs) 0}.message{line-clamp:5;-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*5);overflow:hidden;word-break:break-word}.message.truncated:after{background-color:var(--sgds-surface-fixed-dark);bottom:0;content:"";height:var(--sgds-line-height-20,20px);position:absolute;right:0;text-align:right;width:10ch}.clamped-container{display:inline-block;margin-right:var(--sgds-margin-2-xl);max-width:var(--sgds-dimension-872);position:relative}.show-more{bottom:0;position:absolute;right:0;white-space:nowrap}.show-more__link{cursor:pointer;text-decoration:underline}.action{align-items:center;display:flex;gap:var(--sgds-gap-2-xs,4px);margin-top:6px;min-height:var(--sgds-line-height-20);white-space:nowrap}slot[name=action]::slotted(a){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;text-decoration:none!important}.banner-item__message_and__action{display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-xs)}@media (min-width:1024px){.banner-item__message_and__action{align-items:center;flex-direction:row;gap:var(--sgds-gap-sm)}.action{margin-left:auto;margin-top:0}.message{line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*2)}}`;
|
|
8
|
+
var css_248z = lit.css`:host{display:block;font-size:var(--sgds-font-size-14,14px);font-style:normal;font-weight:var(--sgds-font-weight-regular,400);letter-spacing:var(--sgds-letter-spacing-normal,0);line-height:var(--sgds-line-height-20,20px);width:inherit}::slotted(:not(sgds-icon)){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;line-height:var(--sgds-line-height-20,20px)!important}.banner-item{color:var(--sgds-color-fixed-light);display:flex;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-2-xs) 0}.message{line-clamp:5;-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*5);overflow:hidden;word-break:break-word}.message.truncated:after{background-color:var(--sgds-surface-fixed-dark);bottom:0;content:"";height:var(--sgds-line-height-20,20px);position:absolute;right:0;text-align:right;width:10ch}.clamped-container{display:inline-block;margin-right:var(--sgds-margin-2-xl);max-width:var(--sgds-dimension-872);position:relative}.show-more{bottom:0;position:absolute;right:0;white-space:nowrap}.show-more__link{cursor:pointer;text-decoration:underline}.action{align-items:center;display:flex;gap:var(--sgds-gap-2-xs,4px);margin-top:6px;min-height:var(--sgds-line-height-20);white-space:nowrap}slot[name=action]::slotted(a){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;text-decoration:none!important}.banner-item__message_and__action{display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-xs)}@media (min-width:1024px){.banner-item__message_and__action{align-items:center;flex-direction:row;gap:var(--sgds-gap-sm)}.action{margin-left:auto;margin-top:0}.message{line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*2)}::slotted(sgds-icon){align-self:center}}`;
|
|
9
9
|
|
|
10
10
|
exports["default"] = css_248z;
|
|
11
11
|
//# sourceMappingURL=system-banner-item.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { css } from 'lit';
|
|
3
3
|
|
|
4
|
-
var css_248z = css`:host{display:block;font-size:var(--sgds-font-size-14,14px);font-style:normal;font-weight:var(--sgds-font-weight-regular,400);letter-spacing:var(--sgds-letter-spacing-normal,0);line-height:var(--sgds-line-height-20,20px);width:inherit}::slotted(:not(sgds-icon)){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;line-height:var(--sgds-line-height-20,20px)!important}.banner-item{color:var(--sgds-color-fixed-light);display:flex;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-2-xs) 0}.message{line-clamp:5;-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*5);overflow:hidden;word-break:break-word}.message.truncated:after{background-color:var(--sgds-surface-fixed-dark);bottom:0;content:"";height:var(--sgds-line-height-20,20px);position:absolute;right:0;text-align:right;width:10ch}.clamped-container{display:inline-block;margin-right:var(--sgds-margin-2-xl);max-width:var(--sgds-dimension-872);position:relative}.show-more{bottom:0;position:absolute;right:0;white-space:nowrap}.show-more__link{cursor:pointer;text-decoration:underline}.action{align-items:center;display:flex;gap:var(--sgds-gap-2-xs,4px);margin-top:6px;min-height:var(--sgds-line-height-20);white-space:nowrap}slot[name=action]::slotted(a){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;text-decoration:none!important}.banner-item__message_and__action{display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-xs)}@media (min-width:1024px){.banner-item__message_and__action{align-items:center;flex-direction:row;gap:var(--sgds-gap-sm)}.action{margin-left:auto;margin-top:0}.message{line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*2)}}`;
|
|
4
|
+
var css_248z = css`:host{display:block;font-size:var(--sgds-font-size-14,14px);font-style:normal;font-weight:var(--sgds-font-weight-regular,400);letter-spacing:var(--sgds-letter-spacing-normal,0);line-height:var(--sgds-line-height-20,20px);width:inherit}::slotted(:not(sgds-icon)){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;line-height:var(--sgds-line-height-20,20px)!important}.banner-item{color:var(--sgds-color-fixed-light);display:flex;gap:var(--sgds-gap-sm);padding:var(--sgds-padding-2-xs) 0}.message{line-clamp:5;-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*5);overflow:hidden;word-break:break-word}.message.truncated:after{background-color:var(--sgds-surface-fixed-dark);bottom:0;content:"";height:var(--sgds-line-height-20,20px);position:absolute;right:0;text-align:right;width:10ch}.clamped-container{display:inline-block;margin-right:var(--sgds-margin-2-xl);max-width:var(--sgds-dimension-872);position:relative}.show-more{bottom:0;position:absolute;right:0;white-space:nowrap}.show-more__link{cursor:pointer;text-decoration:underline}.action{align-items:center;display:flex;gap:var(--sgds-gap-2-xs,4px);margin-top:6px;min-height:var(--sgds-line-height-20);white-space:nowrap}slot[name=action]::slotted(a){color:var(--sgds-color-fixed-light)!important;font-size:var(--sgds-font-size-14,14px)!important;text-decoration:none!important}.banner-item__message_and__action{display:flex;flex:1 0 0;flex-direction:column;gap:var(--sgds-gap-xs)}@media (min-width:1024px){.banner-item__message_and__action{align-items:center;flex-direction:row;gap:var(--sgds-gap-sm)}.action{margin-left:auto;margin-top:0}.message{line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;max-height:calc(var(--sgds-line-height-20, 20px)*2)}::slotted(sgds-icon){align-self:center}}`;
|
|
5
5
|
|
|
6
6
|
export { css_248z as default };
|
|
7
7
|
//# sourceMappingURL=system-banner-item.js.map
|
|
@@ -173,16 +173,16 @@ tslib.__decorate([
|
|
|
173
173
|
decorators_js.property({ type: Array })
|
|
174
174
|
], SgdsTable.prototype, "tableData", void 0);
|
|
175
175
|
tslib.__decorate([
|
|
176
|
-
decorators_js.property({ type: String })
|
|
176
|
+
decorators_js.property({ type: String, reflect: true })
|
|
177
177
|
], SgdsTable.prototype, "headerPosition", void 0);
|
|
178
178
|
tslib.__decorate([
|
|
179
|
-
decorators_js.property({ type: Boolean })
|
|
179
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
180
180
|
], SgdsTable.prototype, "headerBackground", void 0);
|
|
181
181
|
tslib.__decorate([
|
|
182
|
-
decorators_js.property({ type: Boolean })
|
|
182
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
183
183
|
], SgdsTable.prototype, "tableBorder", void 0);
|
|
184
184
|
tslib.__decorate([
|
|
185
|
-
decorators_js.property({ type: String })
|
|
185
|
+
decorators_js.property({ type: String, reflect: true })
|
|
186
186
|
], SgdsTable.prototype, "layout", void 0);
|
|
187
187
|
tslib.__decorate([
|
|
188
188
|
decorators_js.property({ type: Boolean })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-table.cjs.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { provide } from \"@lit/context\";\nimport { TableHeaderBackgroundContext } from \"./table-context\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Specifies the responsive breakpoint for the table.\n * Use \"sm\", \"md\", \"lg\", or \"xl\" to create responsive tables up to a particular breakpoint.\n * From that breakpoint and up, the table will behave normally and not scroll horizontally.\n * Use \"always\" to make the table always responsive.\n *\n * (@deprecated) Deprecated since 3.9.0 legacy from v2\n * @type {\"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\"}\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Array of strings to populate row header cells.\n * @type {string[]}\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Array of strings to populate column header cells.\n * Only used when `headerPosition` is set to \"vertical\" or \"both\".\n * @type {string[]}\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Two-dimensional array of strings or numbers to populate table data cells.\n * @type {Array<(string | number)[]>}\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table.\n * Use \"horizontal\" for top headers only, \"vertical\" for left headers only,\n * or \"both\" for both row and column headers.\n * @type {\"horizontal\" | \"vertical\" | \"both\"}\n * @default \"horizontal\"\n */\n @property({ type: String }) headerPosition: HeaderPosition = \"horizontal\";\n\n /**\n * Enables background styling on horizontal header rows.\n * When true, applies background color to header cells for better visual distinction.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) headerBackground = false;\n\n /**\n * Enables borders around table cells.\n * When true, displays visible borders between all table cells.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) tableBorder = false;\n\n /**\n * Controls the CSS `table-layout` algorithm.\n * Use \"auto\" to let the browser size columns based on content, or \"fixed\" to distribute column widths evenly regardless of content.\n * @type {\"auto\" | \"fixed\"}\n * @default \"auto\"\n */\n @property({ type: String }) layout: \"auto\" | \"fixed\" = \"auto\";\n\n /**\n * Indicates the presence of the default slot.\n * Used for server-side rendering to determine table structure.\n * @type {boolean}\n * @internal\n * @default false\n */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n @provide({ context: TableHeaderBackgroundContext })\n @state()\n private _headerBackground = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n this._headerBackground = this.headerBackground;\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th><div></div></th>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <div role=\"table\">\n <slot id=\"table-slot\" class=${classMap({ table: true, \"no-border\": !this.hasDefaultSlot })}></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["SgdsElement","HasSlotController","html","classMap","tableStyle","__decorate","property","provide","TableHeaderBackgroundContext","state"],"mappings":";;;;;;;;;;;;;;;AAYA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQA,sBAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAcE;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAAa,EAAE,CAAC;AAEpD;;;;AAIG;QACwB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;AAEvD;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAA+B,EAAE,CAAC;AAEtE;;;;;;AAMG;QACyB,IAAc,CAAA,cAAA,GAAmB,YAAY,CAAC;AAE1E;;;;;AAKG;QAC0B,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAC;AAEtD;;;;;AAKG;QAC0B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AAEjD;;;;;AAKG;QACyB,IAAM,CAAA,MAAA,GAAqB,MAAM,CAAC;AAE9D;;;;;;AAMG;QAC0B,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;QAI5C,IAAiB,CAAA,iBAAA,GAAG,KAAK,CAAC;;QAGjB,IAAiB,CAAA,iBAAA,GAAG,IAAIC,sBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;KA4F/E;IA1FC,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;KAC3B;IAED,OAAO,GAAA;QACL,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACzF,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC;KAChD;IAEO,YAAY,GAAA;AAClB,QAAA,IAAI,IAAI,CAAC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BAAA,CAAA;AAA5B,IAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAAwB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI5CD,gBAAA,CAAA;AAFP,IAAAE,eAAO,CAAC,EAAE,OAAO,EAAEC,yCAA4B,EAAE,CAAC;AAClD,IAAAC,mBAAK,EAAE;AAC0B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-table.cjs.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { provide } from \"@lit/context\";\nimport { TableHeaderBackgroundContext } from \"./table-context\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Specifies the responsive breakpoint for the table.\n * Use \"sm\", \"md\", \"lg\", or \"xl\" to create responsive tables up to a particular breakpoint.\n * From that breakpoint and up, the table will behave normally and not scroll horizontally.\n * Use \"always\" to make the table always responsive.\n *\n * (@deprecated) Deprecated since 3.9.0 legacy from v2\n * @type {\"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\"}\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Array of strings to populate row header cells.\n * @type {string[]}\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Array of strings to populate column header cells.\n * Only used when `headerPosition` is set to \"vertical\" or \"both\".\n * @type {string[]}\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Two-dimensional array of strings or numbers to populate table data cells.\n * @type {Array<(string | number)[]>}\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table.\n * Use \"horizontal\" for top headers only, \"vertical\" for left headers only,\n * or \"both\" for both row and column headers.\n * @type {\"horizontal\" | \"vertical\" | \"both\"}\n * @default \"horizontal\"\n */\n @property({ type: String, reflect: true }) headerPosition: HeaderPosition = \"horizontal\";\n\n /**\n * Enables background styling on horizontal header rows.\n * When true, applies background color to header cells for better visual distinction.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) headerBackground = false;\n\n /**\n * Enables borders around table cells.\n * When true, displays visible borders between all table cells.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) tableBorder = false;\n\n /**\n * Controls the CSS `table-layout` algorithm.\n * Use \"auto\" to let the browser size columns based on content, or \"fixed\" to distribute column widths evenly regardless of content.\n * @type {\"auto\" | \"fixed\"}\n * @default \"auto\"\n */\n @property({ type: String, reflect: true }) layout: \"auto\" | \"fixed\" = \"auto\";\n\n /**\n * Indicates the presence of the default slot.\n * Used for server-side rendering to determine table structure.\n * @type {boolean}\n * @internal\n * @default false\n */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n @provide({ context: TableHeaderBackgroundContext })\n @state()\n private _headerBackground = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n this._headerBackground = this.headerBackground;\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th><div></div></th>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <div role=\"table\">\n <slot id=\"table-slot\" class=${classMap({ table: true, \"no-border\": !this.hasDefaultSlot })}></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["SgdsElement","HasSlotController","html","classMap","tableStyle","__decorate","property","provide","TableHeaderBackgroundContext","state"],"mappings":";;;;;;;;;;;;;;;AAYA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQA,sBAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAcE;;;AAGG;QACwB,IAAS,CAAA,S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D,IAAAC,mBAAK,EAAE;AAC0B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
|
|
@@ -169,16 +169,16 @@ __decorate([
|
|
|
169
169
|
property({ type: Array })
|
|
170
170
|
], SgdsTable.prototype, "tableData", void 0);
|
|
171
171
|
__decorate([
|
|
172
|
-
property({ type: String })
|
|
172
|
+
property({ type: String, reflect: true })
|
|
173
173
|
], SgdsTable.prototype, "headerPosition", void 0);
|
|
174
174
|
__decorate([
|
|
175
|
-
property({ type: Boolean })
|
|
175
|
+
property({ type: Boolean, reflect: true })
|
|
176
176
|
], SgdsTable.prototype, "headerBackground", void 0);
|
|
177
177
|
__decorate([
|
|
178
|
-
property({ type: Boolean })
|
|
178
|
+
property({ type: Boolean, reflect: true })
|
|
179
179
|
], SgdsTable.prototype, "tableBorder", void 0);
|
|
180
180
|
__decorate([
|
|
181
|
-
property({ type: String })
|
|
181
|
+
property({ type: String, reflect: true })
|
|
182
182
|
], SgdsTable.prototype, "layout", void 0);
|
|
183
183
|
__decorate([
|
|
184
184
|
property({ type: Boolean })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-table.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { provide } from \"@lit/context\";\nimport { TableHeaderBackgroundContext } from \"./table-context\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Specifies the responsive breakpoint for the table.\n * Use \"sm\", \"md\", \"lg\", or \"xl\" to create responsive tables up to a particular breakpoint.\n * From that breakpoint and up, the table will behave normally and not scroll horizontally.\n * Use \"always\" to make the table always responsive.\n *\n * (@deprecated) Deprecated since 3.9.0 legacy from v2\n * @type {\"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\"}\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Array of strings to populate row header cells.\n * @type {string[]}\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Array of strings to populate column header cells.\n * Only used when `headerPosition` is set to \"vertical\" or \"both\".\n * @type {string[]}\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Two-dimensional array of strings or numbers to populate table data cells.\n * @type {Array<(string | number)[]>}\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table.\n * Use \"horizontal\" for top headers only, \"vertical\" for left headers only,\n * or \"both\" for both row and column headers.\n * @type {\"horizontal\" | \"vertical\" | \"both\"}\n * @default \"horizontal\"\n */\n @property({ type: String }) headerPosition: HeaderPosition = \"horizontal\";\n\n /**\n * Enables background styling on horizontal header rows.\n * When true, applies background color to header cells for better visual distinction.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) headerBackground = false;\n\n /**\n * Enables borders around table cells.\n * When true, displays visible borders between all table cells.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean }) tableBorder = false;\n\n /**\n * Controls the CSS `table-layout` algorithm.\n * Use \"auto\" to let the browser size columns based on content, or \"fixed\" to distribute column widths evenly regardless of content.\n * @type {\"auto\" | \"fixed\"}\n * @default \"auto\"\n */\n @property({ type: String }) layout: \"auto\" | \"fixed\" = \"auto\";\n\n /**\n * Indicates the presence of the default slot.\n * Used for server-side rendering to determine table structure.\n * @type {boolean}\n * @internal\n * @default false\n */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n @provide({ context: TableHeaderBackgroundContext })\n @state()\n private _headerBackground = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n this._headerBackground = this.headerBackground;\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th><div></div></th>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <div role=\"table\">\n <slot id=\"table-slot\" class=${classMap({ table: true, \"no-border\": !this.hasDefaultSlot })}></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["tableStyle"],"mappings":";;;;;;;;;;;AAYA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQ,WAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAcE;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAAa,EAAE,CAAC;AAEpD;;;;AAIG;QACwB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;AAEvD;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAA+B,EAAE,CAAC;AAEtE;;;;;;AAMG;QACyB,IAAc,CAAA,cAAA,GAAmB,YAAY,CAAC;AAE1E;;;;;AAKG;QAC0B,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAC;AAEtD;;;;;AAKG;QAC0B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AAEjD;;;;;AAKG;QACyB,IAAM,CAAA,MAAA,GAAqB,MAAM,CAAC;AAE9D;;;;;;AAMG;QAC0B,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;QAI5C,IAAiB,CAAA,iBAAA,GAAG,KAAK,CAAC;;QAGjB,IAAiB,CAAA,iBAAA,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;KA4F/E;IA1FC,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;KAC3B;IAED,OAAO,GAAA;QACL,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACzF,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC;KAChD;IAEO,YAAY,GAAA;AAClB,QAAA,IAAI,IAAI,CAAC,cAAc,KAAK,YAAY,EAAE;AACxC,YAAA,OAAO,IA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A,EAAA,gBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI5C,UAAA,CAAA;AAFP,IAAA,OAAO,CAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;AAClD,IAAA,KAAK,EAAE;AAC0B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-table.js","sources":["../../../../src/components/Table/sgds-table.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\n\nimport tableStyle from \"./table.css\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { provide } from \"@lit/context\";\nimport { TableHeaderBackgroundContext } from \"./table-context\";\n\nexport type HeaderPosition = \"horizontal\" | \"vertical\" | \"both\";\n\n/**\n * @summary Table is used for displaying collections of data in organized rows and columns.\n * It supports two rendering methods: supply an array of data for automatic table generation, or use the slot to insert custom table elements for full structural control.\n *\n * @slot - Insert custom table elements (such as rows, headers, or cells) to define the table structure manually.\n */\n\nexport class SgdsTable extends SgdsElement {\n static styles = [...SgdsElement.styles, tableStyle];\n\n /**\n * Specifies the responsive breakpoint for the table.\n * Use \"sm\", \"md\", \"lg\", or \"xl\" to create responsive tables up to a particular breakpoint.\n * From that breakpoint and up, the table will behave normally and not scroll horizontally.\n * Use \"always\" to make the table always responsive.\n *\n * (@deprecated) Deprecated since 3.9.0 legacy from v2\n * @type {\"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\"}\n */\n @property({ type: String, reflect: true }) responsive: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"always\";\n\n /**\n * Array of strings to populate row header cells.\n * @type {string[]}\n */\n @property({ type: Array }) rowHeader: string[] = [];\n\n /**\n * Array of strings to populate column header cells.\n * Only used when `headerPosition` is set to \"vertical\" or \"both\".\n * @type {string[]}\n */\n @property({ type: Array }) columnHeader: string[] = [];\n\n /**\n * Two-dimensional array of strings or numbers to populate table data cells.\n * @type {Array<(string | number)[]>}\n */\n @property({ type: Array }) tableData: Array<(string | number)[]> = [];\n\n /**\n * Defines the placement of headers in the table.\n * Use \"horizontal\" for top headers only, \"vertical\" for left headers only,\n * or \"both\" for both row and column headers.\n * @type {\"horizontal\" | \"vertical\" | \"both\"}\n * @default \"horizontal\"\n */\n @property({ type: String, reflect: true }) headerPosition: HeaderPosition = \"horizontal\";\n\n /**\n * Enables background styling on horizontal header rows.\n * When true, applies background color to header cells for better visual distinction.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) headerBackground = false;\n\n /**\n * Enables borders around table cells.\n * When true, displays visible borders between all table cells.\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean, reflect: true }) tableBorder = false;\n\n /**\n * Controls the CSS `table-layout` algorithm.\n * Use \"auto\" to let the browser size columns based on content, or \"fixed\" to distribute column widths evenly regardless of content.\n * @type {\"auto\" | \"fixed\"}\n * @default \"auto\"\n */\n @property({ type: String, reflect: true }) layout: \"auto\" | \"fixed\" = \"auto\";\n\n /**\n * Indicates the presence of the default slot.\n * Used for server-side rendering to determine table structure.\n * @type {boolean}\n * @internal\n * @default false\n */\n @property({ type: Boolean }) hasDefaultSlot = false;\n\n @provide({ context: TableHeaderBackgroundContext })\n @state()\n private _headerBackground = false;\n\n /** @internal */\n private readonly hasSlotController = new HasSlotController(this, \"[default]\");\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n updated() {\n if (!this.hasDefaultSlot) this.hasDefaultSlot = this.hasSlotController.test(\"[default]\");\n this._headerBackground = this.headerBackground;\n }\n\n private _renderTable() {\n if (this.headerPosition === \"horizontal\") {\n return html`\n <thead>\n <tr>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n row => html`\n <tr>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"both\") {\n return html`\n <thead>\n <tr>\n <th><div></div></th>\n ${this.rowHeader.map((header: string) => html` <th><div>${header}</div></th> `)}\n </tr>\n </thead>\n <tbody>\n ${this.tableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n </tbody>\n `;\n }\n\n if (this.headerPosition === \"vertical\") {\n const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));\n\n return html`\n ${flippedTableData.map(\n (row, index) => html`\n <tr>\n <th><div>${this.columnHeader[index]}</div></th>\n ${row.map((cell: string | number) => html`<td><div>${cell}</div></td>`)}\n </tr>\n `\n )}\n `;\n }\n }\n\n render() {\n return html`\n <div\n class=${classMap({\n \"table-responsive\": this.responsive === \"always\",\n \"table-responsive-sm\": this.responsive === \"sm\",\n \"table-responsive-md\": this.responsive === \"md\",\n \"table-responsive-lg\": this.responsive === \"lg\",\n \"table-responsive-xl\": this.responsive === \"xl\"\n })}\n tabindex=\"0\"\n >\n <div role=\"table\">\n <slot id=\"table-slot\" class=${classMap({ table: true, \"no-border\": !this.hasDefaultSlot })}></slot>\n\n ${!this.hasDefaultSlot\n ? html`<table class=\"table\">\n ${this._renderTable()}\n </table>`\n : \"\"}\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTable;\n"],"names":["tableStyle"],"mappings":";;;;;;;;;;;AAYA;;;;;AAKG;AAEG,MAAO,SAAU,SAAQ,WAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAcE;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAAa,EAAE,CAAC;AAEpD;;;;AAIG;QACwB,IAAY,CAAA,YAAA,GAAa,EAAE,CAAC;AAEvD;;;AAGG;QACwB,IAAS,CAAA,SAAA,GAA+B,EAAE,CAAC;AAEtE;;;;;;AAMG;QACwC,IAAc,CAAA,cAAA,GA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