quasar 2.8.3 → 2.9.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.
- package/dist/api/QBreadcrumbsEl.json +52 -0
- package/dist/api/QBtn.json +41 -6
- package/dist/api/QBtnDropdown.json +9 -0
- package/dist/api/QChip.json +9 -0
- package/dist/api/QCircularProgress.json +6 -0
- package/dist/api/QEditor.json +7 -0
- package/dist/api/QExpansionItem.json +59 -0
- package/dist/api/QItem.json +52 -0
- package/dist/api/QRating.json +13 -0
- package/dist/api/QRouteTab.json +42 -6
- package/dist/api/QTable.json +2 -2
- package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/material-icons.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-themify.umd.prod.js +1 -1
- package/dist/icon-set/themify.umd.prod.js +1 -1
- package/dist/lang/ar-TN.umd.prod.js +2 -2
- package/dist/lang/ar.umd.prod.js +2 -2
- package/dist/lang/az-Latn.umd.prod.js +2 -2
- package/dist/lang/bg.umd.prod.js +2 -2
- package/dist/lang/bn.umd.prod.js +2 -2
- package/dist/lang/ca.umd.prod.js +2 -2
- package/dist/lang/cs.umd.prod.js +2 -2
- package/dist/lang/da.umd.prod.js +2 -2
- package/dist/lang/de.umd.prod.js +2 -2
- package/dist/lang/el.umd.prod.js +2 -2
- package/dist/lang/en-GB.umd.prod.js +2 -2
- package/dist/lang/en-US.umd.prod.js +2 -2
- package/dist/lang/eo.umd.prod.js +2 -2
- package/dist/lang/es.umd.prod.js +2 -2
- package/dist/lang/et.umd.prod.js +2 -2
- package/dist/lang/eu.umd.prod.js +2 -2
- package/dist/lang/fa-IR.umd.prod.js +2 -2
- package/dist/lang/fa.umd.prod.js +2 -2
- package/dist/lang/fi.umd.prod.js +2 -2
- package/dist/lang/fr.umd.prod.js +2 -2
- package/dist/lang/gn.umd.prod.js +2 -2
- package/dist/lang/he.umd.prod.js +2 -2
- package/dist/lang/hr.umd.prod.js +2 -2
- package/dist/lang/hu.umd.prod.js +2 -2
- package/dist/lang/id.umd.prod.js +2 -2
- package/dist/lang/is.umd.prod.js +2 -2
- package/dist/lang/it.umd.prod.js +2 -2
- package/dist/lang/ja.umd.prod.js +2 -2
- package/dist/lang/km.umd.prod.js +2 -2
- package/dist/lang/ko-KR.umd.prod.js +2 -2
- package/dist/lang/kur-CKB.umd.prod.js +2 -2
- package/dist/lang/kz.umd.prod.js +2 -2
- package/dist/lang/lt.umd.prod.js +2 -2
- package/dist/lang/lu.umd.prod.js +2 -2
- package/dist/lang/lv.umd.prod.js +2 -2
- package/dist/lang/ml.umd.prod.js +2 -2
- package/dist/lang/mm.umd.prod.js +2 -2
- package/dist/lang/ms.umd.prod.js +2 -2
- package/dist/lang/my.umd.prod.js +2 -2
- package/dist/lang/nb-NO.umd.prod.js +2 -2
- package/dist/lang/nl.umd.prod.js +2 -2
- package/dist/lang/pl.umd.prod.js +2 -2
- package/dist/lang/pt-BR.umd.prod.js +2 -2
- package/dist/lang/pt.umd.prod.js +2 -2
- package/dist/lang/ro.umd.prod.js +2 -2
- package/dist/lang/ru.umd.prod.js +2 -2
- package/dist/lang/sk.umd.prod.js +2 -2
- package/dist/lang/sl.umd.prod.js +2 -2
- package/dist/lang/sm.umd.prod.js +2 -2
- package/dist/lang/sr-CYR.umd.prod.js +2 -2
- package/dist/lang/sr.umd.prod.js +2 -2
- package/dist/lang/sv.umd.prod.js +2 -2
- package/dist/lang/ta.umd.prod.js +2 -2
- package/dist/lang/th.umd.prod.js +2 -2
- package/dist/lang/tr.umd.prod.js +2 -2
- package/dist/lang/ug.umd.prod.js +2 -2
- package/dist/lang/uk.umd.prod.js +2 -2
- package/dist/lang/uz-Cyrl.umd.prod.js +2 -2
- package/dist/lang/uz-Latn.umd.prod.js +2 -2
- package/dist/lang/vi.umd.prod.js +2 -2
- package/dist/lang/zh-CN.umd.prod.js +2 -2
- package/dist/lang/zh-TW.umd.prod.js +2 -2
- package/dist/quasar.cjs.prod.js +2 -2
- package/dist/quasar.esm.js +16157 -15723
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.sass +1 -1
- package/dist/quasar.umd.js +16290 -15854
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/transforms/import-map.json +2 -0
- package/dist/types/api/qeditor.d.ts +17 -0
- package/dist/types/api/qloading.d.ts +5 -0
- package/dist/types/api.d.ts +2 -0
- package/dist/types/index.d.ts +133 -9
- package/dist/types/utils/is.d.ts +67 -0
- package/dist/types/utils/run-sequential-promises.d.ts +119 -0
- package/dist/types/utils.d.ts +9 -0
- package/dist/vetur/quasar-attributes.json +25 -1
- package/dist/vetur/quasar-tags.json +7 -1
- package/dist/web-types/web-types.json +108 -10
- package/lang/ar-TN.js +3 -1
- package/lang/ar-TN.mjs +3 -1
- package/lang/ar.js +3 -1
- package/lang/ar.mjs +3 -1
- package/lang/az-Latn.js +3 -1
- package/lang/az-Latn.mjs +3 -1
- package/lang/bg.js +3 -1
- package/lang/bg.mjs +3 -1
- package/lang/bn.js +3 -1
- package/lang/bn.mjs +3 -1
- package/lang/ca.js +3 -1
- package/lang/ca.mjs +3 -1
- package/lang/cs.js +3 -1
- package/lang/cs.mjs +3 -1
- package/lang/da.js +3 -1
- package/lang/da.mjs +3 -1
- package/lang/de.js +3 -1
- package/lang/de.mjs +3 -1
- package/lang/el.js +3 -1
- package/lang/el.mjs +3 -1
- package/lang/en-GB.js +3 -1
- package/lang/en-GB.mjs +3 -1
- package/lang/en-US.js +3 -1
- package/lang/en-US.mjs +3 -1
- package/lang/eo.js +3 -1
- package/lang/eo.mjs +3 -1
- package/lang/es.js +3 -1
- package/lang/es.mjs +3 -1
- package/lang/et.js +3 -1
- package/lang/et.mjs +3 -1
- package/lang/eu.js +3 -1
- package/lang/eu.mjs +3 -1
- package/lang/fa-IR.js +5 -3
- package/lang/fa-IR.mjs +5 -3
- package/lang/fa.js +5 -3
- package/lang/fa.mjs +5 -3
- package/lang/fi.js +3 -1
- package/lang/fi.mjs +3 -1
- package/lang/fr.js +3 -1
- package/lang/fr.mjs +3 -1
- package/lang/gn.js +3 -1
- package/lang/gn.mjs +3 -1
- package/lang/he.js +3 -1
- package/lang/he.mjs +3 -1
- package/lang/hr.js +3 -1
- package/lang/hr.mjs +3 -1
- package/lang/hu.js +3 -1
- package/lang/hu.mjs +3 -1
- package/lang/id.js +3 -1
- package/lang/id.mjs +3 -1
- package/lang/is.js +3 -1
- package/lang/is.mjs +3 -1
- package/lang/it.js +3 -1
- package/lang/it.mjs +3 -1
- package/lang/ja.js +3 -1
- package/lang/ja.mjs +3 -1
- package/lang/km.js +3 -1
- package/lang/km.mjs +3 -1
- package/lang/ko-KR.js +3 -1
- package/lang/ko-KR.mjs +3 -1
- package/lang/kur-CKB.js +3 -1
- package/lang/kur-CKB.mjs +3 -1
- package/lang/kz.js +3 -1
- package/lang/kz.mjs +3 -1
- package/lang/lt.js +3 -1
- package/lang/lt.mjs +3 -1
- package/lang/lu.js +3 -1
- package/lang/lu.mjs +3 -1
- package/lang/lv.js +3 -1
- package/lang/lv.mjs +3 -1
- package/lang/ml.js +3 -1
- package/lang/ml.mjs +3 -1
- package/lang/mm.js +4 -1
- package/lang/mm.mjs +4 -1
- package/lang/ms.js +3 -1
- package/lang/ms.mjs +3 -1
- package/lang/my.js +3 -1
- package/lang/my.mjs +3 -1
- package/lang/nb-NO.js +3 -1
- package/lang/nb-NO.mjs +3 -1
- package/lang/nl.js +3 -1
- package/lang/nl.mjs +3 -1
- package/lang/pl.js +3 -1
- package/lang/pl.mjs +3 -1
- package/lang/pt-BR.js +3 -1
- package/lang/pt-BR.mjs +3 -1
- package/lang/pt.js +3 -1
- package/lang/pt.mjs +3 -1
- package/lang/ro.js +3 -1
- package/lang/ro.mjs +3 -1
- package/lang/ru.js +3 -1
- package/lang/ru.mjs +3 -1
- package/lang/sk.js +3 -1
- package/lang/sk.mjs +3 -1
- package/lang/sl.js +3 -1
- package/lang/sl.mjs +3 -1
- package/lang/sm.js +3 -1
- package/lang/sm.mjs +3 -1
- package/lang/sr-CYR.js +3 -1
- package/lang/sr-CYR.mjs +3 -1
- package/lang/sr.js +3 -1
- package/lang/sr.mjs +3 -1
- package/lang/sv.js +3 -1
- package/lang/sv.mjs +3 -1
- package/lang/ta.js +3 -1
- package/lang/ta.mjs +3 -1
- package/lang/th.js +3 -1
- package/lang/th.mjs +3 -1
- package/lang/tr.js +3 -1
- package/lang/tr.mjs +3 -1
- package/lang/ug.js +5 -3
- package/lang/ug.mjs +5 -3
- package/lang/uk.js +3 -1
- package/lang/uk.mjs +3 -1
- package/lang/uz-Cyrl.js +3 -1
- package/lang/uz-Cyrl.mjs +3 -1
- package/lang/uz-Latn.js +3 -1
- package/lang/uz-Latn.mjs +3 -1
- package/lang/vi.js +3 -1
- package/lang/vi.mjs +3 -1
- package/lang/zh-CN.js +3 -1
- package/lang/zh-CN.mjs +3 -1
- package/lang/zh-TW.js +3 -1
- package/lang/zh-TW.mjs +3 -1
- package/package.json +6 -5
- package/src/components/breadcrumbs/QBreadcrumbsEl.js +6 -7
- package/src/components/breadcrumbs/QBreadcrumbsEl.json +53 -0
- package/src/components/btn/QBtn.js +19 -19
- package/src/components/btn/QBtn.json +41 -6
- package/src/components/btn/use-btn.js +6 -4
- package/src/components/btn-dropdown/QBtnDropdown.js +10 -2
- package/src/components/btn-dropdown/QBtnDropdown.json +8 -0
- package/src/components/checkbox/QCheckbox.js +1 -2
- package/src/components/checkbox/use-checkbox.js +2 -1
- package/src/components/chip/QChip.js +9 -2
- package/src/components/chip/QChip.json +8 -0
- package/src/components/chip/__tests__/QChip.spec.js +359 -46
- package/src/components/circular-progress/QCircularProgress.js +4 -2
- package/src/components/circular-progress/QCircularProgress.json +7 -0
- package/src/components/circular-progress/use-circular-progress.js +1 -0
- package/src/components/dialog/QDialog.js +7 -4
- package/src/components/drawer/QDrawer.js +7 -4
- package/src/components/editor/QEditor.json +9 -0
- package/src/components/expansion-item/QExpansionItem.js +37 -8
- package/src/components/expansion-item/QExpansionItem.json +67 -0
- package/src/components/fab/QFab.js +20 -1
- package/src/components/form/QForm.js +35 -40
- package/src/components/form/QFormChildMixin.js +3 -1
- package/src/components/item/QItem.js +4 -5
- package/src/components/item/QItem.json +53 -0
- package/src/components/menu/QMenu.js +5 -5
- package/src/components/menu/__tests__/QMenu.spec.js +7 -0
- package/src/components/page/QPage.js +1 -1
- package/src/components/popup-edit/QPopupEdit.js +2 -5
- package/src/components/radio/QRadio.js +3 -3
- package/src/components/rating/QRating.js +48 -10
- package/src/components/rating/QRating.json +11 -0
- package/src/components/select/QSelect.js +1 -4
- package/src/components/stepper/QStep.js +5 -3
- package/src/components/table/QTable.js +4 -6
- package/src/components/table/QTable.json +2 -2
- package/src/components/tabs/QRouteTab.js +6 -4
- package/src/components/tabs/QRouteTab.json +42 -6
- package/src/components/tabs/QTabs.js +188 -107
- package/src/components/tabs/use-tab.js +62 -38
- package/src/components/time/QTime.js +2 -2
- package/src/components/tooltip/QTooltip.js +7 -13
- package/src/components/tree/QTree.js +1 -1
- package/src/components/uploader/uploader-core.js +2 -3
- package/src/composables/private/__tests__/use-model-toggle.spec.js +2 -0
- package/src/composables/private/__tests__/use-transition.spec.js +4 -0
- package/src/composables/private/use-file.js +1 -1
- package/src/composables/private/use-router-link.js +80 -43
- package/src/composables/private/use-tick.js +15 -9
- package/src/composables/private/use-timeout.js +20 -7
- package/src/composables/private/use-validate.js +7 -13
- package/src/composables/use-form-child.js +6 -4
- package/src/directives/TouchPan.js +1 -1
- package/src/directives/TouchRepeat.js +1 -1
- package/src/directives/TouchSwipe.js +1 -1
- package/src/utils/EventBus.js +64 -0
- package/src/utils/extend.js +19 -19
- package/src/utils/private/inject-obj-prop.js +2 -0
- package/src/utils/private/rtl.js +10 -7
- package/src/utils/private/vm.js +4 -0
- package/src/utils/run-sequential-promises.js +115 -0
- package/src/utils.js +4 -0
|
@@ -4,10 +4,12 @@ export function injectProp (target, propName, get, set) {
|
|
|
4
4
|
set,
|
|
5
5
|
enumerable: true
|
|
6
6
|
})
|
|
7
|
+
return target
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export function injectMultipleProps (target, props) {
|
|
10
11
|
for (const key in props) {
|
|
11
12
|
injectProp(target, key, props[ key ])
|
|
12
13
|
}
|
|
14
|
+
return target
|
|
13
15
|
}
|
package/src/utils/private/rtl.js
CHANGED
|
@@ -3,15 +3,18 @@ let rtlHasScrollBug = false
|
|
|
3
3
|
// mobile Chrome takes the crown for this
|
|
4
4
|
if (!__QUASAR_SSR__) {
|
|
5
5
|
const scroller = document.createElement('div')
|
|
6
|
-
const spacer = document.createElement('div')
|
|
7
|
-
|
|
8
6
|
scroller.setAttribute('dir', 'rtl')
|
|
9
|
-
scroller.style
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
Object.assign(scroller.style, {
|
|
8
|
+
width: '1px',
|
|
9
|
+
height: '1px',
|
|
10
|
+
overflow: 'auto'
|
|
11
|
+
})
|
|
12
12
|
|
|
13
|
-
spacer
|
|
14
|
-
spacer.style
|
|
13
|
+
const spacer = document.createElement('div')
|
|
14
|
+
Object.assign(spacer.style, {
|
|
15
|
+
width: '1000px',
|
|
16
|
+
height: '1px'
|
|
17
|
+
})
|
|
15
18
|
|
|
16
19
|
document.body.appendChild(scroller)
|
|
17
20
|
scroller.appendChild(spacer)
|
package/src/utils/private/vm.js
CHANGED
|
@@ -43,3 +43,7 @@ export function getNormalizedVNodes (vnodes) {
|
|
|
43
43
|
export function vmHasRouter (vm) {
|
|
44
44
|
return vm.appContext.config.globalProperties.$router !== void 0
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
export function vmIsDestroyed (vm) {
|
|
48
|
+
return vm.isUnmounted === true || vm.isDeactivated === true
|
|
49
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
|
|
2
|
+
function parsePromises (sequentialPromises) {
|
|
3
|
+
const isList = Array.isArray(sequentialPromises)
|
|
4
|
+
|
|
5
|
+
if (isList === true) {
|
|
6
|
+
const totalJobs = sequentialPromises.length
|
|
7
|
+
return {
|
|
8
|
+
isList,
|
|
9
|
+
totalJobs,
|
|
10
|
+
resultAggregator: Array(totalJobs).fill(null)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const resultKeys = Object.keys(sequentialPromises)
|
|
15
|
+
const resultAggregator = {}
|
|
16
|
+
resultKeys.forEach(keyName => { resultAggregator[ keyName ] = null })
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
isList,
|
|
20
|
+
totalJobs: resultKeys.length,
|
|
21
|
+
resultAggregator,
|
|
22
|
+
resultKeys
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Run a list of Promises sequentially, optionally on multiple threads.
|
|
28
|
+
*
|
|
29
|
+
* @param {*} sequentialPromises - Array of Functions or Object with Functions as values
|
|
30
|
+
* Array of Function form: [ (resultAggregator: Array) => Promise<any>, ... ]
|
|
31
|
+
* Object form: { [key: string]: (resultAggregator: object) => Promise<any>, ... }
|
|
32
|
+
* @param {*} opts - Optional options Object
|
|
33
|
+
* Object form: { threadsNumber?: number, abortOnFail?: boolean }
|
|
34
|
+
* Default: { threadsNumber: 1, abortOnFail: true }
|
|
35
|
+
* When configuring threadsNumber AND using http requests, be
|
|
36
|
+
* aware of the maximum threads that the hosting browser
|
|
37
|
+
* supports (usually 5); any number of threads above that
|
|
38
|
+
* won't add any real benefits
|
|
39
|
+
* @returns Promise<Array<Object> | Object>
|
|
40
|
+
* With opts.abortOnFail set to true (which is default):
|
|
41
|
+
* When sequentialPromises param is Array:
|
|
42
|
+
* The Promise resolves with an Array of Objects of the following form:
|
|
43
|
+
* [ { key: number, status: 'fulfilled', value: any }, ... ]
|
|
44
|
+
* The Promise rejects with an Object of the following form:
|
|
45
|
+
* { key: number, status: 'rejected', reason: Error, resultAggregator: array }
|
|
46
|
+
* When sequentialPromises param is Object:
|
|
47
|
+
* The Promise resolves with an Object of the following form:
|
|
48
|
+
* { [key: string]: { key: string, status: 'fulfilled', value: any }, ... }
|
|
49
|
+
* The Promise rejects with an Object of the following form:
|
|
50
|
+
* { key: string, status: 'rejected', reason: Error, resultAggregator: object }
|
|
51
|
+
* With opts.abortOnFail set to false:
|
|
52
|
+
* The Promise is never rejected (no catch() needed)
|
|
53
|
+
* The Promise resolves with:
|
|
54
|
+
* An Array of Objects (when sequentialPromises param is also an Array) of the following form:
|
|
55
|
+
* [ { key: number, status: 'fulfilled', value: any } | { status: 'rejected', reason: Error }, ... ]
|
|
56
|
+
* An Object (when sequentialPromises param is also an Object) of the following form:
|
|
57
|
+
* { [key: string]: { key: string, status: 'fulfilled', value: any } | { key: string, status: 'rejected', reason: Error }, ... }
|
|
58
|
+
*/
|
|
59
|
+
export default function runSequentialPromises (
|
|
60
|
+
sequentialPromises,
|
|
61
|
+
{ threadsNumber = 1, abortOnFail = true } = {}
|
|
62
|
+
) {
|
|
63
|
+
let jobIndex = -1, hasAborted = false
|
|
64
|
+
|
|
65
|
+
const { isList, totalJobs, resultAggregator, resultKeys } = parsePromises(sequentialPromises)
|
|
66
|
+
|
|
67
|
+
const getPromiseThread = () => new Promise((resolve, reject) => {
|
|
68
|
+
function runNextPromise () {
|
|
69
|
+
const currentJobIndex = ++jobIndex
|
|
70
|
+
|
|
71
|
+
if (hasAborted === true || currentJobIndex >= totalJobs) {
|
|
72
|
+
resolve()
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const key = isList === true ? currentJobIndex : resultKeys[ currentJobIndex ]
|
|
77
|
+
|
|
78
|
+
sequentialPromises[ key ](resultAggregator)
|
|
79
|
+
.then(value => {
|
|
80
|
+
if (hasAborted === true) {
|
|
81
|
+
resolve()
|
|
82
|
+
return // early exit
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
resultAggregator[ key ] = { key, status: 'fulfilled', value }
|
|
86
|
+
|
|
87
|
+
// timeout so it doesn't interfere with the .catch() below
|
|
88
|
+
setTimeout(runNextPromise)
|
|
89
|
+
})
|
|
90
|
+
.catch(reason => {
|
|
91
|
+
if (hasAborted === true) {
|
|
92
|
+
resolve()
|
|
93
|
+
return // early exit
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const result = { key, status: 'rejected', reason }
|
|
97
|
+
resultAggregator[ key ] = result
|
|
98
|
+
|
|
99
|
+
if (abortOnFail === true) {
|
|
100
|
+
hasAborted = true
|
|
101
|
+
reject({ ...result, resultAggregator })
|
|
102
|
+
return // early exit
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// timeout so no interference
|
|
106
|
+
setTimeout(runNextPromise)
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
runNextPromise()
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const threads = Array(threadsNumber).fill(getPromiseThread())
|
|
114
|
+
return Promise.all(threads).then(() => resultAggregator)
|
|
115
|
+
}
|
package/src/utils.js
CHANGED
|
@@ -6,6 +6,7 @@ import createUploaderComponent from './utils/create-uploader-component.js'
|
|
|
6
6
|
import date from './utils/date.js'
|
|
7
7
|
import debounce from './utils/debounce.js'
|
|
8
8
|
import dom from './utils/dom.js'
|
|
9
|
+
import EventBus from './utils/EventBus.js'
|
|
9
10
|
import event, { noop } from './utils/event.js'
|
|
10
11
|
import exportFile from './utils/export-file.js'
|
|
11
12
|
import extend from './utils/extend.js'
|
|
@@ -16,6 +17,7 @@ import is from './utils/is.js'
|
|
|
16
17
|
import morph from './utils/morph.js'
|
|
17
18
|
import openURL from './utils/open-url.js'
|
|
18
19
|
import patterns from './utils/patterns.js'
|
|
20
|
+
import runSequentialPromises from './utils/run-sequential-promises.js'
|
|
19
21
|
import scroll from './utils/scroll.js'
|
|
20
22
|
import setCssVar from './utils/set-css-var.js'
|
|
21
23
|
import throttle from './utils/throttle.js'
|
|
@@ -30,6 +32,7 @@ export {
|
|
|
30
32
|
date,
|
|
31
33
|
debounce,
|
|
32
34
|
dom,
|
|
35
|
+
EventBus,
|
|
33
36
|
event,
|
|
34
37
|
exportFile,
|
|
35
38
|
extend,
|
|
@@ -41,6 +44,7 @@ export {
|
|
|
41
44
|
morph,
|
|
42
45
|
openURL,
|
|
43
46
|
patterns,
|
|
47
|
+
runSequentialPromises,
|
|
44
48
|
scroll,
|
|
45
49
|
setCssVar,
|
|
46
50
|
throttle,
|