quasar 2.14.0 → 2.14.2

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.
Files changed (133) hide show
  1. package/dist/api/Notify.json +2 -2
  2. package/dist/api/QTime.json +8 -1
  3. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  4. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  5. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  6. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  7. package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
  8. package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
  9. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  10. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  11. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  12. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  13. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  14. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  15. package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
  16. package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
  17. package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
  18. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  19. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  20. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  21. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  22. package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
  23. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +2 -2
  24. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  25. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  39. package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
  40. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  41. package/dist/icon-set/themify.umd.prod.js +1 -1
  42. package/dist/lang/ar-TN.umd.prod.js +1 -1
  43. package/dist/lang/ar.umd.prod.js +1 -1
  44. package/dist/lang/az-Latn.umd.prod.js +1 -1
  45. package/dist/lang/bg.umd.prod.js +1 -1
  46. package/dist/lang/bn.umd.prod.js +1 -1
  47. package/dist/lang/ca.umd.prod.js +1 -1
  48. package/dist/lang/cs.umd.prod.js +1 -1
  49. package/dist/lang/da.umd.prod.js +1 -1
  50. package/dist/lang/de-CH.umd.prod.js +1 -1
  51. package/dist/lang/de-DE.umd.prod.js +1 -1
  52. package/dist/lang/de.umd.prod.js +1 -1
  53. package/dist/lang/el.umd.prod.js +1 -1
  54. package/dist/lang/en-GB.umd.prod.js +1 -1
  55. package/dist/lang/en-US.umd.prod.js +1 -1
  56. package/dist/lang/eo.umd.prod.js +1 -1
  57. package/dist/lang/es.umd.prod.js +1 -1
  58. package/dist/lang/et.umd.prod.js +1 -1
  59. package/dist/lang/eu.umd.prod.js +1 -1
  60. package/dist/lang/fa-IR.umd.prod.js +1 -1
  61. package/dist/lang/fa.umd.prod.js +1 -1
  62. package/dist/lang/fi.umd.prod.js +1 -1
  63. package/dist/lang/fr.umd.prod.js +1 -1
  64. package/dist/lang/gn.umd.prod.js +1 -1
  65. package/dist/lang/he.umd.prod.js +1 -1
  66. package/dist/lang/hi.umd.prod.js +1 -1
  67. package/dist/lang/hr.umd.prod.js +1 -1
  68. package/dist/lang/hu.umd.prod.js +1 -1
  69. package/dist/lang/id.umd.prod.js +1 -1
  70. package/dist/lang/is.umd.prod.js +1 -1
  71. package/dist/lang/it.umd.prod.js +1 -1
  72. package/dist/lang/ja.umd.prod.js +1 -1
  73. package/dist/lang/kk.umd.prod.js +1 -1
  74. package/dist/lang/km.umd.prod.js +1 -1
  75. package/dist/lang/ko-KR.umd.prod.js +1 -1
  76. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  77. package/dist/lang/lt.umd.prod.js +1 -1
  78. package/dist/lang/lu.umd.prod.js +1 -1
  79. package/dist/lang/lv.umd.prod.js +1 -1
  80. package/dist/lang/mk.umd.prod.js +1 -1
  81. package/dist/lang/ml.umd.prod.js +1 -1
  82. package/dist/lang/mm.umd.prod.js +1 -1
  83. package/dist/lang/ms.umd.prod.js +2 -2
  84. package/dist/lang/my.umd.prod.js +1 -1
  85. package/dist/lang/nb-NO.umd.prod.js +1 -1
  86. package/dist/lang/nl.umd.prod.js +1 -1
  87. package/dist/lang/pl.umd.prod.js +1 -1
  88. package/dist/lang/pt-BR.umd.prod.js +1 -1
  89. package/dist/lang/pt.umd.prod.js +1 -1
  90. package/dist/lang/ro.umd.prod.js +1 -1
  91. package/dist/lang/ru.umd.prod.js +1 -1
  92. package/dist/lang/sk.umd.prod.js +1 -1
  93. package/dist/lang/sl.umd.prod.js +1 -1
  94. package/dist/lang/sm.umd.prod.js +1 -1
  95. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  96. package/dist/lang/sr.umd.prod.js +1 -1
  97. package/dist/lang/sv.umd.prod.js +1 -1
  98. package/dist/lang/ta.umd.prod.js +1 -1
  99. package/dist/lang/th.umd.prod.js +1 -1
  100. package/dist/lang/tr.umd.prod.js +1 -1
  101. package/dist/lang/ug.umd.prod.js +1 -1
  102. package/dist/lang/uk.umd.prod.js +1 -1
  103. package/dist/lang/uz-Cyrl.umd.prod.js +1 -1
  104. package/dist/lang/uz-Latn.umd.prod.js +1 -1
  105. package/dist/lang/vi.umd.prod.js +1 -1
  106. package/dist/lang/zh-CN.umd.prod.js +1 -1
  107. package/dist/lang/zh-TW.umd.prod.js +1 -1
  108. package/dist/quasar.cjs.prod.js +2 -2
  109. package/dist/quasar.esm.js +120 -85
  110. package/dist/quasar.esm.prod.js +2 -2
  111. package/dist/quasar.sass +1 -1
  112. package/dist/quasar.umd.js +120 -85
  113. package/dist/quasar.umd.prod.js +2 -2
  114. package/dist/types/index.d.ts +8 -5
  115. package/dist/web-types/web-types.json +1 -1
  116. package/lang/ms.js +1 -1
  117. package/lang/ms.mjs +1 -1
  118. package/package.json +1 -1
  119. package/src/components/btn/QBtn.js +2 -2
  120. package/src/components/circular-progress/QCircularProgress.js +9 -4
  121. package/src/components/color/QColor.js +5 -9
  122. package/src/components/date/QDate.js +16 -4
  123. package/src/components/editor/QEditor.js +1 -1
  124. package/src/components/range/QRange.js +8 -8
  125. package/src/components/resize-observer/QResizeObserver.js +3 -3
  126. package/src/components/select/QSelect.js +3 -4
  127. package/src/components/slider/QSlider.js +2 -2
  128. package/src/components/slider/use-slider.js +15 -9
  129. package/src/components/time/QTime.json +4 -1
  130. package/src/composables/private/use-field.js +0 -3
  131. package/src/composables/private/use-validate.js +49 -30
  132. package/src/plugins/Notify.js +4 -3
  133. package/src/plugins/Notify.json +2 -2
@@ -12810,10 +12810,13 @@ export interface QTimeProps {
12810
12810
  * @param hr Hour
12811
12811
  * @param min Minutes
12812
12812
  * @param sec Seconds
12813
+ * @returns Is the user allowed to set the specified time?
12813
12814
  */
12814
- options?:
12815
- | ((hr: number, min: number | null, sec: number | null) => void)
12816
- | undefined;
12815
+ options?: (
12816
+ hr: number,
12817
+ min: number | null,
12818
+ sec: number | null
12819
+ ) => boolean | null | undefined;
12817
12820
  /**
12818
12821
  * Optionally configure what hours is the user allowed to set; Overrides 'options' prop if that is also set
12819
12822
  */
@@ -14513,7 +14516,7 @@ export interface QNotifyCreateOptions {
14513
14516
  */
14514
14517
  attrs?: any;
14515
14518
  /**
14516
- * Amount of time to display (in milliseconds)
14519
+ * Amount of time to display (in milliseconds). Set to 0 to never dismiss automatically.
14517
14520
  * Default value: 5000
14518
14521
  */
14519
14522
  timeout?: number;
@@ -15527,7 +15530,7 @@ declare module "./config.d.ts" {
15527
15530
  */
15528
15531
  attrs?: any;
15529
15532
  /**
15530
- * Amount of time to display (in milliseconds)
15533
+ * Amount of time to display (in milliseconds). Set to 0 to never dismiss automatically.
15531
15534
  * Default value: 5000
15532
15535
  */
15533
15536
  timeout?: number;
@@ -2,7 +2,7 @@
2
2
  "$schema": "",
3
3
  "framework": "vue",
4
4
  "name": "quasar",
5
- "version": "2.14.0",
5
+ "version": "2.14.2",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
package/lang/ms.js CHANGED
@@ -25,7 +25,7 @@ module.exports = {
25
25
  },
26
26
  date: {
27
27
  days: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jummat_Sabtu'.split('_'),
28
- daysShort: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jummat_Sabtu'.split('_'),
28
+ daysShort: 'Aha_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
29
29
  months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_Oktober_November_Disember'.split('_'),
30
30
  monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogos_Sep_Okt_Nov_Dis'.split('_'),
31
31
  firstDayOfWeek: 1, // 0-6, 0 - Sunday, 1 Monday, ...
package/lang/ms.mjs CHANGED
@@ -20,7 +20,7 @@ export default {
20
20
  },
21
21
  date: {
22
22
  days: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jummat_Sabtu'.split('_'),
23
- daysShort: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jummat_Sabtu'.split('_'),
23
+ daysShort: 'Aha_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
24
24
  months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_Oktober_November_Disember'.split('_'),
25
25
  monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogos_Sep_Okt_Nov_Dis'.split('_'),
26
26
  firstDayOfWeek: 1, // 0-6, 0 - Sunday, 1 Monday, ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar",
3
- "version": "2.14.0",
3
+ "version": "2.14.2",
4
4
  "description": "Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time",
5
5
  "main": "dist/quasar.cjs.prod.js",
6
6
  "module": "dist/quasar.esm.prod.js",
@@ -297,7 +297,7 @@ export default createComponent({
297
297
  props.icon !== void 0 && inner.push(
298
298
  h(QIcon, {
299
299
  name: props.icon,
300
- left: props.stack === false && hasLabel.value === true,
300
+ left: props.stack !== true && hasLabel.value === true,
301
301
  role: 'img',
302
302
  'aria-hidden': 'true'
303
303
  })
@@ -313,7 +313,7 @@ export default createComponent({
313
313
  inner.push(
314
314
  h(QIcon, {
315
315
  name: props.iconRight,
316
- right: props.stack === false && hasLabel.value === true,
316
+ right: props.stack !== true && hasLabel.value === true,
317
317
  role: 'img',
318
318
  'aria-hidden': 'true'
319
319
  })
@@ -60,11 +60,16 @@ export default createComponent({
60
60
 
61
61
  const normalized = computed(() => between(props.value, props.min, props.max))
62
62
 
63
- const strokeDashOffset = computed(() => circumference * (
64
- 1 - (normalized.value - props.min) / (props.max - props.min)
65
- ))
66
-
63
+ const range = computed(() => props.max - props.min)
67
64
  const strokeWidth = computed(() => props.thickness / 2 * viewBox.value)
65
+ const strokeDashOffset = computed(() => {
66
+ const dashRatio = (props.max - normalized.value) / range.value
67
+ const dashGap = props.rounded === true && normalized.value < props.max && dashRatio < 0.25
68
+ ? strokeWidth.value / 2 * (1 - dashRatio / 0.25)
69
+ : 0
70
+
71
+ return circumference * dashRatio + dashGap
72
+ })
68
73
 
69
74
  function getCircle ({ thickness, offset, color, cls, rounded }) {
70
75
  return h('circle', {
@@ -176,15 +176,11 @@ export default createComponent({
176
176
  + (isDark.value === true ? ' q-color-picker--dark q-dark' : '')
177
177
  )
178
178
 
179
- const attributes = computed(() => {
180
- if (props.disable === true) {
181
- return { 'aria-disabled': 'true' }
182
- }
183
- if (props.readonly === true) {
184
- return { 'aria-readonly': 'true' }
185
- }
186
- return {}
187
- })
179
+ const attributes = computed(() => (
180
+ props.disable === true
181
+ ? { 'aria-disabled': 'true' }
182
+ : {}
183
+ ))
188
184
 
189
185
  const spectrumDirective = computed(() => {
190
186
  // if editable.value === true
@@ -694,7 +694,7 @@ export default createComponent({
694
694
  const attributes = computed(() => (
695
695
  props.disable === true
696
696
  ? { 'aria-disabled': 'true' }
697
- : (props.readonly === true ? { 'aria-readonly': 'true' } : {})
697
+ : {}
698
698
  ))
699
699
 
700
700
  watch(() => props.modelValue, v => {
@@ -728,10 +728,22 @@ export default createComponent({
728
728
  })
729
729
 
730
730
  function setToday () {
731
- const date = today.value
732
- const month = daysMap.value[ getMonthHash(date) ]
731
+ const { year, month, day } = today.value
733
732
 
734
- if (month === void 0 || month.includes(date.day) === false) {
733
+ const date = {
734
+ // contains more props than needed (hour, minute, second, millisecond)
735
+ // but those aren't used in the processing of this "date" variable
736
+ ...viewModel.value,
737
+
738
+ // overwriting with today's date
739
+ year,
740
+ month,
741
+ day
742
+ }
743
+
744
+ const monthMap = daysMap.value[ getMonthHash(date) ]
745
+
746
+ if (monthMap === void 0 || monthMap.includes(date.day) === false) {
735
747
  addToModel(date)
736
748
  }
737
749
 
@@ -323,7 +323,7 @@ export default createComponent({
323
323
  const attributes = computed(() => (
324
324
  props.disable === true
325
325
  ? { 'aria-disabled': 'true' }
326
- : (props.readonly === true ? { 'aria-readonly': 'true' } : {})
326
+ : {}
327
327
  ))
328
328
 
329
329
  function onInput () {
@@ -288,15 +288,15 @@ export default createComponent({
288
288
  case dragType.RANGE:
289
289
  const
290
290
  ratioDelta = ratio - dragging.offsetRatio,
291
- minR = between(dragging.ratioMin + ratioDelta, 0, 1 - dragging.rangeRatio),
291
+ minR = between(dragging.ratioMin + ratioDelta, state.innerMinRatio.value, state.innerMaxRatio.value - dragging.rangeRatio),
292
292
  modelDelta = localModel - dragging.offsetModel,
293
- min = between(dragging.valueMin + modelDelta, props.min, props.max - dragging.rangeValue)
293
+ min = between(dragging.valueMin + modelDelta, state.innerMin.value, state.innerMax.value - dragging.rangeValue)
294
294
 
295
295
  pos = {
296
296
  minR,
297
297
  maxR: minR + dragging.rangeRatio,
298
- min: parseFloat(min.toFixed(state.decimals.value)),
299
- max: parseFloat((min + dragging.rangeValue).toFixed(state.decimals.value))
298
+ min: state.roundValueFn.value(min),
299
+ max: state.roundValueFn.value(min + dragging.rangeValue)
300
300
  }
301
301
 
302
302
  state.focus.value = 'both'
@@ -326,7 +326,7 @@ export default createComponent({
326
326
  stopAndPrevent(evt)
327
327
 
328
328
  const
329
- stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * state.step.value,
329
+ stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * state.keyStep.value,
330
330
  offset = (
331
331
  ([ 34, 37, 40 ].includes(evt.keyCode) ? -1 : 1)
332
332
  * (state.isReversed.value === true ? -1 : 1)
@@ -336,14 +336,14 @@ export default createComponent({
336
336
  if (state.focus.value === 'both') {
337
337
  const interval = model.value.max - model.value.min
338
338
  const min = between(
339
- parseFloat((model.value.min + offset).toFixed(state.decimals.value)),
339
+ state.roundValueFn.value(model.value.min + offset),
340
340
  state.innerMin.value,
341
341
  state.innerMax.value - interval
342
342
  )
343
343
 
344
344
  model.value = {
345
345
  min,
346
- max: parseFloat((min + interval).toFixed(state.decimals.value))
346
+ max: state.roundValueFn.value(min + interval)
347
347
  }
348
348
  }
349
349
  else if (state.focus.value === false) {
@@ -355,7 +355,7 @@ export default createComponent({
355
355
  model.value = {
356
356
  ...model.value,
357
357
  [ which ]: between(
358
- parseFloat((model.value[ which ] + offset).toFixed(state.decimals.value)),
358
+ state.roundValueFn.value(model.value[ which ] + offset),
359
359
  which === 'min' ? state.innerMin.value : model.value.min,
360
360
  which === 'max' ? state.innerMax.value : model.value.max
361
361
  )
@@ -57,6 +57,9 @@ export default createComponent({
57
57
 
58
58
  const { proxy } = getCurrentInstance()
59
59
 
60
+ // expose public method
61
+ proxy.trigger = trigger
62
+
60
63
  if (hasObserver === true) {
61
64
  let observer
62
65
 
@@ -130,9 +133,6 @@ export default createComponent({
130
133
 
131
134
  onBeforeUnmount(cleanup)
132
135
 
133
- // expose public method
134
- proxy.trigger = trigger
135
-
136
136
  return () => {
137
137
  if (canRender.value === true) {
138
138
  return h('object', {
@@ -319,11 +319,12 @@ export default createComponent({
319
319
 
320
320
  return props.options.slice(from, to).map((opt, i) => {
321
321
  const disable = isOptionDisabled.value(opt) === true
322
+ const active = isOptionSelected(opt) === true
322
323
  const index = from + i
323
324
 
324
325
  const itemProps = {
325
326
  clickable: true,
326
- active: false,
327
+ active,
327
328
  activeClass: computedOptionsSelectedClass.value,
328
329
  manualFocus: true,
329
330
  focused: false,
@@ -332,16 +333,14 @@ export default createComponent({
332
333
  dense: props.optionsDense,
333
334
  dark: isOptionsDark.value,
334
335
  role: 'option',
336
+ 'aria-selected': active === true ? 'true' : 'false',
335
337
  id: `${ state.targetUid.value }_${ index }`,
336
338
  onClick: () => { toggleOption(opt) }
337
339
  }
338
340
 
339
341
  if (disable !== true) {
340
- isOptionSelected(opt) === true && (itemProps.active = true)
341
342
  optionIndex.value === index && (itemProps.focused = true)
342
343
 
343
- itemProps[ 'aria-selected' ] = itemProps.active === true ? 'true' : 'false'
344
-
345
344
  if ($q.platform.is.desktop === true) {
346
345
  itemProps.onMousemove = () => { menu.value === true && setOptionIndex(index) }
347
346
  }
@@ -133,7 +133,7 @@ export default createComponent({
133
133
  stopAndPrevent(evt)
134
134
 
135
135
  const
136
- stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * state.step.value,
136
+ stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * state.keyStep.value,
137
137
  offset = (
138
138
  ([ 34, 37, 40 ].includes(evt.keyCode) ? -1 : 1)
139
139
  * (state.isReversed.value === true ? -1 : 1)
@@ -141,7 +141,7 @@ export default createComponent({
141
141
  )
142
142
 
143
143
  model.value = between(
144
- parseFloat((model.value + offset).toFixed(state.decimals.value)),
144
+ state.roundValueFn.value(model.value + offset),
145
145
  state.innerMin.value,
146
146
  state.innerMax.value
147
147
  )
@@ -129,8 +129,16 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
129
129
  && innerMin.value < innerMax.value
130
130
  ))
131
131
 
132
- const decimals = computed(() => (String(props.step).trim().split('.')[ 1 ] || '').length)
133
- const step = computed(() => (props.step === 0 ? 1 : props.step))
132
+ const roundValueFn = computed(() => {
133
+ if (props.step === 0) {
134
+ return v => v
135
+ }
136
+
137
+ const decimals = (String(props.step).trim().split('.')[ 1 ] || '').length
138
+ return v => parseFloat(v.toFixed(decimals))
139
+ })
140
+
141
+ const keyStep = computed(() => (props.step === 0 ? 1 : props.step))
134
142
  const tabindex = computed(() => (editable.value === true ? props.tabindex || 0 : -1))
135
143
 
136
144
  const trackLen = computed(() => props.max - props.min)
@@ -238,13 +246,11 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
238
246
  let model = min + ratio * (max - min)
239
247
 
240
248
  if (step > 0) {
241
- const modulo = (model - min) % step
249
+ const modulo = (model - innerMin.value) % step
242
250
  model += (Math.abs(modulo) >= step / 2 ? (modulo < 0 ? -1 : 1) * step : 0) - modulo
243
251
  }
244
252
 
245
- if (decimals.value > 0) {
246
- model = parseFloat(model.toFixed(decimals.value))
247
- }
253
+ model = roundValueFn.value(model)
248
254
 
249
255
  return between(model, innerMin.value, innerMax.value)
250
256
  }
@@ -270,7 +276,7 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
270
276
  }
271
277
 
272
278
  const markerStep = computed(() => (
273
- isNumber(props.markers) === true ? props.markers : step.value)
279
+ isNumber(props.markers) === true ? props.markers : keyStep.value)
274
280
  )
275
281
 
276
282
  const markerTicks = computed(() => {
@@ -630,8 +636,8 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
630
636
  tabindex,
631
637
  attributes,
632
638
 
633
- step,
634
- decimals,
639
+ roundValueFn,
640
+ keyStep,
635
641
  trackLen,
636
642
  innerMin,
637
643
  innerMinRatio,
@@ -55,7 +55,10 @@
55
55
  "desc": "Seconds"
56
56
  }
57
57
  },
58
- "returns": null,
58
+ "returns": {
59
+ "type": [ "Boolean", "null", "undefined" ],
60
+ "desc": "Is the user allowed to set the specified time?"
61
+ },
59
62
  "examples": [
60
63
  ":options=\"(hr, min, sec) => hr <= 6\""
61
64
  ],
@@ -259,9 +259,6 @@ export default function (state) {
259
259
  if (props.disable === true) {
260
260
  acc[ 'aria-disabled' ] = 'true'
261
261
  }
262
- else if (props.readonly === true) {
263
- acc[ 'aria-readonly' ] = 'true'
264
- }
265
262
 
266
263
  return acc
267
264
  })
@@ -21,6 +21,7 @@ export const useValidateProps = {
21
21
  reactiveRules: Boolean,
22
22
  lazyRules: {
23
23
  type: [ Boolean, String ],
24
+ default: false, // statement unneeded but avoids future vue implementation changes
24
25
  validator: v => lazyRulesValues.includes(v)
25
26
  }
26
27
  }
@@ -42,10 +43,14 @@ export default function (focused, innerLoading) {
42
43
  && props.rules.length !== 0
43
44
  )
44
45
 
45
- const hasActiveRules = computed(() =>
46
+ const canDebounceValidate = computed(() => (
46
47
  props.disable !== true
47
48
  && hasRules.value === true
48
- )
49
+ // Should not have a validation in progress already;
50
+ // It might mean that focus switched to submit btn and
51
+ // QForm's submit() has been called already (ENTER key)
52
+ && innerLoading.value === false
53
+ ))
49
54
 
50
55
  const hasError = computed(() =>
51
56
  props.error === true || innerError.value === true
@@ -58,15 +63,29 @@ export default function (focused, innerLoading) {
58
63
  ))
59
64
 
60
65
  watch(() => props.modelValue, () => {
61
- validateIfNeeded()
66
+ isDirtyModel.value = true
67
+
68
+ if (
69
+ canDebounceValidate.value === true
70
+ // trigger validation if not using any kind of lazy-rules
71
+ && props.lazyRules === false
72
+ ) {
73
+ debouncedValidate()
74
+ }
62
75
  })
63
76
 
64
77
  watch(() => props.reactiveRules, val => {
65
78
  if (val === true) {
66
79
  if (unwatchRules === void 0) {
67
80
  unwatchRules = watch(() => props.rules, () => {
68
- validateIfNeeded(true)
69
- })
81
+ if (
82
+ canDebounceValidate.value === true
83
+ && isDirtyModel.value === true
84
+ && props.lazyRules !== 'ondemand'
85
+ ) {
86
+ debouncedValidate()
87
+ }
88
+ }, { immediate: true })
70
89
  }
71
90
  }
72
91
  else if (unwatchRules !== void 0) {
@@ -75,25 +94,32 @@ export default function (focused, innerLoading) {
75
94
  }
76
95
  }, { immediate: true })
77
96
 
97
+ watch(() => props.lazyRules, val => {
98
+ if (
99
+ val === false
100
+ && canDebounceValidate.value === true
101
+ && isDirtyModel.value === true
102
+ ) {
103
+ debouncedValidate()
104
+ }
105
+ })
106
+
78
107
  watch(focused, val => {
79
108
  if (val === true) {
80
109
  if (isDirtyModel.value === null) {
81
- isDirtyModel.value = false
110
+ isDirtyModel.value = props.lazyRules === true
82
111
  }
83
112
  }
84
- else if (isDirtyModel.value === false) {
85
- isDirtyModel.value = true
86
-
87
- if (
88
- hasActiveRules.value === true
89
- && props.lazyRules !== 'ondemand'
90
- // Don't re-trigger if it's already in progress;
91
- // It might mean that focus switched to submit btn and
92
- // QForm's submit() has been called already (ENTER key)
93
- && innerLoading.value === false
94
- ) {
95
- debouncedValidate()
96
- }
113
+ else if (
114
+ canDebounceValidate.value === true
115
+ && (
116
+ // props.lazyRules can also be 'ondemand',
117
+ // hence the following form:
118
+ props.lazyRules === false
119
+ || (props.lazyRules === true && isDirtyModel.value === true)
120
+ )
121
+ ) {
122
+ debouncedValidate()
97
123
  }
98
124
  })
99
125
 
@@ -113,7 +139,10 @@ export default function (focused, innerLoading) {
113
139
  * - Promise (pending async validation)
114
140
  */
115
141
  function validate (val = props.modelValue) {
116
- if (hasActiveRules.value !== true) {
142
+ if (
143
+ props.disable === true
144
+ || hasRules.value === false
145
+ ) {
117
146
  return true
118
147
  }
119
148
 
@@ -182,16 +211,6 @@ export default function (focused, innerLoading) {
182
211
  )
183
212
  }
184
213
 
185
- function validateIfNeeded (changedRules) {
186
- if (
187
- hasActiveRules.value === true
188
- && props.lazyRules !== 'ondemand'
189
- && (isDirtyModel.value === true || (props.lazyRules !== true && changedRules !== true))
190
- ) {
191
- debouncedValidate()
192
- }
193
- }
194
-
195
214
  const debouncedValidate = debounce(validate, 0)
196
215
 
197
216
  onBeforeUnmount(() => {
@@ -19,6 +19,7 @@ const notificationsList = {}
19
19
  const positionClass = {}
20
20
  const emptyRE = /^\s*$/
21
21
  const notifRefs = []
22
+ const invalidTimeoutValues = [ void 0, null, true, false, '' ]
22
23
 
23
24
  const positionList = [
24
25
  'top-left', 'top-right',
@@ -112,15 +113,15 @@ function addNotification (config, $q, originalApi) {
112
113
  notif.position = 'bottom'
113
114
  }
114
115
 
115
- if (notif.timeout === void 0) {
116
+ if (invalidTimeoutValues.includes(notif.timeout) === true) {
116
117
  notif.timeout = 5000
117
118
  }
118
119
  else {
119
- const t = parseInt(notif.timeout, 10)
120
+ const t = Number(notif.timeout) // we catch exponential notation too with Number() casting
120
121
  if (isNaN(t) || t < 0) {
121
122
  return logError('wrong timeout', config)
122
123
  }
123
- notif.timeout = t
124
+ notif.timeout = Number.isFinite(t) ? t : 0
124
125
  }
125
126
 
126
127
  if (notif.timeout === 0) {
@@ -166,7 +166,7 @@
166
166
 
167
167
  "timeout": {
168
168
  "type": "Number",
169
- "desc": "Amount of time to display (in milliseconds)",
169
+ "desc": "Amount of time to display (in milliseconds). Set to 0 to never dismiss automatically.",
170
170
  "default": 5000
171
171
  },
172
172
 
@@ -392,7 +392,7 @@
392
392
 
393
393
  "timeout": {
394
394
  "type": "Number",
395
- "desc": "Amount of time to display (in milliseconds)",
395
+ "desc": "Amount of time to display (in milliseconds). Set to 0 to never dismiss automatically.",
396
396
  "default": 5000,
397
397
  "examples": [ 2500 ]
398
398
  },