@govtechsg/sgds-web-component 3.21.0 → 3.21.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Masthead/index.js +1 -1
- 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/combo-box.js +1 -1
- package/components/ComboBox/index.umd.min.js +6 -5
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +1 -0
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +12 -13
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +2 -3
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.js +8 -4
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Masthead/index.umd.min.js +1 -1
- package/components/Masthead/index.umd.min.js.map +1 -1
- package/components/Masthead/masthead.js +1 -1
- package/components/QuantityToggle/index.umd.min.js +3 -4
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Tab/index.umd.min.js +1 -1
- package/components/Tab/index.umd.min.js.map +1 -1
- package/components/Tab/sgds-tab-panel.js +1 -0
- package/components/Tab/sgds-tab-panel.js.map +1 -1
- package/components/index.umd.min.js +11 -11
- package/components/index.umd.min.js.map +1 -1
- package/custom-elements.json +1 -1
- package/index.umd.min.js +11 -11
- 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/ComboBox/combo-box.cjs.js +1 -1
- package/react/components/ComboBox/combo-box.js +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +1 -0
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +1 -0
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +8 -4
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +8 -4
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/Masthead/masthead.cjs.js +1 -1
- package/react/components/Masthead/masthead.js +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/react/components/Tab/sgds-tab-panel.cjs.js +1 -0
- package/react/components/Tab/sgds-tab-panel.cjs.js.map +1 -1
- package/react/components/Tab/sgds-tab-panel.js +1 -0
- package/react/components/Tab/sgds-tab-panel.js.map +1 -1
- package/themes/day.css +1 -0
- package/themes/night.css +1 -0
- package/types/react.d.ts +73 -73
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-quantity-toggle.cjs.js","sources":["../../../../src/components/QuantityToggle/sgds-quantity-toggle.ts"],"sourcesContent":["import { property, query, queryAsync } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { html } from \"lit/static-html.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport formPlaceholderStyles from \"../../styles/form-placeholder.css\";\nimport svgStyles from \"../../styles/svg.css\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport SgdsIconButton from \"../IconButton/sgds-icon-button\";\nimport SgdsInput from \"../Input/sgds-input\";\nimport quantityToggleStyle from \"./quantity-toggle.css\";\nimport formControlStyle from \"../../styles/form-text-control.css\";\n/**\n * @summary The quantity toggle component is used to increase or decrease an incremental venue, best used when the user needs to enter or adjust the quantity of a selected item.\n *\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when an alteration to the control's value is committed by the user.\n * @event sgds-input - Emitted when the control receives input and its value changes.\n *\n */\nexport class SgdsQuantityToggle extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [\n ...FormControlElement.styles,\n formPlaceholderStyles,\n svgStyles,\n formControlStyle,\n quantityToggleStyle\n ];\n\n /** @internal */\n static dependencies = {\n \"sgds-input\": SgdsInput,\n \"sgds-icon-button\": SgdsIconButton\n };\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='increase by']\") private plusBtn: HTMLButtonElement;\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='decrease by']\") private minusBtn: HTMLButtonElement;\n\n /** The input's value. Set to 0 by default */\n @property({ type: Number, reflect: true }) value = 0;\n\n /** Controls the incremental / decremental value of the input */\n @property({ type: Number }) step = 1;\n\n /** The input's minimum value. Only applies number input types. */\n @property({ type: Number }) min: number;\n\n /** The input's maximum value. Only applies number input types. */\n @property({ type: Number }) max: number;\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: String, reflect: true }) hasFeedback: \"style\" | \"text\" | \"both\";\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback: string;\n /** Sets the quantity toggle as readonly */\n @property({ type: Boolean, reflect: true }) readonly = false;\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 = 0;\n\n @queryAsync(\"sgds-input\") private _sgdsInput: Promise<SgdsInput>;\n\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 * 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 private async _handleChange() {\n const sgdsInput = await this._sgdsInput;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n this.invalid = !this._mixinReportValidity();\n }\n private async _handleInputChange() {\n const sgdsInput = await this._sgdsInput;\n this.invalid = false;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n }\n\n private async _mixinResetFormControl() {\n const sgdsInput = await this._sgdsInput;\n this.value = this.defaultValue;\n sgdsInput.input.value = this.value.toString();\n this._mixinResetValidity(sgdsInput.input);\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const allowedKeys = [\n \"Backspace\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n ...Array.from(Array(10).keys()).map(key => key.toString()),\n \"Tab\"\n ];\n\n // Allow keydown event only if the pressed key is in the allowedKeys array\n if (!allowedKeys.includes(event.key)) {\n event.preventDefault();\n }\n }\n\n private _handleInvalid() {\n this.invalid = true;\n }\n private _handleValid() {\n this.invalid = false;\n }\n\n /** Simulates a click on the plus button */\n public plus() {\n this.plusBtn.click();\n }\n\n /** Simulates a click on the minus button */\n public minus() {\n this.minusBtn.click();\n }\n\n private async _onPlus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n this.value = parseInt(sgdsInput.value) + parseInt(sgdsInput.step.toString());\n this._validateOnClick(sgdsInput.input);\n }\n private async _onMinus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n if (this.value < this.step) {\n this.value = 0;\n } else {\n this.value = parseInt(sgdsInput.value) - parseInt(sgdsInput.step.toString());\n }\n\n this._validateOnClick(sgdsInput.input);\n }\n\n /**\n * Validates the input on button clicks of the toggle.\n * Input is validated every time the button is click to update the invalid state\n * to indiciate the validity of quantity toggle\n * @param input native HTMLInputElement\n */\n private async _validateOnClick(input: HTMLInputElement) {\n const sgdsInput = await this._sgdsInput;\n await sgdsInput.updateComplete;\n this._mixinSetFormValue();\n this._mixinValidate(input);\n this.invalid = !this._mixinReportValidity();\n }\n\n protected _renderFeedback() {\n const wantFeedbackText = this.hasFeedback === \"both\" || this.hasFeedback === \"text\";\n return this.invalid && wantFeedbackText\n ? html` <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"${this._controlId}-invalid\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.validationMessage}\n </div>\n </div>`\n : html`${this._renderHintText()}`;\n }\n\n protected _renderLabel() {\n const labelTemplate = html`\n <label\n for=${this._controlId}\n id=${this._labelId}\n class=${classMap({\n \"form-label\": true,\n disabled: this.disabled\n })}\n >${this.label}</label\n >\n `;\n return this.label && labelTemplate;\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n\n render() {\n return html`\n <div class=\"form-control-container m-width-160\">\n ${this._renderLabel()}\n <div class=\"input-group\">\n <sgds-icon-button\n class=\"minus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`decrease by ${this.step}`}\n ?disabled=${this.disabled ||\n (this.min !== undefined ? this.value <= this.min : this.value < 1) ||\n this.readonly}\n @click=${this._onMinus}\n name=\"dash\"\n >\n </sgds-icon-button>\n <sgds-input\n type=\"number\"\n class=\"quantity-toggle\"\n name=${ifDefined(this.name)}\n step=${ifDefined(this.step)}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n .value=${live(this.value)}\n @sgds-change=${this._handleChange}\n @sgds-input=${this._handleInputChange}\n @sgds-invalid=${this._handleInvalid}\n @sgds-valid=${this._handleValid}\n @keydown=${this._handleKeyDown}\n ?disabled=${this.disabled}\n id=${this._controlId}\n ?invalid=${this.invalid}\n hasFeedback=${ifDefined(this.hasFeedback !== \"text\" ? \"style\" : undefined)}\n ></sgds-input>\n <sgds-icon-button\n class=\"plus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`increase by ${this.step}`}\n @click=${this._onPlus}\n ?disabled=${this.disabled ||\n (this.max !== undefined && this.max && this.value >= this.max) ||\n this.readonly}\n name=\"plus\"\n >\n </sgds-icon-button>\n </div>\n <div id=\"announcer\" role=\"region\" aria-live=\"assertive\" class=\"visually-hidden\">${this.value}</div>\n ${this._renderFeedback()}\n </div>\n `;\n }\n}\n\nexport default SgdsQuantityToggle;\n"],"names":["SgdsFormValidatorMixin","FormControlElement","html","classMap","ifDefined","live","formPlaceholderStyles","svgStyles","formControlStyle","quantityToggleStyle","SgdsInput","SgdsIconButton","__decorate","query","property","defaultValue","queryAsync"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;;;AAQG;MACU,kBAAmB,SAAQA,qCAAsB,CAACC,6BAAkB,CAAC,CAAA;AAAlF,IAAA,WAAA,GAAA;;;QAoB6C,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;;QAGzB,IAAI,CAAA,IAAA,GAAG,CAAC,CAAC;;QAaO,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAI7D,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC;KA6NlB;AAzNC;;;AAGG;IACI,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC;KACpC;AACD;;AAEG;IACI,aAAa,GAAA;AAClB,QAAA,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;KACnC;AAED;;AAEG;AACH,IAAA,IAAW,QAAQ,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;KACjC;AACD;;AAEG;AACH,IAAA,IAAW,iBAAiB,GAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,0BAA0B,EAAE,CAAC;KAC1C;AAEO,IAAA,MAAM,aAAa,GAAA;AACzB,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC;AACxC,QAAA,IAAI,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,KAAK,KAAK,EAAE,EAAE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,CAAC;AAAkB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI7DF,gBAAA,CAAA;AADC,IAAAG,yBAAY,EAAE;AACE,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEiBH,gBAAA,CAAA;IAAjCI,wBAAU,CAAC,YAAY,CAAC;AAAwC,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-quantity-toggle.cjs.js","sources":["../../../../src/components/QuantityToggle/sgds-quantity-toggle.ts"],"sourcesContent":["import { property, query, queryAsync } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { html } from \"lit/static-html.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport formPlaceholderStyles from \"../../styles/form-placeholder.css\";\nimport svgStyles from \"../../styles/svg.css\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport SgdsIconButton from \"../IconButton/sgds-icon-button\";\nimport SgdsInput from \"../Input/sgds-input\";\nimport quantityToggleStyle from \"./quantity-toggle.css\";\nimport formControlStyle from \"../../styles/form-text-control.css\";\n/**\n * @summary The quantity toggle component is used to increase or decrease an incremental venue, best used when the user needs to enter or adjust the quantity of a selected item.\n *\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when an alteration to the control's value is committed by the user.\n * @event sgds-input - Emitted when the control receives input and its value changes.\n *\n */\nexport class SgdsQuantityToggle extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [\n ...FormControlElement.styles,\n formPlaceholderStyles,\n svgStyles,\n formControlStyle,\n quantityToggleStyle\n ];\n\n /** @internal */\n static dependencies = {\n \"sgds-input\": SgdsInput,\n \"sgds-icon-button\": SgdsIconButton\n };\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='increase by']\") private plusBtn: HTMLButtonElement;\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='decrease by']\") private minusBtn: HTMLButtonElement;\n\n /** The input's value. Set to 0 by default */\n @property({ type: Number, reflect: true }) value = 0;\n\n /** Controls the incremental / decremental value of the input */\n @property({ type: Number }) step = 1;\n\n /** The input's minimum value. Only applies number input types. */\n @property({ type: Number }) min: number;\n\n /** The input's maximum value. Only applies number input types. */\n @property({ type: Number }) max: number;\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: String, reflect: true }) hasFeedback: \"style\" | \"text\" | \"both\";\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback: string;\n /** Sets the quantity toggle as readonly */\n @property({ type: Boolean, reflect: true }) readonly = false;\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 = 0;\n\n @queryAsync(\"sgds-input\") private _sgdsInput: Promise<SgdsInput>;\n\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 * 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 private async _handleChange() {\n const sgdsInput = await this._sgdsInput;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n this.invalid = !this._mixinReportValidity();\n }\n private async _handleInputChange() {\n const sgdsInput = await this._sgdsInput;\n this.invalid = false;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n }\n\n private async _mixinResetFormControl() {\n const sgdsInput = await this._sgdsInput;\n this.value = this.defaultValue;\n sgdsInput.input.value = this.value.toString();\n this._mixinResetValidity(sgdsInput.input);\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const allowedKeys = [\n \"Backspace\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n ...Array.from(Array(10).keys()).map(key => key.toString()),\n \"Tab\"\n ];\n\n // Allow keydown event only if the pressed key is in the allowedKeys array\n if (!allowedKeys.includes(event.key)) {\n event.preventDefault();\n }\n }\n\n private _handleInvalid() {\n this.invalid = true;\n }\n private _handleValid() {\n this.invalid = false;\n }\n\n /** Simulates a click on the plus button */\n public plus() {\n this.plusBtn.click();\n }\n\n /** Simulates a click on the minus button */\n public minus() {\n this.minusBtn.click();\n }\n\n private async _onPlus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n this.value = parseInt(sgdsInput.value) + parseInt(sgdsInput.step.toString());\n this._validateOnClick(sgdsInput.input);\n }\n private async _onMinus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n if (this.value < this.step) {\n this.value = 0;\n } else {\n this.value = parseInt(sgdsInput.value) - parseInt(sgdsInput.step.toString());\n }\n\n this._validateOnClick(sgdsInput.input);\n }\n\n /**\n * Validates the input on button clicks of the toggle.\n * Input is validated every time the button is click to update the invalid state\n * to indiciate the validity of quantity toggle\n * @param input native HTMLInputElement\n */\n private async _validateOnClick(input: HTMLInputElement) {\n const sgdsInput = await this._sgdsInput;\n await sgdsInput.updateComplete;\n this._mixinSetFormValue();\n this._mixinValidate(input);\n this.invalid = !this._mixinReportValidity();\n }\n\n protected _renderFeedback() {\n const wantFeedbackText = this.hasFeedback === \"both\" || this.hasFeedback === \"text\";\n return this.invalid && wantFeedbackText\n ? html` <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"${this._controlId}-invalid\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.validationMessage}\n </div>\n </div>`\n : html`${this._renderHintText()}`;\n }\n\n protected _renderLabel() {\n const labelTemplate = html`\n <label\n for=${this._controlId}\n id=${this._labelId}\n class=${classMap({\n \"form-label\": true,\n disabled: this.disabled\n })}\n >${this.label}</label\n >\n `;\n return this.label && labelTemplate;\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n\n render() {\n return html`\n <div class=\"form-control-container m-width-160\">\n ${this._renderLabel()}\n <div class=\"input-group\">\n <sgds-icon-button\n class=\"minus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`decrease by ${this.step}`}\n ?disabled=${this.disabled ||\n (this.min !== undefined ? this.value <= this.min : this.value < 1) ||\n this.readonly}\n @click=${this._onMinus}\n name=\"dash\"\n >\n </sgds-icon-button>\n <sgds-input\n type=\"number\"\n class=\"quantity-toggle\"\n name=${ifDefined(this.name)}\n step=${ifDefined(this.step)}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n .value=${live(this.value)}\n @sgds-change=${this._handleChange}\n @sgds-input=${this._handleInputChange}\n @sgds-invalid=${this._handleInvalid}\n @sgds-valid=${this._handleValid}\n @keydown=${this._handleKeyDown}\n ?disabled=${this.disabled}\n id=${this._controlId}\n ?invalid=${this.invalid}\n hasFeedback=${ifDefined(this.hasFeedback !== \"text\" ? \"style\" : undefined)}\n ></sgds-input>\n <sgds-icon-button\n class=\"plus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`increase by ${this.step}`}\n @click=${this._onPlus}\n ?disabled=${this.disabled ||\n (this.max !== undefined && this.max && this.value >= this.max) ||\n this.readonly}\n name=\"plus\"\n >\n </sgds-icon-button>\n </div>\n <div id=\"${this._controlId}-announcer\" aria-live=\"assertive\" class=\"visually-hidden\">${this.value}</div>\n ${this._renderFeedback()}\n </div>\n `;\n }\n}\n\nexport default SgdsQuantityToggle;\n"],"names":["SgdsFormValidatorMixin","FormControlElement","html","classMap","ifDefined","live","formPlaceholderStyles","svgStyles","formControlStyle","quantityToggleStyle","SgdsInput","SgdsIconButton","__decorate","query","property","defaultValue","queryAsync"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;;;AAQG;MACU,kBAAmB,SAAQA,qCAAsB,CAACC,6BAAkB,CAAC,CAAA;AAAlF,IAAA,WAAA,GAAA;;;QAoB6C,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;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236
236
|
</div>
|
|
237
|
-
<div id="announcer"
|
|
237
|
+
<div id="${this._controlId}-announcer" aria-live="assertive" class="visually-hidden">${this.value}</div>
|
|
238
238
|
${this._renderFeedback()}
|
|
239
239
|
</div>
|
|
240
240
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-quantity-toggle.js","sources":["../../../../src/components/QuantityToggle/sgds-quantity-toggle.ts"],"sourcesContent":["import { property, query, queryAsync } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { html } from \"lit/static-html.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport formPlaceholderStyles from \"../../styles/form-placeholder.css\";\nimport svgStyles from \"../../styles/svg.css\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport SgdsIconButton from \"../IconButton/sgds-icon-button\";\nimport SgdsInput from \"../Input/sgds-input\";\nimport quantityToggleStyle from \"./quantity-toggle.css\";\nimport formControlStyle from \"../../styles/form-text-control.css\";\n/**\n * @summary The quantity toggle component is used to increase or decrease an incremental venue, best used when the user needs to enter or adjust the quantity of a selected item.\n *\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when an alteration to the control's value is committed by the user.\n * @event sgds-input - Emitted when the control receives input and its value changes.\n *\n */\nexport class SgdsQuantityToggle extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [\n ...FormControlElement.styles,\n formPlaceholderStyles,\n svgStyles,\n formControlStyle,\n quantityToggleStyle\n ];\n\n /** @internal */\n static dependencies = {\n \"sgds-input\": SgdsInput,\n \"sgds-icon-button\": SgdsIconButton\n };\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='increase by']\") private plusBtn: HTMLButtonElement;\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='decrease by']\") private minusBtn: HTMLButtonElement;\n\n /** The input's value. Set to 0 by default */\n @property({ type: Number, reflect: true }) value = 0;\n\n /** Controls the incremental / decremental value of the input */\n @property({ type: Number }) step = 1;\n\n /** The input's minimum value. Only applies number input types. */\n @property({ type: Number }) min: number;\n\n /** The input's maximum value. Only applies number input types. */\n @property({ type: Number }) max: number;\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: String, reflect: true }) hasFeedback: \"style\" | \"text\" | \"both\";\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback: string;\n /** Sets the quantity toggle as readonly */\n @property({ type: Boolean, reflect: true }) readonly = false;\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 = 0;\n\n @queryAsync(\"sgds-input\") private _sgdsInput: Promise<SgdsInput>;\n\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 * 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 private async _handleChange() {\n const sgdsInput = await this._sgdsInput;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n this.invalid = !this._mixinReportValidity();\n }\n private async _handleInputChange() {\n const sgdsInput = await this._sgdsInput;\n this.invalid = false;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n }\n\n private async _mixinResetFormControl() {\n const sgdsInput = await this._sgdsInput;\n this.value = this.defaultValue;\n sgdsInput.input.value = this.value.toString();\n this._mixinResetValidity(sgdsInput.input);\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const allowedKeys = [\n \"Backspace\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n ...Array.from(Array(10).keys()).map(key => key.toString()),\n \"Tab\"\n ];\n\n // Allow keydown event only if the pressed key is in the allowedKeys array\n if (!allowedKeys.includes(event.key)) {\n event.preventDefault();\n }\n }\n\n private _handleInvalid() {\n this.invalid = true;\n }\n private _handleValid() {\n this.invalid = false;\n }\n\n /** Simulates a click on the plus button */\n public plus() {\n this.plusBtn.click();\n }\n\n /** Simulates a click on the minus button */\n public minus() {\n this.minusBtn.click();\n }\n\n private async _onPlus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n this.value = parseInt(sgdsInput.value) + parseInt(sgdsInput.step.toString());\n this._validateOnClick(sgdsInput.input);\n }\n private async _onMinus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n if (this.value < this.step) {\n this.value = 0;\n } else {\n this.value = parseInt(sgdsInput.value) - parseInt(sgdsInput.step.toString());\n }\n\n this._validateOnClick(sgdsInput.input);\n }\n\n /**\n * Validates the input on button clicks of the toggle.\n * Input is validated every time the button is click to update the invalid state\n * to indiciate the validity of quantity toggle\n * @param input native HTMLInputElement\n */\n private async _validateOnClick(input: HTMLInputElement) {\n const sgdsInput = await this._sgdsInput;\n await sgdsInput.updateComplete;\n this._mixinSetFormValue();\n this._mixinValidate(input);\n this.invalid = !this._mixinReportValidity();\n }\n\n protected _renderFeedback() {\n const wantFeedbackText = this.hasFeedback === \"both\" || this.hasFeedback === \"text\";\n return this.invalid && wantFeedbackText\n ? html` <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"${this._controlId}-invalid\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.validationMessage}\n </div>\n </div>`\n : html`${this._renderHintText()}`;\n }\n\n protected _renderLabel() {\n const labelTemplate = html`\n <label\n for=${this._controlId}\n id=${this._labelId}\n class=${classMap({\n \"form-label\": true,\n disabled: this.disabled\n })}\n >${this.label}</label\n >\n `;\n return this.label && labelTemplate;\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n\n render() {\n return html`\n <div class=\"form-control-container m-width-160\">\n ${this._renderLabel()}\n <div class=\"input-group\">\n <sgds-icon-button\n class=\"minus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`decrease by ${this.step}`}\n ?disabled=${this.disabled ||\n (this.min !== undefined ? this.value <= this.min : this.value < 1) ||\n this.readonly}\n @click=${this._onMinus}\n name=\"dash\"\n >\n </sgds-icon-button>\n <sgds-input\n type=\"number\"\n class=\"quantity-toggle\"\n name=${ifDefined(this.name)}\n step=${ifDefined(this.step)}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n .value=${live(this.value)}\n @sgds-change=${this._handleChange}\n @sgds-input=${this._handleInputChange}\n @sgds-invalid=${this._handleInvalid}\n @sgds-valid=${this._handleValid}\n @keydown=${this._handleKeyDown}\n ?disabled=${this.disabled}\n id=${this._controlId}\n ?invalid=${this.invalid}\n hasFeedback=${ifDefined(this.hasFeedback !== \"text\" ? \"style\" : undefined)}\n ></sgds-input>\n <sgds-icon-button\n class=\"plus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`increase by ${this.step}`}\n @click=${this._onPlus}\n ?disabled=${this.disabled ||\n (this.max !== undefined && this.max && this.value >= this.max) ||\n this.readonly}\n name=\"plus\"\n >\n </sgds-icon-button>\n </div>\n <div id=\"announcer\" role=\"region\" aria-live=\"assertive\" class=\"visually-hidden\">${this.value}</div>\n ${this._renderFeedback()}\n </div>\n `;\n }\n}\n\nexport default SgdsQuantityToggle;\n"],"names":["formPlaceholderStyles","svgStyles","formControlStyle","quantityToggleStyle"],"mappings":";;;;;;;;;;;;;;;;;AAeA;;;;;;;;AAQG;MACU,kBAAmB,SAAQ,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;AAAlF,IAAA,WAAA,GAAA;;;QAoB6C,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;;QAGzB,IAAI,CAAA,IAAA,GAAG,CAAC,CAAC;;QAaO,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAI7D,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC;KA6NlB;AAzNC;;;AAGG;IACI,cAAc,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC;KACpC;AACD;;AAEG;IACI,aAAa,GAAA;AAClB,QAA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EAAE,IAAI,EAAE,CAAC;AAAwC,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,aAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGvC,UAAA,CAAA;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAyB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEvB,UAAA,CAAA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAkB,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI7D,UAAA,CAAA;AADC,IAAA,YAAY,EAAE;AACE,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEiB,UAAA,CAAA;IAAjC,UAAU,CAAC,YAAY,CAAC;AAAwC,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-quantity-toggle.js","sources":["../../../../src/components/QuantityToggle/sgds-quantity-toggle.ts"],"sourcesContent":["import { property, query, queryAsync } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { html } from \"lit/static-html.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport formPlaceholderStyles from \"../../styles/form-placeholder.css\";\nimport svgStyles from \"../../styles/svg.css\";\nimport { defaultValue } from \"../../utils/defaultvalue\";\nimport { SgdsFormControl } from \"../../utils/formSubmitController\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport SgdsIconButton from \"../IconButton/sgds-icon-button\";\nimport SgdsInput from \"../Input/sgds-input\";\nimport quantityToggleStyle from \"./quantity-toggle.css\";\nimport formControlStyle from \"../../styles/form-text-control.css\";\n/**\n * @summary The quantity toggle component is used to increase or decrease an incremental venue, best used when the user needs to enter or adjust the quantity of a selected item.\n *\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when an alteration to the control's value is committed by the user.\n * @event sgds-input - Emitted when the control receives input and its value changes.\n *\n */\nexport class SgdsQuantityToggle extends SgdsFormValidatorMixin(FormControlElement) implements SgdsFormControl {\n static styles = [\n ...FormControlElement.styles,\n formPlaceholderStyles,\n svgStyles,\n formControlStyle,\n quantityToggleStyle\n ];\n\n /** @internal */\n static dependencies = {\n \"sgds-input\": SgdsInput,\n \"sgds-icon-button\": SgdsIconButton\n };\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='increase by']\") private plusBtn: HTMLButtonElement;\n /** @internal */\n @query(\"sgds-icon-button[ariaLabel^='decrease by']\") private minusBtn: HTMLButtonElement;\n\n /** The input's value. Set to 0 by default */\n @property({ type: Number, reflect: true }) value = 0;\n\n /** Controls the incremental / decremental value of the input */\n @property({ type: Number }) step = 1;\n\n /** The input's minimum value. Only applies number input types. */\n @property({ type: Number }) min: number;\n\n /** The input's maximum value. Only applies number input types. */\n @property({ type: Number }) max: number;\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: String, reflect: true }) hasFeedback: \"style\" | \"text\" | \"both\";\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback: string;\n /** Sets the quantity toggle as readonly */\n @property({ type: Boolean, reflect: true }) readonly = false;\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 = 0;\n\n @queryAsync(\"sgds-input\") private _sgdsInput: Promise<SgdsInput>;\n\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 * 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 private async _handleChange() {\n const sgdsInput = await this._sgdsInput;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n this.invalid = !this._mixinReportValidity();\n }\n private async _handleInputChange() {\n const sgdsInput = await this._sgdsInput;\n this.invalid = false;\n if (parseInt(sgdsInput.value) < this.step || sgdsInput.value === \"\") {\n sgdsInput.value = \"0\";\n }\n this.value = parseInt(sgdsInput.value);\n this._mixinSetFormValue();\n this._mixinValidate(sgdsInput.input);\n }\n\n private async _mixinResetFormControl() {\n const sgdsInput = await this._sgdsInput;\n this.value = this.defaultValue;\n sgdsInput.input.value = this.value.toString();\n this._mixinResetValidity(sgdsInput.input);\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const allowedKeys = [\n \"Backspace\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n ...Array.from(Array(10).keys()).map(key => key.toString()),\n \"Tab\"\n ];\n\n // Allow keydown event only if the pressed key is in the allowedKeys array\n if (!allowedKeys.includes(event.key)) {\n event.preventDefault();\n }\n }\n\n private _handleInvalid() {\n this.invalid = true;\n }\n private _handleValid() {\n this.invalid = false;\n }\n\n /** Simulates a click on the plus button */\n public plus() {\n this.plusBtn.click();\n }\n\n /** Simulates a click on the minus button */\n public minus() {\n this.minusBtn.click();\n }\n\n private async _onPlus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n this.value = parseInt(sgdsInput.value) + parseInt(sgdsInput.step.toString());\n this._validateOnClick(sgdsInput.input);\n }\n private async _onMinus(event: MouseEvent) {\n const sgdsInput = await this._sgdsInput;\n event.preventDefault();\n event.stopPropagation();\n if (this.value < this.step) {\n this.value = 0;\n } else {\n this.value = parseInt(sgdsInput.value) - parseInt(sgdsInput.step.toString());\n }\n\n this._validateOnClick(sgdsInput.input);\n }\n\n /**\n * Validates the input on button clicks of the toggle.\n * Input is validated every time the button is click to update the invalid state\n * to indiciate the validity of quantity toggle\n * @param input native HTMLInputElement\n */\n private async _validateOnClick(input: HTMLInputElement) {\n const sgdsInput = await this._sgdsInput;\n await sgdsInput.updateComplete;\n this._mixinSetFormValue();\n this._mixinValidate(input);\n this.invalid = !this._mixinReportValidity();\n }\n\n protected _renderFeedback() {\n const wantFeedbackText = this.hasFeedback === \"both\" || this.hasFeedback === \"text\";\n return this.invalid && wantFeedbackText\n ? html` <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"${this._controlId}-invalid\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.validationMessage}\n </div>\n </div>`\n : html`${this._renderHintText()}`;\n }\n\n protected _renderLabel() {\n const labelTemplate = html`\n <label\n for=${this._controlId}\n id=${this._labelId}\n class=${classMap({\n \"form-label\": true,\n disabled: this.disabled\n })}\n >${this.label}</label\n >\n `;\n return this.label && labelTemplate;\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n\n render() {\n return html`\n <div class=\"form-control-container m-width-160\">\n ${this._renderLabel()}\n <div class=\"input-group\">\n <sgds-icon-button\n class=\"minus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`decrease by ${this.step}`}\n ?disabled=${this.disabled ||\n (this.min !== undefined ? this.value <= this.min : this.value < 1) ||\n this.readonly}\n @click=${this._onMinus}\n name=\"dash\"\n >\n </sgds-icon-button>\n <sgds-input\n type=\"number\"\n class=\"quantity-toggle\"\n name=${ifDefined(this.name)}\n step=${ifDefined(this.step)}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n .value=${live(this.value)}\n @sgds-change=${this._handleChange}\n @sgds-input=${this._handleInputChange}\n @sgds-invalid=${this._handleInvalid}\n @sgds-valid=${this._handleValid}\n @keydown=${this._handleKeyDown}\n ?disabled=${this.disabled}\n id=${this._controlId}\n ?invalid=${this.invalid}\n hasFeedback=${ifDefined(this.hasFeedback !== \"text\" ? \"style\" : undefined)}\n ></sgds-input>\n <sgds-icon-button\n class=\"plus-btn\"\n variant=\"outline\"\n tone=\"neutral\"\n size=\"md\"\n ariaLabel=${`increase by ${this.step}`}\n @click=${this._onPlus}\n ?disabled=${this.disabled ||\n (this.max !== undefined && this.max && this.value >= this.max) ||\n this.readonly}\n name=\"plus\"\n >\n </sgds-icon-button>\n </div>\n <div id=\"${this._controlId}-announcer\" aria-live=\"assertive\" class=\"visually-hidden\">${this.value}</div>\n ${this._renderFe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AA,kBAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-tab-panel.cjs.js","sources":["../../../../src/components/Tab/sgds-tab-panel.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { watch } from \"../../utils/watch\";\nimport tabPanelStyles from \"./tab-panel.css\";\n\nlet id = 0;\n\n/**\n * @summary Tab panels are used inside tab groups to display tabbed content.\n * @slot - The tab panel's content.\n *\n */\nexport class SgdsTabPanel extends SgdsElement {\n static styles = [...SgdsElement.styles, tabPanelStyles];\n private readonly attrId = ++id;\n private readonly componentId = `sgds-tab-panel-${this.attrId}`;\n /** The tab panel's name. */\n @property({ reflect: true }) name = \"\";\n\n /** When true, the tab panel will be shown. When used with tab-group, this property is already being managed */\n @property({ type: Boolean, reflect: true }) active = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.id = this.id.length > 0 ? this.id : this.componentId;\n this.setAttribute(\"role\", \"tabpanel\");\n }\n\n @watch(\"active\")\n _handleActiveChange() {\n this.setAttribute(\"aria-hidden\", this.active ? \"false\" : \"true\");\n }\n\n render() {\n return html`\n <slot\n class=${classMap({\n \"tab-panel\": true,\n \"tab-panel--active\": this.active\n })}\n ></slot>\n `;\n }\n}\n\nexport default SgdsTabPanel;\n"],"names":["SgdsElement","html","classMap","tabPanelStyles","__decorate","property","watch"],"mappings":";;;;;;;;;;;;;AAOA,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;AAIG;AACG,MAAO,YAAa,SAAQA,sBAAW,CAAA;AAA7C,IAAA,WAAA,GAAA;;QAEmB,IAAM,CAAA,MAAA,GAAG,EAAE,EAAE,CAAC;AACd,QAAA,IAAA,CAAA,WAAW,GAAG,CAAkB,eAAA,EAAA,IAAI,CAAC,MAAM,EAAE,CAAC;;QAElC,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;;QAGK,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sgds-tab-panel.cjs.js","sources":["../../../../src/components/Tab/sgds-tab-panel.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { watch } from \"../../utils/watch\";\nimport tabPanelStyles from \"./tab-panel.css\";\n\nlet id = 0;\n\n/**\n * @summary Tab panels are used inside tab groups to display tabbed content.\n * @slot - The tab panel's content.\n *\n */\nexport class SgdsTabPanel extends SgdsElement {\n static styles = [...SgdsElement.styles, tabPanelStyles];\n private readonly attrId = ++id;\n private readonly componentId = `sgds-tab-panel-${this.attrId}`;\n /** The tab panel's name. */\n @property({ reflect: true }) name = \"\";\n\n /** When true, the tab panel will be shown. When used with tab-group, this property is already being managed */\n @property({ type: Boolean, reflect: true }) active = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.id = this.id.length > 0 ? this.id : this.componentId;\n this.setAttribute(\"role\", \"tabpanel\");\n }\n\n @watch(\"active\")\n _handleActiveChange() {\n this.setAttribute(\"aria-hidden\", this.active ? \"false\" : \"true\");\n this.inert = !this.active;\n }\n\n render() {\n return html`\n <slot\n class=${classMap({\n \"tab-panel\": true,\n \"tab-panel--active\": this.active\n })}\n ></slot>\n `;\n }\n}\n\nexport default SgdsTabPanel;\n"],"names":["SgdsElement","html","classMap","tabPanelStyles","__decorate","property","watch"],"mappings":";;;;;;;;;;;;;AAOA,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;AAIG;AACG,MAAO,YAAa,SAAQA,sBAAW,CAAA;AAA7C,IAAA,WAAA,GAAA;;QAEmB,IAAM,CAAA,MAAA,GAAG,EAAE,EAAE,CAAC;AACd,QAAA,IAAA,CAAA,WAAW,GAAG,CAAkB,eAAA,EAAA,IAAI,CAAC,MAAM,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AAC,QAAQ,CAAC;AAIf,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,qBAAA,EAAA,IAAA,CAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-tab-panel.js","sources":["../../../../src/components/Tab/sgds-tab-panel.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { watch } from \"../../utils/watch\";\nimport tabPanelStyles from \"./tab-panel.css\";\n\nlet id = 0;\n\n/**\n * @summary Tab panels are used inside tab groups to display tabbed content.\n * @slot - The tab panel's content.\n *\n */\nexport class SgdsTabPanel extends SgdsElement {\n static styles = [...SgdsElement.styles, tabPanelStyles];\n private readonly attrId = ++id;\n private readonly componentId = `sgds-tab-panel-${this.attrId}`;\n /** The tab panel's name. */\n @property({ reflect: true }) name = \"\";\n\n /** When true, the tab panel will be shown. When used with tab-group, this property is already being managed */\n @property({ type: Boolean, reflect: true }) active = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.id = this.id.length > 0 ? this.id : this.componentId;\n this.setAttribute(\"role\", \"tabpanel\");\n }\n\n @watch(\"active\")\n _handleActiveChange() {\n this.setAttribute(\"aria-hidden\", this.active ? \"false\" : \"true\");\n }\n\n render() {\n return html`\n <slot\n class=${classMap({\n \"tab-panel\": true,\n \"tab-panel--active\": this.active\n })}\n ></slot>\n `;\n }\n}\n\nexport default SgdsTabPanel;\n"],"names":["tabPanelStyles"],"mappings":";;;;;;;;;AAOA,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;AAIG;AACG,MAAO,YAAa,SAAQ,WAAW,CAAA;AAA7C,IAAA,WAAA,GAAA;;QAEmB,IAAM,CAAA,MAAA,GAAG,EAAE,EAAE,CAAC;AACd,QAAA,IAAA,CAAA,WAAW,GAAG,CAAkB,eAAA,EAAA,IAAI,CAAC,MAAM,EAAE,CAAC;;QAElC,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;;QAGK,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sgds-tab-panel.js","sources":["../../../../src/components/Tab/sgds-tab-panel.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { watch } from \"../../utils/watch\";\nimport tabPanelStyles from \"./tab-panel.css\";\n\nlet id = 0;\n\n/**\n * @summary Tab panels are used inside tab groups to display tabbed content.\n * @slot - The tab panel's content.\n *\n */\nexport class SgdsTabPanel extends SgdsElement {\n static styles = [...SgdsElement.styles, tabPanelStyles];\n private readonly attrId = ++id;\n private readonly componentId = `sgds-tab-panel-${this.attrId}`;\n /** The tab panel's name. */\n @property({ reflect: true }) name = \"\";\n\n /** When true, the tab panel will be shown. When used with tab-group, this property is already being managed */\n @property({ type: Boolean, reflect: true }) active = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.id = this.id.length > 0 ? this.id : this.componentId;\n this.setAttribute(\"role\", \"tabpanel\");\n }\n\n @watch(\"active\")\n _handleActiveChange() {\n this.setAttribute(\"aria-hidden\", this.active ? \"false\" : \"true\");\n this.inert = !this.active;\n }\n\n render() {\n return html`\n <slot\n class=${classMap({\n \"tab-panel\": true,\n \"tab-panel--active\": this.active\n })}\n ></slot>\n `;\n }\n}\n\nexport default SgdsTabPanel;\n"],"names":["tabPanelStyles"],"mappings":";;;;;;;;;AAOA,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;AAIG;AACG,MAAO,YAAa,SAAQ,WAAW,CAAA;AAA7C,IAAA,WAAA,GAAA;;QAEmB,IAAM,CAAA,MAAA,GAAG,EAAE,EAAE,CAAC;AACd,QAAA,IAAA,CAAA,WAAW,GAAG,CAAkB,eAAA,EAAA,IAAI,CAAC,MAAM,EAAE,CAAC;;QAElC,IAAI,CAAA,IAAA,GAAG,EAAE,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AA,IAAA,CAAA;;;;"}
|
package/themes/day.css
CHANGED
package/themes/night.css
CHANGED
package/types/react.d.ts
CHANGED
|
@@ -1553,79 +1553,79 @@ export interface SgdsTooltipProps extends SgdsBaseProps {
|
|
|
1553
1553
|
declare module "react" {
|
|
1554
1554
|
namespace JSX {
|
|
1555
1555
|
interface IntrinsicElements {
|
|
1556
|
-
"sgds-accordion-item": SgdsAccordionItemProps
|
|
1557
|
-
"sgds-accordion": SgdsAccordionProps
|
|
1558
|
-
"sgds-alert-link": SgdsAlertLinkProps
|
|
1559
|
-
"sgds-alert": SgdsAlertProps
|
|
1560
|
-
"sgds-badge": SgdsBadgeProps
|
|
1561
|
-
"sgds-breadcrumb-item": SgdsBreadcrumbItemProps
|
|
1562
|
-
"sgds-breadcrumb": SgdsBreadcrumbProps
|
|
1563
|
-
"sgds-button": SgdsButtonProps
|
|
1564
|
-
"sgds-card": SgdsCardProps
|
|
1565
|
-
"sgds-checkbox-group": SgdsCheckboxGroupProps
|
|
1566
|
-
"sgds-checkbox": SgdsCheckboxProps
|
|
1567
|
-
"sgds-close-button": SgdsCloseButtonProps
|
|
1568
|
-
"sgds-combo-box-option": SgdsComboBoxOptionProps
|
|
1569
|
-
"sgds-combo-box": SgdsComboBoxProps
|
|
1570
|
-
"sgds-datepicker": SgdsDatepickerProps
|
|
1571
|
-
"sgds-description-list-group": SgdsDescriptionListGroupProps
|
|
1572
|
-
"sgds-description-list": SgdsDescriptionListProps
|
|
1573
|
-
"sgds-divider": SgdsDividerProps
|
|
1574
|
-
"sgds-drawer": SgdsDrawerProps
|
|
1575
|
-
"sgds-dropdown-item": SgdsDropdownItemProps
|
|
1576
|
-
"sgds-dropdown": SgdsDropdownProps
|
|
1577
|
-
"sgds-file-upload": SgdsFileUploadProps
|
|
1578
|
-
"sgds-footer-item": SgdsFooterItemProps
|
|
1579
|
-
"sgds-footer": SgdsFooterProps
|
|
1580
|
-
"sgds-icon": SgdsIconProps
|
|
1581
|
-
"sgds-icon-button": SgdsIconButtonProps
|
|
1582
|
-
"sgds-icon-card": SgdsIconCardProps
|
|
1583
|
-
"sgds-icon-list": SgdsIconListProps
|
|
1584
|
-
"sgds-image-card": SgdsImageCardProps
|
|
1585
|
-
"sgds-input": SgdsInputProps
|
|
1586
|
-
"sgds-link": SgdsLinkProps
|
|
1587
|
-
"sgds-mainnav-dropdown": SgdsMainnavDropdownProps
|
|
1588
|
-
"sgds-mainnav-item": SgdsMainnavItemProps
|
|
1589
|
-
"sgds-mainnav": SgdsMainnavProps
|
|
1590
|
-
"sgds-masthead": SgdsMastheadProps
|
|
1591
|
-
"sgds-modal": SgdsModalProps
|
|
1592
|
-
"sgds-overflow-menu": SgdsOverflowMenuProps
|
|
1593
|
-
"sgds-pagination": SgdsPaginationProps
|
|
1594
|
-
"sgds-progress-bar": SgdsProgressBarProps
|
|
1595
|
-
"sgds-quantity-toggle": SgdsQuantityToggleProps
|
|
1596
|
-
"sgds-radio-group": SgdsRadioGroupProps
|
|
1597
|
-
"sgds-radio": SgdsRadioProps
|
|
1598
|
-
"sgds-select-option": SgdsSelectOptionProps
|
|
1599
|
-
"sgds-select": SgdsSelectProps
|
|
1600
|
-
"sgds-sidebar-group": SgdsSidebarGroupProps
|
|
1601
|
-
"sgds-sidebar-item": SgdsSidebarItemProps
|
|
1602
|
-
"sgds-sidebar-section": SgdsSidebarSectionProps
|
|
1603
|
-
"sgds-sidebar": SgdsSidebarProps
|
|
1604
|
-
"sgds-sidenav-item": SgdsSidenavItemProps
|
|
1605
|
-
"sgds-sidenav-link": SgdsSidenavLinkProps
|
|
1606
|
-
"sgds-sidenav": SgdsSidenavProps
|
|
1607
|
-
"sgds-skeleton": SgdsSkeletonProps
|
|
1608
|
-
"sgds-spinner": SgdsSpinnerProps
|
|
1609
|
-
"sgds-step": SgdsStepProps
|
|
1610
|
-
"sgds-stepper": SgdsStepperProps
|
|
1611
|
-
"sgds-subnav-item": SgdsSubnavItemProps
|
|
1612
|
-
"sgds-subnav": SgdsSubnavProps
|
|
1613
|
-
"sgds-switch": SgdsSwitchProps
|
|
1614
|
-
"sgds-system-banner-item": SgdsSystemBannerItemProps
|
|
1615
|
-
"sgds-system-banner": SgdsSystemBannerProps
|
|
1616
|
-
"sgds-tab-group": SgdsTabGroupProps
|
|
1617
|
-
"sgds-tab-panel": SgdsTabPanelProps
|
|
1618
|
-
"sgds-tab": SgdsTabProps
|
|
1619
|
-
"sgds-table-cell": SgdsTableCellProps
|
|
1620
|
-
"sgds-table-head": SgdsTableHeadProps
|
|
1621
|
-
"sgds-table-row": SgdsTableRowProps
|
|
1622
|
-
"sgds-table": SgdsTableProps
|
|
1623
|
-
"sgds-table-of-contents": SgdsTableOfContentsProps
|
|
1624
|
-
"sgds-textarea": SgdsTextareaProps
|
|
1625
|
-
"sgds-thumbnail-card": SgdsThumbnailCardProps
|
|
1626
|
-
"sgds-toast-container": SgdsToastContainerProps
|
|
1627
|
-
"sgds-toast": SgdsToastProps
|
|
1628
|
-
"sgds-tooltip": SgdsTooltipProps
|
|
1556
|
+
"sgds-accordion-item": React.DetailedHTMLProps<SgdsAccordionItemProps, HTMLElement>;
|
|
1557
|
+
"sgds-accordion": React.DetailedHTMLProps<SgdsAccordionProps, HTMLElement>;
|
|
1558
|
+
"sgds-alert-link": React.DetailedHTMLProps<SgdsAlertLinkProps, HTMLElement>;
|
|
1559
|
+
"sgds-alert": React.DetailedHTMLProps<SgdsAlertProps, HTMLElement>;
|
|
1560
|
+
"sgds-badge": React.DetailedHTMLProps<SgdsBadgeProps, HTMLElement>;
|
|
1561
|
+
"sgds-breadcrumb-item": React.DetailedHTMLProps<SgdsBreadcrumbItemProps, HTMLElement>;
|
|
1562
|
+
"sgds-breadcrumb": React.DetailedHTMLProps<SgdsBreadcrumbProps, HTMLElement>;
|
|
1563
|
+
"sgds-button": React.DetailedHTMLProps<SgdsButtonProps, HTMLElement>;
|
|
1564
|
+
"sgds-card": React.DetailedHTMLProps<SgdsCardProps, HTMLElement>;
|
|
1565
|
+
"sgds-checkbox-group": React.DetailedHTMLProps<SgdsCheckboxGroupProps, HTMLElement>;
|
|
1566
|
+
"sgds-checkbox": React.DetailedHTMLProps<SgdsCheckboxProps, HTMLElement>;
|
|
1567
|
+
"sgds-close-button": React.DetailedHTMLProps<SgdsCloseButtonProps, HTMLElement>;
|
|
1568
|
+
"sgds-combo-box-option": React.DetailedHTMLProps<SgdsComboBoxOptionProps, HTMLElement>;
|
|
1569
|
+
"sgds-combo-box": React.DetailedHTMLProps<SgdsComboBoxProps, HTMLElement>;
|
|
1570
|
+
"sgds-datepicker": React.DetailedHTMLProps<SgdsDatepickerProps, HTMLElement>;
|
|
1571
|
+
"sgds-description-list-group": React.DetailedHTMLProps<SgdsDescriptionListGroupProps, HTMLElement>;
|
|
1572
|
+
"sgds-description-list": React.DetailedHTMLProps<SgdsDescriptionListProps, HTMLElement>;
|
|
1573
|
+
"sgds-divider": React.DetailedHTMLProps<SgdsDividerProps, HTMLElement>;
|
|
1574
|
+
"sgds-drawer": React.DetailedHTMLProps<SgdsDrawerProps, HTMLElement>;
|
|
1575
|
+
"sgds-dropdown-item": React.DetailedHTMLProps<SgdsDropdownItemProps, HTMLElement>;
|
|
1576
|
+
"sgds-dropdown": React.DetailedHTMLProps<SgdsDropdownProps, HTMLElement>;
|
|
1577
|
+
"sgds-file-upload": React.DetailedHTMLProps<SgdsFileUploadProps, HTMLElement>;
|
|
1578
|
+
"sgds-footer-item": React.DetailedHTMLProps<SgdsFooterItemProps, HTMLElement>;
|
|
1579
|
+
"sgds-footer": React.DetailedHTMLProps<SgdsFooterProps, HTMLElement>;
|
|
1580
|
+
"sgds-icon": React.DetailedHTMLProps<SgdsIconProps, HTMLElement>;
|
|
1581
|
+
"sgds-icon-button": React.DetailedHTMLProps<SgdsIconButtonProps, HTMLElement>;
|
|
1582
|
+
"sgds-icon-card": React.DetailedHTMLProps<SgdsIconCardProps, HTMLElement>;
|
|
1583
|
+
"sgds-icon-list": React.DetailedHTMLProps<SgdsIconListProps, HTMLElement>;
|
|
1584
|
+
"sgds-image-card": React.DetailedHTMLProps<SgdsImageCardProps, HTMLElement>;
|
|
1585
|
+
"sgds-input": React.DetailedHTMLProps<SgdsInputProps, HTMLElement>;
|
|
1586
|
+
"sgds-link": React.DetailedHTMLProps<SgdsLinkProps, HTMLElement>;
|
|
1587
|
+
"sgds-mainnav-dropdown": React.DetailedHTMLProps<SgdsMainnavDropdownProps, HTMLElement>;
|
|
1588
|
+
"sgds-mainnav-item": React.DetailedHTMLProps<SgdsMainnavItemProps, HTMLElement>;
|
|
1589
|
+
"sgds-mainnav": React.DetailedHTMLProps<SgdsMainnavProps, HTMLElement>;
|
|
1590
|
+
"sgds-masthead": React.DetailedHTMLProps<SgdsMastheadProps, HTMLElement>;
|
|
1591
|
+
"sgds-modal": React.DetailedHTMLProps<SgdsModalProps, HTMLElement>;
|
|
1592
|
+
"sgds-overflow-menu": React.DetailedHTMLProps<SgdsOverflowMenuProps, HTMLElement>;
|
|
1593
|
+
"sgds-pagination": React.DetailedHTMLProps<SgdsPaginationProps, HTMLElement>;
|
|
1594
|
+
"sgds-progress-bar": React.DetailedHTMLProps<SgdsProgressBarProps, HTMLElement>;
|
|
1595
|
+
"sgds-quantity-toggle": React.DetailedHTMLProps<SgdsQuantityToggleProps, HTMLElement>;
|
|
1596
|
+
"sgds-radio-group": React.DetailedHTMLProps<SgdsRadioGroupProps, HTMLElement>;
|
|
1597
|
+
"sgds-radio": React.DetailedHTMLProps<SgdsRadioProps, HTMLElement>;
|
|
1598
|
+
"sgds-select-option": React.DetailedHTMLProps<SgdsSelectOptionProps, HTMLElement>;
|
|
1599
|
+
"sgds-select": React.DetailedHTMLProps<SgdsSelectProps, HTMLElement>;
|
|
1600
|
+
"sgds-sidebar-group": React.DetailedHTMLProps<SgdsSidebarGroupProps, HTMLElement>;
|
|
1601
|
+
"sgds-sidebar-item": React.DetailedHTMLProps<SgdsSidebarItemProps, HTMLElement>;
|
|
1602
|
+
"sgds-sidebar-section": React.DetailedHTMLProps<SgdsSidebarSectionProps, HTMLElement>;
|
|
1603
|
+
"sgds-sidebar": React.DetailedHTMLProps<SgdsSidebarProps, HTMLElement>;
|
|
1604
|
+
"sgds-sidenav-item": React.DetailedHTMLProps<SgdsSidenavItemProps, HTMLElement>;
|
|
1605
|
+
"sgds-sidenav-link": React.DetailedHTMLProps<SgdsSidenavLinkProps, HTMLElement>;
|
|
1606
|
+
"sgds-sidenav": React.DetailedHTMLProps<SgdsSidenavProps, HTMLElement>;
|
|
1607
|
+
"sgds-skeleton": React.DetailedHTMLProps<SgdsSkeletonProps, HTMLElement>;
|
|
1608
|
+
"sgds-spinner": React.DetailedHTMLProps<SgdsSpinnerProps, HTMLElement>;
|
|
1609
|
+
"sgds-step": React.DetailedHTMLProps<SgdsStepProps, HTMLElement>;
|
|
1610
|
+
"sgds-stepper": React.DetailedHTMLProps<SgdsStepperProps, HTMLElement>;
|
|
1611
|
+
"sgds-subnav-item": React.DetailedHTMLProps<SgdsSubnavItemProps, HTMLElement>;
|
|
1612
|
+
"sgds-subnav": React.DetailedHTMLProps<SgdsSubnavProps, HTMLElement>;
|
|
1613
|
+
"sgds-switch": React.DetailedHTMLProps<SgdsSwitchProps, HTMLElement>;
|
|
1614
|
+
"sgds-system-banner-item": React.DetailedHTMLProps<SgdsSystemBannerItemProps, HTMLElement>;
|
|
1615
|
+
"sgds-system-banner": React.DetailedHTMLProps<SgdsSystemBannerProps, HTMLElement>;
|
|
1616
|
+
"sgds-tab-group": React.DetailedHTMLProps<SgdsTabGroupProps, HTMLElement>;
|
|
1617
|
+
"sgds-tab-panel": React.DetailedHTMLProps<SgdsTabPanelProps, HTMLElement>;
|
|
1618
|
+
"sgds-tab": React.DetailedHTMLProps<SgdsTabProps, HTMLElement>;
|
|
1619
|
+
"sgds-table-cell": React.DetailedHTMLProps<SgdsTableCellProps, HTMLElement>;
|
|
1620
|
+
"sgds-table-head": React.DetailedHTMLProps<SgdsTableHeadProps, HTMLElement>;
|
|
1621
|
+
"sgds-table-row": React.DetailedHTMLProps<SgdsTableRowProps, HTMLElement>;
|
|
1622
|
+
"sgds-table": React.DetailedHTMLProps<SgdsTableProps, HTMLElement>;
|
|
1623
|
+
"sgds-table-of-contents": React.DetailedHTMLProps<SgdsTableOfContentsProps, HTMLElement>;
|
|
1624
|
+
"sgds-textarea": React.DetailedHTMLProps<SgdsTextareaProps, HTMLElement>;
|
|
1625
|
+
"sgds-thumbnail-card": React.DetailedHTMLProps<SgdsThumbnailCardProps, HTMLElement>;
|
|
1626
|
+
"sgds-toast-container": React.DetailedHTMLProps<SgdsToastContainerProps, HTMLElement>;
|
|
1627
|
+
"sgds-toast": React.DetailedHTMLProps<SgdsToastProps, HTMLElement>;
|
|
1628
|
+
"sgds-tooltip": React.DetailedHTMLProps<SgdsTooltipProps, HTMLElement>;
|
|
1629
1629
|
}
|
|
1630
1630
|
}
|
|
1631
1631
|
}
|