@undecaf/vue-material-locales
Advanced tools
Comparing version 0.1.2 to 0.2.0
/*! | ||
* @undecaf/vue-material-locales v0.1.0 | ||
* @undecaf/vue-material-locales v0.2.0 | ||
* Locales for the Vue Material datepicker | ||
* Built 2020-09-11 11:58:08 | ||
* Built 2020-09-21 12:54:41 | ||
* (c) 2020-present Ferdinand Kasper | ||
* Released under the MIT license | ||
*/ | ||
var t=function(t,r,a){return t(a={path:r,exports:{},require:function(t,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&a.path)}},a.exports),a.exports}((function(t,r){var a=["tag","startYear","endYear","dateFormat","days","shortDays","shorterDays","months","shortMonths","shorterMonths","firstDayOfAWeek","cancel","confirm"];var e={install:function(t,r){void 0===r&&(r=[]);var e=a.indexOf("tag");t.material.locales={},t.material.addLocale=function(r){t.material.locales[r[e]]=function(t){var r={};return a.forEach((function(a,e){return r[a]=t[e]})),r}(r)},t.material.addLocales=function(r){r.forEach((function(r){return t.material.addLocale(r)}))},t.material.selectLocale=function(){for(var r=this,a=[],e=arguments.length;e--;)a[e]=arguments[e];for(var o=function(e,o){if(Object.values(t.material.locales).some((function(t){return(o=t).tag.toLowerCase()===e}))||Object.values(t.material.locales).some((function(t){return(o=t).tag.toLowerCase().startsWith(e)})))return t.material.locale=o,{v:o.tag};if(a.length)return{v:t.material.selectLocale.apply(r,a)};var i=e.match(/^(.+)-(.+)$/);if(!i)return{};e=i[1],l=o,n=e},n=a.shift().toLowerCase().replace(/_/g,"-"),l=void 0;;){var i=o(n,l);if(i)return i.v}},t.material.addLocales(r)}};r.props=a,r.VueMaterialLocales=e,r.default=e,t.exports=r})).default;export default t;export{t as VueMaterialLocales}; | ||
var r=function(r,a,e){return r(e={path:a,exports:{},require:function(r,a){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==a&&e.path)}},e.exports),e.exports}((function(r,a){var e=["tag","startYear","endYear","dateFormat","days","shortDays","shorterDays","months","shortMonths","shorterMonths","firstDayOfAWeek","cancel","confirm"];var t={install:function(r,a){void 0===a&&(a=[]);var t=e.indexOf("tag");r.material.locales={},r.material.addLocale=function(a){r.material.locales[a[t]]=function(r){var a={};return e.forEach((function(e,t){return a[e]=r[t]})),a}(a)},r.material.addLocales=function(a){a.forEach((function(a){return r.material.addLocale(a)}))},r.material.selectLocale=function(){for(var a=[],e=arguments.length;e--;)a[e]=arguments[e];for(var t=function(a,e){if(Object.values(r.material.locales).some((function(r){return(e=r).tag.toLowerCase()===a}))||Object.values(r.material.locales).some((function(r){return(e=r).tag.toLowerCase().startsWith(a)})))return r.material.locale=e,{v:e.tag};var t=a.match(/^(.+)-(.+)$/);if(!t)return"break";a=t[1],n=e,o=a},o=a.shift().toLowerCase().replace(/_/g,"-"),n=void 0;;){var l=t(o,n);if("break"===l)break;if(l)return l.v}return a.length?r.material.selectLocale.apply(this,a):void 0},r.material.addLocales(a)}};a.props=e,a.VueMaterialLocales=t,a.default=t,r.exports=a})).default;export default r;export{r as VueMaterialLocales}; | ||
//# sourceMappingURL=index.esm.js.map |
/*! | ||
* @undecaf/vue-material-locales v0.1.0 | ||
* @undecaf/vue-material-locales v0.2.0 | ||
* Locales for the Vue Material datepicker | ||
* Built 2020-09-11 11:58:08 | ||
* Built 2020-09-21 12:54:41 | ||
* (c) 2020-present Ferdinand Kasper | ||
* Released under the MIT license | ||
*/ | ||
var VueMaterialLocales=function(e){"use strict";var t,a=function(e,t,a){return e(a={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&a.path)}},a.exports),a.exports}((function(e,t){var a=["tag","startYear","endYear","dateFormat","days","shortDays","shorterDays","months","shortMonths","shorterMonths","firstDayOfAWeek","cancel","confirm"];var r={install:function(e,t){void 0===t&&(t=[]);var r=a.indexOf("tag");e.material.locales={},e.material.addLocale=function(t){e.material.locales[t[r]]=function(e){var t={};return a.forEach((function(a,r){return t[a]=e[r]})),t}(t)},e.material.addLocales=function(t){t.forEach((function(t){return e.material.addLocale(t)}))},e.material.selectLocale=function(){for(var t=this,a=[],r=arguments.length;r--;)a[r]=arguments[r];for(var o=function(r,o){if(Object.values(e.material.locales).some((function(e){return(o=e).tag.toLowerCase()===r}))||Object.values(e.material.locales).some((function(e){return(o=e).tag.toLowerCase().startsWith(r)})))return e.material.locale=o,{v:o.tag};if(a.length)return{v:e.material.selectLocale.apply(t,a)};var i=r.match(/^(.+)-(.+)$/);if(!i)return{};r=i[1],l=o,n=r},n=a.shift().toLowerCase().replace(/_/g,"-"),l=void 0;;){var i=o(n,l);if(i)return i.v}},e.material.addLocales(t)}};t.props=a,t.VueMaterialLocales=r,t.default=r,e.exports=t})).default,r=Object.freeze({__proto__:null,default:a,VueMaterialLocales:a});function o(e){if(!o.installed){for(var t in r){var a=r[t];if("function"==typeof a.install)try{a.install(e)}catch(e){console.error("Could not install '"+t+"'",e)}}o.installed=!0}}return"undefined"!=typeof window?t=window.Vue:"undefined"!=typeof global&&(t=global.Vue),t&&t.use({install:o}),e.default=o,e}({}); | ||
var VueMaterialLocales=function(e){"use strict";var t,a=function(e,t,a){return e(a={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&a.path)}},a.exports),a.exports}((function(e,t){var a=["tag","startYear","endYear","dateFormat","days","shortDays","shorterDays","months","shortMonths","shorterMonths","firstDayOfAWeek","cancel","confirm"];var r={install:function(e,t){void 0===t&&(t=[]);var r=a.indexOf("tag");e.material.locales={},e.material.addLocale=function(t){e.material.locales[t[r]]=function(e){var t={};return a.forEach((function(a,r){return t[a]=e[r]})),t}(t)},e.material.addLocales=function(t){t.forEach((function(t){return e.material.addLocale(t)}))},e.material.selectLocale=function(){for(var t=[],a=arguments.length;a--;)t[a]=arguments[a];for(var r=function(t,a){if(Object.values(e.material.locales).some((function(e){return(a=e).tag.toLowerCase()===t}))||Object.values(e.material.locales).some((function(e){return(a=e).tag.toLowerCase().startsWith(t)})))return e.material.locale=a,{v:a.tag};var r=t.match(/^(.+)-(.+)$/);if(!r)return"break";t=r[1],n=a,o=t},o=t.shift().toLowerCase().replace(/_/g,"-"),n=void 0;;){var l=r(o,n);if("break"===l)break;if(l)return l.v}return t.length?e.material.selectLocale.apply(this,t):void 0},e.material.addLocales(t)}};t.props=a,t.VueMaterialLocales=r,t.default=r,e.exports=t})).default,r=Object.freeze({__proto__:null,default:a,VueMaterialLocales:a});function o(e){if(!o.installed){for(var t in r){var a=r[t];if("function"==typeof a.install)try{a.install(e)}catch(e){console.error("Could not install '"+t+"'",e)}}o.installed=!0}}return"undefined"!=typeof window?t=window.Vue:"undefined"!=typeof global&&(t=global.Vue),t&&t.use({install:o}),e.default=o,e}({}); | ||
//# sourceMappingURL=index.min.js.map |
/*! | ||
* @undecaf/vue-material-locales v0.1.0 | ||
* @undecaf/vue-material-locales v0.2.0 | ||
* Locales for the Vue Material datepicker | ||
* Built 2020-09-11 11:58:08 | ||
* Built 2020-09-21 12:54:41 | ||
* (c) 2020-present Ferdinand Kasper | ||
* Released under the MIT license | ||
*/ | ||
"use strict";function createCommonjsModule(e,a,r){return e(r={path:a,exports:{},require:function(e,a){return commonjsRequire(e,null==a?r.path:a)}},r.exports),r.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}Object.defineProperty(exports,"__esModule",{value:!0});var vueMaterialLocales=createCommonjsModule((function(e,a){var r=["tag","startYear","endYear","dateFormat","days","shortDays","shorterDays","months","shortMonths","shorterMonths","firstDayOfAWeek","cancel","confirm"];var t={install:function(e,a){void 0===a&&(a=[]);var t=r.indexOf("tag");e.material.locales={},e.material.addLocale=function(a){e.material.locales[a[t]]=function(e){var a={};return r.forEach((function(r,t){return a[r]=e[t]})),a}(a)},e.material.addLocales=function(a){a.forEach((function(a){return e.material.addLocale(a)}))},e.material.selectLocale=function(){for(var a=this,r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var o=function(t,o){if(Object.values(e.material.locales).some((function(e){return(o=e).tag.toLowerCase()===t}))||Object.values(e.material.locales).some((function(e){return(o=e).tag.toLowerCase().startsWith(t)})))return e.material.locale=o,{v:o.tag};if(r.length)return{v:e.material.selectLocale.apply(a,r)};var s=t.match(/^(.+)-(.+)$/);if(!s)return{};t=s[1],n=o,l=t},l=r.shift().toLowerCase().replace(/_/g,"-"),n=void 0;;){var s=o(l,n);if(s)return s.v}},e.material.addLocales(a)}};a.props=r,a.VueMaterialLocales=t,a.default=t,e.exports=a})),VueMaterialLocales=vueMaterialLocales.default;exports.VueMaterialLocales=VueMaterialLocales,exports.default=VueMaterialLocales; | ||
"use strict";function createCommonjsModule(e,a,r){return e(r={path:a,exports:{},require:function(e,a){return commonjsRequire(e,null==a?r.path:a)}},r.exports),r.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}Object.defineProperty(exports,"__esModule",{value:!0});var vueMaterialLocales=createCommonjsModule((function(e,a){var r=["tag","startYear","endYear","dateFormat","days","shortDays","shorterDays","months","shortMonths","shorterMonths","firstDayOfAWeek","cancel","confirm"];var t={install:function(e,a){void 0===a&&(a=[]);var t=r.indexOf("tag");e.material.locales={},e.material.addLocale=function(a){e.material.locales[a[t]]=function(e){var a={};return r.forEach((function(r,t){return a[r]=e[t]})),a}(a)},e.material.addLocales=function(a){a.forEach((function(a){return e.material.addLocale(a)}))},e.material.selectLocale=function(){for(var a=[],r=arguments.length;r--;)a[r]=arguments[r];for(var t=function(a,r){if(Object.values(e.material.locales).some((function(e){return(r=e).tag.toLowerCase()===a}))||Object.values(e.material.locales).some((function(e){return(r=e).tag.toLowerCase().startsWith(a)})))return e.material.locale=r,{v:r.tag};var t=a.match(/^(.+)-(.+)$/);if(!t)return"break";a=t[1],l=r,o=a},o=a.shift().toLowerCase().replace(/_/g,"-"),l=void 0;;){var n=t(o,l);if("break"===n)break;if(n)return n.v}return a.length?e.material.selectLocale.apply(this,a):void 0},e.material.addLocales(a)}};a.props=r,a.VueMaterialLocales=t,a.default=t,e.exports=a})),VueMaterialLocales=vueMaterialLocales.default;exports.VueMaterialLocales=VueMaterialLocales,exports.default=VueMaterialLocales; | ||
//# sourceMappingURL=index.ssr.js.map |
{ | ||
"name": "@undecaf/vue-material-locales", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Locales for the Vue Material datepicker", | ||
@@ -31,3 +31,4 @@ "keywords": [ | ||
"postbuild": "node terser.js dist/index.*.js", | ||
"build:example": "vue-cli-service build --dest example", | ||
"prebuild:example": "rimraf docs/example", | ||
"build:example": "vue-cli-service build --dest docs/example", | ||
"serve": "vue-cli-service serve", | ||
@@ -34,0 +35,0 @@ "lint": "eslint '{src,tests}/**/*.{js,vue}'", |
@@ -17,3 +17,3 @@ # Locales for the Vue Material datepicker | ||
A simple example [is available here](https://undecaf.github.io/vue-material-locales/example/) | ||
A simple online example [is available here](https://undecaf.github.io/vue-material-locales/example/) | ||
([example source code](https://github.com/undecaf/vue-material-locales/blob/master/src/components/Demo.vue)). | ||
@@ -96,11 +96,10 @@ | ||
Fallback locales can be given as additional arguments. A _more general_ locale will be considered | ||
only for the last argument, _more specific_ locales will be considered for any argument: | ||
Fallback locales can be given as additional arguments: | ||
```javascript 1.8 | ||
// Assuming that 'en-US' and 'de' have been registered | ||
vm.$material.selectLocale('de-AT', 'en') // -> 'en-US', locale set | ||
vm.$material.selectLocale('de-AT', 'de-CH', 'de-DE') // -> 'de', locale set | ||
vm.$material.selectLocale('de-AT', 'de-CH', 'it') // -> undefined, locale unchanged | ||
vm.$material.selectLocale('en', 'de') // -> 'en-US', locale set | ||
vm.$material.selectLocale('de-AT', 'en') // -> 'de', locale set | ||
vm.$material.selectLocale('it', 'de-DE') // -> 'de', locale set | ||
vm.$material.selectLocale('it', 'en') // -> 'en-US', locale set | ||
vm.$material.selectLocale('jp', 'it') // -> undefined, locale unchanged | ||
``` | ||
@@ -107,0 +106,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
119374
129