@dialpad/dialtone-vue 2.9.1 → 2.10.0

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.
@@ -14877,18 +14877,20 @@ var select_menu_component = normalizeComponent(
14877
14877
  ;// CONCATENATED MODULE: ./components/select_menu/index.js
14878
14878
 
14879
14879
 
14880
- ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/toast/toast.vue?vue&type=template&id=6db045bb&
14881
- var toastvue_type_template_id_6db045bb_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.hidden)?_c('div',{class:[
14880
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/toast/toast.vue?vue&type=template&id=7c8c2d2a&
14881
+ var toastvue_type_template_id_7c8c2d2a_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isShown)?_c('div',{class:[
14882
14882
  'd-toast',
14883
14883
  _vm.kindClass,
14884
- { 'd-toast--important': _vm.important } ],attrs:{"data-qa":"dt-toast","aria-hidden":_vm.hidden.toString()}},[_c('div',{staticClass:"d-toast__dialog"},[_c('dt-notice-icon',_vm._g({attrs:{"kind":_vm.kind}},_vm.$listeners),[_vm._t("icon")],2),_c('dt-notice-content',_vm._g({attrs:{"title-id":_vm.titleId,"content-id":_vm.contentId,"title":_vm.title,"role":_vm.role},scopedSlots:_vm._u([{key:"titleOverride",fn:function(){return [_vm._t("titleOverride")]},proxy:true}],null,true)},_vm.$listeners),[_vm._t("default",function(){return [_vm._v(" "+_vm._s(_vm.message)+" ")]})],2),_c('dt-notice-action',_vm._g({attrs:{"hide-close":_vm.hideClose,"close-button-props":_vm.closeButtonProps}},_vm.$listeners),[_vm._t("action")],2)],1)]):_vm._e()}
14885
- var toastvue_type_template_id_6db045bb_staticRenderFns = []
14884
+ { 'd-toast--important': _vm.important } ],attrs:{"data-qa":"dt-toast","aria-hidden":(!_vm.isShown).toString()}},[_c('div',{staticClass:"d-toast__dialog"},[_c('dt-notice-icon',_vm._g({attrs:{"kind":_vm.kind}},_vm.$listeners),[_vm._t("icon")],2),_c('dt-notice-content',_vm._g({attrs:{"title-id":_vm.titleId,"content-id":_vm.contentId,"title":_vm.title,"role":_vm.role},scopedSlots:_vm._u([{key:"titleOverride",fn:function(){return [_vm._t("titleOverride")]},proxy:true}],null,true)},_vm.$listeners),[_vm._t("default",function(){return [_vm._v(" "+_vm._s(_vm.message)+" ")]})],2),_c('dt-notice-action',_vm._g({attrs:{"hide-close":_vm.hideClose,"close-button-props":_vm.closeButtonProps}},_vm.noticeActionListeners),[_vm._t("action")],2)],1)]):_vm._e()}
14885
+ var toastvue_type_template_id_7c8c2d2a_staticRenderFns = []
14886
14886
 
14887
14887
 
14888
14888
  ;// CONCATENATED MODULE: ./components/toast/toast_constants.js
14889
14889
  const TOAST_ROLES = ['status', 'alert'];
14890
+ const TOAST_MIN_DURATION = 6000;
14890
14891
  /* harmony default export */ const toast_constants = ({
14891
- TOAST_ROLES
14892
+ TOAST_ROLES,
14893
+ TOAST_MIN_DURATION
14892
14894
  });
14893
14895
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40[0].rules[0].use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/toast/toast.vue?vue&type=script&lang=js&
14894
14896
  //
@@ -15026,6 +15028,17 @@ const TOAST_ROLES = ['status', 'alert'];
15026
15028
  default: false
15027
15029
  },
15028
15030
 
15031
+ /**
15032
+ * Controls whether the toast is shown. If a valid duration is provided, the toast will disappear
15033
+ * after reaching the duration time, so it's convenient to use `.sync` modifier with this prop to update
15034
+ * the data in your component.
15035
+ * Supports .sync modifier
15036
+ */
15037
+ show: {
15038
+ type: Boolean,
15039
+ default: false
15040
+ },
15041
+
15029
15042
  /**
15030
15043
  * Props for the toast close button.
15031
15044
  */
@@ -15044,13 +15057,14 @@ const TOAST_ROLES = ['status', 'alert'];
15044
15057
 
15045
15058
  /**
15046
15059
  * The duration in ms the toast will display before disappearing.
15047
- * Defaults to 6000 ms and the prop validation is that provided duration is equal to or greater than 6000.
15060
+ * The toast won't disappear if the duration is not provided.
15061
+ * If it's provided, it should be equal to or greater than 6000.
15048
15062
  */
15049
15063
  duration: {
15050
15064
  type: Number,
15051
- default: 6000,
15065
+ default: null,
15052
15066
  validator: duration => {
15053
- return duration >= 6000;
15067
+ return duration >= TOAST_MIN_DURATION;
15054
15068
  }
15055
15069
  }
15056
15070
  },
@@ -15058,7 +15072,8 @@ const TOAST_ROLES = ['status', 'alert'];
15058
15072
 
15059
15073
  data() {
15060
15074
  return {
15061
- hidden: true
15075
+ isShown: false,
15076
+ minDuration: TOAST_MIN_DURATION
15062
15077
  };
15063
15078
  },
15064
15079
 
@@ -15072,29 +15087,54 @@ const TOAST_ROLES = ['status', 'alert'];
15072
15087
  base: 'd-toast--base'
15073
15088
  };
15074
15089
  return kindClasses[this.kind];
15090
+ },
15091
+
15092
+ noticeActionListeners() {
15093
+ return { // eslint-disable-next-line vue/no-deprecated-dollar-listeners-api
15094
+ ...this.$listeners,
15095
+ close: event => {
15096
+ this.isShown = false;
15097
+ this.$emit('update:show', false);
15098
+ this.$emit('close', event);
15099
+ }
15100
+ };
15101
+ },
15102
+
15103
+ shouldSetTimeout() {
15104
+ return !!this.duration && this.duration >= this.minDuration;
15075
15105
  }
15076
15106
 
15077
15107
  },
15108
+ watch: {
15109
+ show: {
15110
+ handler: function (show) {
15111
+ this.isShown = show;
15112
+
15113
+ if (show) {
15114
+ this.setTimeout();
15115
+ } else {
15116
+ clearTimeout(this.displayTimer);
15117
+ }
15118
+ },
15119
+ immediate: true
15120
+ }
15121
+ },
15078
15122
 
15079
- /* TODO Vue 3 Migration
15080
- * destroyed() should be updated to unmounted() when migrating to Vue 3.
15081
- */
15082
15123
  // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle
15083
15124
  destroyed() {
15084
- clearTimeout(this.displayTimer);
15125
+ if (this.shouldSetTimeout) {
15126
+ clearTimeout(this.displayTimer);
15127
+ }
15085
15128
  },
15086
15129
 
15087
15130
  methods: {
15088
- show() {
15089
- this.hidden = false;
15090
- this.displayTimer = setTimeout(() => {
15091
- this.hidden = true;
15092
- }, this.duration);
15093
- },
15094
-
15095
- close() {
15096
- this.hidden = true;
15097
- clearTimeout(this.displayTimer);
15131
+ setTimeout() {
15132
+ if (this.shouldSetTimeout) {
15133
+ this.displayTimer = setTimeout(() => {
15134
+ this.isShown = false;
15135
+ this.$emit('update:show', false);
15136
+ }, this.duration);
15137
+ }
15098
15138
  }
15099
15139
 
15100
15140
  }
@@ -15111,8 +15151,8 @@ const TOAST_ROLES = ['status', 'alert'];
15111
15151
  ;
15112
15152
  var toast_component = normalizeComponent(
15113
15153
  toast_toastvue_type_script_lang_js_,
15114
- toastvue_type_template_id_6db045bb_render,
15115
- toastvue_type_template_id_6db045bb_staticRenderFns,
15154
+ toastvue_type_template_id_7c8c2d2a_render,
15155
+ toastvue_type_template_id_7c8c2d2a_staticRenderFns,
15116
15156
  false,
15117
15157
  null,
15118
15158
  null,
@@ -14895,18 +14895,20 @@ var select_menu_component = normalizeComponent(
14895
14895
  ;// CONCATENATED MODULE: ./components/select_menu/index.js
14896
14896
 
14897
14897
 
14898
- ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/toast/toast.vue?vue&type=template&id=6db045bb&
14899
- var toastvue_type_template_id_6db045bb_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.hidden)?_c('div',{class:[
14898
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/toast/toast.vue?vue&type=template&id=7c8c2d2a&
14899
+ var toastvue_type_template_id_7c8c2d2a_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isShown)?_c('div',{class:[
14900
14900
  'd-toast',
14901
14901
  _vm.kindClass,
14902
- { 'd-toast--important': _vm.important } ],attrs:{"data-qa":"dt-toast","aria-hidden":_vm.hidden.toString()}},[_c('div',{staticClass:"d-toast__dialog"},[_c('dt-notice-icon',_vm._g({attrs:{"kind":_vm.kind}},_vm.$listeners),[_vm._t("icon")],2),_c('dt-notice-content',_vm._g({attrs:{"title-id":_vm.titleId,"content-id":_vm.contentId,"title":_vm.title,"role":_vm.role},scopedSlots:_vm._u([{key:"titleOverride",fn:function(){return [_vm._t("titleOverride")]},proxy:true}],null,true)},_vm.$listeners),[_vm._t("default",function(){return [_vm._v(" "+_vm._s(_vm.message)+" ")]})],2),_c('dt-notice-action',_vm._g({attrs:{"hide-close":_vm.hideClose,"close-button-props":_vm.closeButtonProps}},_vm.$listeners),[_vm._t("action")],2)],1)]):_vm._e()}
14903
- var toastvue_type_template_id_6db045bb_staticRenderFns = []
14902
+ { 'd-toast--important': _vm.important } ],attrs:{"data-qa":"dt-toast","aria-hidden":(!_vm.isShown).toString()}},[_c('div',{staticClass:"d-toast__dialog"},[_c('dt-notice-icon',_vm._g({attrs:{"kind":_vm.kind}},_vm.$listeners),[_vm._t("icon")],2),_c('dt-notice-content',_vm._g({attrs:{"title-id":_vm.titleId,"content-id":_vm.contentId,"title":_vm.title,"role":_vm.role},scopedSlots:_vm._u([{key:"titleOverride",fn:function(){return [_vm._t("titleOverride")]},proxy:true}],null,true)},_vm.$listeners),[_vm._t("default",function(){return [_vm._v(" "+_vm._s(_vm.message)+" ")]})],2),_c('dt-notice-action',_vm._g({attrs:{"hide-close":_vm.hideClose,"close-button-props":_vm.closeButtonProps}},_vm.noticeActionListeners),[_vm._t("action")],2)],1)]):_vm._e()}
14903
+ var toastvue_type_template_id_7c8c2d2a_staticRenderFns = []
14904
14904
 
14905
14905
 
14906
14906
  ;// CONCATENATED MODULE: ./components/toast/toast_constants.js
14907
14907
  const TOAST_ROLES = ['status', 'alert'];
14908
+ const TOAST_MIN_DURATION = 6000;
14908
14909
  /* harmony default export */ const toast_constants = ({
14909
- TOAST_ROLES
14910
+ TOAST_ROLES,
14911
+ TOAST_MIN_DURATION
14910
14912
  });
14911
14913
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-80[0].rules[0].use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/toast/toast.vue?vue&type=script&lang=js&
14912
14914
  //
@@ -15044,6 +15046,17 @@ const TOAST_ROLES = ['status', 'alert'];
15044
15046
  default: false
15045
15047
  },
15046
15048
 
15049
+ /**
15050
+ * Controls whether the toast is shown. If a valid duration is provided, the toast will disappear
15051
+ * after reaching the duration time, so it's convenient to use `.sync` modifier with this prop to update
15052
+ * the data in your component.
15053
+ * Supports .sync modifier
15054
+ */
15055
+ show: {
15056
+ type: Boolean,
15057
+ default: false
15058
+ },
15059
+
15047
15060
  /**
15048
15061
  * Props for the toast close button.
15049
15062
  */
@@ -15062,13 +15075,14 @@ const TOAST_ROLES = ['status', 'alert'];
15062
15075
 
15063
15076
  /**
15064
15077
  * The duration in ms the toast will display before disappearing.
15065
- * Defaults to 6000 ms and the prop validation is that provided duration is equal to or greater than 6000.
15078
+ * The toast won't disappear if the duration is not provided.
15079
+ * If it's provided, it should be equal to or greater than 6000.
15066
15080
  */
15067
15081
  duration: {
15068
15082
  type: Number,
15069
- default: 6000,
15083
+ default: null,
15070
15084
  validator: duration => {
15071
- return duration >= 6000;
15085
+ return duration >= TOAST_MIN_DURATION;
15072
15086
  }
15073
15087
  }
15074
15088
  },
@@ -15076,7 +15090,8 @@ const TOAST_ROLES = ['status', 'alert'];
15076
15090
 
15077
15091
  data() {
15078
15092
  return {
15079
- hidden: true
15093
+ isShown: false,
15094
+ minDuration: TOAST_MIN_DURATION
15080
15095
  };
15081
15096
  },
15082
15097
 
@@ -15090,29 +15105,54 @@ const TOAST_ROLES = ['status', 'alert'];
15090
15105
  base: 'd-toast--base'
15091
15106
  };
15092
15107
  return kindClasses[this.kind];
15108
+ },
15109
+
15110
+ noticeActionListeners() {
15111
+ return { // eslint-disable-next-line vue/no-deprecated-dollar-listeners-api
15112
+ ...this.$listeners,
15113
+ close: event => {
15114
+ this.isShown = false;
15115
+ this.$emit('update:show', false);
15116
+ this.$emit('close', event);
15117
+ }
15118
+ };
15119
+ },
15120
+
15121
+ shouldSetTimeout() {
15122
+ return !!this.duration && this.duration >= this.minDuration;
15093
15123
  }
15094
15124
 
15095
15125
  },
15126
+ watch: {
15127
+ show: {
15128
+ handler: function (show) {
15129
+ this.isShown = show;
15130
+
15131
+ if (show) {
15132
+ this.setTimeout();
15133
+ } else {
15134
+ clearTimeout(this.displayTimer);
15135
+ }
15136
+ },
15137
+ immediate: true
15138
+ }
15139
+ },
15096
15140
 
15097
- /* TODO Vue 3 Migration
15098
- * destroyed() should be updated to unmounted() when migrating to Vue 3.
15099
- */
15100
15141
  // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle
15101
15142
  destroyed() {
15102
- clearTimeout(this.displayTimer);
15143
+ if (this.shouldSetTimeout) {
15144
+ clearTimeout(this.displayTimer);
15145
+ }
15103
15146
  },
15104
15147
 
15105
15148
  methods: {
15106
- show() {
15107
- this.hidden = false;
15108
- this.displayTimer = setTimeout(() => {
15109
- this.hidden = true;
15110
- }, this.duration);
15111
- },
15112
-
15113
- close() {
15114
- this.hidden = true;
15115
- clearTimeout(this.displayTimer);
15149
+ setTimeout() {
15150
+ if (this.shouldSetTimeout) {
15151
+ this.displayTimer = setTimeout(() => {
15152
+ this.isShown = false;
15153
+ this.$emit('update:show', false);
15154
+ }, this.duration);
15155
+ }
15116
15156
  }
15117
15157
 
15118
15158
  }
@@ -15129,8 +15169,8 @@ const TOAST_ROLES = ['status', 'alert'];
15129
15169
  ;
15130
15170
  var toast_component = normalizeComponent(
15131
15171
  toast_toastvue_type_script_lang_js_,
15132
- toastvue_type_template_id_6db045bb_render,
15133
- toastvue_type_template_id_6db045bb_staticRenderFns,
15172
+ toastvue_type_template_id_7c8c2d2a_render,
15173
+ toastvue_type_template_id_7c8c2d2a_staticRenderFns,
15134
15174
  false,
15135
15175
  null,
15136
15176
  null,