diff --git a/docs/assets/script.js b/docs/assets/script.js index 3d7cc8f..a1984b9 100644 --- a/docs/assets/script.js +++ b/docs/assets/script.js @@ -352,4 +352,13 @@ function initPageExamples() { alert('Form submitted'); } }); + + initVirtualSelect({ + ele: '#custom-styling-select', + multiple: true, + additionalClasses: 'custom-wrapper', + additionalDropboxClasses: 'custom-dropbox', + additionalDropboxContainerClasses: 'custom-dropbox-container', + additionalToggleButtonClasses: 'custom-toggle-button', + }); } diff --git a/docs/assets/styles.css b/docs/assets/styles.css index 810d401..88adf8c 100644 --- a/docs/assets/styles.css +++ b/docs/assets/styles.css @@ -107,10 +107,10 @@ section.cover { .get-started-example { display: flex; + flex-wrap: wrap; justify-content: space-between; - max-width: 600px; margin: 30px auto 0; - flex-wrap: wrap; + max-width: 600px; } .get-started-example .vscomp-ele { @@ -124,8 +124,8 @@ section.cover { } .vscomp-wrapper.text-direction-rtl .vscomp-option-text .flag { - margin-right: 0; margin-left: 12px; + margin-right: 0; } #show-value-as-tags-select, @@ -136,3 +136,28 @@ section.cover { #validation-select { margin-bottom: 20px; } + +/* utility classes - start */ + +.custom-wrapper { + padding: 0 0 10px; +} + +.custom-dropbox { + border: 1px solid var(--theme-color, #42b983); + border-radius: 14px; + color: var(--theme-color, #42b983); + overflow-y: auto; +} + +.custom-dropbox-container { + border-radius: 14px; +} + +.custom-toggle-button { + border-color: var(--theme-color, #42b983); + border-radius: 14px; + color: var(--theme-color, #42b983); +} + +/* utility classes - end */ diff --git a/docs/assets/virtual-select.js b/docs/assets/virtual-select.js index c4644be..2fa5df3 100644 --- a/docs/assets/virtual-select.js +++ b/docs/assets/virtual-select.js @@ -636,7 +636,7 @@ var keyDownMethodMapping = { var valueLessProps = ['autofocus', 'disabled', 'multiple', 'required']; var nativeProps = ['autofocus', 'class', 'disabled', 'id', 'multiple', 'name', 'placeholder', 'required']; var attrPropsMapping; -var dataProps = ['additionalClasses', 'aliasKey', 'allOptionsSelectedText', 'allowNewOption', 'alwaysShowSelectedOptionsCount', 'alwaysShowSelectedOptionsLabel', 'ariaLabelledby', 'ariaLabelText', 'ariaLabelClearButtonText', 'autoSelectFirstOption', 'clearButtonText', 'descriptionKey', 'disableAllOptionsSelectedText', 'disableOptionGroupCheckbox', 'disableSelectAll', 'disableValidation', 'dropboxWidth', 'dropboxWrapper', 'emptyValue', 'enableSecureText', 'focusSelectedOptionOnOpen', 'hasOptionDescription', 'hideClearButton', 'hideValueTooltipOnSelectAll', 'keepAlwaysOpen', 'labelKey', 'markSearchResults', 'maxValues', 'maxWidth', 'minValues', 'moreText', 'noOfDisplayValues', 'noOptionsText', 'noSearchResultsText', 'optionHeight', 'optionSelectedText', 'optionsCount', 'optionsSelectedText', 'popupDropboxBreakpoint', 'popupPosition', 'position', 'search', 'searchByStartsWith', 'searchDelay', 'searchFormLabel', 'searchGroup', 'searchNormalize', 'searchPlaceholderText', 'selectAllOnlyVisible', 'selectAllText', 'setValueAsArray', 'showDropboxAsPopup', 'showOptionsOnlyOnSearch', 'showSelectedOptionsFirst', 'showValueAsTags', 'silentInitialValueSet', 'textDirection', 'tooltipAlignment', 'tooltipFontSize', 'tooltipMaxWidth', 'updatePositionThrottle', 'useGroupValue', 'valueKey', 'zIndex']; +var dataProps = ['additionalClasses', 'additionalDropboxClasses', 'additionalDropboxContainerClasses', 'additionalToggleButtonClasses', 'aliasKey', 'allOptionsSelectedText', 'allowNewOption', 'alwaysShowSelectedOptionsCount', 'alwaysShowSelectedOptionsLabel', 'ariaLabelledby', 'ariaLabelText', 'ariaLabelClearButtonText', 'autoSelectFirstOption', 'clearButtonText', 'descriptionKey', 'disableAllOptionsSelectedText', 'disableOptionGroupCheckbox', 'disableSelectAll', 'disableValidation', 'dropboxWidth', 'dropboxWrapper', 'emptyValue', 'enableSecureText', 'focusSelectedOptionOnOpen', 'hasOptionDescription', 'hideClearButton', 'hideValueTooltipOnSelectAll', 'keepAlwaysOpen', 'labelKey', 'markSearchResults', 'maxValues', 'maxWidth', 'minValues', 'moreText', 'noOfDisplayValues', 'noOptionsText', 'noSearchResultsText', 'optionHeight', 'optionSelectedText', 'optionsCount', 'optionsSelectedText', 'popupDropboxBreakpoint', 'popupPosition', 'position', 'search', 'searchByStartsWith', 'searchDelay', 'searchFormLabel', 'searchGroup', 'searchNormalize', 'searchPlaceholderText', 'selectAllOnlyVisible', 'selectAllText', 'setValueAsArray', 'showDropboxAsPopup', 'showOptionsOnlyOnSearch', 'showSelectedOptionsFirst', 'showValueAsTags', 'silentInitialValueSet', 'textDirection', 'tooltipAlignment', 'tooltipFontSize', 'tooltipMaxWidth', 'updatePositionThrottle', 'useGroupValue', 'valueKey', 'zIndex']; /** Class representing VirtualSelect */ var VirtualSelect = /*#__PURE__*/function () { @@ -668,6 +668,7 @@ var VirtualSelect = /*#__PURE__*/function () { } var uniqueId = this.uniqueId; var wrapperClasses = 'vscomp-wrapper'; + var toggleButtonClasses = 'vscomp-toggle-button'; var valueTooltip = this.showValueAsTags ? '' : this.getTooltipAttrText(this.placeholder, true, true); var clearButtonTooltip = this.getTooltipAttrText(this.clearButtonText); var ariaLabelledbyText = this.ariaLabelledby ? "aria-labelledby=\"".concat(this.ariaLabelledby, "\"") : ''; @@ -677,6 +678,9 @@ var VirtualSelect = /*#__PURE__*/function () { if (this.additionalClasses) { wrapperClasses += " ".concat(this.additionalClasses); } + if (this.additionalToggleButtonClasses) { + toggleButtonClasses += " ".concat(this.additionalToggleButtonClasses); + } if (this.multiple) { wrapperClasses += ' multiple'; if (!this.disableSelectAll) { @@ -709,7 +713,7 @@ var VirtualSelect = /*#__PURE__*/function () { } // eslint-disable-next-line no-trailing-spaces - var html = "