@3dwayfinder/wayfinder-vue-components 1.8.1 → 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,
@@ -3830,6 +3828,8 @@ const __vue_component__$e = /*#__PURE__*/normalizeComponent({
3830
3828
  //
3831
3829
  //
3832
3830
  var script$d = {
3831
+ name: "Clock",
3832
+
3833
3833
  data() {
3834
3834
  return {
3835
3835
  time: new Date()
@@ -3909,10 +3909,6 @@ const __vue_component__$d = /*#__PURE__*/normalizeComponent({
3909
3909
  staticRenderFns: __vue_staticRenderFns__$d
3910
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);
3911
3911
 
3912
- var dayjs_min = createCommonjsModule(function (module, exports) {
3913
- !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}));
3914
- });
3915
-
3916
3912
  //
3917
3913
 
3918
3914
  function loadScript(url, callback) {
@@ -3929,6 +3925,7 @@ function loadScript(url, callback) {
3929
3925
  }
3930
3926
 
3931
3927
  var script$c = {
3928
+ name: "Date",
3932
3929
  props: {
3933
3930
  format: {
3934
3931
  type: String,
@@ -3946,7 +3943,7 @@ var script$c = {
3946
3943
  mounted() {
3947
3944
  setTimeout(this.addDate, 1000);
3948
3945
 
3949
- if (typeof dayjs_min === "undefined") {
3946
+ if (typeof dayjs === "undefined") {
3950
3947
  console.warn("WFDate dayjs is not loaded");
3951
3948
  }
3952
3949
 
@@ -3955,9 +3952,9 @@ var script$c = {
3955
3952
 
3956
3953
  computed: { ...mapState('wf', ['language']),
3957
3954
 
3958
- date() {
3959
- if (typeof dayjs_min !== "undefined") {
3960
- return dayjs_min(this.time).format(this.format);
3955
+ datestr() {
3956
+ if (typeof dayjs !== "undefined") {
3957
+ return dayjs(this.time).format(this.format);
3961
3958
  } else {
3962
3959
  return this.time.toLocaleString(this.language, {
3963
3960
  "dateStyle": "long"
@@ -3970,12 +3967,12 @@ var script$c = {
3970
3967
  language() {
3971
3968
  this.time = new Date();
3972
3969
 
3973
- if (typeof dayjs_min !== "undefined") {
3970
+ if (typeof dayjs !== "undefined") {
3974
3971
  if (!this.locales[this.language]) {
3975
3972
  this.loadLocale(this.language);
3976
3973
  }
3977
3974
 
3978
- dayjs_min.locale(this.language);
3975
+ dayjs.locale(this.language);
3979
3976
  }
3980
3977
  }
3981
3978
 
@@ -3990,6 +3987,10 @@ var script$c = {
3990
3987
  loadScript(this.$wayfinder.options.assetsLocation + "/dayjs/locale/" + locale + ".js", a => {
3991
3988
  console.log('locale.loaded', a, locale, this.language);
3992
3989
  this.locales[locale] = true;
3990
+
3991
+ if (this.language == locale && dayjs) {
3992
+ dayjs.locale(this.language);
3993
+ }
3993
3994
  });
3994
3995
  }
3995
3996
 
@@ -4009,7 +4010,7 @@ var __vue_render__$c = function () {
4009
4010
 
4010
4011
  return _c('div', {
4011
4012
  staticClass: "wf-date"
4012
- }, [_vm._v("\n " + _vm._s(_vm.date) + "\n")]);
4013
+ }, [_vm._v("\n " + _vm._s(_vm.datestr) + "\n")]);
4013
4014
  };
4014
4015
 
4015
4016
  var __vue_staticRenderFns__$c = [];
@@ -5424,23 +5425,29 @@ var script$1 = {
5424
5425
 
5425
5426
  watch: {
5426
5427
  language() {
5428
+ console.log('trans.language');
5429
+
5427
5430
  if (this.$wayfinder) {
5428
5431
  this.update();
5429
5432
  }
5430
5433
  },
5431
5434
 
5432
- key() {
5435
+ k() {
5436
+ console.log('trans.key');
5433
5437
  this.update();
5434
5438
  }
5435
5439
 
5436
5440
  },
5437
5441
 
5438
5442
  mounted() {
5443
+ console.log('trans.mounted');
5439
5444
  this.update();
5440
5445
  },
5441
5446
 
5442
5447
  methods: {
5443
5448
  update() {
5449
+ console.log('trans.updated', this.$wayfinder, this.k);
5450
+
5444
5451
  if (this.$wayfinder && this.k && this.k.length > 0 && this.$wayfinder.translator.exists(this.k)) {
5445
5452
  console.log('trans.update', this.k, this.params, this.$wayfinder.translator.get(this.k, this.params));
5446
5453
  this.value = this.$wayfinder.translator.get(this.k, this.params);
@@ -5465,11 +5472,8 @@ var __vue_render__$1 = function () {
5465
5472
  staticClass: "wf-translatable",
5466
5473
  class: {
5467
5474
  'wf-translated': _vm.translated
5468
- },
5469
- domProps: {
5470
- "innerHTML": _vm._s(_vm.value)
5471
5475
  }
5472
- }, [_vm._t("default")], 2);
5476
+ }, [_vm.value == '' ? _vm._t("default") : _vm._e(), _vm._v("\n " + _vm._s(_vm.value) + "\n")], 2);
5473
5477
  };
5474
5478
 
5475
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: {},
@@ -3505,6 +3503,7 @@ var __vue_component__$e = /*#__PURE__*/normalizeComponent({
3505
3503
  //
3506
3504
  //
3507
3505
  var script$d = {
3506
+ name: "Clock",
3508
3507
  data: function data() {
3509
3508
  return {
3510
3509
  time: new Date()
@@ -3555,7 +3554,7 @@ var __vue_inject_styles__$d = undefined;
3555
3554
  var __vue_scope_id__$d = undefined;
3556
3555
  /* module identifier */
3557
3556
 
3558
- var __vue_module_identifier__$d = "data-v-8424a2d0";
3557
+ var __vue_module_identifier__$d = "data-v-7b4006ab";
3559
3558
  /* functional template */
3560
3559
 
3561
3560
  var __vue_is_functional_template__$d = false;
@@ -3568,9 +3567,7 @@ var __vue_is_functional_template__$d = false;
3568
3567
  var __vue_component__$d = /*#__PURE__*/normalizeComponent({
3569
3568
  render: __vue_render__$d,
3570
3569
  staticRenderFns: __vue_staticRenderFns__$d
3571
- }, __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) {
3572
- !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}));
3573
- });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) {
3574
3571
  var s = document.createElement('script');
3575
3572
  s.type = 'text/javascript';
3576
3573
  s.async = true;
@@ -3584,6 +3581,7 @@ var __vue_component__$d = /*#__PURE__*/normalizeComponent({
3584
3581
  }
3585
3582
 
3586
3583
  var script$c = {
3584
+ name: "Date",
3587
3585
  props: {
3588
3586
  format: {
3589
3587
  type: String,
@@ -3599,16 +3597,16 @@ var script$c = {
3599
3597
  mounted: function mounted() {
3600
3598
  setTimeout(this.addDate, 1000);
3601
3599
 
3602
- if (typeof dayjs_min === "undefined") {
3600
+ if (typeof dayjs === "undefined") {
3603
3601
  console.warn("WFDate dayjs is not loaded");
3604
3602
  }
3605
3603
 
3606
3604
  this.loadLocale(this.language);
3607
3605
  },
3608
3606
  computed: _objectSpread2(_objectSpread2({}, mapState('wf', ['language'])), {}, {
3609
- date: function date() {
3610
- if (typeof dayjs_min !== "undefined") {
3611
- 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);
3612
3610
  } else {
3613
3611
  return this.time.toLocaleString(this.language, {
3614
3612
  "dateStyle": "long"
@@ -3620,12 +3618,12 @@ var script$c = {
3620
3618
  language: function language() {
3621
3619
  this.time = new Date();
3622
3620
 
3623
- if (typeof dayjs_min !== "undefined") {
3621
+ if (typeof dayjs !== "undefined") {
3624
3622
  if (!this.locales[this.language]) {
3625
3623
  this.loadLocale(this.language);
3626
3624
  }
3627
3625
 
3628
- dayjs_min.locale(this.language);
3626
+ dayjs.locale(this.language);
3629
3627
  }
3630
3628
  }
3631
3629
  },
@@ -3640,6 +3638,10 @@ var script$c = {
3640
3638
  loadScript(this.$wayfinder.options.assetsLocation + "/dayjs/locale/" + locale + ".js", function (a) {
3641
3639
  console.log('locale.loaded', a, locale, _this.language);
3642
3640
  _this.locales[locale] = true;
3641
+
3642
+ if (_this.language == locale && dayjs) {
3643
+ dayjs.locale(_this.language);
3644
+ }
3643
3645
  });
3644
3646
  }
3645
3647
  }
@@ -3656,7 +3658,7 @@ var __vue_render__$c = function __vue_render__() {
3656
3658
 
3657
3659
  return _c('div', {
3658
3660
  staticClass: "wf-date"
3659
- }, [_vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.date) + "\n"))]);
3661
+ }, [_vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.datestr) + "\n"))]);
3660
3662
  };
3661
3663
 
3662
3664
  var __vue_staticRenderFns__$c = [];
@@ -3668,7 +3670,7 @@ var __vue_inject_styles__$c = undefined;
3668
3670
  var __vue_scope_id__$c = undefined;
3669
3671
  /* module identifier */
3670
3672
 
3671
- var __vue_module_identifier__$c = "data-v-30605052";
3673
+ var __vue_module_identifier__$c = "data-v-b52739fe";
3672
3674
  /* functional template */
3673
3675
 
3674
3676
  var __vue_is_functional_template__$c = false;
@@ -4828,19 +4830,25 @@ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
4828
4830
  },
4829
4831
  watch: {
4830
4832
  language: function language() {
4833
+ console.log('trans.language');
4834
+
4831
4835
  if (this.$wayfinder) {
4832
4836
  this.update();
4833
4837
  }
4834
4838
  },
4835
- key: function key() {
4839
+ k: function k() {
4840
+ console.log('trans.key');
4836
4841
  this.update();
4837
4842
  }
4838
4843
  },
4839
4844
  mounted: function mounted() {
4845
+ console.log('trans.mounted');
4840
4846
  this.update();
4841
4847
  },
4842
4848
  methods: {
4843
4849
  update: function update() {
4850
+ console.log('trans.updated', this.$wayfinder, this.k);
4851
+
4844
4852
  if (this.$wayfinder && this.k && this.k.length > 0 && this.$wayfinder.translator.exists(this.k)) {
4845
4853
  console.log('trans.update', this.k, this.params, this.$wayfinder.translator.get(this.k, this.params));
4846
4854
  this.value = this.$wayfinder.translator.get(this.k, this.params);
@@ -4862,11 +4870,8 @@ var __vue_render__$1 = function __vue_render__() {
4862
4870
  staticClass: "wf-translatable",
4863
4871
  class: {
4864
4872
  'wf-translated': _vm.translated
4865
- },
4866
- domProps: {
4867
- "innerHTML": _vm._s(_vm.value)
4868
4873
  }
4869
- }, [_vm._t("default")], 2);
4874
+ }, [_vm.value == '' ? _vm._t("default") : _vm._e(), _vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.value) + "\n"))], 2);
4870
4875
  };
4871
4876
 
4872
4877
  var __vue_staticRenderFns__$1 = [];
@@ -4878,7 +4883,7 @@ var __vue_inject_styles__$1 = undefined;
4878
4883
  var __vue_scope_id__$1 = undefined;
4879
4884
  /* module identifier */
4880
4885
 
4881
- var __vue_module_identifier__$1 = "data-v-6b23d0c2";
4886
+ var __vue_module_identifier__$1 = "data-v-e6c19c38";
4882
4887
  /* functional template */
4883
4888
 
4884
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.1",
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",
@@ -6,6 +6,7 @@
6
6
 
7
7
  <script>
8
8
  export default {
9
+ name: "Clock",
9
10
  data() {
10
11
  return {
11
12
  time: new Date()
@@ -23,7 +24,6 @@ export default {
23
24
  },
24
25
  seconds() {
25
26
  return (this.time.getSeconds() < 10 ? "0" : "") + this.time.getSeconds()
26
- return (this.time.getSeconds() < 10 ? "0" : "") + this.time.getSeconds()
27
27
  },
28
28
  },
29
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) {
@@ -22,6 +21,7 @@ function loadScript(url, callback) {
22
21
  }
23
22
 
24
23
  export default {
24
+ name: "Date",
25
25
  props: {
26
26
  format: {type: String, default: "DD.MM" },
27
27
  },
@@ -40,7 +40,7 @@ export default {
40
40
  },
41
41
  computed: {
42
42
  ...mapState('wf', ['language']),
43
- date() {
43
+ datestr() {
44
44
  if (typeof dayjs !== "undefined") {
45
45
  return dayjs(this.time).format(this.format);
46
46
  }
@@ -70,6 +70,9 @@ export default {
70
70
  loadScript(this.$wayfinder.options.assetsLocation + "/dayjs/locale/" + locale + ".js", (a) => {
71
71
  console.log('locale.loaded', a, locale, this.language)
72
72
  this.locales[locale] = true;
73
+ if (this.language == locale && dayjs) {
74
+ dayjs.locale(this.language);
75
+ }
73
76
  });
74
77
  }
75
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