@3dwayfinder/wayfinder-vue-components 1.8.2 → 1.8.3

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/entry.esm.js CHANGED
@@ -3439,8 +3439,6 @@ const __vue_component__$g = /*#__PURE__*/normalizeComponent({
3439
3439
  staticRenderFns: __vue_staticRenderFns__$g
3440
3440
  }, __vue_inject_styles__$g, __vue_script__$g, __vue_scope_id__$g, __vue_is_functional_template__$g, __vue_module_identifier__$g, false, undefined, undefined, undefined);
3441
3441
 
3442
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3443
-
3444
3442
  function createCommonjsModule(fn, basedir, module) {
3445
3443
  return module = {
3446
3444
  path: basedir,
@@ -3911,10 +3909,6 @@ const __vue_component__$d = /*#__PURE__*/normalizeComponent({
3911
3909
  staticRenderFns: __vue_staticRenderFns__$d
3912
3910
  }, __vue_inject_styles__$d, __vue_script__$d, __vue_scope_id__$d, __vue_is_functional_template__$d, __vue_module_identifier__$d, false, undefined, undefined, undefined);
3913
3911
 
3914
- var dayjs_min = createCommonjsModule(function (module, exports) {
3915
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
3916
- });
3917
-
3918
3912
  //
3919
3913
 
3920
3914
  function loadScript(url, callback) {
@@ -3949,7 +3943,7 @@ var script$c = {
3949
3943
  mounted() {
3950
3944
  setTimeout(this.addDate, 1000);
3951
3945
 
3952
- if (typeof dayjs_min === "undefined") {
3946
+ if (typeof dayjs === "undefined") {
3953
3947
  console.warn("WFDate dayjs is not loaded");
3954
3948
  }
3955
3949
 
@@ -3958,9 +3952,9 @@ var script$c = {
3958
3952
 
3959
3953
  computed: { ...mapState('wf', ['language']),
3960
3954
 
3961
- date() {
3962
- if (typeof dayjs_min !== "undefined") {
3963
- return dayjs_min(this.time).format(this.format);
3955
+ datestr() {
3956
+ if (typeof dayjs !== "undefined") {
3957
+ return dayjs(this.time).format(this.format);
3964
3958
  } else {
3965
3959
  return this.time.toLocaleString(this.language, {
3966
3960
  "dateStyle": "long"
@@ -3973,12 +3967,12 @@ var script$c = {
3973
3967
  language() {
3974
3968
  this.time = new Date();
3975
3969
 
3976
- if (typeof dayjs_min !== "undefined") {
3970
+ if (typeof dayjs !== "undefined") {
3977
3971
  if (!this.locales[this.language]) {
3978
3972
  this.loadLocale(this.language);
3979
3973
  }
3980
3974
 
3981
- dayjs_min.locale(this.language);
3975
+ dayjs.locale(this.language);
3982
3976
  }
3983
3977
  }
3984
3978
 
@@ -3993,6 +3987,10 @@ var script$c = {
3993
3987
  loadScript(this.$wayfinder.options.assetsLocation + "/dayjs/locale/" + locale + ".js", a => {
3994
3988
  console.log('locale.loaded', a, locale, this.language);
3995
3989
  this.locales[locale] = true;
3990
+
3991
+ if (this.language == locale && dayjs) {
3992
+ dayjs.locale(this.language);
3993
+ }
3996
3994
  });
3997
3995
  }
3998
3996
 
@@ -4012,7 +4010,7 @@ var __vue_render__$c = function () {
4012
4010
 
4013
4011
  return _c('div', {
4014
4012
  staticClass: "wf-date"
4015
- }, [_vm._v("\n " + _vm._s(_vm.date) + "\n")]);
4013
+ }, [_vm._v("\n " + _vm._s(_vm.datestr) + "\n")]);
4016
4014
  };
4017
4015
 
4018
4016
  var __vue_staticRenderFns__$c = [];
@@ -5427,23 +5425,29 @@ var script$1 = {
5427
5425
 
5428
5426
  watch: {
5429
5427
  language() {
5428
+ console.log('trans.language');
5429
+
5430
5430
  if (this.$wayfinder) {
5431
5431
  this.update();
5432
5432
  }
5433
5433
  },
5434
5434
 
5435
- key() {
5435
+ k() {
5436
+ console.log('trans.key');
5436
5437
  this.update();
5437
5438
  }
5438
5439
 
5439
5440
  },
5440
5441
 
5441
5442
  mounted() {
5443
+ console.log('trans.mounted');
5442
5444
  this.update();
5443
5445
  },
5444
5446
 
5445
5447
  methods: {
5446
5448
  update() {
5449
+ console.log('trans.updated', this.$wayfinder, this.k);
5450
+
5447
5451
  if (this.$wayfinder && this.k && this.k.length > 0 && this.$wayfinder.translator.exists(this.k)) {
5448
5452
  console.log('trans.update', this.k, this.params, this.$wayfinder.translator.get(this.k, this.params));
5449
5453
  this.value = this.$wayfinder.translator.get(this.k, this.params);
@@ -5468,11 +5472,8 @@ var __vue_render__$1 = function () {
5468
5472
  staticClass: "wf-translatable",
5469
5473
  class: {
5470
5474
  'wf-translated': _vm.translated
5471
- },
5472
- domProps: {
5473
- "innerHTML": _vm._s(_vm.value)
5474
5475
  }
5475
- }, [_vm._t("default")], 2);
5476
+ }, [_vm.value == '' ? _vm._t("default") : _vm._e(), _vm._v("\n " + _vm._s(_vm.value) + "\n")], 2);
5476
5477
  };
5477
5478
 
5478
5479
  var __vue_staticRenderFns__$1 = [];
package/dist/entry.js CHANGED
@@ -3182,9 +3182,7 @@ var __vue_is_functional_template__$g = false;
3182
3182
  var __vue_component__$g = /*#__PURE__*/normalizeComponent({
3183
3183
  render: __vue_render__$g,
3184
3184
  staticRenderFns: __vue_staticRenderFns__$g
3185
- }, __vue_inject_styles__$g, __vue_script__$g, __vue_scope_id__$g, __vue_is_functional_template__$g, __vue_module_identifier__$g, false, undefined, undefined, undefined);var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3186
-
3187
- function createCommonjsModule(fn, basedir, module) {
3185
+ }, __vue_inject_styles__$g, __vue_script__$g, __vue_scope_id__$g, __vue_is_functional_template__$g, __vue_module_identifier__$g, false, undefined, undefined, undefined);function createCommonjsModule(fn, basedir, module) {
3188
3186
  return module = {
3189
3187
  path: basedir,
3190
3188
  exports: {},
@@ -3556,7 +3554,7 @@ var __vue_inject_styles__$d = undefined;
3556
3554
  var __vue_scope_id__$d = undefined;
3557
3555
  /* module identifier */
3558
3556
 
3559
- var __vue_module_identifier__$d = "data-v-6df73895";
3557
+ var __vue_module_identifier__$d = "data-v-7b4006ab";
3560
3558
  /* functional template */
3561
3559
 
3562
3560
  var __vue_is_functional_template__$d = false;
@@ -3569,9 +3567,7 @@ var __vue_is_functional_template__$d = false;
3569
3567
  var __vue_component__$d = /*#__PURE__*/normalizeComponent({
3570
3568
  render: __vue_render__$d,
3571
3569
  staticRenderFns: __vue_staticRenderFns__$d
3572
- }, __vue_inject_styles__$d, __vue_script__$d, __vue_scope_id__$d, __vue_is_functional_template__$d, __vue_module_identifier__$d, false, undefined, undefined, undefined);var dayjs_min = createCommonjsModule(function (module, exports) {
3573
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
3574
- });function loadScript(url, callback) {
3570
+ }, __vue_inject_styles__$d, __vue_script__$d, __vue_scope_id__$d, __vue_is_functional_template__$d, __vue_module_identifier__$d, false, undefined, undefined, undefined);function loadScript(url, callback) {
3575
3571
  var s = document.createElement('script');
3576
3572
  s.type = 'text/javascript';
3577
3573
  s.async = true;
@@ -3601,16 +3597,16 @@ var script$c = {
3601
3597
  mounted: function mounted() {
3602
3598
  setTimeout(this.addDate, 1000);
3603
3599
 
3604
- if (typeof dayjs_min === "undefined") {
3600
+ if (typeof dayjs === "undefined") {
3605
3601
  console.warn("WFDate dayjs is not loaded");
3606
3602
  }
3607
3603
 
3608
3604
  this.loadLocale(this.language);
3609
3605
  },
3610
3606
  computed: _objectSpread2(_objectSpread2({}, mapState('wf', ['language'])), {}, {
3611
- date: function date() {
3612
- if (typeof dayjs_min !== "undefined") {
3613
- return dayjs_min(this.time).format(this.format);
3607
+ datestr: function datestr() {
3608
+ if (typeof dayjs !== "undefined") {
3609
+ return dayjs(this.time).format(this.format);
3614
3610
  } else {
3615
3611
  return this.time.toLocaleString(this.language, {
3616
3612
  "dateStyle": "long"
@@ -3622,12 +3618,12 @@ var script$c = {
3622
3618
  language: function language() {
3623
3619
  this.time = new Date();
3624
3620
 
3625
- if (typeof dayjs_min !== "undefined") {
3621
+ if (typeof dayjs !== "undefined") {
3626
3622
  if (!this.locales[this.language]) {
3627
3623
  this.loadLocale(this.language);
3628
3624
  }
3629
3625
 
3630
- dayjs_min.locale(this.language);
3626
+ dayjs.locale(this.language);
3631
3627
  }
3632
3628
  }
3633
3629
  },
@@ -3642,6 +3638,10 @@ var script$c = {
3642
3638
  loadScript(this.$wayfinder.options.assetsLocation + "/dayjs/locale/" + locale + ".js", function (a) {
3643
3639
  console.log('locale.loaded', a, locale, _this.language);
3644
3640
  _this.locales[locale] = true;
3641
+
3642
+ if (_this.language == locale && dayjs) {
3643
+ dayjs.locale(_this.language);
3644
+ }
3645
3645
  });
3646
3646
  }
3647
3647
  }
@@ -3658,7 +3658,7 @@ var __vue_render__$c = function __vue_render__() {
3658
3658
 
3659
3659
  return _c('div', {
3660
3660
  staticClass: "wf-date"
3661
- }, [_vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.date) + "\n"))]);
3661
+ }, [_vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.datestr) + "\n"))]);
3662
3662
  };
3663
3663
 
3664
3664
  var __vue_staticRenderFns__$c = [];
@@ -3670,7 +3670,7 @@ var __vue_inject_styles__$c = undefined;
3670
3670
  var __vue_scope_id__$c = undefined;
3671
3671
  /* module identifier */
3672
3672
 
3673
- var __vue_module_identifier__$c = "data-v-f7b8851e";
3673
+ var __vue_module_identifier__$c = "data-v-b52739fe";
3674
3674
  /* functional template */
3675
3675
 
3676
3676
  var __vue_is_functional_template__$c = false;
@@ -4830,19 +4830,25 @@ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
4830
4830
  },
4831
4831
  watch: {
4832
4832
  language: function language() {
4833
+ console.log('trans.language');
4834
+
4833
4835
  if (this.$wayfinder) {
4834
4836
  this.update();
4835
4837
  }
4836
4838
  },
4837
- key: function key() {
4839
+ k: function k() {
4840
+ console.log('trans.key');
4838
4841
  this.update();
4839
4842
  }
4840
4843
  },
4841
4844
  mounted: function mounted() {
4845
+ console.log('trans.mounted');
4842
4846
  this.update();
4843
4847
  },
4844
4848
  methods: {
4845
4849
  update: function update() {
4850
+ console.log('trans.updated', this.$wayfinder, this.k);
4851
+
4846
4852
  if (this.$wayfinder && this.k && this.k.length > 0 && this.$wayfinder.translator.exists(this.k)) {
4847
4853
  console.log('trans.update', this.k, this.params, this.$wayfinder.translator.get(this.k, this.params));
4848
4854
  this.value = this.$wayfinder.translator.get(this.k, this.params);
@@ -4864,11 +4870,8 @@ var __vue_render__$1 = function __vue_render__() {
4864
4870
  staticClass: "wf-translatable",
4865
4871
  class: {
4866
4872
  'wf-translated': _vm.translated
4867
- },
4868
- domProps: {
4869
- "innerHTML": _vm._s(_vm.value)
4870
4873
  }
4871
- }, [_vm._t("default")], 2);
4874
+ }, [_vm.value == '' ? _vm._t("default") : _vm._e(), _vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.value) + "\n"))], 2);
4872
4875
  };
4873
4876
 
4874
4877
  var __vue_staticRenderFns__$1 = [];
@@ -4880,7 +4883,7 @@ var __vue_inject_styles__$1 = undefined;
4880
4883
  var __vue_scope_id__$1 = undefined;
4881
4884
  /* module identifier */
4882
4885
 
4883
- var __vue_module_identifier__$1 = "data-v-6b23d0c2";
4886
+ var __vue_module_identifier__$1 = "data-v-e6c19c38";
4884
4887
  /* functional template */
4885
4888
 
4886
4889
  var __vue_is_functional_template__$1 = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dwayfinder/wayfinder-vue-components",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "VueJS UI components for 3D Wayfinder floor plans",
5
5
  "main": "dist/wayfinder-vue-components.ssr.js",
6
6
  "browser": "dist/wayfinder-vue-components.esm.js",
@@ -24,7 +24,6 @@ export default {
24
24
  },
25
25
  seconds() {
26
26
  return (this.time.getSeconds() < 10 ? "0" : "") + this.time.getSeconds()
27
- return (this.time.getSeconds() < 10 ? "0" : "") + this.time.getSeconds()
28
27
  },
29
28
  },
30
29
  methods: {
@@ -1,11 +1,10 @@
1
1
  <template>
2
2
  <div class="wf-date">
3
- {{ date }}
3
+ {{ datestr }}
4
4
  </div>
5
5
  </template>
6
6
 
7
7
  <script>
8
- import dayjs from 'dayjs';
9
8
  import { mapState } from 'vuex';
10
9
 
11
10
  function loadScript(url, callback) {
@@ -41,7 +40,7 @@ export default {
41
40
  },
42
41
  computed: {
43
42
  ...mapState('wf', ['language']),
44
- date() {
43
+ datestr() {
45
44
  if (typeof dayjs !== "undefined") {
46
45
  return dayjs(this.time).format(this.format);
47
46
  }
@@ -71,6 +70,9 @@ export default {
71
70
  loadScript(this.$wayfinder.options.assetsLocation + "/dayjs/locale/" + locale + ".js", (a) => {
72
71
  console.log('locale.loaded', a, locale, this.language)
73
72
  this.locales[locale] = true;
73
+ if (this.language == locale && dayjs) {
74
+ dayjs.locale(this.language);
75
+ }
74
76
  });
75
77
  }
76
78
  }
@@ -1,6 +1,7 @@
1
1
  <template>
2
- <label class="wf-translatable" :class="{'wf-translated': translated}" v-html="value">
3
- <slot></slot>
2
+ <label class="wf-translatable" :class="{'wf-translated': translated}">
3
+ <slot v-if="value == ''"></slot>
4
+ {{ value }}
4
5
  </label>
5
6
  </template>
6
7
 
@@ -8,48 +9,51 @@
8
9
  import { mapState } from 'vuex';
9
10
 
10
11
  export default {
11
- name: "Translate",
12
- props: {
13
- k: {
14
- type: String,
15
- default: ""
16
- },
17
- params: {
18
- type: Array,
19
- default: () => []
20
- },
12
+ name: "Translate",
13
+ props: {
14
+ k: {
15
+ type: String,
16
+ default: ""
21
17
  },
22
- computed: {
23
- ...mapState('wf', ['language']),
18
+ params: {
19
+ type: Array,
20
+ default: () => []
24
21
  },
25
- data () {
26
- return {
27
- translated: false,
28
- value: ""
29
- }
30
- },
31
- watch: {
32
- language () {
33
- if (this.$wayfinder) {
34
- this.update();
35
- }
36
- },
37
- key () {
38
- this.update();
39
- },
40
- },
41
- mounted () {
22
+ },
23
+ computed: {
24
+ ...mapState('wf', ['language']),
25
+ },
26
+ data () {
27
+ return {
28
+ translated: false,
29
+ value: ""
30
+ }
31
+ },
32
+ watch: {
33
+ language () {
34
+ console.log('trans.language')
35
+ if (this.$wayfinder) {
42
36
  this.update();
37
+ }
43
38
  },
44
- methods: {
45
- update () {
46
- if (this.$wayfinder && this.k && this.k.length > 0 && this.$wayfinder.translator.exists(this.k)) {
47
- console.log('trans.update', this.k, this.params, this.$wayfinder.translator.get(this.k, this.params))
48
- this.value = this.$wayfinder.translator.get(this.k, this.params);
49
- }
50
- }
51
- }
52
-
39
+ k () {
40
+ console.log('trans.key')
41
+ this.update();
42
+ },
43
+ },
44
+ mounted () {
45
+ console.log('trans.mounted')
46
+ this.update();
47
+ },
48
+ methods: {
49
+ update () {
50
+ console.log('trans.updated', this.$wayfinder, this.k)
51
+ if (this.$wayfinder && this.k && this.k.length > 0 && this.$wayfinder.translator.exists(this.k)) {
52
+ console.log('trans.update', this.k, this.params, this.$wayfinder.translator.get(this.k, this.params))
53
+ this.value = this.$wayfinder.translator.get(this.k, this.params);
54
+ }
55
+ }
56
+ }
53
57
  }
54
58
  </script>
55
59