quasar 2.1.8 → 2.2.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 (145) hide show
  1. package/dist/api/QCarousel.json +19 -5
  2. package/dist/api/QColor.json +6 -0
  3. package/dist/api/QInnerLoading.json +32 -0
  4. package/dist/api/QOptionGroup.json +58 -1
  5. package/dist/api/QRange.json +10 -3
  6. package/dist/api/QSeparator.json +1 -1
  7. package/dist/api/QSkeleton.json +14 -0
  8. package/dist/api/QSlider.json +10 -3
  9. package/dist/api/QStepper.json +16 -2
  10. package/dist/api/QTabPanels.json +16 -2
  11. package/dist/api/QTable.json +5 -0
  12. package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
  13. package/dist/icon-set/eva-icons.umd.prod.js +1 -1
  14. package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
  15. package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
  16. package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
  17. package/dist/icon-set/line-awesome.umd.prod.js +1 -1
  18. package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
  19. package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
  20. package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
  21. package/dist/icon-set/material-icons.umd.prod.js +1 -1
  22. package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
  23. package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
  24. package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
  25. package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
  26. package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
  27. package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
  28. package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
  29. package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
  30. package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
  31. package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
  32. package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
  33. package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
  34. package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
  35. package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
  36. package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
  37. package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
  38. package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
  39. package/dist/icon-set/svg-themify.umd.prod.js +1 -1
  40. package/dist/icon-set/themify.umd.prod.js +1 -1
  41. package/dist/lang/ar.umd.prod.js +1 -1
  42. package/dist/lang/az-Latn.umd.prod.js +1 -1
  43. package/dist/lang/bg.umd.prod.js +1 -1
  44. package/dist/lang/bn.umd.prod.js +1 -1
  45. package/dist/lang/ca.umd.prod.js +1 -1
  46. package/dist/lang/cs.umd.prod.js +1 -1
  47. package/dist/lang/da.umd.prod.js +1 -1
  48. package/dist/lang/de.umd.prod.js +1 -1
  49. package/dist/lang/el.umd.prod.js +1 -1
  50. package/dist/lang/en-GB.umd.prod.js +1 -1
  51. package/dist/lang/en-US.umd.prod.js +1 -1
  52. package/dist/lang/eo.umd.prod.js +1 -1
  53. package/dist/lang/es.umd.prod.js +1 -1
  54. package/dist/lang/et.umd.prod.js +1 -1
  55. package/dist/lang/fa-IR.umd.prod.js +1 -1
  56. package/dist/lang/fa.umd.prod.js +1 -1
  57. package/dist/lang/fi.umd.prod.js +1 -1
  58. package/dist/lang/fr.umd.prod.js +1 -1
  59. package/dist/lang/gn.umd.prod.js +1 -1
  60. package/dist/lang/he.umd.prod.js +1 -1
  61. package/dist/lang/hr.umd.prod.js +1 -1
  62. package/dist/lang/hu.umd.prod.js +1 -1
  63. package/dist/lang/id.umd.prod.js +1 -1
  64. package/dist/lang/is.umd.prod.js +1 -1
  65. package/dist/lang/it.umd.prod.js +1 -1
  66. package/dist/lang/ja.umd.prod.js +1 -1
  67. package/dist/lang/km.umd.prod.js +1 -1
  68. package/dist/lang/ko-KR.umd.prod.js +1 -1
  69. package/dist/lang/kur-CKB.umd.prod.js +1 -1
  70. package/dist/lang/lt.umd.prod.js +6 -0
  71. package/dist/lang/lu.umd.prod.js +1 -1
  72. package/dist/lang/lv.umd.prod.js +1 -1
  73. package/dist/lang/ml.umd.prod.js +1 -1
  74. package/dist/lang/ms.umd.prod.js +1 -1
  75. package/dist/lang/nb-NO.umd.prod.js +1 -1
  76. package/dist/lang/nl.umd.prod.js +1 -1
  77. package/dist/lang/pl.umd.prod.js +1 -1
  78. package/dist/lang/pt-BR.umd.prod.js +1 -1
  79. package/dist/lang/pt.umd.prod.js +1 -1
  80. package/dist/lang/ro.umd.prod.js +1 -1
  81. package/dist/lang/ru.umd.prod.js +1 -1
  82. package/dist/lang/sk.umd.prod.js +1 -1
  83. package/dist/lang/sl.umd.prod.js +1 -1
  84. package/dist/lang/sr-CYR.umd.prod.js +1 -1
  85. package/dist/lang/sr.umd.prod.js +1 -1
  86. package/dist/lang/sv.umd.prod.js +1 -1
  87. package/dist/lang/ta.umd.prod.js +1 -1
  88. package/dist/lang/th.umd.prod.js +1 -1
  89. package/dist/lang/tr.umd.prod.js +1 -1
  90. package/dist/lang/ug.umd.prod.js +2 -2
  91. package/dist/lang/uk.umd.prod.js +1 -1
  92. package/dist/lang/vi.umd.prod.js +1 -1
  93. package/dist/lang/zh-CN.umd.prod.js +1 -1
  94. package/dist/lang/zh-TW.umd.prod.js +1 -1
  95. package/dist/quasar.cjs.prod.js +2 -2
  96. package/dist/quasar.css +24 -17
  97. package/dist/quasar.esm.prod.js +2 -2
  98. package/dist/quasar.prod.css +1 -1
  99. package/dist/quasar.rtl.css +29 -22
  100. package/dist/quasar.rtl.prod.css +1 -1
  101. package/dist/quasar.sass +24 -16
  102. package/dist/quasar.umd.js +374 -242
  103. package/dist/quasar.umd.prod.js +2 -2
  104. package/dist/ssr-directives/Morph.js +1 -1
  105. package/dist/types/index.d.ts +81 -12
  106. package/dist/vetur/quasar-attributes.json +39 -7
  107. package/dist/vetur/quasar-tags.json +9 -1
  108. package/dist/web-types/web-types.json +101 -15
  109. package/lang/index.json +4 -0
  110. package/lang/lt.js +103 -0
  111. package/lang/ug.js +42 -42
  112. package/package.json +1 -1
  113. package/src/components/btn/QBtn.js +17 -20
  114. package/src/components/carousel/QCarousel.js +8 -1
  115. package/src/components/carousel/QCarousel.json +9 -1
  116. package/src/components/color/QColor.js +73 -61
  117. package/src/components/color/QColor.json +7 -0
  118. package/src/components/color/QColor.sass +5 -1
  119. package/src/components/dialog/QDialog.js +6 -0
  120. package/src/components/drawer/QDrawer.js +3 -0
  121. package/src/components/inner-loading/QInnerLoading.js +31 -7
  122. package/src/components/inner-loading/QInnerLoading.json +29 -0
  123. package/src/components/inner-loading/QInnerLoading.sass +4 -0
  124. package/src/components/option-group/QOptionGroup.js +29 -19
  125. package/src/components/option-group/QOptionGroup.json +50 -1
  126. package/src/components/range/QRange.js +1 -1
  127. package/src/components/range/QRange.json +7 -3
  128. package/src/components/rating/QRating.js +59 -39
  129. package/src/components/rating/QRating.sass +8 -6
  130. package/src/components/select/QSelect.js +1 -1
  131. package/src/components/separator/QSeparator.json +1 -1
  132. package/src/components/skeleton/QSkeleton.js +15 -5
  133. package/src/components/skeleton/QSkeleton.json +9 -0
  134. package/src/components/skeleton/QSkeleton.sass +7 -6
  135. package/src/components/slider/QSlider.js +1 -1
  136. package/src/components/slider/QSlider.json +7 -3
  137. package/src/components/slider/use-slider.js +7 -2
  138. package/src/components/stepper/StepHeader.js +10 -10
  139. package/src/components/table/QTable.json +1 -0
  140. package/src/components/tabs/use-tab.js +11 -9
  141. package/src/components/time/QTime.js +0 -2
  142. package/src/composables/private/use-panel.js +13 -8
  143. package/src/composables/private/use-panel.json +11 -2
  144. package/src/css/core/transitions.sass +4 -4
  145. package/src/utils/date.js +93 -60
@@ -62,14 +62,23 @@
62
62
  "extends": "transition",
63
63
  "desc": "One of Quasar's embedded transitions (has effect only if 'animated' prop is set)",
64
64
  "default": "slide-right/slide-down",
65
- "category": "behavior"
65
+ "category": "transition"
66
66
  },
67
67
 
68
68
  "transition-next": {
69
69
  "extends": "transition",
70
70
  "desc": "One of Quasar's embedded transitions (has effect only if 'animated' prop is set)",
71
71
  "default": "slide-left/slide-up",
72
- "category": "behavior"
72
+ "category": "transition"
73
+ },
74
+
75
+ "transition-duration": {
76
+ "type": [ "String", "Number" ],
77
+ "desc": "Transition duration (in milliseconds, without unit)",
78
+ "default": 300,
79
+ "examples": [ 500, "1200" ],
80
+ "category": "transition",
81
+ "addedIn": "v2.2"
73
82
  }
74
83
  },
75
84
 
@@ -1,9 +1,5 @@
1
1
  // default easing is easeOutCubic
2
2
 
3
- \:root
4
- --q-transition-duration: .3s
5
- --q-transition-easing: cubic-bezier(0.215,0.61,0.355,1)
6
-
7
3
  .q-transition
8
4
  &--slide-right,
9
5
  &--slide-left,
@@ -17,6 +13,10 @@
17
13
  &--scale,
18
14
  &--rotate,
19
15
  &--flip
16
+ &-enter-active,
17
+ &-leave-active
18
+ --q-transition-duration: .3s
19
+ --q-transition-easing: cubic-bezier(0.215,0.61,0.355,1)
20
20
  &-leave-active
21
21
  position: absolute
22
22
 
package/src/utils/date.js CHANGED
@@ -161,6 +161,96 @@ function getDateLocale (paramDateLocale, langProps) {
161
161
  )
162
162
  }
163
163
 
164
+ function formatTimezone (offset, delimeter = '') {
165
+ const
166
+ sign = offset > 0 ? '-' : '+',
167
+ absOffset = Math.abs(offset),
168
+ hours = Math.floor(absOffset / 60),
169
+ minutes = absOffset % 60
170
+
171
+ return sign + pad(hours) + delimeter + pad(minutes)
172
+ }
173
+
174
+ function applyYearMonthDayChange (date, mod, sign) {
175
+ let
176
+ year = date.getFullYear(),
177
+ month = date.getMonth(),
178
+ day = date.getDate()
179
+
180
+ if (mod.years !== void 0) {
181
+ year += sign * mod.years
182
+ }
183
+
184
+ if (mod.months !== void 0) {
185
+ month += sign * mod.months
186
+ }
187
+
188
+ if (mod.days !== void 0) {
189
+ day += sign * mod.days
190
+ }
191
+
192
+ date.setDate(1)
193
+ date.setMonth(2)
194
+
195
+ date.setFullYear(year)
196
+ date.setMonth(month)
197
+ date.setDate(day)
198
+
199
+ return date
200
+ }
201
+
202
+ function getChange (date, mod, sign) {
203
+ const
204
+ d = new Date(date),
205
+ t = mod.years !== void 0 || mod.months !== void 0 || mod.days !== void 0
206
+ ? applyYearMonthDayChange(d, mod, sign)
207
+ : d
208
+
209
+ Object.keys(mod).forEach(key => {
210
+ if (key !== 'years' && key !== 'months' && key !== 'days') {
211
+ const op = capitalize(key)
212
+ t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ])
213
+ }
214
+ })
215
+
216
+ return t
217
+ }
218
+
219
+ function applyYearMonthDay (date, mod, middle) {
220
+ const
221
+ year = mod.year !== void 0 ? mod.year : date[ `get${ middle }FullYear` ](),
222
+ month = mod.month !== void 0 ? mod.month - 1 : date[ `get${ middle }Month` ](),
223
+ maxDay = (new Date(year, month + 1, 0)).getDate(),
224
+ day = Math.min(maxDay, mod.date !== void 0 ? mod.date : date[ `get${ middle }Date` ]())
225
+
226
+ date[ `set${ middle }Date` ](1)
227
+ date[ `set${ middle }Month` ](2)
228
+
229
+ date[ `set${ middle }FullYear` ](year)
230
+ date[ `set${ middle }Month` ](month)
231
+ date[ `set${ middle }Date` ](day)
232
+
233
+ return date
234
+ }
235
+
236
+ export function adjustDate (date, mod, utc) {
237
+ const
238
+ middle = utc === true ? 'UTC' : '',
239
+ d = new Date(date),
240
+ t = mod.year !== void 0 || mod.month !== void 0 || mod.date !== void 0
241
+ ? applyYearMonthDay(d, mod, middle)
242
+ : d
243
+
244
+ Object.keys(mod).forEach(key => {
245
+ if (key !== 'year' && key !== 'month' && key !== 'date') {
246
+ const op = key.charAt(0).toUpperCase() + key.slice(1)
247
+ t[ `set${ middle }${ op }` ](mod[ key ])
248
+ }
249
+ })
250
+
251
+ return t
252
+ }
253
+
164
254
  export function extractDate (str, mask, dateLocale) {
165
255
  const d = __splitDate(str, mask, dateLocale)
166
256
 
@@ -178,7 +268,7 @@ export function extractDate (str, mask, dateLocale) {
178
268
 
179
269
  return d.timezoneOffset === null || d.timezoneOffset === tzOffset
180
270
  ? date
181
- : getChange(date, { minutes: d.timezoneOffset - tzOffset }, true)
271
+ : getChange(date, { minutes: d.timezoneOffset - tzOffset }, 1)
182
272
  }
183
273
 
184
274
  export function __splitDate (str, mask, dateLocale, calendar, defaultModel) {
@@ -319,43 +409,6 @@ export function __splitDate (str, mask, dateLocale, calendar, defaultModel) {
319
409
  return date
320
410
  }
321
411
 
322
- function formatTimezone (offset, delimeter = '') {
323
- const
324
- sign = offset > 0 ? '-' : '+',
325
- absOffset = Math.abs(offset),
326
- hours = Math.floor(absOffset / 60),
327
- minutes = absOffset % 60
328
-
329
- return sign + pad(hours) + delimeter + pad(minutes)
330
- }
331
-
332
- function setMonth (date, newMonth /* 1-based */) {
333
- const
334
- test = new Date(date.getFullYear(), newMonth, 0, 0, 0, 0, 0),
335
- days = test.getDate()
336
-
337
- date.setMonth(newMonth - 1, Math.min(days, date.getDate()))
338
- }
339
-
340
- function getChange (date, mod, add) {
341
- const
342
- t = new Date(date),
343
- sign = (add ? 1 : -1)
344
-
345
- Object.keys(mod).forEach(key => {
346
- if (key === 'months') {
347
- setMonth(t, t.getMonth() + 1 + sign * mod.months)
348
- return
349
- }
350
-
351
- const op = key === 'years'
352
- ? 'FullYear'
353
- : capitalize(key === 'days' ? 'date' : key)
354
- t[ `set${ op }` ](t[ `get${ op }` ]() + sign * mod[ key ])
355
- })
356
- return t
357
- }
358
-
359
412
  export function isValid (date) {
360
413
  return typeof date === 'number'
361
414
  ? true
@@ -413,30 +466,10 @@ export function isBetweenDates (date, from, to, opts = {}) {
413
466
  }
414
467
 
415
468
  export function addToDate (date, mod) {
416
- return getChange(date, mod, true)
469
+ return getChange(date, mod, 1)
417
470
  }
418
471
  export function subtractFromDate (date, mod) {
419
- return getChange(date, mod, false)
420
- }
421
-
422
- export function adjustDate (date, mod, utc) {
423
- const
424
- t = new Date(date),
425
- prefix = `set${ utc === true ? 'UTC' : '' }`
426
-
427
- Object.keys(mod).forEach(key => {
428
- if (key === 'month') {
429
- setMonth(t, mod.month)
430
- return
431
- }
432
-
433
- const op = key === 'year'
434
- ? 'FullYear'
435
- : key.charAt(0).toUpperCase() + key.slice(1)
436
- t[ `${ prefix }${ op }` ](mod[ key ])
437
- })
438
-
439
- return t
472
+ return getChange(date, mod, -1)
440
473
  }
441
474
 
442
475
  export function startOfDate (date, unit, utc) {