react-language-combobox 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-language-combobox.cjs.js +1 -0
- package/dist/react-language-combobox.es.js +1375 -0
- package/dist/types/components/Flag.d.ts +9 -0
- package/dist/types/components/LanguagePicker.d.ts +19 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/assets/browser-ponyfill-DB4WlJ8E.js +0 -2
- package/dist/assets/index-BbkIzn4_.js +0 -9
- package/dist/assets/index-Bx1X7uu6.css +0 -2
- package/dist/index.html +0 -13
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FlagProps {
|
|
3
|
+
language?: string;
|
|
4
|
+
svg?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export default function Flag({ language, className, title }: FlagProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const defaultTheme: LanguagePickerTheme;
|
|
2
|
+
export declare const darkTheme: LanguagePickerTheme;
|
|
3
|
+
export declare function LanguagePicker(properties: LanguagePickerProperties): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
export interface LanguagePickerProperties {
|
|
5
|
+
languages?: string[];
|
|
6
|
+
defaultLanguage?: string;
|
|
7
|
+
languageChanged?: (lng: string) => void;
|
|
8
|
+
useAbbreviations?: boolean;
|
|
9
|
+
showFlags?: boolean;
|
|
10
|
+
showEnglishNames?: boolean;
|
|
11
|
+
theme?: LanguagePickerTheme;
|
|
12
|
+
}
|
|
13
|
+
export interface LanguagePickerTheme {
|
|
14
|
+
container?: string;
|
|
15
|
+
button?: string;
|
|
16
|
+
list?: string;
|
|
17
|
+
item?: string;
|
|
18
|
+
selectedItem?: string;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./index-BbkIzn4_.js";var t=e(((e,t)=>{var n=typeof globalThis<`u`&&globalThis||typeof self<`u`&&self||typeof global<`u`&&global,r=(function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e})();(function(e){(function(t){var n=e!==void 0&&e||typeof self<`u`&&self||n!==void 0&&n,r={searchParams:`URLSearchParams`in n,iterable:`Symbol`in n&&`iterator`in Symbol,blob:`FileReader`in n&&`Blob`in n&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:`FormData`in n,arrayBuffer:`ArrayBuffer`in n};function i(e){return e&&DataView.prototype.isPrototypeOf(e)}if(r.arrayBuffer)var a=[`[object Int8Array]`,`[object Uint8Array]`,`[object Uint8ClampedArray]`,`[object Int16Array]`,`[object Uint16Array]`,`[object Int32Array]`,`[object Uint32Array]`,`[object Float32Array]`,`[object Float64Array]`],o=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if(typeof e!=`string`&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e===``)throw TypeError(`Invalid character in header field name: "`+e+`"`);return e.toLowerCase()}function c(e){return typeof e!=`string`&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:t===void 0,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}u.prototype.append=function(e,t){e=s(e),t=c(t);var n=this.map[e];this.map[e]=n?n+`, `+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=c(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),l(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),l(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),l(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);function d(e){if(e.bodyUsed)return Promise.reject(TypeError(`Already read`));e.bodyUsed=!0}function f(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function m(e){var t=new FileReader,n=f(t);return t.readAsText(e),n}function h(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join(``)}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e==`string`?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&i(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText=``,this.headers.get(`content-type`)||(typeof e==`string`?this.headers.set(`content-type`,`text/plain;charset=UTF-8`):this._bodyBlob&&this._bodyBlob.type?this.headers.set(`content-type`,this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`))},r.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error(`could not read FormData body as blob`);return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(p)}),this.text=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(h(this._bodyArrayBuffer));if(this._bodyFormData)throw Error(`could not read FormData body as text`);return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}var v=[`DELETE`,`GET`,`HEAD`,`OPTIONS`,`POST`,`PUT`];function y(e){var t=e.toUpperCase();return v.indexOf(t)>-1?t:e}function b(e,t){if(!(this instanceof b))throw TypeError(`Please use the "new" operator, this DOM object constructor cannot be called as a function.`);t||={};var n=t.body;if(e instanceof b){if(e.bodyUsed)throw TypeError(`Already read`);this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||`same-origin`,(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=y(t.method||this.method||`GET`),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method===`GET`||this.method===`HEAD`)&&n)throw TypeError(`Body not allowed for GET or HEAD requests`);if(this._initBody(n),(this.method===`GET`||this.method===`HEAD`)&&(t.cache===`no-store`||t.cache===`no-cache`)){var r=/([?&])_=[^&]*/;r.test(this.url)?this.url=this.url.replace(r,`$1_=`+new Date().getTime()):this.url+=(/\?/.test(this.url)?`&`:`?`)+`_=`+new Date().getTime()}}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function x(e){var t=new FormData;return e.trim().split(`&`).forEach(function(e){if(e){var n=e.split(`=`),r=n.shift().replace(/\+/g,` `),i=n.join(`=`).replace(/\+/g,` `);t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function S(e){var t=new u;return e.replace(/\r?\n[\t ]+/g,` `).split(`\r`).map(function(e){return e.indexOf(`
|
|
2
|
-
`)===0?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(`:`),r=n.shift().trim();if(r){var i=n.join(`:`).trim();t.append(r,i)}}),t}_.call(b.prototype);function C(e,t){if(!(this instanceof C))throw TypeError(`Please use the "new" operator, this DOM object constructor cannot be called as a function.`);t||={},this.type=`default`,this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?``:``+t.statusText,this.headers=new u(t.headers),this.url=t.url||``,this._initBody(e)}_.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},C.error=function(){var e=new C(null,{status:0,statusText:``});return e.type=`error`,e};var w=[301,302,303,307,308];C.redirect=function(e,t){if(w.indexOf(t)===-1)throw RangeError(`Invalid status code`);return new C(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(e,t){this.message=e,this.name=t,this.stack=Error(e).stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,i){return new Promise(function(a,o){var s=new b(e,i);if(s.signal&&s.signal.aborted)return o(new t.DOMException(`Aborted`,`AbortError`));var l=new XMLHttpRequest;function d(){l.abort()}l.onload=function(){var e={status:l.status,statusText:l.statusText,headers:S(l.getAllResponseHeaders()||``)};e.url=`responseURL`in l?l.responseURL:e.headers.get(`X-Request-URL`);var t=`response`in l?l.response:l.responseText;setTimeout(function(){a(new C(t,e))},0)},l.onerror=function(){setTimeout(function(){o(TypeError(`Network request failed`))},0)},l.ontimeout=function(){setTimeout(function(){o(TypeError(`Network request failed`))},0)},l.onabort=function(){setTimeout(function(){o(new t.DOMException(`Aborted`,`AbortError`))},0)};function f(e){try{return e===``&&n.location.href?n.location.href:e}catch{return e}}l.open(s.method,f(s.url),!0),s.credentials===`include`?l.withCredentials=!0:s.credentials===`omit`&&(l.withCredentials=!1),`responseType`in l&&(r.blob?l.responseType=`blob`:r.arrayBuffer&&s.headers.get(`Content-Type`)&&s.headers.get(`Content-Type`).indexOf(`application/octet-stream`)!==-1&&(l.responseType=`arraybuffer`)),i&&typeof i.headers==`object`&&!(i.headers instanceof u)?Object.getOwnPropertyNames(i.headers).forEach(function(e){l.setRequestHeader(e,c(i.headers[e]))}):s.headers.forEach(function(e,t){l.setRequestHeader(t,e)}),s.signal&&(s.signal.addEventListener(`abort`,d),l.onreadystatechange=function(){l.readyState===4&&s.signal.removeEventListener(`abort`,d)}),l.send(s._bodyInit===void 0?null:s._bodyInit)})}return T.polyfill=!0,n.fetch||(n.fetch=T,n.Headers=u,n.Request=b,n.Response=C),t.Headers=u,t.Request=b,t.Response=C,t.fetch=T,t})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}));export default t();
|