@tager/admin-import 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/paths.d.ts +4 -4
- package/dist/constants/routes.d.ts +3 -3
- package/dist/dev/App.vue.d.ts +5 -0
- package/dist/dev/config.d.ts +2 -0
- package/dist/dev/env.d.ts +1 -0
- package/dist/dev/main.d.ts +3 -0
- package/dist/index.mjs +439 -0
- package/dist/locales/apply.d.ts +1 -0
- package/dist/locales/en.d.ts +19 -20
- package/dist/locales/ru.d.ts +2 -3
- package/dist/main.d.ts +3 -3
- package/dist/services/requests.d.ts +8 -8
- package/dist/style.css +1 -0
- package/dist/typings/model.d.ts +33 -26
- package/dist/utils/paths.d.ts +4 -4
- package/dist/views/ImportForm/ImportForm.helpers.d.ts +9 -7
- package/dist/views/ImportForm/ImportForm.vue.d.ts +2688 -70
- package/dist/views/ImportForm/index.d.ts +1 -1
- package/dist/views/ImportList/ImportList.vue.d.ts +16 -41
- package/dist/views/ImportList/components/CellHistory/CellHistory.helpers.d.ts +1 -0
- package/dist/views/ImportList/components/CellHistory/CellHistory.vue.d.ts +19 -0
- package/dist/views/ImportList/components/CellHistory/index.d.ts +1 -0
- package/dist/views/ImportList/index.d.ts +1 -1
- package/package.json +49 -47
- package/src/constants/routes.ts +10 -10
- package/src/dev/App.vue +38 -0
- package/src/dev/config.ts +23 -0
- package/src/dev/env.ts +17 -0
- package/src/dev/main.ts +36 -0
- package/src/locales/apply.ts +9 -0
- package/src/locales/en.ts +2 -4
- package/src/locales/ru.ts +19 -21
- package/src/main.ts +2 -6
- package/src/typings/model.ts +14 -1
- package/src/views/ImportForm/ImportForm.helpers.ts +17 -2
- package/src/views/ImportForm/ImportForm.vue +109 -69
- package/src/views/ImportList/ImportList.vue +60 -63
- package/src/views/ImportList/components/CellHistory/CellHistory.helpers.ts +13 -0
- package/src/views/ImportList/components/CellHistory/CellHistory.vue +38 -0
- package/src/views/ImportList/components/CellHistory/index.ts +1 -0
- package/README.md +0 -1
- package/dist/dev.d.ts +0 -1
- package/dist/index.esm.js +0 -618
- package/dist/index.umd.js +0 -629
- package/src/dev.ts +0 -41
- package/src/typings/sfc.d.ts +0 -12
- package/src/typings/shims-tsx.d.ts +0 -13
- package/src/typings/shims-vue.d.ts +0 -11
- package/src/views/App.vue +0 -36
package/dist/index.umd.js
DELETED
|
@@ -1,629 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tager/admin-services'), require('@vue/composition-api'), require('@tager/admin-ui'), require('path-to-regexp')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tager/admin-services', '@vue/composition-api', '@tager/admin-ui', 'path-to-regexp'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TagerAdminImport = {}, global.adminServices, global.compositionApi, global.adminUi, global.pathToRegexp));
|
|
5
|
-
}(this, (function (exports, adminServices, compositionApi, adminUi, pathToRegexp) { 'use strict';
|
|
6
|
-
|
|
7
|
-
const EN = {
|
|
8
|
-
home: 'Home',
|
|
9
|
-
exportAndImport: 'Export / Import',
|
|
10
|
-
import: 'Import',
|
|
11
|
-
importList: 'Import List',
|
|
12
|
-
importForm: 'Import Form',
|
|
13
|
-
type: 'Type',
|
|
14
|
-
importType: 'Import type',
|
|
15
|
-
status: 'status',
|
|
16
|
-
message: 'Message',
|
|
17
|
-
log: 'Log',
|
|
18
|
-
file: 'file',
|
|
19
|
-
newImport: 'New import',
|
|
20
|
-
importCreation: 'Import creation',
|
|
21
|
-
success: 'Success',
|
|
22
|
-
error: 'Error',
|
|
23
|
-
createdSuccessMessage: 'Import has been successfully created',
|
|
24
|
-
createdErrorMessage: 'Import creation has been failed',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const RU = {
|
|
28
|
-
home: 'Главная',
|
|
29
|
-
exportAndImport: 'Экспорт / Импорт',
|
|
30
|
-
import: 'Импорт',
|
|
31
|
-
importList: 'Список импортов',
|
|
32
|
-
importForm: 'Форма импорта',
|
|
33
|
-
type: 'Тип',
|
|
34
|
-
importType: 'Тип импорта',
|
|
35
|
-
status: 'Статус',
|
|
36
|
-
message: 'Сообщение',
|
|
37
|
-
log: 'Лог',
|
|
38
|
-
file: 'Файл',
|
|
39
|
-
newImport: 'Новый импорт',
|
|
40
|
-
importCreation: 'Создание импорта',
|
|
41
|
-
success: 'Успех',
|
|
42
|
-
error: 'Ошибка',
|
|
43
|
-
createdSuccessMessage: 'Импорт была успешно создан',
|
|
44
|
-
createdErrorMessage: 'Создание импорта не удалось',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
function getImportList(params) {
|
|
48
|
-
return adminServices.request.get({ path: '/admin/tager/import', params });
|
|
49
|
-
}
|
|
50
|
-
function getModuleInfo() {
|
|
51
|
-
return adminServices.request.get({ path: '/admin/tager/import/info' });
|
|
52
|
-
}
|
|
53
|
-
function createImport(payload) {
|
|
54
|
-
return adminServices.request.post({ path: '/admin/tager/import', body: payload });
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const IMPORT_ROUTE_PATHS = {
|
|
58
|
-
IMPORT_LIST: '/import',
|
|
59
|
-
IMPORT_FORM: '/import/:importId',
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
function getImportListUrl() {
|
|
63
|
-
return IMPORT_ROUTE_PATHS.IMPORT_LIST;
|
|
64
|
-
}
|
|
65
|
-
function getImportFormUrl(params) {
|
|
66
|
-
return pathToRegexp.compile(IMPORT_ROUTE_PATHS.IMPORT_FORM)(params);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var script = compositionApi.defineComponent({
|
|
70
|
-
name: 'ImportList',
|
|
71
|
-
setup(props, context) {
|
|
72
|
-
const { t } = adminUi.useTranslation(context);
|
|
73
|
-
const { fetchEntityList: fetchImportList, isLoading: isImportListLoading, rowData: importList, errorMessage, searchQuery, handleChange, pageSize, pageCount, pageNumber, } = adminUi.useDataTable({
|
|
74
|
-
fetchEntityList: (params) => getImportList({
|
|
75
|
-
pageNumber: params.pageNumber,
|
|
76
|
-
pageSize: params.pageSize,
|
|
77
|
-
}),
|
|
78
|
-
initialValue: [],
|
|
79
|
-
context,
|
|
80
|
-
resourceName: 'Import list',
|
|
81
|
-
pageSize: 100,
|
|
82
|
-
});
|
|
83
|
-
compositionApi.onMounted(() => {
|
|
84
|
-
fetchImportList();
|
|
85
|
-
});
|
|
86
|
-
const columnDefs = [
|
|
87
|
-
{
|
|
88
|
-
id: 1,
|
|
89
|
-
name: 'ID',
|
|
90
|
-
field: 'id',
|
|
91
|
-
style: { width: '50px', textAlign: 'center' },
|
|
92
|
-
headStyle: { width: '50px', textAlign: 'center' },
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: 2,
|
|
96
|
-
name: t('import:type'),
|
|
97
|
-
field: 'strategy',
|
|
98
|
-
style: { width: '15%' },
|
|
99
|
-
headStyle: { width: '15%' },
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
id: 3,
|
|
103
|
-
name: t('import:status'),
|
|
104
|
-
field: 'status',
|
|
105
|
-
style: { width: '15%' },
|
|
106
|
-
headStyle: { width: '15%' },
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: 4,
|
|
110
|
-
name: t('import:message'),
|
|
111
|
-
field: 'message',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
id: 5,
|
|
115
|
-
name: t('import:log'),
|
|
116
|
-
field: 'history',
|
|
117
|
-
style: { width: '25%' },
|
|
118
|
-
headStyle: { width: '25%' },
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: 6,
|
|
122
|
-
name: t('import:file'),
|
|
123
|
-
field: 'file',
|
|
124
|
-
type: 'file',
|
|
125
|
-
style: { width: '150px', textAlign: 'center' },
|
|
126
|
-
headStyle: { width: '150px', textAlign: 'center' },
|
|
127
|
-
},
|
|
128
|
-
];
|
|
129
|
-
function dateTimeFormat(value) {
|
|
130
|
-
const options = {
|
|
131
|
-
year: 'numeric',
|
|
132
|
-
month: 'numeric',
|
|
133
|
-
day: 'numeric',
|
|
134
|
-
hour: 'numeric',
|
|
135
|
-
minute: 'numeric',
|
|
136
|
-
second: 'numeric',
|
|
137
|
-
};
|
|
138
|
-
const date = new Date(value);
|
|
139
|
-
return new Intl.DateTimeFormat('ru-RU', options).format(date);
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
columnDefs,
|
|
143
|
-
getImportFormUrl,
|
|
144
|
-
rowData: importList,
|
|
145
|
-
isRowDataLoading: isImportListLoading,
|
|
146
|
-
errorMessage: errorMessage,
|
|
147
|
-
searchQuery,
|
|
148
|
-
handleChange,
|
|
149
|
-
pageSize,
|
|
150
|
-
pageCount,
|
|
151
|
-
pageNumber,
|
|
152
|
-
t,
|
|
153
|
-
dateTimeFormat,
|
|
154
|
-
};
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
159
|
-
if (typeof shadowMode !== 'boolean') {
|
|
160
|
-
createInjectorSSR = createInjector;
|
|
161
|
-
createInjector = shadowMode;
|
|
162
|
-
shadowMode = false;
|
|
163
|
-
}
|
|
164
|
-
// Vue.extend constructor export interop.
|
|
165
|
-
const options = typeof script === 'function' ? script.options : script;
|
|
166
|
-
// render functions
|
|
167
|
-
if (template && template.render) {
|
|
168
|
-
options.render = template.render;
|
|
169
|
-
options.staticRenderFns = template.staticRenderFns;
|
|
170
|
-
options._compiled = true;
|
|
171
|
-
// functional template
|
|
172
|
-
if (isFunctionalTemplate) {
|
|
173
|
-
options.functional = true;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
// scopedId
|
|
177
|
-
if (scopeId) {
|
|
178
|
-
options._scopeId = scopeId;
|
|
179
|
-
}
|
|
180
|
-
let hook;
|
|
181
|
-
if (moduleIdentifier) {
|
|
182
|
-
// server build
|
|
183
|
-
hook = function (context) {
|
|
184
|
-
// 2.3 injection
|
|
185
|
-
context =
|
|
186
|
-
context || // cached call
|
|
187
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
188
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
189
|
-
// 2.2 with runInNewContext: true
|
|
190
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
191
|
-
context = __VUE_SSR_CONTEXT__;
|
|
192
|
-
}
|
|
193
|
-
// inject component styles
|
|
194
|
-
if (style) {
|
|
195
|
-
style.call(this, createInjectorSSR(context));
|
|
196
|
-
}
|
|
197
|
-
// register component module identifier for async chunk inference
|
|
198
|
-
if (context && context._registeredComponents) {
|
|
199
|
-
context._registeredComponents.add(moduleIdentifier);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
// used by ssr in case component is cached and beforeCreate
|
|
203
|
-
// never gets called
|
|
204
|
-
options._ssrRegister = hook;
|
|
205
|
-
}
|
|
206
|
-
else if (style) {
|
|
207
|
-
hook = shadowMode
|
|
208
|
-
? function (context) {
|
|
209
|
-
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
|
|
210
|
-
}
|
|
211
|
-
: function (context) {
|
|
212
|
-
style.call(this, createInjector(context));
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
if (hook) {
|
|
216
|
-
if (options.functional) {
|
|
217
|
-
// register for functional component in vue file
|
|
218
|
-
const originalRender = options.render;
|
|
219
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
220
|
-
hook.call(context);
|
|
221
|
-
return originalRender(h, context);
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
// inject component registration as beforeCreate hook
|
|
226
|
-
const existing = options.beforeCreate;
|
|
227
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return script;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/* script */
|
|
234
|
-
const __vue_script__ = script;
|
|
235
|
-
|
|
236
|
-
/* template */
|
|
237
|
-
var __vue_render__ = function () {
|
|
238
|
-
var _vm = this;
|
|
239
|
-
var _h = _vm.$createElement;
|
|
240
|
-
var _c = _vm._self._c || _h;
|
|
241
|
-
return _c(
|
|
242
|
-
"page",
|
|
243
|
-
{
|
|
244
|
-
attrs: {
|
|
245
|
-
title: _vm.t("import:import"),
|
|
246
|
-
"header-buttons": [
|
|
247
|
-
{
|
|
248
|
-
text: _vm.t("import:newImport"),
|
|
249
|
-
href: _vm.getImportFormUrl({ importId: "create" }),
|
|
250
|
-
},
|
|
251
|
-
],
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
[
|
|
255
|
-
_c("data-table", {
|
|
256
|
-
attrs: {
|
|
257
|
-
"column-defs": _vm.columnDefs,
|
|
258
|
-
"row-data": _vm.rowData,
|
|
259
|
-
loading: _vm.isRowDataLoading,
|
|
260
|
-
"error-message": _vm.errorMessage,
|
|
261
|
-
pagination: {
|
|
262
|
-
pageSize: _vm.pageSize,
|
|
263
|
-
pageCount: _vm.pageCount,
|
|
264
|
-
pageNumber: _vm.pageNumber,
|
|
265
|
-
disabled: _vm.isRowDataLoading,
|
|
266
|
-
},
|
|
267
|
-
"use-search": false,
|
|
268
|
-
},
|
|
269
|
-
on: { change: _vm.handleChange },
|
|
270
|
-
scopedSlots: _vm._u([
|
|
271
|
-
{
|
|
272
|
-
key: "cell(history)",
|
|
273
|
-
fn: function (ref) {
|
|
274
|
-
var row = ref.row;
|
|
275
|
-
return [
|
|
276
|
-
row.history
|
|
277
|
-
? _c(
|
|
278
|
-
"ul",
|
|
279
|
-
_vm._l(row.history, function (history, index) {
|
|
280
|
-
return _c("li", { key: index }, [
|
|
281
|
-
_c(
|
|
282
|
-
"span",
|
|
283
|
-
{
|
|
284
|
-
style: {
|
|
285
|
-
width: "100px",
|
|
286
|
-
display: "inline-block",
|
|
287
|
-
},
|
|
288
|
-
},
|
|
289
|
-
[_vm._v(_vm._s(history.status))]
|
|
290
|
-
),
|
|
291
|
-
_vm._v(
|
|
292
|
-
"\n " +
|
|
293
|
-
_vm._s(_vm.dateTimeFormat(history.datetime)) +
|
|
294
|
-
"\n "
|
|
295
|
-
),
|
|
296
|
-
])
|
|
297
|
-
}),
|
|
298
|
-
0
|
|
299
|
-
)
|
|
300
|
-
: _vm._e(),
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
},
|
|
304
|
-
]),
|
|
305
|
-
}),
|
|
306
|
-
],
|
|
307
|
-
1
|
|
308
|
-
)
|
|
309
|
-
};
|
|
310
|
-
var __vue_staticRenderFns__ = [];
|
|
311
|
-
__vue_render__._withStripped = true;
|
|
312
|
-
|
|
313
|
-
/* style */
|
|
314
|
-
const __vue_inject_styles__ = undefined;
|
|
315
|
-
/* scoped */
|
|
316
|
-
const __vue_scope_id__ = undefined;
|
|
317
|
-
/* module identifier */
|
|
318
|
-
const __vue_module_identifier__ = undefined;
|
|
319
|
-
/* functional template */
|
|
320
|
-
const __vue_is_functional_template__ = false;
|
|
321
|
-
/* style inject */
|
|
322
|
-
|
|
323
|
-
/* style inject SSR */
|
|
324
|
-
|
|
325
|
-
/* style inject shadow dom */
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
330
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
331
|
-
__vue_inject_styles__,
|
|
332
|
-
__vue_script__,
|
|
333
|
-
__vue_scope_id__,
|
|
334
|
-
__vue_is_functional_template__,
|
|
335
|
-
__vue_module_identifier__,
|
|
336
|
-
false,
|
|
337
|
-
undefined,
|
|
338
|
-
undefined,
|
|
339
|
-
undefined
|
|
340
|
-
);
|
|
341
|
-
|
|
342
|
-
function convertImportFormValuesToCreationPayload(values) {
|
|
343
|
-
var _a, _b, _c, _d;
|
|
344
|
-
return {
|
|
345
|
-
strategy: (_b = (_a = values.strategy) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '',
|
|
346
|
-
file: (_d = (_c = values.file) === null || _c === void 0 ? void 0 : _c.file.id) !== null && _d !== void 0 ? _d : '',
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
var script$1 = compositionApi.defineComponent({
|
|
351
|
-
name: 'ImportForm',
|
|
352
|
-
components: { FormFooter: adminUi.FormFooter },
|
|
353
|
-
setup(props, context) {
|
|
354
|
-
const { t } = adminUi.useTranslation(context);
|
|
355
|
-
/** Strategies */
|
|
356
|
-
const [fetchModuleInfo, { data: moduleInfo, loading: isModuleInfoLoading },] = adminServices.useResource({
|
|
357
|
-
fetchResource: getModuleInfo,
|
|
358
|
-
initialValue: null,
|
|
359
|
-
context,
|
|
360
|
-
resourceName: 'Module info',
|
|
361
|
-
});
|
|
362
|
-
const strategyFileScenario = compositionApi.computed(() => { var _a, _b; return (_b = (_a = moduleInfo.value) === null || _a === void 0 ? void 0 : _a.fileScenario) !== null && _b !== void 0 ? _b : ''; });
|
|
363
|
-
const strategyOptionList = compositionApi.computed(() => { var _a, _b; return (_b = (_a = moduleInfo.value) === null || _a === void 0 ? void 0 : _a.strategies.map((strategy) => ({
|
|
364
|
-
value: strategy.id,
|
|
365
|
-
label: strategy.name,
|
|
366
|
-
}))) !== null && _b !== void 0 ? _b : []; });
|
|
367
|
-
compositionApi.onMounted(() => {
|
|
368
|
-
fetchModuleInfo();
|
|
369
|
-
});
|
|
370
|
-
/** Form state */
|
|
371
|
-
const errors = compositionApi.ref({});
|
|
372
|
-
const values = compositionApi.ref({ strategy: null, file: null });
|
|
373
|
-
const isSubmitting = compositionApi.ref(false);
|
|
374
|
-
function submitForm(event) {
|
|
375
|
-
isSubmitting.value = true;
|
|
376
|
-
const creationPayload = convertImportFormValuesToCreationPayload(values.value);
|
|
377
|
-
createImport(creationPayload)
|
|
378
|
-
.then(() => {
|
|
379
|
-
errors.value = {};
|
|
380
|
-
if (event.type === 'create' ||
|
|
381
|
-
event.type === 'save' ||
|
|
382
|
-
event.type === 'create_exit' ||
|
|
383
|
-
event.type === 'save_exit') {
|
|
384
|
-
context.root.$router.push(getImportListUrl());
|
|
385
|
-
}
|
|
386
|
-
context.root.$toast({
|
|
387
|
-
variant: 'success',
|
|
388
|
-
title: t('import:success'),
|
|
389
|
-
body: t('import:createdSuccessMessage'),
|
|
390
|
-
});
|
|
391
|
-
})
|
|
392
|
-
.catch((error) => {
|
|
393
|
-
console.error(error);
|
|
394
|
-
errors.value = adminServices.convertRequestErrorToMap(error);
|
|
395
|
-
context.root.$toast({
|
|
396
|
-
variant: 'danger',
|
|
397
|
-
title: t('import:error'),
|
|
398
|
-
body: t('import:createdErrorMessage'),
|
|
399
|
-
});
|
|
400
|
-
})
|
|
401
|
-
.finally(() => {
|
|
402
|
-
isSubmitting.value = false;
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
/** Is content loading **/
|
|
406
|
-
const isContentLoading = compositionApi.computed(() => isModuleInfoLoading.value);
|
|
407
|
-
return {
|
|
408
|
-
values,
|
|
409
|
-
errors,
|
|
410
|
-
isSubmitting,
|
|
411
|
-
submitForm,
|
|
412
|
-
getImportListUrl,
|
|
413
|
-
strategyOptionList,
|
|
414
|
-
strategyFileScenario,
|
|
415
|
-
isContentLoading,
|
|
416
|
-
};
|
|
417
|
-
},
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
const isOldIE = typeof navigator !== 'undefined' &&
|
|
421
|
-
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
422
|
-
function createInjector(context) {
|
|
423
|
-
return (id, style) => addStyle(id, style);
|
|
424
|
-
}
|
|
425
|
-
let HEAD;
|
|
426
|
-
const styles = {};
|
|
427
|
-
function addStyle(id, css) {
|
|
428
|
-
const group = isOldIE ? css.media || 'default' : id;
|
|
429
|
-
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
|
|
430
|
-
if (!style.ids.has(id)) {
|
|
431
|
-
style.ids.add(id);
|
|
432
|
-
let code = css.source;
|
|
433
|
-
if (css.map) {
|
|
434
|
-
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
435
|
-
// this makes source maps inside style tags work properly in Chrome
|
|
436
|
-
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
437
|
-
// http://stackoverflow.com/a/26603875
|
|
438
|
-
code +=
|
|
439
|
-
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
440
|
-
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
441
|
-
' */';
|
|
442
|
-
}
|
|
443
|
-
if (!style.element) {
|
|
444
|
-
style.element = document.createElement('style');
|
|
445
|
-
style.element.type = 'text/css';
|
|
446
|
-
if (css.media)
|
|
447
|
-
style.element.setAttribute('media', css.media);
|
|
448
|
-
if (HEAD === undefined) {
|
|
449
|
-
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
450
|
-
}
|
|
451
|
-
HEAD.appendChild(style.element);
|
|
452
|
-
}
|
|
453
|
-
if ('styleSheet' in style.element) {
|
|
454
|
-
style.styles.push(code);
|
|
455
|
-
style.element.styleSheet.cssText = style.styles
|
|
456
|
-
.filter(Boolean)
|
|
457
|
-
.join('\n');
|
|
458
|
-
}
|
|
459
|
-
else {
|
|
460
|
-
const index = style.ids.size - 1;
|
|
461
|
-
const textNode = document.createTextNode(code);
|
|
462
|
-
const nodes = style.element.childNodes;
|
|
463
|
-
if (nodes[index])
|
|
464
|
-
style.element.removeChild(nodes[index]);
|
|
465
|
-
if (nodes.length)
|
|
466
|
-
style.element.insertBefore(textNode, nodes[index]);
|
|
467
|
-
else
|
|
468
|
-
style.element.appendChild(textNode);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/* script */
|
|
474
|
-
const __vue_script__$1 = script$1;
|
|
475
|
-
|
|
476
|
-
/* template */
|
|
477
|
-
var __vue_render__$1 = function () {
|
|
478
|
-
var _vm = this;
|
|
479
|
-
var _h = _vm.$createElement;
|
|
480
|
-
var _c = _vm._self._c || _h;
|
|
481
|
-
return _c(
|
|
482
|
-
"page",
|
|
483
|
-
{
|
|
484
|
-
attrs: {
|
|
485
|
-
title: _vm.$t("import:importCreation"),
|
|
486
|
-
"is-content-loading": _vm.isContentLoading,
|
|
487
|
-
},
|
|
488
|
-
scopedSlots: _vm._u([
|
|
489
|
-
{
|
|
490
|
-
key: "footer",
|
|
491
|
-
fn: function () {
|
|
492
|
-
return [
|
|
493
|
-
_c("FormFooter", {
|
|
494
|
-
attrs: {
|
|
495
|
-
"back-href": _vm.getImportListUrl(),
|
|
496
|
-
"on-submit": _vm.submitForm,
|
|
497
|
-
"is-submitting": _vm.isSubmitting,
|
|
498
|
-
"is-creation": true,
|
|
499
|
-
},
|
|
500
|
-
}),
|
|
501
|
-
]
|
|
502
|
-
},
|
|
503
|
-
proxy: true,
|
|
504
|
-
},
|
|
505
|
-
]),
|
|
506
|
-
},
|
|
507
|
-
[
|
|
508
|
-
_c(
|
|
509
|
-
"form",
|
|
510
|
-
{
|
|
511
|
-
attrs: { novalidate: "" },
|
|
512
|
-
on: {
|
|
513
|
-
submit: function ($event) {
|
|
514
|
-
$event.preventDefault();
|
|
515
|
-
},
|
|
516
|
-
},
|
|
517
|
-
},
|
|
518
|
-
[
|
|
519
|
-
[
|
|
520
|
-
_c("form-field-select", {
|
|
521
|
-
attrs: {
|
|
522
|
-
options: _vm.strategyOptionList,
|
|
523
|
-
error: _vm.errors.strategy,
|
|
524
|
-
name: "importType",
|
|
525
|
-
label: _vm.$t("import:importType"),
|
|
526
|
-
},
|
|
527
|
-
model: {
|
|
528
|
-
value: _vm.values.strategy,
|
|
529
|
-
callback: function ($$v) {
|
|
530
|
-
_vm.$set(_vm.values, "strategy", $$v);
|
|
531
|
-
},
|
|
532
|
-
expression: "values.strategy",
|
|
533
|
-
},
|
|
534
|
-
}),
|
|
535
|
-
_vm._v(" "),
|
|
536
|
-
_c("form-field-file-input", {
|
|
537
|
-
attrs: {
|
|
538
|
-
error: _vm.errors.file,
|
|
539
|
-
label: _vm.$t("import:file"),
|
|
540
|
-
name: "file",
|
|
541
|
-
scenario: _vm.strategyFileScenario,
|
|
542
|
-
},
|
|
543
|
-
model: {
|
|
544
|
-
value: _vm.values.file,
|
|
545
|
-
callback: function ($$v) {
|
|
546
|
-
_vm.$set(_vm.values, "file", $$v);
|
|
547
|
-
},
|
|
548
|
-
expression: "values.file",
|
|
549
|
-
},
|
|
550
|
-
}),
|
|
551
|
-
],
|
|
552
|
-
],
|
|
553
|
-
2
|
|
554
|
-
),
|
|
555
|
-
]
|
|
556
|
-
)
|
|
557
|
-
};
|
|
558
|
-
var __vue_staticRenderFns__$1 = [];
|
|
559
|
-
__vue_render__$1._withStripped = true;
|
|
560
|
-
|
|
561
|
-
/* style */
|
|
562
|
-
const __vue_inject_styles__$1 = function (inject) {
|
|
563
|
-
if (!inject) return
|
|
564
|
-
inject("data-v-e28a3998_0", { source: "\n\n/*# sourceMappingURL=ImportForm.vue.map */", map: {"version":3,"sources":["ImportForm.vue"],"names":[],"mappings":";;AAEA,yCAAyC","file":"ImportForm.vue"}, media: undefined });
|
|
565
|
-
|
|
566
|
-
};
|
|
567
|
-
/* scoped */
|
|
568
|
-
const __vue_scope_id__$1 = "data-v-e28a3998";
|
|
569
|
-
/* module identifier */
|
|
570
|
-
const __vue_module_identifier__$1 = undefined;
|
|
571
|
-
/* functional template */
|
|
572
|
-
const __vue_is_functional_template__$1 = false;
|
|
573
|
-
/* style inject SSR */
|
|
574
|
-
|
|
575
|
-
/* style inject shadow dom */
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
|
|
580
|
-
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
581
|
-
__vue_inject_styles__$1,
|
|
582
|
-
__vue_script__$1,
|
|
583
|
-
__vue_scope_id__$1,
|
|
584
|
-
__vue_is_functional_template__$1,
|
|
585
|
-
__vue_module_identifier__$1,
|
|
586
|
-
false,
|
|
587
|
-
createInjector,
|
|
588
|
-
undefined,
|
|
589
|
-
undefined
|
|
590
|
-
);
|
|
591
|
-
|
|
592
|
-
const IMPORT_LIST_ROUTE = {
|
|
593
|
-
path: IMPORT_ROUTE_PATHS.IMPORT_LIST,
|
|
594
|
-
component: __vue_component__,
|
|
595
|
-
name: 'Import List',
|
|
596
|
-
meta: {
|
|
597
|
-
getBreadcrumbs: (route, t) => [
|
|
598
|
-
{ url: '/', text: t('import:home') },
|
|
599
|
-
{ url: route.path, text: t('import:importList') },
|
|
600
|
-
],
|
|
601
|
-
},
|
|
602
|
-
};
|
|
603
|
-
const IMPORT_FORM_ROUTE = {
|
|
604
|
-
path: IMPORT_ROUTE_PATHS.IMPORT_FORM,
|
|
605
|
-
component: __vue_component__$1,
|
|
606
|
-
name: 'Import Form',
|
|
607
|
-
meta: {
|
|
608
|
-
getBreadcrumbs: (route, t) => [
|
|
609
|
-
{ url: '/', text: t('import:home') },
|
|
610
|
-
{ url: IMPORT_LIST_ROUTE.path, text: t('import:importList') },
|
|
611
|
-
{ url: route.path, text: t('import:importForm') },
|
|
612
|
-
],
|
|
613
|
-
},
|
|
614
|
-
};
|
|
615
|
-
|
|
616
|
-
adminServices.i18n.addTranslations('en', 'import', EN);
|
|
617
|
-
adminServices.i18n.addTranslations('ru', 'import', RU);
|
|
618
|
-
|
|
619
|
-
exports.IMPORT_FORM_ROUTE = IMPORT_FORM_ROUTE;
|
|
620
|
-
exports.IMPORT_LIST_ROUTE = IMPORT_LIST_ROUTE;
|
|
621
|
-
exports.createImport = createImport;
|
|
622
|
-
exports.getImportFormUrl = getImportFormUrl;
|
|
623
|
-
exports.getImportList = getImportList;
|
|
624
|
-
exports.getImportListUrl = getImportListUrl;
|
|
625
|
-
exports.getModuleInfo = getModuleInfo;
|
|
626
|
-
|
|
627
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
628
|
-
|
|
629
|
-
})));
|
package/src/dev.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import Vue, { CreateElement } from 'vue';
|
|
2
|
-
import VueCompositionApi, { createApp } from '@vue/composition-api';
|
|
3
|
-
|
|
4
|
-
import { configStore, i18n } from '@tager/admin-services';
|
|
5
|
-
import { AdminUiPlugin } from '@tager/admin-ui';
|
|
6
|
-
import { AdminLayoutPlugin, createRouter } from '@tager/admin-layout';
|
|
7
|
-
|
|
8
|
-
import '@tager/admin-ui/dist/admin-ui.css';
|
|
9
|
-
|
|
10
|
-
import EN from './locales/en';
|
|
11
|
-
import RU from './locales/ru';
|
|
12
|
-
import config from './config/config.json';
|
|
13
|
-
import App from './views/App.vue';
|
|
14
|
-
import { IMPORT_LIST_ROUTE, IMPORT_FORM_ROUTE } from './constants/routes';
|
|
15
|
-
|
|
16
|
-
configStore.setConfig(config);
|
|
17
|
-
|
|
18
|
-
const router = createRouter(
|
|
19
|
-
{
|
|
20
|
-
routes: [IMPORT_LIST_ROUTE, IMPORT_FORM_ROUTE],
|
|
21
|
-
},
|
|
22
|
-
{ useTitleSync: false }
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
i18n.addTranslations('en', 'import', EN);
|
|
26
|
-
i18n.addTranslations('ru', 'import', RU);
|
|
27
|
-
|
|
28
|
-
i18n.init({ debug: false, lng: 'ru' }).then(() => {
|
|
29
|
-
Vue.use(VueCompositionApi);
|
|
30
|
-
|
|
31
|
-
const app = createApp({
|
|
32
|
-
router,
|
|
33
|
-
render: (h: CreateElement) => h(App),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
app.use(i18n.getPlugin());
|
|
37
|
-
app.use(AdminUiPlugin);
|
|
38
|
-
app.use(AdminLayoutPlugin);
|
|
39
|
-
|
|
40
|
-
app.mount('#app');
|
|
41
|
-
});
|
package/src/typings/sfc.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Reference: https://stackoverflow.com/a/53999913 */
|
|
2
|
-
// 1. Make sure to import 'vue' before declaring augmented types
|
|
3
|
-
import Vue from 'vue';
|
|
4
|
-
|
|
5
|
-
// 2. Specify a file with the types you want to augment
|
|
6
|
-
// Vue has the constructor type in types/vue.d.ts
|
|
7
|
-
declare module 'vue/types/vue' {
|
|
8
|
-
// 3. Declare augmentation for Vue
|
|
9
|
-
interface Vue {
|
|
10
|
-
$style: { [key: string]: string };
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Vue, { VNode } from 'vue';
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
namespace JSX {
|
|
5
|
-
// tslint:disable no-empty-interface
|
|
6
|
-
interface Element extends VNode {}
|
|
7
|
-
// tslint:disable no-empty-interface
|
|
8
|
-
interface ElementClass extends Vue {}
|
|
9
|
-
interface IntrinsicElements {
|
|
10
|
-
[elem: string]: any;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|