@topvisor/ui 1.0.42-popupPosition.0 → 1.1.0-addNativeDialog.11
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/.chunks/{core-BGKb9a73.es.js → core-DyAbOlfX.es.js} +4 -4
- package/.chunks/{core-BGKb9a73.es.js.map → core-DyAbOlfX.es.js.map} +1 -1
- package/.chunks/core-rNR04ITp.amd.js +2 -0
- package/.chunks/{core-D-etXW3Y.amd.js.map → core-rNR04ITp.amd.js.map} +1 -1
- package/.chunks/datepicker-DsKl-YZR.amd.js +2 -0
- package/.chunks/{datepicker-BWaVsTd0.amd.js.map → datepicker-DsKl-YZR.amd.js.map} +1 -1
- package/.chunks/{datepicker-DCDYQmsc.es.js → datepicker-U31BrqE_.es.js} +2 -2
- package/.chunks/{datepicker-DCDYQmsc.es.js.map → datepicker-U31BrqE_.es.js.map} +1 -1
- package/.chunks/{dialog_selectorRegions-BAK6xG6N.es.js → dialog_selectorRegions-BXNEJotg.es.js} +4 -4
- package/.chunks/{dialog_selectorRegions-BAK6xG6N.es.js.map → dialog_selectorRegions-BXNEJotg.es.js.map} +1 -1
- package/.chunks/dialog_selectorRegions-D64IfJEs.amd.js +2 -0
- package/.chunks/{dialog_selectorRegions-CMI1gx5d.amd.js.map → dialog_selectorRegions-D64IfJEs.amd.js.map} +1 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DIVnPVQ4.es.js +622 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-DIVnPVQ4.es.js.map +1 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-aLCfJKIO.amd.js +2 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-aLCfJKIO.amd.js.map +1 -0
- package/.chunks/field-Cvv0SRcJ.amd.js +2 -0
- package/.chunks/field-Cvv0SRcJ.amd.js.map +1 -0
- package/.chunks/field-CyyFzM-Y.es.js +16 -0
- package/.chunks/field-CyyFzM-Y.es.js.map +1 -0
- package/.chunks/forms-DRhpgERJ.amd.js +3 -0
- package/.chunks/forms-DRhpgERJ.amd.js.map +1 -0
- package/.chunks/{forms-DOGPN_TR.es.js → forms-t2AEUjqg.es.js} +20 -20
- package/.chunks/forms-t2AEUjqg.es.js.map +1 -0
- package/.chunks/lazy-CiM2Ny-s.amd.js +2 -0
- package/.chunks/lazy-CiM2Ny-s.amd.js.map +1 -0
- package/.chunks/lazy-Crun7esL.es.js +39 -0
- package/.chunks/lazy-Crun7esL.es.js.map +1 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-B6psuRkm.es.js +184 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-B6psuRkm.es.js.map +1 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C8PDRggQ.amd.js +2 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C8PDRggQ.amd.js.map +1 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-6kqWYFuX.es.js +110 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-6kqWYFuX.es.js.map +1 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-DRHk9iBB.amd.js +2 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-DRHk9iBB.amd.js.map +1 -0
- package/.chunks/{notice-DE88Oe-t.es.js → notice-4bdzRXtl.es.js} +2 -2
- package/.chunks/{notice-DE88Oe-t.es.js.map → notice-4bdzRXtl.es.js.map} +1 -1
- package/.chunks/{notice-C5sXcBql.amd.js → notice-DQ9qFyQ2.amd.js} +3 -3
- package/.chunks/{notice-C5sXcBql.amd.js.map → notice-DQ9qFyQ2.amd.js.map} +1 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-BVgw26Vp.es.js +151 -0
- package/.chunks/page.vue_vue_type_script_setup_true_lang-BVgw26Vp.es.js.map +1 -0
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DGHsC5Ii.amd.js +2 -0
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DGHsC5Ii.amd.js.map +1 -0
- package/.chunks/{popup-BjsK_pMZ.es.js → popup-DuraSW2f.es.js} +84 -77
- package/.chunks/popup-DuraSW2f.es.js.map +1 -0
- package/.chunks/popup-IcMnYYXr.amd.js +2 -0
- package/.chunks/popup-IcMnYYXr.amd.js.map +1 -0
- package/.chunks/punycode.es6-CNOnFR2-.amd.js +2 -0
- package/.chunks/{punycode.es6-C2yitnNb.amd.js.map → punycode.es6-CNOnFR2-.amd.js.map} +1 -1
- package/.chunks/punycode.es6-CgGegfA_.es.js +134 -0
- package/.chunks/{punycode.es6-CNI-zL6U.es.js.map → punycode.es6-CgGegfA_.es.js.map} +1 -1
- package/.chunks/store-CX_6ZXhO.es.js.map +1 -1
- package/.chunks/store-YRW59xEF.amd.js +2 -0
- package/.chunks/{store-esTid5oI.amd.js.map → store-YRW59xEF.amd.js.map} +1 -1
- package/.chunks/{utils-CRPkMfKD.es.js → utils-BR_kFG05.es.js} +2 -2
- package/.chunks/{utils-CRPkMfKD.es.js.map → utils-BR_kFG05.es.js.map} +1 -1
- package/.chunks/utils-BVONc_yb.amd.js +2 -0
- package/.chunks/{utils-BVdq18mg.amd.js.map → utils-BVONc_yb.amd.js.map} +1 -1
- package/api/additional.amd.js +2 -0
- package/api/additional.amd.js.map +1 -0
- package/api/additional.js +66 -0
- package/api/additional.js.map +1 -0
- package/api/index.amd.js +2 -0
- package/api/index.amd.js.map +1 -0
- package/api/index.js +265 -0
- package/api/index.js.map +1 -0
- package/assets/core.css +1 -1
- package/assets/forms.css +1 -1
- package/assets/formsExt.css +1 -1
- package/assets/project.css +1 -1
- package/assets/themes/dark-th.css +1 -1
- package/assets/themes/dark.css +1 -1
- package/assets/themes/light.css +1 -1
- package/charts/charts.amd.js +1 -1
- package/charts/charts.amd.js.map +1 -1
- package/charts/charts.js +3 -3
- package/charts/charts.js.map +1 -1
- package/core/app.amd.js +1 -1
- package/core/app.amd.js.map +1 -1
- package/core/app.js +18 -16
- package/core/app.js.map +1 -1
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.amd.js.map +1 -1
- package/dialog/dialog.js +2 -2
- package/dialog/dialog.js.map +1 -1
- package/extra/extra.amd.js +1 -1
- package/extra/extra.amd.js.map +1 -1
- package/extra/extra.js.map +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +1 -1
- package/forms/helpers.amd.js +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +409 -320
- package/formsExt/formsExt.js.map +1 -1
- package/layout/layout.amd.js +1 -1
- package/layout/layout.amd.js.map +1 -1
- package/layout/layout.js +1 -1
- package/layout/layout.js.map +1 -1
- package/package.json +7 -2
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +125 -109
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +30 -21
- package/popup/worker.js.map +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +6 -6
- package/project/project.js.map +1 -1
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.amd.js.map +1 -1
- package/tabs/tabs.js.map +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +1 -1
- package/tabsView/tabsView.js.map +1 -1
- package/types/api/additional.d.ts +2 -0
- package/types/api/api/additional.d.ts +1 -0
- package/types/api/api/client/client.d.ts +55 -0
- package/types/api/api/client/request-options.d.ts +1 -0
- package/types/api/api/client/request.d.ts +2 -0
- package/types/api/api/index.d.ts +12 -0
- package/types/api/api/tests/model.d.ts +0 -0
- package/types/api/api/tests/test.d.ts +16 -0
- package/types/api/api/types/api.d.ts +139 -0
- package/types/api/api/types/client/client.d.ts +8 -0
- package/types/api/api/types/client/middleware.d.ts +65 -0
- package/types/api/api/types/client/options.d.ts +60 -0
- package/types/api/api/types/client/request-context.d.ts +35 -0
- package/types/api/api/types/client/request-options.d.ts +73 -0
- package/types/api/api/types/client/request.d.ts +85 -0
- package/types/api/api/types/ext.d.ts +51 -0
- package/types/api/api/types/field.d.ts +33 -0
- package/types/api/api/types/index.d.ts +12 -0
- package/types/api/api/types/schema.d.ts +50 -0
- package/types/api/api/types/tv.d.ts +59 -0
- package/types/api/api/types/utils.d.ts +51 -0
- package/types/api/api/utils/common.d.ts +16 -0
- package/types/api/api/utils/field.d.ts +8 -0
- package/types/api/api/utils/filters.d.ts +48 -0
- package/types/api/api/utils/lazy.d.ts +17 -0
- package/types/api/index.d.ts +2 -0
- package/{components → types/components}/dialog/dialog/dialog.vue.d.ts +2 -2
- package/{components → types/components}/dialog/lib/types.d.ts +2 -2
- package/types/components/dialog/lib/utils.d.ts +45 -0
- package/{components → types/components}/dialog/lib/worker.d.ts +2 -2
- package/{components → types/components}/forms/button/button.vue.d.ts +2 -5
- package/{components → types/components}/forms/button/types.d.ts +10 -0
- package/{components → types/components}/forms/checkbox/checkbox.vue.d.ts +2 -2
- package/types/components/formsExt/policy/policy.vue.d.ts +8 -0
- package/types/components/formsExt/policy/types.d.ts +20 -0
- package/{components → types/components}/formsExt/selector2/composables/useAPI.d.ts +1 -1
- package/{components → types/components}/formsExt/selector2/composables/useMenu.d.ts +3 -1
- package/{components → types/components}/formsExt/selector2/selector2.vue.d.ts +11 -3
- package/{components → types/components}/formsExt/selector2/types.d.ts +50 -27
- package/types/components/popup/alert/alert.vue.d.ts +25 -0
- package/types/components/popup/alert/types.d.ts +8 -0
- package/types/components/popup/confirm/confirm.vue.d.ts +26 -0
- package/{components → types/components}/popup/confirm/types.d.ts +2 -2
- package/{components → types/components}/popup/lib/popup.d.ts +6 -2
- package/{components → types/components}/popup/lib/worker.d.ts +6 -4
- package/types/components/popup/popup/opener.vue.d.ts +17 -0
- package/types/components/popup/popup/popup.vue.d.ts +38 -0
- package/{components → types/components}/popup/popup/types.d.ts +20 -11
- package/types/components/popup/prompt/prompt.vue.d.ts +26 -0
- package/{components → types/components}/popup/prompt/types.d.ts +2 -2
- package/{components → types/components}/project/selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts +1 -1
- package/{components → types/components}/project/selectorRegion/utils/utils.d.ts +1 -1
- package/{core → types/core}/utils/string.d.ts +1 -1
- package/types/for-delete/dark-positions.d.ts +1 -0
- package/types/for-delete/dark-th-positions.d.ts +1 -0
- package/types/for-delete/dark-th.d.ts +1 -0
- package/types/for-delete/dark.d.ts +1 -0
- package/types/for-delete/light-positions.d.ts +1 -0
- package/types/for-delete/light.d.ts +1 -0
- package/types/forms/helpers.d.ts +1 -0
- package/utils/check.amd.js +1 -1
- package/utils/check.amd.js.map +1 -1
- package/utils/check.js.map +1 -1
- package/utils/clipboard.amd.js +2 -2
- package/utils/clipboard.amd.js.map +1 -1
- package/utils/clipboard.js +1 -1
- package/utils/clipboard.js.map +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.js +1 -1
- package/utils/dom.amd.js +1 -1
- package/utils/dom.amd.js.map +1 -1
- package/utils/dom.js.map +1 -1
- package/utils/image.amd.js +2 -2
- package/utils/image.amd.js.map +1 -1
- package/utils/image.js +1 -1
- package/utils/image.js.map +1 -1
- package/utils/keyboard.amd.js +1 -1
- package/utils/keyboard.amd.js.map +1 -1
- package/utils/keyboard.js.map +1 -1
- package/utils/lodash.amd.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/number.amd.js +1 -1
- package/utils/number.amd.js.map +1 -1
- package/utils/number.js.map +1 -1
- package/utils/price.amd.js +1 -1
- package/utils/price.amd.js.map +1 -1
- package/utils/price.js +1 -1
- package/utils/price.js.map +1 -1
- package/utils/route.amd.js +1 -1
- package/utils/route.amd.js.map +1 -1
- package/utils/route.js.map +1 -1
- package/utils/scroll.amd.js +1 -1
- package/utils/scroll.amd.js.map +1 -1
- package/utils/scroll.js.map +1 -1
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.amd.js.map +1 -1
- package/utils/searchers.js +3 -3
- package/utils/searchers.js.map +1 -1
- package/utils/store.amd.js +1 -1
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +34 -30
- package/utils/string.js.map +1 -1
- package/utils/system.amd.js +1 -1
- package/utils/system.amd.js.map +1 -1
- package/utils/system.js.map +1 -1
- package/utils/url.amd.js +2 -2
- package/utils/url.amd.js.map +1 -1
- package/utils/url.js +1 -1
- package/utils/url.js.map +1 -1
- package/.chunks/core-D-etXW3Y.amd.js +0 -2
- package/.chunks/datepicker-BWaVsTd0.amd.js +0 -2
- package/.chunks/dialog_selectorRegions-CMI1gx5d.amd.js +0 -2
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-BSxHPUWf.amd.js +0 -2
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-BSxHPUWf.amd.js.map +0 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CjUHErAY.es.js +0 -322
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CjUHErAY.es.js.map +0 -1
- package/.chunks/forms-DOGPN_TR.es.js.map +0 -1
- package/.chunks/forms-Gb7ujpmz.amd.js +0 -3
- package/.chunks/forms-Gb7ujpmz.amd.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CF_hIWa6.amd.js +0 -2
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CF_hIWa6.amd.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CJQj81Yq.es.js +0 -181
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CJQj81Yq.es.js.map +0 -1
- package/.chunks/menu.vue_vue_type_style_index_0_lang-CczcI_-j.amd.js +0 -2
- package/.chunks/menu.vue_vue_type_style_index_0_lang-CczcI_-j.amd.js.map +0 -1
- package/.chunks/menu.vue_vue_type_style_index_0_lang-Dq5eEX9i.es.js +0 -109
- package/.chunks/menu.vue_vue_type_style_index_0_lang-Dq5eEX9i.es.js.map +0 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DFvul4oF.es.js +0 -143
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DFvul4oF.es.js.map +0 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DJSuza2e.amd.js +0 -2
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DJSuza2e.amd.js.map +0 -1
- package/.chunks/popup-B_8bvIsF.amd.js +0 -2
- package/.chunks/popup-B_8bvIsF.amd.js.map +0 -1
- package/.chunks/popup-BjsK_pMZ.es.js.map +0 -1
- package/.chunks/punycode.es6-C2yitnNb.amd.js +0 -2
- package/.chunks/punycode.es6-CNI-zL6U.es.js +0 -134
- package/.chunks/store-esTid5oI.amd.js +0 -2
- package/.chunks/utils-BVdq18mg.amd.js +0 -2
- package/.chunks/utils-CacKxWvO.es.js +0 -303
- package/.chunks/utils-CacKxWvO.es.js.map +0 -1
- package/.chunks/utils-DiQZv1Ae.amd.js +0 -2
- package/.chunks/utils-DiQZv1Ae.amd.js.map +0 -1
- package/components/charts/miniChart/stories/dummy.d.ts +0 -13
- package/components/charts/miniCharts/stories/dummy.d.ts +0 -6
- package/components/dialog/dialog/stories/autoload.d.ts +0 -2
- package/components/dialog/lib/utils.d.ts +0 -14
- package/components/forms/select/stories/exampleOptions.d.ts +0 -5
- package/components/formsExt/checkboxGroup/stories/example.d.ts +0 -15
- package/components/formsExt/menu/stories/items.d.ts +0 -3
- package/components/formsExt/policy/policy.vue.d.ts +0 -4
- package/components/formsExt/policy/types.d.ts +0 -10
- package/components/formsExt/radioGroup/stories/example.d.ts +0 -20
- package/components/formsExt/selector2/stories/dummyAPIRequest.d.ts +0 -10
- package/components/popup/alert/alert.vue.d.ts +0 -31
- package/components/popup/alert/types.d.ts +0 -8
- package/components/popup/confirm/confirm.vue.d.ts +0 -33
- package/components/popup/popup/opener.vue.d.ts +0 -23
- package/components/popup/popup/popup.vue.d.ts +0 -40
- package/components/popup/prompt/prompt.vue.d.ts +0 -33
- package/components/project/selectorCompetitors/stories/items.d.ts +0 -3
- package/components/project/selectorRegion/stories/searchers.d.ts +0 -3
- package/icomoon/Topvisor icons.json +0 -6635
- package/{charts → types/charts}/charts.d.ts +0 -0
- package/{components → types/components}/charts/charts.d.ts +0 -0
- package/{components → types/components}/charts/miniChart/miniChart.vue.d.ts +0 -0
- package/{components → types/components}/charts/miniChart/types.d.ts +0 -0
- package/{components → types/components}/charts/miniChart/utils/consts.d.ts +0 -0
- package/{components → types/components}/charts/miniCharts/miniCharts.d.ts +0 -0
- package/{components → types/components}/charts/miniCharts/miniCharts.vue.d.ts +0 -0
- package/{components → types/components}/core/notice/item/item.vue.d.ts +0 -0
- package/{components → types/components}/core/notice/item/types.d.ts +0 -0
- package/{components → types/components}/core/notice/notice.vue.d.ts +0 -0
- package/{components → types/components}/core/notice/types.d.ts +0 -0
- package/{components → types/components}/core/notice/utils.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/composables/asyncDialogHandle.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/composables/dialogHandle.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/composables/types.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/composables/utils.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/dialogs/dialogs.vue.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/page/page.vue.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/page/types.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/pageComponent/pageComponent.vue.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/pageComponent/types.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/stories/dialog_example/pages/utils.d.ts +0 -0
- package/{components → types/components}/dialog/dialog/types.d.ts +0 -0
- package/{components → types/components}/dialog/dialog.d.ts +0 -0
- package/{components → types/components}/dialog/lib/utils.globalEvents.d.ts +0 -0
- package/{components → types/components}/extra/extra.d.ts +0 -0
- package/{components → types/components}/extra/rive/rive.vue.d.ts +0 -0
- package/{components → types/components}/extra/rive/types.d.ts +0 -0
- package/{components → types/components}/forms/avatar/avatar.vue.d.ts +1 -1
- /package/{components → types/components}/forms/avatar/types.d.ts +0 -0
- /package/{components → types/components}/forms/caption/caption.vue.d.ts +0 -0
- /package/{components → types/components}/forms/caption/types.d.ts +0 -0
- /package/{components → types/components}/forms/checkbox/types.d.ts +0 -0
- /package/{components → types/components}/forms/controlLabel/controlLabel.vue.d.ts +0 -0
- /package/{components → types/components}/forms/controlLabel/types.d.ts +0 -0
- /package/{components → types/components}/forms/forms.d.ts +0 -0
- /package/{components → types/components}/forms/helpers.d.ts +0 -0
- /package/{components → types/components}/forms/hint/hint.vue.d.ts +0 -0
- /package/{components → types/components}/forms/hint/types.d.ts +0 -0
- /package/{components → types/components}/forms/input/input.vue.d.ts +0 -0
- /package/{components → types/components}/forms/input/types.d.ts +0 -0
- /package/{components → types/components}/forms/inputDate/datepicker.d.ts +0 -0
- /package/{components → types/components}/forms/inputDate/inputDate.vue.d.ts +0 -0
- /package/{components → types/components}/forms/inputDate/types.d.ts +0 -0
- /package/{components → types/components}/forms/inputRange/inputRange.vue.d.ts +0 -0
- /package/{components → types/components}/forms/inputRange/types.d.ts +0 -0
- /package/{components → types/components}/forms/loadbar/loadbar.vue.d.ts +0 -0
- /package/{components → types/components}/forms/preloader/preloader.vue.d.ts +0 -0
- /package/{components → types/components}/forms/preloader/types.d.ts +0 -0
- /package/{components → types/components}/forms/radio/radio.vue.d.ts +0 -0
- /package/{components → types/components}/forms/radio/types.d.ts +0 -0
- /package/{components → types/components}/forms/select/select.vue.d.ts +0 -0
- /package/{components → types/components}/forms/select/types.d.ts +0 -0
- /package/{components → types/components}/forms/switcher/switcher.vue.d.ts +0 -0
- /package/{components → types/components}/forms/switcher/types.d.ts +0 -0
- /package/{components → types/components}/forms/textarea/textarea.vue.d.ts +0 -0
- /package/{components → types/components}/forms/textarea/types.d.ts +0 -0
- /package/{components → types/components}/formsExt/checkboxGroup/checkboxGroup.vue.d.ts +0 -0
- /package/{components → types/components}/formsExt/checkboxGroup/types.d.ts +0 -0
- /package/{components → types/components}/formsExt/editArea/editArea.vue.d.ts +0 -0
- /package/{components → types/components}/formsExt/editArea/types.d.ts +0 -0
- /package/{components → types/components}/formsExt/editInput/editInput.vue.d.ts +0 -0
- /package/{components → types/components}/formsExt/editInput/types.d.ts +0 -0
- /package/{components → types/components}/formsExt/formsExt.d.ts +0 -0
- /package/{components → types/components}/formsExt/info/info.vue.d.ts +0 -0
- /package/{components → types/components}/formsExt/info/types.d.ts +0 -0
- /package/{components → types/components}/formsExt/menu/menu.vue.d.ts +0 -0
- /package/{components → types/components}/formsExt/menu/types.d.ts +0 -0
- /package/{components → types/components}/formsExt/radioGroup/radioGroup.vue.d.ts +0 -0
- /package/{components → types/components}/formsExt/radioGroup/types.d.ts +0 -0
- /package/{components → types/components}/formsExt/selector2/itemMulti.vue.d.ts +0 -0
- /package/{components → types/components}/formsExt/selector2/utils.d.ts +0 -0
- /package/{components → types/components}/layout/islandRows/islandRows.vue.d.ts +0 -0
- /package/{components → types/components}/layout/islandRows/islandRowsRow/islandRowsRow.vue.d.ts +0 -0
- /package/{components → types/components}/layout/islandRows/islandRowsRow/types.d.ts +0 -0
- /package/{components → types/components}/layout/islandRows/islandRowsSubTitle/islandRowsSubTitle.vue.d.ts +0 -0
- /package/{components → types/components}/layout/islandRows/types.d.ts +0 -0
- /package/{components → types/components}/layout/layout.d.ts +0 -0
- /package/{components → types/components}/layout/rows/rows.vue.d.ts +0 -0
- /package/{components → types/components}/layout/rows/types.d.ts +0 -0
- /package/{components → types/components}/popup/lib/popup.globalEvents.d.ts +0 -0
- /package/{components → types/components}/popup/lib/worker.globalEvents.d.ts +0 -0
- /package/{components → types/components}/popup/popup/listItem.vue.d.ts +0 -0
- /package/{components → types/components}/popup/popup/widgetInput.vue.d.ts +0 -0
- /package/{components → types/components}/popup/popup.d.ts +0 -0
- /package/{components → types/components}/popup/worker.d.ts +0 -0
- /package/{components → types/components}/project/project.d.ts +0 -0
- /package/{components → types/components}/project/selectorCompetitors/composables.d.ts +0 -0
- /package/{components → types/components}/project/selectorCompetitors/selectorCompetitors.vue.d.ts +0 -0
- /package/{components → types/components}/project/selectorCompetitors/types.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/composables/compare.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/composables/selectRegion.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/composables/selectSearcher.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/composables/selectorRegion.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/dialog_selectorRegions/types.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/selectorRegion.vue.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/types.d.ts +0 -0
- /package/{components → types/components}/project/selectorRegion/utils/consts.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/popupListItem/tagPopupListItem.vue.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/popupListItem/types.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/popupOpener/popupOpener.vue.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/popupOpener/types.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/tagIcon/tagIcon.vue.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/tagIcon/types.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/tagSelector.vue.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/tagsDefaults.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/types.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/utils/el.d.ts +0 -0
- /package/{components → types/components}/project/tagSelector/utils/utils.d.ts +0 -0
- /package/{components → types/components}/tabs/tabs/content.vue.d.ts +0 -0
- /package/{components → types/components}/tabs/tabs/tab.vue.d.ts +0 -0
- /package/{components → types/components}/tabs/tabs/tabs.vue.d.ts +0 -0
- /package/{components → types/components}/tabs/tabs/types.d.ts +0 -0
- /package/{components → types/components}/tabs/tabs.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/menu.vue.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/menuDelimeter.vue.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/menuItem.vue.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/menuTitle.vue.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/store.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/tabsView.vue.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/types.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView/utils.d.ts +0 -0
- /package/{components → types/components}/tabsView/tabsView.d.ts +0 -0
- /package/{core → types/core}/app.d.ts +0 -0
- /package/{core → types/core}/core/core.d.ts +0 -0
- /package/{core → types/core}/core/events/resize.d.ts +0 -0
- /package/{core → types/core}/core/events.d.ts +0 -0
- /package/{core → types/core}/core/options.d.ts +0 -0
- /package/{core → types/core}/core/preloaders.d.ts +0 -0
- /package/{core → types/core}/core/state.d.ts +0 -0
- /package/{core → types/core}/directives/data.d.ts +0 -0
- /package/{core → types/core}/directives/focus.d.ts +0 -0
- /package/{core → types/core}/directives/preloader.d.ts +0 -0
- /package/{core → types/core}/directives/scrollIntoView.d.ts +0 -0
- /package/{core → types/core}/directives/scrollShadow.d.ts +0 -0
- /package/{core → types/core}/directives/sticky.d.ts +0 -0
- /package/{core → types/core}/directives/swimUp.d.ts +0 -0
- /package/{core → types/core}/directives/tooltip.d.ts +0 -0
- /package/{core → types/core}/plugins/core.d.ts +0 -0
- /package/{core → types/core}/plugins/i18n.d.ts +0 -0
- /package/{core → types/core}/plugins/piniaTPA.d.ts +0 -0
- /package/{core → types/core}/utils/check.d.ts +0 -0
- /package/{core → types/core}/utils/clipboard.d.ts +0 -0
- /package/{core → types/core}/utils/date.d.ts +0 -0
- /package/{core → types/core}/utils/device.d.ts +0 -0
- /package/{core → types/core}/utils/dom.d.ts +0 -0
- /package/{core → types/core}/utils/image.d.ts +0 -0
- /package/{core → types/core}/utils/keyboard.d.ts +0 -0
- /package/{core → types/core}/utils/lodash.d.ts +0 -0
- /package/{core → types/core}/utils/number.d.ts +0 -0
- /package/{core → types/core}/utils/price.d.ts +0 -0
- /package/{core → types/core}/utils/route.d.ts +0 -0
- /package/{core → types/core}/utils/scroll.d.ts +0 -0
- /package/{core → types/core}/utils/searchers.d.ts +0 -0
- /package/{core → types/core}/utils/store/localStorage.d.ts +0 -0
- /package/{core → types/core}/utils/store/plugin.d.ts +0 -0
- /package/{core → types/core}/utils/store/store.d.ts +0 -0
- /package/{core → types/core}/utils/store.d.ts +0 -0
- /package/{core → types/core}/utils/system.d.ts +0 -0
- /package/{core → types/core}/utils/url.d.ts +0 -0
- /package/{dialog → types/dialog}/dialog.d.ts +0 -0
- /package/{extra → types/extra}/extra.d.ts +0 -0
- /package/{forms/helpers.d.ts → types/for-delete/core.d.ts} +0 -0
- /package/{forms → types/forms}/forms.d.ts +0 -0
- /package/{formsExt → types/formsExt}/formsExt.d.ts +0 -0
- /package/{layout → types/layout}/layout.d.ts +0 -0
- /package/{popup → types/popup}/popup.d.ts +0 -0
- /package/{popup → types/popup}/worker.d.ts +0 -0
- /package/{project → types/project}/project.d.ts +0 -0
- /package/{tabs → types/tabs}/tabs.d.ts +0 -0
- /package/{tabsView → types/tabsView}/tabsView.d.ts +0 -0
- /package/{utils → types/utils}/check.d.ts +0 -0
- /package/{utils → types/utils}/clipboard.d.ts +0 -0
- /package/{utils → types/utils}/date.d.ts +0 -0
- /package/{utils → types/utils}/device.d.ts +0 -0
- /package/{utils → types/utils}/dom.d.ts +0 -0
- /package/{utils → types/utils}/image.d.ts +0 -0
- /package/{utils → types/utils}/keyboard.d.ts +0 -0
- /package/{utils → types/utils}/lodash.d.ts +0 -0
- /package/{utils → types/utils}/number.d.ts +0 -0
- /package/{utils → types/utils}/price.d.ts +0 -0
- /package/{utils → types/utils}/route.d.ts +0 -0
- /package/{utils → types/utils}/scroll.d.ts +0 -0
- /package/{utils → types/utils}/searchers.d.ts +0 -0
- /package/{utils → types/utils}/store.d.ts +0 -0
- /package/{utils → types/utils}/string.d.ts +0 -0
- /package/{utils → types/utils}/system.d.ts +0 -0
- /package/{utils → types/utils}/url.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-
|
|
1
|
+
{"version":3,"file":"store-YRW59xEF.amd.js","sources":["../../src/core/utils/store/plugin.ts","../../src/core/utils/store/store.ts"],"sourcesContent":["import { inject, type ObjectPlugin } from 'vue';\nimport type { Store } from './store';\n\nconst PluginsByApp = new WeakMap();\n\ntype Options = {\n\tonInit: (context: Context) => void;\n}\n\ntype Context = {\n\tstore: Store,\n\toptions: object,\n}\n\n/**\n * Плагин tpa (Third-party access) для pinia\n *\n * Сейчас не используется\n *\n * TODO: Должен реализовывать возмоэности piniaTPAPlugin\n */\nexport default {\n\tinstall: (app, options) => {\n\t\tif (!PluginsByApp.has(app)) {\n\t\t\tPluginsByApp.set(app, []);\n\t\t}\n\n\t\tconst onInits = PluginsByApp.get(app);\n\n\t\tonInits.push(options.onInit);\n\n\t\tapp.provide('TopStoreOnInits', onInits);\n\t},\n} satisfies ObjectPlugin<Options>;\n\n/**\n * Применить плагины к store\n */\nexport const usePlugins = (store: Store, options: object = {}) => {\n\tconst context: Context = {\n\t\tstore,\n\t\toptions,\n\t};\n\n\tconst onInits: Array<Function> = inject('TopStoreOnInits', []);\n\n\tonInits.forEach((onInit) => {\n\t\tonInit.call(context);\n\t});\n};\n","/**\n * Храналище выполненное по аналогии с https://pinia.vuejs.org/\n *\n * Основное отличие от Pinia - реализация Храналища на уровне компонента, а не приложения.\n * Каждый экземдяр компонента будет иметь свой Store.\n *\n * Основное отличие от классического State - является общим для компонента и всех его дочерних компонентов. Основано на принципе provide/inject.\n * https://vuejs.org/guide/components/provide-inject.html\n *\n * @packageDocumentation\n */\n\nimport type { InjectionKey, UnwrapNestedRefs } from 'vue';\nimport { inject, provide, reactive, watch } from 'vue';\nimport { usePlugins } from './plugin';\n\n/**\n * Определить Store\n *\n * Следует определять на уровне корневого компонента, использующего Store\n * @param injectionKey - InjectionKey для provide / inject в области компонента\n * @param setup - Нстройки Store, см. https://pinia.vuejs.org/core-concepts/#Setup-Stores\n * @param $id - строковой id Store, используется в плагинах\n * @param options - настройки Store, используются в плагинах\n */\nexport const defineStore = <T extends object>(\n\tinjectionKey: InjectionKey<UnwrapNestedRefs<T>>,\n\tsetup: () => T | object,\n\t$id?: string,\n\toptions?: object,\n): UnwrapNestedRefs<T> & Store => {\n\tconst store = reactive(setup()) as UnwrapNestedRefs<T> & Store;\n\n\tstore.$id = $id;\n\tstore.$subscribe = (cb: Function) => {\n\t\twatch(store, () => cb(), { deep: true });\n\t};\n\n\tusePlugins(store, options);\n\n\tprovide(injectionKey, store);\n\n\treturn store;\n};\n\n/**\n * Получить State компонента\n * @param injectionKey - InjectionKey для provide / inject в области компонента\n * @return - State компонента\n */\nexport const useStore = <T>(injectionKey: InjectionKey<T>): T & Store => {\n\tconst store = inject(injectionKey);\n\n\tif (!store) {\n\t\tthrow Error('Попытка использовать Store до его инициализации, убедитесь, что defineStore() вызван в setup() необходимого компонента');\n\t}\n\n\treturn store;\n};\n\n/**\n * Легковесный аналог объекта Store Pinia для совместимости с плагинами Pinia\n */\nexport interface Store {\n\t/**\n\t * Строковой идентификатор Store\n\t *\n\t * Не уникален в рамках приложения\n\t */\n\t$id?: string;\n\t$subscribe?: Function;\n}\n\nexport default {\n\tdefineStore,\n\tuseStore,\n};\n"],"names":["store","onInit","context","defineStore","injectionKey","setup","$id","options","vue","cb","usePlugins","useStore"],"mappings":"8HAuC0B,MAAAA,4CAOzB,QAAAC,GAAA,CACCA,EAAA,KAAAC,CAAA,CAAmB,CAAA,GCtBdC,EAAA,CAAAC,EAAAC,EAAAC,EAAAC,IAAA,CAMN,MAAAP,EAAAQ,EAAA,SAAAH,EAAA,CAAA,EAEA,OAAAL,EAAA,IAAAM,EACAN,EAAA,WAAAS,GAAA,CACCD,EAAA,MAAAR,EAAA,IAAAS,EAAA,EAAA,CAAA,KAAA,EAAA,CAAA,CAAuC,EAGxCC,EAAAV,EAAAO,CAAA,EAEAC,EAAA,QAAAJ,EAAAJ,CAAA,EAEAA,CACD,EAOOW,EAAAP,GAAA,CACN,MAAAJ,EAAAQ,EAAA,OAAAJ,CAAA,QAGC,MAAA,MAAA,wHAAA,EAGD,OAAAJ,CACD,EAeAA,EAAA,CAAe,YAAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as s, getCurrentInstance as a, inject as i } from "vue";
|
|
2
|
-
import { a as n, g as c } from "./dialogs.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { a as n, g as c } from "./dialogs.vue_vue_type_script_setup_true_lang-DIVnPVQ4.es.js";
|
|
3
3
|
import { waitWhile as w } from "../utils/system.js";
|
|
4
4
|
class l {
|
|
5
5
|
/**
|
|
@@ -76,4 +76,4 @@ export {
|
|
|
76
76
|
d as b,
|
|
77
77
|
h as u
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=utils-
|
|
79
|
+
//# sourceMappingURL=utils-BR_kFG05.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-BR_kFG05.es.js","sources":["../../src/components/dialog/dialog/composables/asyncDialogHandle.ts","../../src/components/dialog/dialog/composables/utils.ts"],"sourcesContent":["import type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { useTopDialog } from './utils';\nimport { waitWhile } from '@/core/utils/system';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { TopDialogHandle } from './dialogHandle';\n\n/**\n * Объект для работы с асинхронным диалоговым окном\n *\n * Является прослойкой для доступа к TopDialogHandle\n */\nexport class AsyncTopDialogHandle<T extends TopDialogComponent> {\n\n\t/**\n\t * Функция, определяющая компонент TopDialogComponent\n\t */\n\treadonly resolve: AsyncTopDialogComponentLoader<T>;\n\n\t/**\n\t * Реактивная Сссылка на объект worker,\n\t *\n\t * Ссылка не будет указывать на объект, если диалоговое окно еще не загружено\n\t */\n\treadonly worker: Ref<TopDialogHandle<T> | null> = ref(null);\n\n\tconstructor(resolve: AsyncTopDialogComponentLoader<T>) {\n\t\tthis.resolve = resolve;\n\t}\n\n\t/**\n\t * Получить доступ к TopDialogHandle\n\t */\n\tasync get() {\n\t\tif (this.worker.value) return this.worker.value;\n\n\t\tconst result = await this.resolve();\n\t\tconst TopDialogComponent = result.default;\n\n\t\tthis.worker.value = useTopDialog(TopDialogComponent);\n\n\t\tconst worker = this.worker.value;\n\n\t\tawait waitWhile(() => !worker.isMounted);\n\n\t\treturn worker;\n\t}\n\n\t/**\n\t * Открыть диалоговое окно\n\t */\n\tasync open(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.open(...args);\n\t}\n\n\t/**\n\t * Открыть диалоговое окно как ссылку, для хеш-навигации\n\t *\n\t * Только общедоступные диалоговые окна, расположенные в @/dialogs\n\t */\n\tasync openAsLink(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tvoid worker.openAsLink(...args);\n\t}\n\n\t/**\n\t * Закрыть диалоговое окно\n\t *\n\t * Не меняет состояние компонента диалогового окна\n\t */\n\tasync close(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.close(...args);\n\t}\n\n\t/**\n\t * Размонтировать виджет диалогового окна\n\t */\n\tasync destroy(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.destroy(...args);\n\t}\n\n\t/**\n\t * Устанвоить props\n\t *\n\t * Полностью сбрасывается состояние props\n\t */\n\tasync setProps(...args: Parameters<TopDialogHandle<T>['setProps']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.setProps(...args);\n\t}\n}\n","import { getCurrentInstance, inject } from 'vue';\nimport { TopDialogHandle } from './dialogHandle';\nimport { AsyncTopDialogHandle } from './asyncDialogHandle';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { addDialogWorker, getDialogWorker } from '../dialogs/dialogs.vue';\n\n/**\n * Получить объект управленя текущим диалоговым окном\n */\nexport const useTopDialogSelf = () => {\n\t// вызов из пользовтаельского компонента диалога\n\tconst topDialogComponent = getCurrentInstance() as any;\n\tif (topDialogComponent?.type?.id) {\n\t\tconst dialogWorker = getDialogWorker(topDialogComponent.type.id);\n\t\tif (dialogWorker) return dialogWorker;\n\t}\n\n\treturn inject('dialogWorker') as TopDialogHandle<TopDialogComponent>;\n};\n\n/**\n * Получить объект управленя диалоговым окном\n *\n * При первом вызове компонент диалогового окна будет внедрен в компонент DialogWrapper\n */\nexport const useTopDialog = <T extends TopDialogComponent>(DialogComponent: T): TopDialogHandle<T> => {\n\treturn addDialogWorker(DialogComponent);\n};\n\n/**\n * Получить объект управленя асинхронным диалоговым окном\n *\n * Компонент диалогового окна будет загружен и инициирован при первом взаимодействии с объектом\n *\n * Использует useTopDialog()\n */\nexport const useAsyncTopDialog = <T extends TopDialogComponent>(resolve: AsyncTopDialogComponentLoader<T>): AsyncTopDialogHandle<T> => {\n\treturn new AsyncTopDialogHandle(resolve);\n};\n"],"names":["AsyncTopDialogHandle","ref","resolve","TopDialogComponent","useTopDialog","worker","waitWhile","args","useTopDialogSelf","topDialogComponent","getCurrentInstance","_a","dialogWorker","getDialogWorker","inject","DialogComponent","addDialogWorker","useAsyncTopDialog"],"mappings":";;;AAYO,MAAMA,EAAmD;AAAA;AAAA;AAAA;AAAA,EAKtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAyCC,EAAI,IAAI;AAAA,EAE1D,YAAYC,GAA2C;AACtD,SAAK,UAAUA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAM;AACX,QAAI,KAAK,OAAO,MAAO,QAAO,KAAK,OAAO;AAG1C,UAAMC,KADS,MAAM,KAAK,QAAA,GACQ;AAElC,SAAK,OAAO,QAAQC,EAAaD,CAAkB;AAEnD,UAAME,IAAS,KAAK,OAAO;AAE3B,iBAAMC,EAAU,MAAM,CAACD,EAAO,SAAS,GAEhCA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAQE,GAA8C;AAG3D,WAFe,MAAM,KAAK,IAAA,GAEb,KAAK,GAAGA,CAAI;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAcA,GAA8C;AAGjE,KAFe,MAAM,KAAK,IAAA,GAEd,WAAW,GAAGA,CAAI;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,SAASA,GAA+C;AAG7D,KAFe,MAAM,KAAK,IAAA,GAEnB,MAAM,GAAGA,CAAI;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,WAAWA,GAA+C;AAG/D,KAFe,MAAM,KAAK,IAAA,GAEnB,QAAQ,GAAGA,CAAI;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,YAAYA,GAAkD;AAGnE,WAFe,MAAM,KAAK,IAAA,GAEb,SAAS,GAAGA,CAAI;AAAA,EAC9B;AACD;ACzFO,MAAMC,IAAmB,MAAM;;AAErC,QAAMC,IAAqBC,EAAA;AAC3B,OAAIC,IAAAF,KAAA,gBAAAA,EAAoB,SAApB,QAAAE,EAA0B,IAAI;AACjC,UAAMC,IAAeC,EAAgBJ,EAAmB,KAAK,EAAE;AAC/D,QAAIG,EAAc,QAAOA;AAAA,EAC1B;AAEA,SAAOE,EAAO,cAAc;AAC7B,GAOaV,IAAe,CAA+BW,MACnDC,EAAgBD,CAAe,GAU1BE,IAAoB,CAA+Bf,MACxD,IAAIF,EAAqBE,CAAO;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-aLCfJKIO.amd","../utils/system.amd"],(function(k,s,t,i,u){"use strict";if(typeof t>"u")var t=window.Vue;class c{resolve;worker=t.ref(null);constructor(e){this.resolve=e}async get(){if(this.worker.value)return this.worker.value;const o=(await this.resolve()).default;this.worker.value=n(o);const a=this.worker.value;return await u.waitWhile(()=>!a.isMounted),a}async open(...e){await(await this.get()).open(...e)}async openAsLink(...e){(await this.get()).openAsLink(...e)}async close(...e){(await this.get()).close(...e)}async destroy(...e){(await this.get()).destroy(...e)}async setProps(...e){await(await this.get()).setProps(...e)}}const l=()=>{var e;const r=t.getCurrentInstance();if((e=r==null?void 0:r.type)!=null&&e.id){const o=i.getDialogWorker(r.type.id);if(o)return o}return t.inject("dialogWorker")},n=r=>i.addDialogWorker(r),w=r=>new c(r);s.useAsyncTopDialog=w,s.useTopDialog=n,s.useTopDialogSelf=l}));
|
|
2
|
+
//# sourceMappingURL=utils-BVONc_yb.amd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-BVONc_yb.amd.js","sources":["../../src/components/dialog/dialog/composables/asyncDialogHandle.ts","../../src/components/dialog/dialog/composables/utils.ts"],"sourcesContent":["import type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { useTopDialog } from './utils';\nimport { waitWhile } from '@/core/utils/system';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { TopDialogHandle } from './dialogHandle';\n\n/**\n * Объект для работы с асинхронным диалоговым окном\n *\n * Является прослойкой для доступа к TopDialogHandle\n */\nexport class AsyncTopDialogHandle<T extends TopDialogComponent> {\n\n\t/**\n\t * Функция, определяющая компонент TopDialogComponent\n\t */\n\treadonly resolve: AsyncTopDialogComponentLoader<T>;\n\n\t/**\n\t * Реактивная Сссылка на объект worker,\n\t *\n\t * Ссылка не будет указывать на объект, если диалоговое окно еще не загружено\n\t */\n\treadonly worker: Ref<TopDialogHandle<T> | null> = ref(null);\n\n\tconstructor(resolve: AsyncTopDialogComponentLoader<T>) {\n\t\tthis.resolve = resolve;\n\t}\n\n\t/**\n\t * Получить доступ к TopDialogHandle\n\t */\n\tasync get() {\n\t\tif (this.worker.value) return this.worker.value;\n\n\t\tconst result = await this.resolve();\n\t\tconst TopDialogComponent = result.default;\n\n\t\tthis.worker.value = useTopDialog(TopDialogComponent);\n\n\t\tconst worker = this.worker.value;\n\n\t\tawait waitWhile(() => !worker.isMounted);\n\n\t\treturn worker;\n\t}\n\n\t/**\n\t * Открыть диалоговое окно\n\t */\n\tasync open(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.open(...args);\n\t}\n\n\t/**\n\t * Открыть диалоговое окно как ссылку, для хеш-навигации\n\t *\n\t * Только общедоступные диалоговые окна, расположенные в @/dialogs\n\t */\n\tasync openAsLink(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tvoid worker.openAsLink(...args);\n\t}\n\n\t/**\n\t * Закрыть диалоговое окно\n\t *\n\t * Не меняет состояние компонента диалогового окна\n\t */\n\tasync close(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.close(...args);\n\t}\n\n\t/**\n\t * Размонтировать виджет диалогового окна\n\t */\n\tasync destroy(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.destroy(...args);\n\t}\n\n\t/**\n\t * Устанвоить props\n\t *\n\t * Полностью сбрасывается состояние props\n\t */\n\tasync setProps(...args: Parameters<TopDialogHandle<T>['setProps']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.setProps(...args);\n\t}\n}\n","import { getCurrentInstance, inject } from 'vue';\nimport { TopDialogHandle } from './dialogHandle';\nimport { AsyncTopDialogHandle } from './asyncDialogHandle';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { addDialogWorker, getDialogWorker } from '../dialogs/dialogs.vue';\n\n/**\n * Получить объект управленя текущим диалоговым окном\n */\nexport const useTopDialogSelf = () => {\n\t// вызов из пользовтаельского компонента диалога\n\tconst topDialogComponent = getCurrentInstance() as any;\n\tif (topDialogComponent?.type?.id) {\n\t\tconst dialogWorker = getDialogWorker(topDialogComponent.type.id);\n\t\tif (dialogWorker) return dialogWorker;\n\t}\n\n\treturn inject('dialogWorker') as TopDialogHandle<TopDialogComponent>;\n};\n\n/**\n * Получить объект управленя диалоговым окном\n *\n * При первом вызове компонент диалогового окна будет внедрен в компонент DialogWrapper\n */\nexport const useTopDialog = <T extends TopDialogComponent>(DialogComponent: T): TopDialogHandle<T> => {\n\treturn addDialogWorker(DialogComponent);\n};\n\n/**\n * Получить объект управленя асинхронным диалоговым окном\n *\n * Компонент диалогового окна будет загружен и инициирован при первом взаимодействии с объектом\n *\n * Использует useTopDialog()\n */\nexport const useAsyncTopDialog = <T extends TopDialogComponent>(resolve: AsyncTopDialogComponentLoader<T>): AsyncTopDialogHandle<T> => {\n\treturn new AsyncTopDialogHandle(resolve);\n};\n"],"names":["AsyncTopDialogHandle","vue","resolve","TopDialogComponent","worker","args","useTopDialogSelf","topDialogComponent","_a","dialogWorker","useTopDialog","DialogComponent","dialogs_vue_vue_type_script_setup_true_lang","useAsyncTopDialog"],"mappings":"yLAYO,MAAAA,CAAA,CAAyD,QAKtD,OAAAC,EAAA,IAAA,IAAA,iBAUR,KAAA,QAAAC,cAOA,GAAA,KAAA,OAAA,MAAA,OAAA,KAAA,OAAA,MAGA,MAAAC,GADA,MAAA,KAAA,QAAA,GACA,+BAIA,MAAAC,EAAA,KAAA,OAAA,iDAIAA,EACD,MAAA,QAAAC,EAAA,CAQC,MAFA,MAAA,KAAA,IAAA,GAEA,KAAA,GAAAA,CAAA,EACD,MAAA,cAAAA,EAAA,EAQC,MAAA,KAAA,IAAA,GAEA,WAAA,GAAAA,CAAA,EACD,MAAA,SAAAA,EAAA,EAQC,MAAA,KAAA,IAAA,GAEA,MAAA,GAAAA,CAAA,EACD,MAAA,WAAAA,EAAA,EAMC,MAAA,KAAA,IAAA,GAEA,QAAA,GAAAA,CAAA,EACD,MAAA,YAAAA,EAAA,CAUC,MAFA,MAAA,KAAA,IAAA,GAEA,SAAA,GAAAA,CAAA,EAEF,CCzFO,MAAAC,EAAA,IAAA,OAEN,MAAAC,EAAAN,EAAA,mBAAA,EACA,IAAAO,EAAAD,GAAA,YAAAA,EAAA,OAAA,MAAAC,EAAA,GAAA,sCAEC,GAAAC,EAAA,OAAAA,EAGD,OAAAR,EAAA,OAAA,cAAA,CACD,EAOOS,EAAAC,GACNC,EAAA,gBAAAD,CAAA,EAUME,EAAAX,GACN,IAAAF,EAAAE,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["require","exports","../.chunks/field-Cvv0SRcJ.amd"],(function(f,a,c){"use strict";if(typeof N>"u")var N=window.Vue;const o=t=>{const e=[];return Object.keys(t).forEach(r=>{const s=r,n=t[s];if(n===void 0)return;let i;s==="tags_ids"||s==="tags"?l(s,e,n):typeof n=="string"||typeof n=="number"||typeof n=="boolean"?i=u(s,n):(Array.isArray(n)||n instanceof Set)&&(i=b(s,n)),i&&e.push(i)}),e},g=t=>{let e=t,r="EQUALS",s;switch((t[1]===":"||t[2]===":")&&([s,e]=t.split(":")),s){case">":r="GREATER_THAN",e=Number(e);break;case">=":r="GREATER_THAN_EQUALS",e=Number(e);break;case"<":r="LESS_THAN",e=Number(e);break;case"<=":r="LESS_THAN_EQUALS",e=Number(e);break;case"!=":r="NOT_EQUALS",e.match(/^\d+$/)&&(e=Number(e));break;case"%":r="CONTAINS";break;case"!%":r="DOES_NOT_CONTAIN";break;case"^":r="STARTS_WITH";break;case"null":r="IS_NULL";break;case"!null":r="IS_NOT_NULL";break;case"~":r="REGEXP";break;case"!~":r="NOT_REGEXP";break}return{value:e,operator:r}},l=(t,e,r)=>{const s=[],n=[];r.forEach(i=>{i[0]==="-"?n.push(i.substring(1)):s.push(i)}),s.length&&e.push(c.genFieldFilter(t,"IN",s)),n.length&&e.push(c.genFieldFilter(t,"NOT_IN",n))},u=(t,e)=>{let r=e,s="EQUALS";return typeof e=="string"&&({value:r,operator:s}=g(e)),typeof r=="boolean"&&(r=r?1:0),c.genFieldFilter(t,s,[r])},b=(t,e)=>c.genFieldFilter(t,"IN",Array.isArray(e)?e:[...e]);a.genFilterIn=b,a.genFilterPrimitive=u,a.genFilters=o,a.pushFilterTagsIds=l,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=additional.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"additional.amd.js","sources":["../../src/api/api/utils/filters.ts"],"sourcesContent":["import type { components as componentsTagId } from 'topvisor-openapi/src/ts/Tags_2/Types/TagId';\nimport { genFieldFilter } from './field';\n\ntype TagId = componentsTagId['schemas']['Tags_2.Types.TagId'];\ntype TagIdExclude = `-${TagId}`;\n\ntype DataWithModifierOperator<Model> = {\n\t[K in keyof Model]: Model[K] | Model[K][] | Set<Model[K]> | string\n};\n\n/**\n * Модификатор оператора сравнения\n *\n * Используется посредством добавления к строковому значению поля для упрощения синтаксиса указания фильтров\n *\n * @example Поиск вхождения `Иван` в поле `name`\n * genFilters({\n * id: 12345, // без модификатора опертора\n * name: '%:' + 'Иван', // с модификатором опертора\n * });\n */\ntype ModifierOperator = '>=' | '<=' | '!=' | '>' | '<' | '%' | '!%' | '^' | '~' | '!~' | 'null' | '!null';\n\ntype ValueWithModifierOperator = `${ModifierOperator}:${string | number}`;\n\n/**\n * Сгенерировать массив с фильтрами API\n *\n * Ключи - `filedName`, значения - `[ModifierOperator:]fieldValue` / `fieldValues`\n *\n * Значения `undefined` будут пропускаться\n *\n * Додерживает типы:\n *\n * - string, number, boolean - строгое равенство `EQUALS`, если не указан `modifierOperator`\n * - Array - вхождение `IN`\n * - Set<string | number> - вхождение `IN`\n *\n * @see ModifierOperator\n */\nexport const genFilters = <Model extends Api.Ext.Schemas['Model']>(\n\tdataWithModifierOperator: DataWithModifierOperator<Model>,\n): Api.Field.Filter<Model>[] => {\n\tconst filters: Api.Field.Filter<Model>[] = [];\n\n\tObject.keys(dataWithModifierOperator).forEach(_name => {\n\t\tconst name = _name as string & keyof Model;\n\t\tconst value = dataWithModifierOperator[name];\n\t\tif (value === undefined) return;\n\n\t\tlet filter: Api.Field.Filter<Model> | undefined;\n\n\t\tif (name === 'tags_ids' || name === 'tags') {\n\t\t\tpushFilterTagsIds(name, filters, value as any);\n\t\t} else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n\t\t\tfilter = genFilterPrimitive(name, value);\n\t\t} else if (Array.isArray(value) || value instanceof Set) {\n\t\t\tfilter = genFilterIn(name, value as any);\n\t\t}\n\n\t\tif (filter) {\n\t\t\tfilters.push(filter);\n\t\t}\n\t});\n\n\treturn filters;\n};\n\n/**\n * Получить value и operator из valueWithModifierOperator\n */\nconst extractOperator = (valueWithModifierOperator: ValueWithModifierOperator): {\n\tvalue: any,\n\toperator: Api.Ext.Schemas['FieldOperator']\n} => {\n\tlet value: string | number = valueWithModifierOperator;\n\tlet operator: Api.Field.Filter<any>['operator'] = 'EQUALS';\n\n\tlet modifierOperator: ModifierOperator | undefined;\n\tif (valueWithModifierOperator[1] === ':' || valueWithModifierOperator[2] === ':') {\n\t\t[modifierOperator, value] = valueWithModifierOperator.split(':') as [ModifierOperator, string];\n\t}\n\n\tswitch (modifierOperator) {\n\t\tcase '>':\n\t\t\toperator = 'GREATER_THAN';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '>=':\n\t\t\toperator = 'GREATER_THAN_EQUALS';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '<':\n\t\t\toperator = 'LESS_THAN';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '<=':\n\t\t\toperator = 'LESS_THAN_EQUALS';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '!=':\n\t\t\toperator = 'NOT_EQUALS';\n\n\t\t\tif (value.match(/^\\d+$/)) value = Number(value);\n\n\t\t\tbreak;\n\t\tcase '%':\n\t\t\toperator = 'CONTAINS';\n\n\t\t\tbreak;\n\t\tcase '!%':\n\t\t\toperator = 'DOES_NOT_CONTAIN';\n\n\t\t\tbreak;\n\t\tcase '^':\n\t\t\toperator = 'STARTS_WITH';\n\n\t\t\tbreak;\n\t\tcase 'null':\n\t\t\toperator = 'IS_NULL';\n\n\t\t\tbreak;\n\t\tcase '!null':\n\t\t\toperator = 'IS_NOT_NULL';\n\n\t\t\tbreak;\n\t\tcase '~':\n\t\t\toperator = 'REGEXP';\n\n\t\t\tbreak;\n\t\tcase '!~':\n\t\t\toperator = 'NOT_REGEXP';\n\n\t\t\tbreak;\n\t}\n\n\treturn { value, operator };\n};\n\n/**\n * Сгенерировать и добавить API фильтр из списка тегов\n */\nexport const pushFilterTagsIds = <\n\tModel extends Api.Ext.Schemas['Model'] = any,\n\tFieldName extends Api.Field.Name<Model> = Api.Field.Name<Model>\n>(\n\tname: FieldName,\n\tfilters: Api.Field.Filter<Model, FieldName>[],\n\ttagsIds: Array<TagId | TagIdExclude>,\n) => {\n\tconst tagsIncluded: Array<Model[FieldName] & TagId> = [];\n\tconst tagsExcluded: Array<Model[FieldName] & TagId> = [];\n\n\ttagsIds.forEach((tagId) => {\n\t\tif (tagId[0] === '-') {\n\t\t\ttagsExcluded.push(tagId.substring(1) as Model[FieldName] & TagId);\n\t\t} else {\n\t\t\ttagsIncluded.push(tagId as Model[FieldName] & TagId);\n\t\t}\n\t});\n\n\tif (tagsIncluded.length) filters.push(genFieldFilter<Model, FieldName>(name, 'IN', tagsIncluded));\n\tif (tagsExcluded.length) filters.push(genFieldFilter<Model, FieldName>(name, 'NOT_IN', tagsExcluded));\n};\n\n/**\n * Сгенерировать API фильтр из простого значения\n */\nexport const genFilterPrimitive = <\n\tModel extends Api.Ext.Schemas['Model'] = any,\n\tFieldName extends Api.Field.Name<Model> = Api.Field.Name<Model>\n>(\n\tname: FieldName,\n\tvalueWithModifierOperator: number | string | boolean | ValueWithModifierOperator,\n) => {\n\tlet value = valueWithModifierOperator;\n\tlet operator: Api.Field.Filter<any>['operator'] = 'EQUALS';\n\n\tif (typeof valueWithModifierOperator === 'string') {\n\t\tlet {} = { value, operator } = extractOperator(valueWithModifierOperator as ValueWithModifierOperator);\n\t}\n\n\t// @deprecated\n\tif (typeof value === 'boolean') {\n\t\tvalue = value ? 1 : 0;\n\t}\n\n\treturn genFieldFilter<Model>(name, operator, [value as any]);\n};\n\n/**\n * Сгенерировать API фильтр IN\n */\nexport const genFilterIn = <\n\tModel extends Api.Ext.Schemas['Model'] = any,\n\tFieldName extends Api.Field.Name<Model> = Api.Field.Name<Model>\n>(\n\tname: FieldName,\n\tvaluesOrSet: Model[FieldName][] | Set<Model[FieldName]>,\n) => {\n\treturn genFieldFilter<Model, FieldName>(name, 'IN', Array.isArray(valuesOrSet) ? valuesOrSet : [...valuesOrSet]);\n};\n"],"names":["genFilters","dataWithModifierOperator","value","name","filter","pushFilterTagsIds","filters","genFilterPrimitive","genFilterIn","extractOperator","valueWithModifierOperator","modifierOperator","operator","tagsIds","tagId","tagsIncluded","field","tagsExcluded","valuesOrSet"],"mappings":"4HAwCO,MAAAA,EAAAC,GAAA,wDAOLC,EAAAD,EAAAE,CAAA,EACA,GAAAD,IAAA,OAAA,OAEA,IAAAE,6BAGCC,EAAAF,EAAAG,EAAAJ,CAAA,EAA6C,OAAAA,GAAA,UAAA,OAAAA,GAAA,UAAA,OAAAA,GAAA,UAE7CE,EAAAG,EAAAJ,EAAAD,CAAA,GAAuC,MAAA,QAAAA,CAAA,GAAAA,aAAA,OAEvCE,EAAAI,EAAAL,EAAAD,CAAA,MAIAI,EAAA,KAAAF,CAAA,CACD,CAAA,EAGDE,CACD,EAKAG,EAAAC,GAAA,oBAOCC,EAKA,QAJAD,EAAA,CAAA,IAAA,KAAAA,EAAA,CAAA,IAAA,2BAIAC,EAAA,CAA0B,IAAA,qBAGxBT,EAAA,OAAAA,CAAA,QAEA,IAAA,6BAGAA,EAAA,OAAAA,CAAA,QAEA,IAAA,kBAGAA,EAAA,OAAAA,CAAA,QAEA,IAAA,0BAGAA,EAAA,OAAAA,CAAA,QAEA,IAAA,oBAIAA,EAAA,MAAA,OAAA,IAAAA,EAAA,OAAAA,CAAA,SAEA,IAAA,uBAIA,IAAA,gCAIA,IAAA,0BAIA,IAAA,yBAIA,IAAA,8BAIA,IAAA,qBAIA,IAAA,yBAIA,CAGF,MAAA,CAAA,MAAAA,EAAA,SAAAU,CAAA,GAMMP,EAAA,CAAAF,EAAAG,EAAAO,IAAA,iBAWNA,EAAA,QAAAC,GAAA,CACCA,EAAA,CAAA,IAAA,2BAGCC,EAAA,KAAAD,CAAA,CACD,CAAA,EAGDC,EAAA,QAAAT,EAAA,KAAAU,EAAA,eAAAb,EAAA,KAAAY,CAAA,CAAA,EACAE,EAAA,QAAAX,EAAA,KAAAU,EAAA,eAAAb,EAAA,SAAAc,CAAA,CAAA,CACD,EAKOV,EAAA,CAAAJ,EAAAO,IAAA,oBAUN,OAAA,OAAAA,GAAA,sCAKA,OAAAR,GAAA,YACCA,EAAAA,EAAA,EAAA,4BAIF,EAKOM,EAAA,CAAAL,EAAAe"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { g as c } from "../.chunks/field-CyyFzM-Y.es.js";
|
|
2
|
+
const u = (t) => {
|
|
3
|
+
const e = [];
|
|
4
|
+
return Object.keys(t).forEach((s) => {
|
|
5
|
+
const r = s, n = t[r];
|
|
6
|
+
if (n === void 0) return;
|
|
7
|
+
let a;
|
|
8
|
+
r === "tags_ids" || r === "tags" ? N(r, e, n) : typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? a = b(r, n) : (Array.isArray(n) || n instanceof Set) && (a = o(r, n)), a && e.push(a);
|
|
9
|
+
}), e;
|
|
10
|
+
}, l = (t) => {
|
|
11
|
+
let e = t, s = "EQUALS", r;
|
|
12
|
+
switch ((t[1] === ":" || t[2] === ":") && ([r, e] = t.split(":")), r) {
|
|
13
|
+
case ">":
|
|
14
|
+
s = "GREATER_THAN", e = Number(e);
|
|
15
|
+
break;
|
|
16
|
+
case ">=":
|
|
17
|
+
s = "GREATER_THAN_EQUALS", e = Number(e);
|
|
18
|
+
break;
|
|
19
|
+
case "<":
|
|
20
|
+
s = "LESS_THAN", e = Number(e);
|
|
21
|
+
break;
|
|
22
|
+
case "<=":
|
|
23
|
+
s = "LESS_THAN_EQUALS", e = Number(e);
|
|
24
|
+
break;
|
|
25
|
+
case "!=":
|
|
26
|
+
s = "NOT_EQUALS", e.match(/^\d+$/) && (e = Number(e));
|
|
27
|
+
break;
|
|
28
|
+
case "%":
|
|
29
|
+
s = "CONTAINS";
|
|
30
|
+
break;
|
|
31
|
+
case "!%":
|
|
32
|
+
s = "DOES_NOT_CONTAIN";
|
|
33
|
+
break;
|
|
34
|
+
case "^":
|
|
35
|
+
s = "STARTS_WITH";
|
|
36
|
+
break;
|
|
37
|
+
case "null":
|
|
38
|
+
s = "IS_NULL";
|
|
39
|
+
break;
|
|
40
|
+
case "!null":
|
|
41
|
+
s = "IS_NOT_NULL";
|
|
42
|
+
break;
|
|
43
|
+
case "~":
|
|
44
|
+
s = "REGEXP";
|
|
45
|
+
break;
|
|
46
|
+
case "!~":
|
|
47
|
+
s = "NOT_REGEXP";
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return { value: e, operator: s };
|
|
51
|
+
}, N = (t, e, s) => {
|
|
52
|
+
const r = [], n = [];
|
|
53
|
+
s.forEach((a) => {
|
|
54
|
+
a[0] === "-" ? n.push(a.substring(1)) : r.push(a);
|
|
55
|
+
}), r.length && e.push(c(t, "IN", r)), n.length && e.push(c(t, "NOT_IN", n));
|
|
56
|
+
}, b = (t, e) => {
|
|
57
|
+
let s = e, r = "EQUALS";
|
|
58
|
+
return typeof e == "string" && ({ value: s, operator: r } = l(e)), typeof s == "boolean" && (s = s ? 1 : 0), c(t, r, [s]);
|
|
59
|
+
}, o = (t, e) => c(t, "IN", Array.isArray(e) ? e : [...e]);
|
|
60
|
+
export {
|
|
61
|
+
o as genFilterIn,
|
|
62
|
+
b as genFilterPrimitive,
|
|
63
|
+
u as genFilters,
|
|
64
|
+
N as pushFilterTagsIds
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=additional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"additional.js","sources":["../../src/api/api/utils/filters.ts"],"sourcesContent":["import type { components as componentsTagId } from 'topvisor-openapi/src/ts/Tags_2/Types/TagId';\nimport { genFieldFilter } from './field';\n\ntype TagId = componentsTagId['schemas']['Tags_2.Types.TagId'];\ntype TagIdExclude = `-${TagId}`;\n\ntype DataWithModifierOperator<Model> = {\n\t[K in keyof Model]: Model[K] | Model[K][] | Set<Model[K]> | string\n};\n\n/**\n * Модификатор оператора сравнения\n *\n * Используется посредством добавления к строковому значению поля для упрощения синтаксиса указания фильтров\n *\n * @example Поиск вхождения `Иван` в поле `name`\n * genFilters({\n * id: 12345, // без модификатора опертора\n * name: '%:' + 'Иван', // с модификатором опертора\n * });\n */\ntype ModifierOperator = '>=' | '<=' | '!=' | '>' | '<' | '%' | '!%' | '^' | '~' | '!~' | 'null' | '!null';\n\ntype ValueWithModifierOperator = `${ModifierOperator}:${string | number}`;\n\n/**\n * Сгенерировать массив с фильтрами API\n *\n * Ключи - `filedName`, значения - `[ModifierOperator:]fieldValue` / `fieldValues`\n *\n * Значения `undefined` будут пропускаться\n *\n * Додерживает типы:\n *\n * - string, number, boolean - строгое равенство `EQUALS`, если не указан `modifierOperator`\n * - Array - вхождение `IN`\n * - Set<string | number> - вхождение `IN`\n *\n * @see ModifierOperator\n */\nexport const genFilters = <Model extends Api.Ext.Schemas['Model']>(\n\tdataWithModifierOperator: DataWithModifierOperator<Model>,\n): Api.Field.Filter<Model>[] => {\n\tconst filters: Api.Field.Filter<Model>[] = [];\n\n\tObject.keys(dataWithModifierOperator).forEach(_name => {\n\t\tconst name = _name as string & keyof Model;\n\t\tconst value = dataWithModifierOperator[name];\n\t\tif (value === undefined) return;\n\n\t\tlet filter: Api.Field.Filter<Model> | undefined;\n\n\t\tif (name === 'tags_ids' || name === 'tags') {\n\t\t\tpushFilterTagsIds(name, filters, value as any);\n\t\t} else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n\t\t\tfilter = genFilterPrimitive(name, value);\n\t\t} else if (Array.isArray(value) || value instanceof Set) {\n\t\t\tfilter = genFilterIn(name, value as any);\n\t\t}\n\n\t\tif (filter) {\n\t\t\tfilters.push(filter);\n\t\t}\n\t});\n\n\treturn filters;\n};\n\n/**\n * Получить value и operator из valueWithModifierOperator\n */\nconst extractOperator = (valueWithModifierOperator: ValueWithModifierOperator): {\n\tvalue: any,\n\toperator: Api.Ext.Schemas['FieldOperator']\n} => {\n\tlet value: string | number = valueWithModifierOperator;\n\tlet operator: Api.Field.Filter<any>['operator'] = 'EQUALS';\n\n\tlet modifierOperator: ModifierOperator | undefined;\n\tif (valueWithModifierOperator[1] === ':' || valueWithModifierOperator[2] === ':') {\n\t\t[modifierOperator, value] = valueWithModifierOperator.split(':') as [ModifierOperator, string];\n\t}\n\n\tswitch (modifierOperator) {\n\t\tcase '>':\n\t\t\toperator = 'GREATER_THAN';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '>=':\n\t\t\toperator = 'GREATER_THAN_EQUALS';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '<':\n\t\t\toperator = 'LESS_THAN';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '<=':\n\t\t\toperator = 'LESS_THAN_EQUALS';\n\t\t\tvalue = Number(value);\n\n\t\t\tbreak;\n\t\tcase '!=':\n\t\t\toperator = 'NOT_EQUALS';\n\n\t\t\tif (value.match(/^\\d+$/)) value = Number(value);\n\n\t\t\tbreak;\n\t\tcase '%':\n\t\t\toperator = 'CONTAINS';\n\n\t\t\tbreak;\n\t\tcase '!%':\n\t\t\toperator = 'DOES_NOT_CONTAIN';\n\n\t\t\tbreak;\n\t\tcase '^':\n\t\t\toperator = 'STARTS_WITH';\n\n\t\t\tbreak;\n\t\tcase 'null':\n\t\t\toperator = 'IS_NULL';\n\n\t\t\tbreak;\n\t\tcase '!null':\n\t\t\toperator = 'IS_NOT_NULL';\n\n\t\t\tbreak;\n\t\tcase '~':\n\t\t\toperator = 'REGEXP';\n\n\t\t\tbreak;\n\t\tcase '!~':\n\t\t\toperator = 'NOT_REGEXP';\n\n\t\t\tbreak;\n\t}\n\n\treturn { value, operator };\n};\n\n/**\n * Сгенерировать и добавить API фильтр из списка тегов\n */\nexport const pushFilterTagsIds = <\n\tModel extends Api.Ext.Schemas['Model'] = any,\n\tFieldName extends Api.Field.Name<Model> = Api.Field.Name<Model>\n>(\n\tname: FieldName,\n\tfilters: Api.Field.Filter<Model, FieldName>[],\n\ttagsIds: Array<TagId | TagIdExclude>,\n) => {\n\tconst tagsIncluded: Array<Model[FieldName] & TagId> = [];\n\tconst tagsExcluded: Array<Model[FieldName] & TagId> = [];\n\n\ttagsIds.forEach((tagId) => {\n\t\tif (tagId[0] === '-') {\n\t\t\ttagsExcluded.push(tagId.substring(1) as Model[FieldName] & TagId);\n\t\t} else {\n\t\t\ttagsIncluded.push(tagId as Model[FieldName] & TagId);\n\t\t}\n\t});\n\n\tif (tagsIncluded.length) filters.push(genFieldFilter<Model, FieldName>(name, 'IN', tagsIncluded));\n\tif (tagsExcluded.length) filters.push(genFieldFilter<Model, FieldName>(name, 'NOT_IN', tagsExcluded));\n};\n\n/**\n * Сгенерировать API фильтр из простого значения\n */\nexport const genFilterPrimitive = <\n\tModel extends Api.Ext.Schemas['Model'] = any,\n\tFieldName extends Api.Field.Name<Model> = Api.Field.Name<Model>\n>(\n\tname: FieldName,\n\tvalueWithModifierOperator: number | string | boolean | ValueWithModifierOperator,\n) => {\n\tlet value = valueWithModifierOperator;\n\tlet operator: Api.Field.Filter<any>['operator'] = 'EQUALS';\n\n\tif (typeof valueWithModifierOperator === 'string') {\n\t\tlet {} = { value, operator } = extractOperator(valueWithModifierOperator as ValueWithModifierOperator);\n\t}\n\n\t// @deprecated\n\tif (typeof value === 'boolean') {\n\t\tvalue = value ? 1 : 0;\n\t}\n\n\treturn genFieldFilter<Model>(name, operator, [value as any]);\n};\n\n/**\n * Сгенерировать API фильтр IN\n */\nexport const genFilterIn = <\n\tModel extends Api.Ext.Schemas['Model'] = any,\n\tFieldName extends Api.Field.Name<Model> = Api.Field.Name<Model>\n>(\n\tname: FieldName,\n\tvaluesOrSet: Model[FieldName][] | Set<Model[FieldName]>,\n) => {\n\treturn genFieldFilter<Model, FieldName>(name, 'IN', Array.isArray(valuesOrSet) ? valuesOrSet : [...valuesOrSet]);\n};\n"],"names":["genFilters","dataWithModifierOperator","filters","_name","name","value","filter","pushFilterTagsIds","genFilterPrimitive","genFilterIn","extractOperator","valueWithModifierOperator","operator","modifierOperator","tagsIds","tagsIncluded","tagsExcluded","tagId","genFieldFilter","valuesOrSet"],"mappings":";AAwCO,MAAMA,IAAa,CACzBC,MAC+B;AAC/B,QAAMC,IAAqC,CAAA;AAE3C,gBAAO,KAAKD,CAAwB,EAAE,QAAQ,CAAAE,MAAS;AACtD,UAAMC,IAAOD,GACPE,IAAQJ,EAAyBG,CAAI;AAC3C,QAAIC,MAAU,OAAW;AAEzB,QAAIC;AAEJ,IAAIF,MAAS,cAAcA,MAAS,SACnCG,EAAkBH,GAAMF,GAASG,CAAY,IACnC,OAAOA,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU,YACrFC,IAASE,EAAmBJ,GAAMC,CAAK,KAC7B,MAAM,QAAQA,CAAK,KAAKA,aAAiB,SACnDC,IAASG,EAAYL,GAAMC,CAAY,IAGpCC,KACHJ,EAAQ,KAAKI,CAAM;AAAA,EAErB,CAAC,GAEMJ;AACR,GAKMQ,IAAkB,CAACC,MAGpB;AACJ,MAAIN,IAAyBM,GACzBC,IAA8C,UAE9CC;AAKJ,WAJIF,EAA0B,CAAC,MAAM,OAAOA,EAA0B,CAAC,MAAM,SAC5E,CAACE,GAAkBR,CAAK,IAAIM,EAA0B,MAAM,GAAG,IAGxDE,GAAA;AAAA,IACP,KAAK;AACJ,MAAAD,IAAW,gBACXP,IAAQ,OAAOA,CAAK;AAEpB;AAAA,IACD,KAAK;AACJ,MAAAO,IAAW,uBACXP,IAAQ,OAAOA,CAAK;AAEpB;AAAA,IACD,KAAK;AACJ,MAAAO,IAAW,aACXP,IAAQ,OAAOA,CAAK;AAEpB;AAAA,IACD,KAAK;AACJ,MAAAO,IAAW,oBACXP,IAAQ,OAAOA,CAAK;AAEpB;AAAA,IACD,KAAK;AACJ,MAAAO,IAAW,cAEPP,EAAM,MAAM,OAAO,MAAGA,IAAQ,OAAOA,CAAK;AAE9C;AAAA,IACD,KAAK;AACJ,MAAAO,IAAW;AAEX;AAAA,IACD,KAAK;AACJ,MAAAA,IAAW;AAEX;AAAA,IACD,KAAK;AACJ,MAAAA,IAAW;AAEX;AAAA,IACD,KAAK;AACJ,MAAAA,IAAW;AAEX;AAAA,IACD,KAAK;AACJ,MAAAA,IAAW;AAEX;AAAA,IACD,KAAK;AACJ,MAAAA,IAAW;AAEX;AAAA,IACD,KAAK;AACJ,MAAAA,IAAW;AAEX;AAAA,EAAA;AAGF,SAAO,EAAE,OAAAP,GAAO,UAAAO,EAAA;AACjB,GAKaL,IAAoB,CAIhCH,GACAF,GACAY,MACI;AACJ,QAAMC,IAAgD,CAAA,GAChDC,IAAgD,CAAA;AAEtD,EAAAF,EAAQ,QAAQ,CAACG,MAAU;AAC1B,IAAIA,EAAM,CAAC,MAAM,MAChBD,EAAa,KAAKC,EAAM,UAAU,CAAC,CAA6B,IAEhEF,EAAa,KAAKE,CAAiC;AAAA,EAErD,CAAC,GAEGF,EAAa,UAAQb,EAAQ,KAAKgB,EAAiCd,GAAM,MAAMW,CAAY,CAAC,GAC5FC,EAAa,UAAQd,EAAQ,KAAKgB,EAAiCd,GAAM,UAAUY,CAAY,CAAC;AACrG,GAKaR,IAAqB,CAIjCJ,GACAO,MACI;AACJ,MAAIN,IAAQM,GACRC,IAA8C;AAElD,SAAI,OAAOD,KAA8B,aAC/B,EAAE,OAAAN,GAAO,UAAAO,MAAaF,EAAgBC,CAAsD,IAIlG,OAAON,KAAU,cACpBA,IAAQA,IAAQ,IAAI,IAGda,EAAsBd,GAAMQ,GAAU,CAACP,CAAY,CAAC;AAC5D,GAKaI,IAAc,CAI1BL,GACAe,MAEOD,EAAiCd,GAAM,MAAM,MAAM,QAAQe,CAAW,IAAIA,IAAc,CAAC,GAAGA,CAAW,CAAC;"}
|
package/api/index.amd.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["require","exports","../.chunks/field-Cvv0SRcJ.amd"],(function(y,u,P){"use strict";if(typeof B>"u")var B=window.Vue;const S=(t={})=>{var o;return t={...t},t.loadingEl??=(o=globalThis.document)==null?void 0:o.body,t.loadingShowSpinner??=!0,t.method??="POST",t.accept??="application/json",t},q=(t,o,r)=>({result:t,errors:o,response:r}),J=t=>t.startsWith("/system_2/common/"),H=(t=!1,o=window.location.href)=>{const{protocol:r,hostname:e,port:n}=new URL(o),s=e.split("."),a=!t||s.length<=2||/^[\d.]+$/.test(e)||e==="localhost"?e:s.slice(-2).join(".");return`${r}//${a}${n?`:${n}`:""}`},N=(t,o,r)=>{const e={inLoading:!1,path:o,url:t.options.baseUrl+o,options:S(t.options.requestOptions),params:{},getInLoading:()=>e.inLoading,setParams:n=>(e.params={...n},e),changeParams:n=>(Object.assign(e.params,n),e),setOptions:n=>(Object.assign(e.options,n),e),call:async n=>e.exec(n),callFetch:async(n,s)=>e.exec(s,n),callInNewWindow:async n=>{var l,f;const s=e.genData(n),a=t.genMiddlewareCtx(e,s);(f=(l=t.options).onPrepareData)==null||f.call(l,s,a);const{postInWindow:p}=await new Promise((g,m)=>y(["../.chunks/lazy-CiM2Ny-s.amd"],g,m));p(e.url,s,"_blank")},callInSelfWindow:async n=>{var l,f;const s=e.genData(n),a=t.genMiddlewareCtx(e,s);(f=(l=t.options).onPrepareData)==null||f.call(l,s,a);const{postInWindow:p}=await new Promise((g,m)=>y(["../.chunks/lazy-CiM2Ny-s.amd"],g,m));p(e.url,s,"_self")},genData:(n,s)=>{const a={...e.params};if(delete a.fetch_style,n){let p=[...n];r&&(p=p.filter(l=>r.includes(l))),a.fields=p}else r&&(a.fields=r);return s&&(a.fetch_style=s),a},async exec(n,s){var C,z,A,D,T,U,F,O,v,L,W,j,k,M,_;const a=t.options.Request,p=t.options.fetch,l=e.genData(n,s),f=t.genMiddlewareCtx(e,l);(z=(C=t.options).onPrepareData)==null||z.call(C,l,f);let g=e.url,m;e.options.method!=="POST"?g+="?"+await t.options.querySerializer(l):m=t.options.bodySerializer(l);let I;if(this.options.checkFingerprint){const c=this.path+this.options.checkFingerprint;(A=t.abortControllers[c])==null||A.abort();const x=new AbortController;t.abortControllers[c]=x,I=x.signal}const X={...t.options,method:e.options.method,body:m,signal:I};let w=new a(g,X);w.headers.set("x-request-id",f.id),w.headers.set("content-type","application/json"),w.headers.set("accept",e.options.accept);const h={...f,request:w};e.inLoading=!0,(T=(D=e.options).onLoading)==null||T.call(D,e.inLoading,h);let d;const b=await t.middlewareOnRequest(w,h);if(b instanceof Response?d=b:b instanceof a&&(w=b),!d)try{d=await p(w)}catch(c){d=await t.middlewareOnError(c,h)}finally{e.inLoading=!1,(F=(U=e.options).onLoading)==null||F.call(U,e.inLoading,h)}d=await t.middlewareOnResponse(d,h);let i,R,E;try{const c=(O=d.headers.get("content-type"))==null?void 0:O.includes("application/json");R=await d.text(),this.options.accept==="application/json"||c?i=JSON.parse(R):t.useExt?i=q(R,void 0,d):i=R}catch(c){if((c instanceof SyntaxError||c instanceof TypeError)&&(E=c,E.responseText=R),t.useExt&&E){let x=d.status,$=d.statusText;x===200&&(x=1e4,$="Error API response"),i=q(null,[{code:x,string:$}],d),t.options.useApiConsole&&console.error(c)}else throw c}return t.useExt&&(i.response=d,i&&((L=(v=e.options).onApiLoaded)==null||L.call(v,i,h)),i!=null&&i.errors&&(t.options.useApiConsole&&console.warn(new Error("API error"),{res:i}),(k=(j=e.options).onApiError)==null||k.call(j,i,{...h,formatError:E},(W=t.options.requestOptions)==null?void 0:W.onApiError)),i!=null&&i.messages&&((_=(M=e.options).onApiMessage)==null||_.call(M,i,h))),i}};return e};class V{options;useExt;middlewares=[];abortControllers={};constructor(o={},r){o.requestOptions=S(o.requestOptions),o.useApiConsole??=!0,o.fetch??=globalThis.fetch,o.Request??=globalThis.Request,o.querySerializer??=async e=>{const{querySerializer:n}=await new Promise((s,a)=>y(["../.chunks/lazy-CiM2Ny-s.amd"],s,a));return n(e)},o.bodySerializer??=e=>typeof e=="string"?e:JSON.stringify(e),this.options=o,this.useExt=r}generateUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const r=Math.random()*16|0;return(o==="x"?r:r&3|8).toString(16)})}use(o){this.middlewares.push(o)}gen(o,r){return N(this,o,r)}genAny(o,r){return this.gen(o,r)}genMiddlewareCtx(o,r){const e=this.generateUUID(),n=Object.freeze({baseUrl:this.options.baseUrl,querySerializer:this.options.querySerializer,bodySerializer:this.options.bodySerializer,Request:this.options.Request,fetch:this.options.fetch});return{useExt:this.useExt,requestOptions:o.options,data:r,middlewareData:{},options:n,schemaPath:o.path,id:e}}async middlewareOnRequest(o,r){var e;for(const n of this.middlewares){const s=await((e=n.onRequest)==null?void 0:e.call(n,{...r,request:o}));if(s)if(s instanceof Request)o=s;else{if(s instanceof Response)return s;throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}return o}async middlewareOnError(o,r){var n;let e=o;for(const s of this.middlewares){const a=await((n=s.onError)==null?void 0:n.call(s,{...r,error:e}));if(a){if(a instanceof Response)return a;if(a instanceof Error){e=a;continue}throw new Error("onError: must return new Response() or instance of Error")}}throw e}async middlewareOnResponse(o,r){var e;for(const n of this.middlewares){const s=await((e=n.onResponse)==null?void 0:e.call(n,{...r,response:o}));if(s){if(!(s instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");o=s}}return o}}const G=async(...t)=>{const{postInWindow:o}=await new Promise((r,e)=>y(["../.chunks/lazy-CiM2Ny-s.amd"],r,e));return o(...t)},K=async(...t)=>{const{dataToForm:o}=await new Promise((r,e)=>y(["../.chunks/lazy-CiM2Ny-s.amd"],r,e));return o(...t)},Q=(t={},o)=>new V(t,o);u.genFieldFilter=P.genFieldFilter,u.genFieldOrder=P.genFieldOrder,u.createClient=Q,u.dataToForm=K,u.genExtRes=q,u.getBaseDomainUrl=H,u.isPublicAPI=J,u.postInWindow=G,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=index.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.amd.js","sources":["../../src/api/api/client/request-options.ts","../../src/api/api/utils/common.ts","../../src/api/api/client/request.ts","../../src/api/api/client/client.ts","../../src/api/api/index.ts"],"sourcesContent":["export const createRequestOptions = (requestOptions: Partial<Api.ClientRequestOptions> = {}): Api.ClientRequestOptions => {\n\trequestOptions = { ...requestOptions };\n\trequestOptions.loadingEl ??= globalThis.document?.body;\n\trequestOptions.loadingShowSpinner ??= true;\n\trequestOptions.method ??= 'POST';\n\trequestOptions.accept ??= 'application/json';\n\n\treturn requestOptions as Api.ClientRequestOptions;\n};\n","/**\n * Сгенерировать объект ответа в формате расширения OpenAPI\n *\n * @see Api.Ext\n */\nexport const genExtRes = (\n\tresult: any,\n\terrors?: Api.Ext.Schemas['ResponseError']['errors'],\n\tresponse?: Response,\n): Api.Response<any> => {\n\treturn {\n\t\tresult,\n\t\terrors,\n\t\tresponse,\n\t};\n};\n\n/**\n * Это публичное API, к которому открыт доступ по прямой ссылке через GET\n *\n * Используется для кеширования и генерации файлов через API\n */\nexport const isPublicAPI = (path: Api.PathAbstract) => {\n\treturn path.startsWith('/system_2/common/');\n};\n\n/**\n * Сгенерировать baseUrl на основе текущего домена\n */\nexport const getBaseDomainUrl = (useMainDomain = false, input: string = window.location.href) => {\n\tconst { protocol, hostname, port } = new URL(input);\n\n\t/**\n\t * localhost / IP-адреса / одноуровневые домены оставляем как есть\n\t */\n\tconst parts = hostname.split('.');\n\tconst baseHostname = !useMainDomain || parts.length <= 2 || /^[\\d.]+$/.test(hostname) || hostname === 'localhost'\n\t\t? hostname\n\t\t: parts.slice(-2).join('.');\n\n\treturn `${protocol}//${baseHostname}${port ? `:${port}` : ''}`;\n};\n","import type { Client } from './client';\nimport { createRequestOptions } from './request-options';\nimport { genExtRes } from '../utils/common';\n\nexport const createRequest = <\n\tRequestContext extends Api.ClientRequestContext<any, any, any>,\n\tFieldsNarrow extends Api.ParamsFields<RequestContext>,\n>(\n\tclient: Client<RequestContext['Paths'], RequestContext['UseExt']>,\n\tpath: RequestContext['Path'],\n\tfieldsNarrow?: FieldsNarrow,\n): Api.ClientRequest<RequestContext, FieldsNarrow> => {\n\tconst clientRequest = {\n\t\tinLoading: false,\n\t\tpath: path as Api.PathAbstract,\n\t\turl: client.options.baseUrl + path,\n\t\toptions: createRequestOptions(client.options.requestOptions),\n\t\tparams: {} as any, // незаполненное свойство\n\t\tgetInLoading: () => clientRequest.inLoading,\n\n\t\tsetParams: (params) => {\n\t\t\tclientRequest.params = { ...params } as any;\n\n\t\t\treturn clientRequest;\n\t\t},\n\n\t\tchangeParams: (params) => {\n\t\t\tObject.assign(clientRequest.params, params);\n\n\t\t\treturn clientRequest;\n\t\t},\n\n\t\tsetOptions: (options) => {\n\t\t\tObject.assign(clientRequest.options, options);\n\n\t\t\treturn clientRequest;\n\t\t},\n\n\t\tcall: async (fields?) => {\n\t\t\treturn clientRequest.exec(fields);\n\t\t},\n\n\t\tcallFetch: async (fetchStyle, fields?) => {\n\t\t\treturn clientRequest.exec(fields, fetchStyle);\n\t\t},\n\n\t\tcallInNewWindow: async (fields?) => {\n\t\t\tconst data = clientRequest.genData(fields);\n\n\t\t\tconst middlewareCtx = client.genMiddlewareCtx(clientRequest, data);\n\n\t\t\tclient.options.onPrepareData?.(data, middlewareCtx);\n\n\t\t\tconst { postInWindow } = await import('../utils/lazy');\n\t\t\tvoid postInWindow(clientRequest.url, data, '_blank');\n\t\t},\n\n\t\tcallInSelfWindow: async (fields?) => {\n\t\t\tconst data = clientRequest.genData(fields);\n\n\t\t\tconst middlewareCtx = client.genMiddlewareCtx(clientRequest, data);\n\n\t\t\tclient.options.onPrepareData?.(data, middlewareCtx);\n\n\t\t\tconst { postInWindow } = await import('../utils/lazy');\n\t\t\tvoid postInWindow(clientRequest.url, data, '_self');\n\t\t},\n\n\t\tgenData: (fields?, fetchStyle?) => {\n\t\t\tconst post: any = { ...clientRequest.params };\n\n\t\t\t// в старом коде fields вставлялись в params, оставлено для совместимости\n\t\t\t// delete post.fields;\n\t\t\tdelete post.fetch_style;\n\n\t\t\t// поля, указанные при запуске запроса\n\t\t\tif (fields) {\n\t\t\t\tlet fieldsPrepared = [...fields as any[]];\n\n\t\t\t\t// поля, указанные при создании запроса\n\t\t\t\tif (fieldsNarrow) {\n\t\t\t\t\tfieldsPrepared = fieldsPrepared.filter(field => fieldsNarrow.includes(field));\n\t\t\t\t}\n\n\t\t\t\tpost.fields = fieldsPrepared;\n\t\t\t} else {\n\t\t\t\tif (fieldsNarrow) {\n\t\t\t\t\tpost.fields = fieldsNarrow;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fetchStyle) {\n\t\t\t\tpost.fetch_style = fetchStyle;\n\t\t\t}\n\n\t\t\treturn post;\n\t\t},\n\n\t\t/**\n\t\t * Общая функция выполнения запросов\n\t\t */\n\t\tasync exec(fields?: FieldsNarrow, fetchStyle?: RequestContext['ParamsFetchStyle']): Promise<any> {\n\t\t\tconst Request = client.options.Request;\n\t\t\tconst fetch = client.options.fetch;\n\n\t\t\tconst data = clientRequest.genData(fields, fetchStyle);\n\n\t\t\tconst middlewareCtxWithoutRequest = client.genMiddlewareCtx(clientRequest, data);\n\n\t\t\tclient.options.onPrepareData?.(data, middlewareCtxWithoutRequest);\n\n\t\t\tlet url = clientRequest.url;\n\n\t\t\tlet requestInitBody: string | undefined = undefined;\n\t\t\tif (clientRequest.options.method !== 'POST') {\n\t\t\t\turl += '?' + await client.options.querySerializer(data);\n\t\t\t} else {\n\t\t\t\trequestInitBody = client.options.bodySerializer(data);\n\t\t\t}\n\n\t\t\t// checkFingerprint\n\t\t\tlet requestInitSignal: AbortController['signal'] | undefined;\n\n\t\t\tif (this.options.checkFingerprint) {\n\t\t\t\tconst fingerprint = this.path + this.options.checkFingerprint;\n\n\t\t\t\tclient.abortControllers[fingerprint]?.abort();\n\n\t\t\t\tconst controller = new AbortController();\n\n\t\t\t\tclient.abortControllers[fingerprint] = controller;\n\t\t\t\trequestInitSignal = controller.signal;\n\t\t\t}\n\n\t\t\tconst requestInit = {\n\t\t\t\t...client.options,\n\t\t\t\tmethod: clientRequest.options.method,\n\t\t\t\tbody: requestInitBody,\n\t\t\t\tsignal: requestInitSignal,\n\t\t\t};\n\n\t\t\tlet request = new Request(url, requestInit);\n\n\t\t\trequest.headers.set('x-request-id', middlewareCtxWithoutRequest.id);\n\t\t\trequest.headers.set('content-type', 'application/json');\n\t\t\trequest.headers.set('accept', clientRequest.options.accept);\n\n\t\t\tconst middlewareCtx: Api.MiddlewareCallbackParams = {\n\t\t\t\t...middlewareCtxWithoutRequest,\n\t\t\t\trequest,\n\t\t\t};\n\n\t\t\tclientRequest.inLoading = true;\n\t\t\tclientRequest.options.onLoading?.(clientRequest.inLoading, middlewareCtx);\n\n\t\t\tlet response: Response | undefined = undefined;\n\n\t\t\tconst requestOrResponse = await client.middlewareOnRequest(request, middlewareCtx);\n\n\t\t\tif (requestOrResponse instanceof Response) {\n\t\t\t\tresponse = requestOrResponse;\n\t\t\t} else if (requestOrResponse instanceof Request) {\n\t\t\t\trequest = requestOrResponse;\n\t\t\t}\n\n\t\t\tif (!response) {\n\t\t\t\ttry {\n\t\t\t\t\tresponse = await fetch(request);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tresponse = await client.middlewareOnError(e, middlewareCtx);\n\t\t\t\t} finally {\n\t\t\t\t\tclientRequest.inLoading = false;\n\t\t\t\t\tclientRequest.options.onLoading?.(clientRequest.inLoading, middlewareCtx);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresponse = await client.middlewareOnResponse(response, middlewareCtx);\n\n\t\t\tlet res: any;\n\t\t\tlet responseText: string | undefined;\n\t\t\tlet formatError: undefined | Api.FormatError = undefined;\n\n\t\t\ttry {\n\t\t\t\t// json - стандартные формат, он может быть возвращен в запросах с другим responseType, если в них произошла ошибка\n\t\t\t\tconst isJSON = response.headers.get('content-type')?.includes('application/json');\n\n\t\t\t\tresponseText = await response.text();\n\n\t\t\t\tif (this.options.accept === 'application/json' || isJSON) {\n\t\t\t\t\tres = JSON.parse(responseText);\n\t\t\t\t} else {\n\t\t\t\t\tif (client.useExt) {\n\t\t\t\t\t\tres = genExtRes(responseText, undefined, response);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tres = responseText;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SyntaxError || e instanceof TypeError) {\n\t\t\t\t\tformatError = e;\n\t\t\t\t\tformatError.responseText = responseText;\n\t\t\t\t}\n\n\t\t\t\t// если в результате не пришел json, сгенерировать объект результата и добавить информацию об ответе API\n\t\t\t\tif (client.useExt && formatError) {\n\t\t\t\t\tlet errorCode = response.status;\n\t\t\t\t\tlet errorMessage = response.statusText;\n\n\t\t\t\t\tif (errorCode === 200) {\n\t\t\t\t\t\terrorCode = 10000;\n\t\t\t\t\t\terrorMessage = 'Error API response';\n\t\t\t\t\t}\n\n\t\t\t\t\tres = genExtRes(null, [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcode: errorCode,\n\t\t\t\t\t\t\tstring: errorMessage,\n\t\t\t\t\t\t},\n\t\t\t\t\t], response);\n\n\t\t\t\t\tif (client.options.useApiConsole) console.error(e);\n\t\t\t\t} else {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (client.useExt) {\n\t\t\t\tres.response = response;\n\n\t\t\t\tif (res) {\n\t\t\t\t\tclientRequest.options.onApiLoaded?.(res, middlewareCtx);\n\t\t\t\t}\n\n\t\t\t\tif (res?.errors) {\n\t\t\t\t\tif (client.options.useApiConsole) console.warn(new Error('API error'), { res });\n\n\t\t\t\t\tclientRequest.options.onApiError?.(res, { ...middlewareCtx, formatError }, client.options.requestOptions?.onApiError);\n\t\t\t\t}\n\n\t\t\t\tif (res?.messages) {\n\t\t\t\t\tclientRequest.options.onApiMessage?.(res, middlewareCtx);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn res;\n\t\t},\n\t};\n\n\treturn clientRequest;\n};\n","import { createRequestOptions } from './request-options';\nimport { createRequest } from './request';\n\nexport class Client<paths extends Api.PathsAbstract, UseExt extends Api.Ext.UseExt> {\n\n\treadonly options: Readonly<Api.ClientOptions>;\n\treadonly useExt: UseExt;\n\treadonly middlewares: Api.Middleware[] = [];\n\tabortControllers: Record<string, AbortController> = {};\n\n\tconstructor(clientOptions: Partial<Api.ClientOptions> = {}, useExt: UseExt) {\n\t\tclientOptions.requestOptions = createRequestOptions(clientOptions.requestOptions);\n\t\tclientOptions.useApiConsole ??= true;\n\n\t\tclientOptions.fetch ??= globalThis.fetch;\n\t\tclientOptions.Request ??= globalThis.Request;\n\t\tclientOptions.querySerializer ??= async (params) => {\n\t\t\tconst { querySerializer } = await import('../utils/lazy');\n\n\t\t\treturn querySerializer(params);\n\t\t}\n\t\tclientOptions.bodySerializer ??= (body) => typeof body === 'string' ? body : JSON.stringify(body);\n\n\t\tthis.options = clientOptions as Api.ClientOptions;\n\n\t\tthis.useExt = useExt;\n\t}\n\n\tgenerateUUID() {\n\t\tif (crypto?.randomUUID) {\n\t\t\treturn crypto.randomUUID();\n\t\t}\n\n\t\treturn 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n\t\t\tconst r = Math.random() * 16 | 0;\n\t\t\tconst v = c === 'x' ? r : (r & 0x3 | 0x8);\n\t\t\treturn v.toString(16);\n\t\t});\n\t}\n\n\t/**\n\t * Зарегистрировать middleware\n\t */\n\tuse(middleware: Api.Middleware) {\n\t\tthis.middlewares.push(middleware);\n\t}\n\n\t/**\n\t * Создать объект запроса\n\t *\n\t * После создания объекта он заполняется необходимыми данными и выполняет запросы к API с помощью APIRequest2.call();\n\t *\n\t * Опционально generic указывать нельзя, поэтому необходимо дублировать определение fetchStyle, [см.](https://github.com/Microsoft/TypeScript/issues/26242)\n\t *\n\t * @param path Путь метода API\n\t * @param fieldsNarrow Список получаемых полей, для методов API с моделью. Если объект запроса переиспользуется, и список полей меняется, указывайте его непосредственно при вызове `api.call()`\n\t */\n\tgen<\n\t\tPath extends Api.Path<paths>,\n\t\tFieldsNarrow extends Api.ParamsFields<Api.ClientRequestContext<paths, Path, UseExt>>\n\t>(\n\t\tpath: Path,\n\t\tfieldsNarrow?: FieldsNarrow,\n\t): Api.ClientRequest<Api.ClientRequestContext<paths, Path, UseExt>, FieldsNarrow> {\n\t\ttype RequestContext = Api.ClientRequestContext<paths, Path, UseExt>;\n\n\t\treturn createRequest<RequestContext, FieldsNarrow>(this, path, fieldsNarrow);\n\t}\n\n\t/**\n\t * Создать объект запроса, не описанного в OpenAPI\n\t */\n\tgenAny<\n\t\tParams extends Record<string, any>,\n\t\tResult = any,\n\t\tFieldsNarrow extends Api.Ext.Schemas['Fields'] | undefined = undefined\n\t>(path: Api.PathAbstract, fieldsNarrow?: FieldsNarrow): Api.ClientRequestCustom<UseExt, Params, Result> {\n\t\treturn this.gen(path as any, fieldsNarrow as any) as unknown as Api.ClientRequestCustom<UseExt, Params, Result>;\n\t}\n\n\t/**\n\t * Создать контекст выполнения запроса\n\t */\n\tgenMiddlewareCtx(\n\t\tclientRequest: Api.ClientRequest<any, any, any>,\n\t\tdata: Record<string, any>,\n\t): Omit<Api.MiddlewareCallbackParams, 'request'> {\n\t\tconst id = this.generateUUID();\n\n\t\tconst options: Api.BaseOptions = Object.freeze({\n\t\t\tbaseUrl: this.options.baseUrl,\n\t\t\tquerySerializer: this.options.querySerializer,\n\t\t\tbodySerializer: this.options.bodySerializer,\n\t\t\tRequest: this.options.Request,\n\t\t\tfetch: this.options.fetch,\n\t\t});\n\n\t\treturn {\n\t\t\tuseExt: this.useExt,\n\t\t\trequestOptions: clientRequest.options,\n\t\t\tdata,\n\t\t\tmiddlewareData: {},\n\t\t\toptions,\n\t\t\tschemaPath: clientRequest.path,\n\t\t\tid,\n\t\t};\n\t};\n\n\t/**\n\t * Обработчик middleware.onRequest\n\t *\n\t * @param request Запрос для обработки\n\t * @param middlewareCtx Контекст выполнения запроса\n\t * @return Новый экземпляр `Request` или `Response` при модификации запроса, или undefined\n\t */\n\tasync middlewareOnRequest(\n\t\trequest: Request,\n\t\tmiddlewareCtx: Api.MiddlewareCallbackParams,\n\t): Promise<Request | Response | undefined> {\n\t\tfor (const middleware of this.middlewares) {\n\t\t\tconst result = await middleware.onRequest?.({\n\t\t\t\t...middlewareCtx,\n\t\t\t\trequest,\n\t\t\t});\n\n\t\t\tif (result) {\n\t\t\t\tif (result instanceof Request) {\n\t\t\t\t\trequest = result;\n\t\t\t\t} else if (result instanceof Response) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error('onRequest: must return new Request() or Response() when modifying the request');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn request;\n\t}\n\n\t/**\n\t * Обработчик middleware.onResponse\n\t *\n\t * @param `error` Ошибка, переданная для обработки\n\t * @param middlewareCtx\n\t * @return Новый экземпляр `Response` при успешной обработке или выбрасывает ошибку\n\t */\n\tasync middlewareOnError(\n\t\terror: Error | unknown,\n\t\tmiddlewareCtx: Api.MiddlewareCallbackParams,\n\t): Promise<Response | never> {\n\t\tlet errorAfterMiddleware = error;\n\n\t\tfor (const middleware of this.middlewares) {\n\t\t\tconst result = await middleware.onError?.({\n\t\t\t\t...middlewareCtx,\n\t\t\t\terror: errorAfterMiddleware,\n\t\t\t});\n\n\t\t\tif (result) {\n\t\t\t\tif (result instanceof Response) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (result instanceof Error) {\n\t\t\t\t\terrorAfterMiddleware = result;\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthrow new Error('onError: must return new Response() or instance of Error');\n\t\t\t}\n\t\t}\n\n\t\tthrow errorAfterMiddleware;\n\t}\n\n\t/**\n\t * Обработчик middleware.onResponse\n\t *\n\t * @param response Ответ для обработки\n\t * @param middlewareCtx Контекст выполнения запроса\n\t * @return Новый экземпляр `Response` при модификации ответа, или undefined\n\t */\n\tasync middlewareOnResponse(\n\t\tresponse: Response,\n\t\tmiddlewareCtx: Api.MiddlewareCallbackParams,\n\t): Promise<Response> {\n\t\tfor (const middleware of this.middlewares) {\n\t\t\tconst result = await middleware.onResponse?.({\n\t\t\t\t...middlewareCtx,\n\t\t\t\tresponse,\n\t\t\t});\n\n\t\t\tif (result) {\n\t\t\t\tif (!(result instanceof Response)) {\n\t\t\t\t\tthrow new Error('onResponse: must return new Response() when modifying the response');\n\t\t\t\t}\n\n\t\t\t\tresponse = result;\n\t\t\t}\n\t\t}\n\n\t\treturn response;\n\t}\n\n}\n","import { Client } from './client/client';\n\nexport * from './utils/field';\nexport * from './utils/common';\n\nexport const postInWindow: typeof import('./utils/lazy').postInWindow = async (...args) => {\n\tconst { postInWindow } = await import('./utils/lazy');\n\n\treturn postInWindow(...args);\n};\n\nexport const dataToForm: typeof import('./utils/lazy').dataToForm = async (...args) => {\n\tconst { dataToForm } = await import('./utils/lazy');\n\n\treturn dataToForm(...args);\n};\n\n/**\n * Создать API клиент\n *\n * @see Api.Ext.UseExt\n */\nexport const createClient = <\n\tpaths extends Api.PathsAbstract,\n\tUseExt extends Api.Ext.UseExt\n>(\n\tclientOptions: Partial<Api.ClientOptions> = {},\n\tuseExt: UseExt,\n) => {\n\treturn new Client<paths, UseExt>(clientOptions, useExt);\n};\n"],"names":["createRequestOptions","requestOptions","genExtRes","result","errors","response","isPublicAPI","path","getBaseDomainUrl","useMainDomain","input","protocol","hostname","port","baseHostname","parts","clientRequest","params","options","fields","fetchStyle","fieldsPrepared","field","fieldsNarrow","post","Request","client","fetch","url","data","requestInitSignal","controller","fingerprint","request","middlewareCtxWithoutRequest","requestOrResponse","e","res","responseText","isJSON","_h","formatError","errorCode","errorMessage","Client","clientOptions","useExt","querySerializer","body","c","middleware","id","middlewareCtx","_a","error","errorAfterMiddleware","postInWindow","args","postInWindow2","dataToForm","dataToForm2","createClient"],"mappings":"4HAAO,MAAAA,EAAA,CAAAC,EAAA,CAAA,IAAA,OACN,OAAAA,EAAA,CAAA,GAAAA,CAAA,4DAEAA,EAAA,qBAAA,GACAA,EAAA,SAAA,OACAA,EAAA,SAAA,mBAEAA,GCFMC,EAAA,CAAAC,EAAAC,EAAAC,KAKN,CAAO,OAAAF,EACN,OAAAC,eAWKE,EAAAC,GACNA,EAAA,WAAA,mBAAA,EAMMC,EAAA,CAAAC,EAAA,GAAAC,EAAA,OAAA,SAAA,OAAA,CACN,KAAA,CAAA,SAAAC,EAAA,SAAAC,EAAA,KAAAC,CAAA,EAAA,IAAA,IAAAH,CAAA,iBAMAI,EAAA,CAAAL,GAAAM,EAAA,QAAA,GAAA,WAAA,KAAAH,CAAA,GAAAA,IAAA,YAAAA,EAAAG,EAAA,MAAA,EAAA,EAAA,KAAA,GAAA,mCAKD,oCC5Ba,KAAAR,wEAIF,aAAA,IAAAS,EAAA,UACyB,UAAAC,IAGjCD,EAAA,OAAA,CAAA,GAAAC,CAAA,EAEAD,GACD,aAAAC,8BAKCD,GACD,WAAAE,+BAKCF,GACD,KAAA,MAAAG,GAGCH,EAAA,KAAAG,CAAA,EACD,UAAA,MAAAC,EAAAD,gBAIA,gBAAA,MAAAA,GAAA,wNAUoD,EACpD,iBAAA,MAAAA,GAAA,uNAUmD,EACnD,QAAA,CAAAA,EAAAC,IAAA,kDAWE,IAAAC,EAAA,CAAA,GAAAF,CAAA,MAICE,EAAAA,EAAA,OAAAC,GAAAC,EAAA,SAAAD,CAAA,CAAA,GAGDE,EAAA,OAAAH,CAAc,UAGbG,EAAA,OAAAD,cAKDC,EAAA,YAAAJ,GAGDI,CAAO,EACR,MAAA,KAAAL,EAAAC,EAAA,mCAMC,MAAAK,EAAAC,EAAA,QAAA,QACAC,EAAAD,EAAA,QAAA,sGAQA,IAAAE,EAAAZ,EAAA,gCAICY,GAAA,IAAA,MAAAF,EAAA,QAAA,gBAAAG,CAAA,gCAMD,IAAAC,EAEA,GAAA,KAAA,QAAA,iBAAA,4FAKC,MAAAC,EAAA,IAAA,gBAEAL,EAAA,iBAAAM,CAAA,EAAAD,EACAD,EAAAC,EAAA,6BAIU,OAAAf,EAAA,QAAA,cAEJ,OAAAc,wGAQPG,EAAA,QAAA,IAAA,SAAAjB,EAAA,QAAA,MAAA,WAEoD,GAAAkB,aAKpDlB,EAAA,UAAA,gHAOAmB,aAAA,aACYA,aAAAV,YAMX,GAAA,CACCpB,EAAA,MAAAsB,EAAAM,CAAA,CAA8B,OAAAG,EAAA,iCAE4B,QAAA,CAE1DpB,EAAA,UAAA,kGAOF,IAAAqB,EACAC,IAGA,GAAA,CAEC,MAAAC,GAAAC,EAAAnC,EAAA,QAAA,IAAA,cAAA,IAAA,YAAAmC,EAAA,SAAA,oBAEAF,EAAA,MAAAjC,EAAA,KAAA,8CAGCgC,EAAA,KAAA,MAAAC,CAAA,EAEAZ,EAAA,0BAKD,OAAAU,EAAA,CAQA,4DAJCK,EAAA,aAAAH,GAIDZ,EAAA,QAAAe,EAAA,CACC,IAAAC,EAAArC,EAAA,OACAsC,EAAAtC,EAAA,WAEAqC,IAAA,oCAKAL,EAAAnC,EAAA,KAAA,SAEQ,OAAAyC,CACE,MAIVjB,EAAA,QAAA,eAAA,QAAA,MAAAU,CAAA,CAAiD,KAEjD,OAAAA,EAIF,OAAAV,EAAA,SACCW,EAAA,SAAAhC,0DAMAgC,GAAA,MAAAA,EAAA,4MAMAA,GAAA,MAAAA,EAAA,iEAKDA,IAIF,OAAArB,GCrPM,MAAA4B,CAAA,CAA6E,QAE1E,0CAG4C,YAAAC,EAAA,CAAA,EAAAC,EAAA,sCAIpDD,EAAA,gBAAA,GAEAA,EAAA,QAAA,WAAA,MACAA,EAAA,UAAA,WAAA,QACAA,EAAA,kBAAA,MAAA5B,GAAA,4FAGC,OAAA8B,EAAA9B,CAAA,CAA6B,EAE9B4B,EAAA,iBAAAG,GAAA,OAAAA,GAAA,SAAAA,EAAA,KAAA,UAAAA,CAAA,EAEA,KAAA,QAAAH,EAEA,KAAA,OAAAC,EACD,cAAA,CAGC,OAAA,qBAAA,WACC,OAAA,WAAA,wFAMA,OADAG,IAAA,IAAA,EAAA,EAAA,EAAA,GACA,SAAA,EAAA,CAAoB,CAAA,SAQrB,KAAA,YAAA,KAAAC,CAAA,EACD,IAAA3C,EAAAgB,EAAA,oBAsBA,OAAAhB,EAAAgB,EAAA,sBAWA,iBAAAP,EAAAa,EAAA,CASC,MAAAsB,EAAA,KAAA,aAAA,EAEAjC,EAAA,OAAA,OAAA,CAA+C,QAAA,KAAA,QAAA,QACxB,gBAAA,KAAA,QAAA,gBACQ,eAAA,KAAA,QAAA,eACD,QAAA,KAAA,QAAA,QACP,MAAA,KAAA,QAAA,KACF,CAAA,EAGrB,MAAA,CAAO,OAAA,KAAA,OACO,eAAAF,EAAA,QACiB,KAAAa,oBAEb,QAAAX,EACjB,WAAAF,EAAA,WAIF,MAAA,oBAAAiB,EAAAmB,EAAA,OAaC,UAAAF,KAAA,KAAA,YAAA,CACC,MAAA/C,EAAA,OAAAkD,EAAAH,EAAA,YAAA,YAAAG,EAAA,KAAAH,EAAA,CAA4C,GAAAE,WAE3C,SAIA,GAAAjD,aAAA,gBACW,IAAAA,aAAA,SAEV,OAAAA,EAEA,MAAA,IAAA,MAAA,+EAAA,GAKH,OAAA8B,EACD,MAAA,kBAAAqB,EAAAF,EAAA,eAeC,UAAAF,KAAA,KAAA,YAAA,CACC,MAAA/C,EAAA,OAAAkD,EAAAH,EAAA,UAAA,YAAAG,EAAA,KAAAH,EAAA,CAA0C,GAAAE,EACtC,MAAAG,CACI,UAIP,GAAApD,aAAA,SACC,OAAAA,EAGD,GAAAA,aAAA,MAAA,cAMA,MAAA,IAAA,MAAA,0DAAA,GAIF,MAAAoD,EACD,MAAA,qBAAAlD,EAAA+C,EAAA,OAaC,UAAAF,KAAA,KAAA,YAAA,CACC,MAAA/C,EAAA,OAAAkD,EAAAH,EAAA,aAAA,YAAAG,EAAA,KAAAH,EAAA,CAA6C,GAAAE,YAE5C,UAIA,GAAA,EAAAjD,aAAA,UACC,MAAA,IAAA,MAAA,oEAAA,OAOH,OAAAE,EAGF,CCxMO,MAAAmD,EAAA,SAAAC,IAAA,yFAGN,OAAAC,EAAA,GAAAD,CAAA,CACD,EAEOE,EAAA,SAAAF,IAAA,uFAGN,OAAAG,EAAA,GAAAH,CAAA,CACD,EAOOI,EAAA,CAAAhB,EAAA,CAAA,EAAAC,IAON,IAAAF,EAAAC,EAAAC,CAAA"}
|
package/api/index.js
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { g as V, a as X } from "../.chunks/field-CyyFzM-Y.es.js";
|
|
2
|
+
const M = (t = {}) => {
|
|
3
|
+
var o;
|
|
4
|
+
return t = { ...t }, t.loadingEl ??= (o = globalThis.document) == null ? void 0 : o.body, t.loadingShowSpinner ??= !0, t.method ??= "POST", t.accept ??= "application/json", t;
|
|
5
|
+
}, v = (t, o, n) => ({
|
|
6
|
+
result: t,
|
|
7
|
+
errors: o,
|
|
8
|
+
response: n
|
|
9
|
+
}), J = (t) => t.startsWith("/system_2/common/"), B = (t = !1, o = window.location.href) => {
|
|
10
|
+
const { protocol: n, hostname: e, port: s } = new URL(o), r = e.split("."), a = !t || r.length <= 2 || /^[\d.]+$/.test(e) || e === "localhost" ? e : r.slice(-2).join(".");
|
|
11
|
+
return `${n}//${a}${s ? `:${s}` : ""}`;
|
|
12
|
+
}, $ = (t, o, n) => {
|
|
13
|
+
const e = {
|
|
14
|
+
inLoading: !1,
|
|
15
|
+
path: o,
|
|
16
|
+
url: t.options.baseUrl + o,
|
|
17
|
+
options: M(t.options.requestOptions),
|
|
18
|
+
params: {},
|
|
19
|
+
// незаполненное свойство
|
|
20
|
+
getInLoading: () => e.inLoading,
|
|
21
|
+
setParams: (s) => (e.params = { ...s }, e),
|
|
22
|
+
changeParams: (s) => (Object.assign(e.params, s), e),
|
|
23
|
+
setOptions: (s) => (Object.assign(e.options, s), e),
|
|
24
|
+
call: async (s) => e.exec(s),
|
|
25
|
+
callFetch: async (s, r) => e.exec(r, s),
|
|
26
|
+
callInNewWindow: async (s) => {
|
|
27
|
+
var d, u;
|
|
28
|
+
const r = e.genData(s), a = t.genMiddlewareCtx(e, r);
|
|
29
|
+
(u = (d = t.options).onPrepareData) == null || u.call(d, r, a);
|
|
30
|
+
const { postInWindow: l } = await import("../.chunks/lazy-Crun7esL.es.js");
|
|
31
|
+
l(e.url, r, "_blank");
|
|
32
|
+
},
|
|
33
|
+
callInSelfWindow: async (s) => {
|
|
34
|
+
var d, u;
|
|
35
|
+
const r = e.genData(s), a = t.genMiddlewareCtx(e, r);
|
|
36
|
+
(u = (d = t.options).onPrepareData) == null || u.call(d, r, a);
|
|
37
|
+
const { postInWindow: l } = await import("../.chunks/lazy-Crun7esL.es.js");
|
|
38
|
+
l(e.url, r, "_self");
|
|
39
|
+
},
|
|
40
|
+
genData: (s, r) => {
|
|
41
|
+
const a = { ...e.params };
|
|
42
|
+
if (delete a.fetch_style, s) {
|
|
43
|
+
let l = [...s];
|
|
44
|
+
n && (l = l.filter((d) => n.includes(d))), a.fields = l;
|
|
45
|
+
} else
|
|
46
|
+
n && (a.fields = n);
|
|
47
|
+
return r && (a.fetch_style = r), a;
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Общая функция выполнения запросов
|
|
51
|
+
*/
|
|
52
|
+
async exec(s, r) {
|
|
53
|
+
var q, b, S, C, I, A, D, P, U, T, L, z, O, F, W;
|
|
54
|
+
const a = t.options.Request, l = t.options.fetch, d = e.genData(s, r), u = t.genMiddlewareCtx(e, d);
|
|
55
|
+
(b = (q = t.options).onPrepareData) == null || b.call(q, d, u);
|
|
56
|
+
let y = e.url, R;
|
|
57
|
+
e.options.method !== "POST" ? y += "?" + await t.options.querySerializer(d) : R = t.options.bodySerializer(d);
|
|
58
|
+
let E;
|
|
59
|
+
if (this.options.checkFingerprint) {
|
|
60
|
+
const c = this.path + this.options.checkFingerprint;
|
|
61
|
+
(S = t.abortControllers[c]) == null || S.abort();
|
|
62
|
+
const w = new AbortController();
|
|
63
|
+
t.abortControllers[c] = w, E = w.signal;
|
|
64
|
+
}
|
|
65
|
+
const _ = {
|
|
66
|
+
...t.options,
|
|
67
|
+
method: e.options.method,
|
|
68
|
+
body: R,
|
|
69
|
+
signal: E
|
|
70
|
+
};
|
|
71
|
+
let h = new a(y, _);
|
|
72
|
+
h.headers.set("x-request-id", u.id), h.headers.set("content-type", "application/json"), h.headers.set("accept", e.options.accept);
|
|
73
|
+
const f = {
|
|
74
|
+
...u,
|
|
75
|
+
request: h
|
|
76
|
+
};
|
|
77
|
+
e.inLoading = !0, (I = (C = e.options).onLoading) == null || I.call(C, e.inLoading, f);
|
|
78
|
+
let p;
|
|
79
|
+
const g = await t.middlewareOnRequest(h, f);
|
|
80
|
+
if (g instanceof Response ? p = g : g instanceof a && (h = g), !p)
|
|
81
|
+
try {
|
|
82
|
+
p = await l(h);
|
|
83
|
+
} catch (c) {
|
|
84
|
+
p = await t.middlewareOnError(c, f);
|
|
85
|
+
} finally {
|
|
86
|
+
e.inLoading = !1, (D = (A = e.options).onLoading) == null || D.call(A, e.inLoading, f);
|
|
87
|
+
}
|
|
88
|
+
p = await t.middlewareOnResponse(p, f);
|
|
89
|
+
let i, x, m;
|
|
90
|
+
try {
|
|
91
|
+
const c = (P = p.headers.get("content-type")) == null ? void 0 : P.includes("application/json");
|
|
92
|
+
x = await p.text(), this.options.accept === "application/json" || c ? i = JSON.parse(x) : t.useExt ? i = v(x, void 0, p) : i = x;
|
|
93
|
+
} catch (c) {
|
|
94
|
+
if ((c instanceof SyntaxError || c instanceof TypeError) && (m = c, m.responseText = x), t.useExt && m) {
|
|
95
|
+
let w = p.status, j = p.statusText;
|
|
96
|
+
w === 200 && (w = 1e4, j = "Error API response"), i = v(null, [
|
|
97
|
+
{
|
|
98
|
+
code: w,
|
|
99
|
+
string: j
|
|
100
|
+
}
|
|
101
|
+
], p), t.options.useApiConsole && console.error(c);
|
|
102
|
+
} else
|
|
103
|
+
throw c;
|
|
104
|
+
}
|
|
105
|
+
return t.useExt && (i.response = p, i && ((T = (U = e.options).onApiLoaded) == null || T.call(U, i, f)), i != null && i.errors && (t.options.useApiConsole && console.warn(new Error("API error"), { res: i }), (O = (z = e.options).onApiError) == null || O.call(z, i, { ...f, formatError: m }, (L = t.options.requestOptions) == null ? void 0 : L.onApiError)), i != null && i.messages && ((W = (F = e.options).onApiMessage) == null || W.call(F, i, f))), i;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return e;
|
|
109
|
+
};
|
|
110
|
+
class k {
|
|
111
|
+
options;
|
|
112
|
+
useExt;
|
|
113
|
+
middlewares = [];
|
|
114
|
+
abortControllers = {};
|
|
115
|
+
constructor(o = {}, n) {
|
|
116
|
+
o.requestOptions = M(o.requestOptions), o.useApiConsole ??= !0, o.fetch ??= globalThis.fetch, o.Request ??= globalThis.Request, o.querySerializer ??= async (e) => {
|
|
117
|
+
const { querySerializer: s } = await import("../.chunks/lazy-Crun7esL.es.js");
|
|
118
|
+
return s(e);
|
|
119
|
+
}, o.bodySerializer ??= (e) => typeof e == "string" ? e : JSON.stringify(e), this.options = o, this.useExt = n;
|
|
120
|
+
}
|
|
121
|
+
generateUUID() {
|
|
122
|
+
return crypto != null && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (o) => {
|
|
123
|
+
const n = Math.random() * 16 | 0;
|
|
124
|
+
return (o === "x" ? n : n & 3 | 8).toString(16);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Зарегистрировать middleware
|
|
129
|
+
*/
|
|
130
|
+
use(o) {
|
|
131
|
+
this.middlewares.push(o);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Создать объект запроса
|
|
135
|
+
*
|
|
136
|
+
* После создания объекта он заполняется необходимыми данными и выполняет запросы к API с помощью APIRequest2.call();
|
|
137
|
+
*
|
|
138
|
+
* Опционально generic указывать нельзя, поэтому необходимо дублировать определение fetchStyle, [см.](https://github.com/Microsoft/TypeScript/issues/26242)
|
|
139
|
+
*
|
|
140
|
+
* @param path Путь метода API
|
|
141
|
+
* @param fieldsNarrow Список получаемых полей, для методов API с моделью. Если объект запроса переиспользуется, и список полей меняется, указывайте его непосредственно при вызове `api.call()`
|
|
142
|
+
*/
|
|
143
|
+
gen(o, n) {
|
|
144
|
+
return $(this, o, n);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Создать объект запроса, не описанного в OpenAPI
|
|
148
|
+
*/
|
|
149
|
+
genAny(o, n) {
|
|
150
|
+
return this.gen(o, n);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Создать контекст выполнения запроса
|
|
154
|
+
*/
|
|
155
|
+
genMiddlewareCtx(o, n) {
|
|
156
|
+
const e = this.generateUUID(), s = Object.freeze({
|
|
157
|
+
baseUrl: this.options.baseUrl,
|
|
158
|
+
querySerializer: this.options.querySerializer,
|
|
159
|
+
bodySerializer: this.options.bodySerializer,
|
|
160
|
+
Request: this.options.Request,
|
|
161
|
+
fetch: this.options.fetch
|
|
162
|
+
});
|
|
163
|
+
return {
|
|
164
|
+
useExt: this.useExt,
|
|
165
|
+
requestOptions: o.options,
|
|
166
|
+
data: n,
|
|
167
|
+
middlewareData: {},
|
|
168
|
+
options: s,
|
|
169
|
+
schemaPath: o.path,
|
|
170
|
+
id: e
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Обработчик middleware.onRequest
|
|
175
|
+
*
|
|
176
|
+
* @param request Запрос для обработки
|
|
177
|
+
* @param middlewareCtx Контекст выполнения запроса
|
|
178
|
+
* @return Новый экземпляр `Request` или `Response` при модификации запроса, или undefined
|
|
179
|
+
*/
|
|
180
|
+
async middlewareOnRequest(o, n) {
|
|
181
|
+
var e;
|
|
182
|
+
for (const s of this.middlewares) {
|
|
183
|
+
const r = await ((e = s.onRequest) == null ? void 0 : e.call(s, {
|
|
184
|
+
...n,
|
|
185
|
+
request: o
|
|
186
|
+
}));
|
|
187
|
+
if (r)
|
|
188
|
+
if (r instanceof Request)
|
|
189
|
+
o = r;
|
|
190
|
+
else {
|
|
191
|
+
if (r instanceof Response)
|
|
192
|
+
return r;
|
|
193
|
+
throw new Error("onRequest: must return new Request() or Response() when modifying the request");
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return o;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Обработчик middleware.onResponse
|
|
200
|
+
*
|
|
201
|
+
* @param `error` Ошибка, переданная для обработки
|
|
202
|
+
* @param middlewareCtx
|
|
203
|
+
* @return Новый экземпляр `Response` при успешной обработке или выбрасывает ошибку
|
|
204
|
+
*/
|
|
205
|
+
async middlewareOnError(o, n) {
|
|
206
|
+
var s;
|
|
207
|
+
let e = o;
|
|
208
|
+
for (const r of this.middlewares) {
|
|
209
|
+
const a = await ((s = r.onError) == null ? void 0 : s.call(r, {
|
|
210
|
+
...n,
|
|
211
|
+
error: e
|
|
212
|
+
}));
|
|
213
|
+
if (a) {
|
|
214
|
+
if (a instanceof Response)
|
|
215
|
+
return a;
|
|
216
|
+
if (a instanceof Error) {
|
|
217
|
+
e = a;
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
throw new Error("onError: must return new Response() or instance of Error");
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
throw e;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Обработчик middleware.onResponse
|
|
227
|
+
*
|
|
228
|
+
* @param response Ответ для обработки
|
|
229
|
+
* @param middlewareCtx Контекст выполнения запроса
|
|
230
|
+
* @return Новый экземпляр `Response` при модификации ответа, или undefined
|
|
231
|
+
*/
|
|
232
|
+
async middlewareOnResponse(o, n) {
|
|
233
|
+
var e;
|
|
234
|
+
for (const s of this.middlewares) {
|
|
235
|
+
const r = await ((e = s.onResponse) == null ? void 0 : e.call(s, {
|
|
236
|
+
...n,
|
|
237
|
+
response: o
|
|
238
|
+
}));
|
|
239
|
+
if (r) {
|
|
240
|
+
if (!(r instanceof Response))
|
|
241
|
+
throw new Error("onResponse: must return new Response() when modifying the response");
|
|
242
|
+
o = r;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return o;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const H = async (...t) => {
|
|
249
|
+
const { postInWindow: o } = await import("../.chunks/lazy-Crun7esL.es.js");
|
|
250
|
+
return o(...t);
|
|
251
|
+
}, N = async (...t) => {
|
|
252
|
+
const { dataToForm: o } = await import("../.chunks/lazy-Crun7esL.es.js");
|
|
253
|
+
return o(...t);
|
|
254
|
+
}, G = (t = {}, o) => new k(t, o);
|
|
255
|
+
export {
|
|
256
|
+
G as createClient,
|
|
257
|
+
N as dataToForm,
|
|
258
|
+
v as genExtRes,
|
|
259
|
+
V as genFieldFilter,
|
|
260
|
+
X as genFieldOrder,
|
|
261
|
+
B as getBaseDomainUrl,
|
|
262
|
+
J as isPublicAPI,
|
|
263
|
+
H as postInWindow
|
|
264
|
+
};
|
|
265
|
+
//# sourceMappingURL=index.js.map
|