bfg-common 1.4.630 → 1.4.631

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.
@@ -154,10 +154,31 @@
154
154
  margin-bottom: 48px;
155
155
  }
156
156
  &__input {
157
- :deep(.ui-main-input),
158
- :deep(.ui-main-input:not(:placeholder-shown) + .ui-input-label) {
157
+ :deep(.ui-main-input) {
159
158
  background-color: #fafafa;
160
159
  }
160
+ :deep(input.ui-main-input:-internal-autofill-selected),
161
+ :deep(input.ui-main-input:-internal-autofill-selected:hover),
162
+ :deep(input.ui-main-input:-internal-autofill-selected:active),
163
+ :deep(input.ui-main-input:-internal-autofill-selected:focus) {
164
+ appearance: menulist-button;
165
+ background-image: none !important;
166
+ background-color: #fafafa !important;
167
+ color: fieldtext !important;
168
+ -webkit-background-clip: text;
169
+ }
170
+
171
+ :deep(input.ui-main-input:-internal-autofill-selected:focus) {
172
+ & + label.ui-input-label {
173
+ position: absolute;
174
+ font-size: 14px;
175
+ top: -8.85px;
176
+
177
+ & + .label-background {
178
+ display: block;
179
+ }
180
+ }
181
+ }
161
182
  &.password {
162
183
  margin-top: 16px;
163
184
  }
@@ -56,7 +56,7 @@ const props = defineProps<{
56
56
  const localization = computed<UI_I_Localization>(() => useLocal())
57
57
 
58
58
  const data = computed<UI_I_DataTable>(() => ({
59
- id: '0',
59
+ id: 'services',
60
60
  header: resentTaskHeadItems.value,
61
61
  body: resentTaskBodyItems.value,
62
62
  }))
@@ -56,7 +56,7 @@ const props = defineProps<{
56
56
  const localization = computed<UI_I_Localization>(() => useLocal())
57
57
 
58
58
  const data = computed<UI_I_DataTable>(() => ({
59
- id: '0',
59
+ id: 'warnings',
60
60
  header: resentTaskHeadItems.value,
61
61
  body: resentTaskBodyItems.value,
62
62
  }))
@@ -352,7 +352,7 @@ watch(
352
352
  )
353
353
 
354
354
  const data = computed<UI_I_DataTable>(() => ({
355
- id: '0',
355
+ id: 'attributes',
356
356
  selectedRows: [],
357
357
  isAllSelected: false,
358
358
  title: '',
@@ -220,7 +220,7 @@ const tagsAssignBodyItems = ref<UI_I_DataTableBody[]>(
220
220
  )
221
221
 
222
222
  const data = computed<UI_I_DataTable>(() => ({
223
- id: '0',
223
+ id: 'tags',
224
224
  selectedRows: [],
225
225
  isAllSelected: false,
226
226
  title: '',
@@ -230,7 +230,7 @@ const data = computed<UI_I_DataTable>(() => ({
230
230
  }))
231
231
 
232
232
  const assignData = computed<UI_I_DataTable>(() => ({
233
- id: '1',
233
+ id: 'tags-assign',
234
234
  selectedRows: [],
235
235
  isAllSelected: false,
236
236
  title: '',
@@ -43,7 +43,7 @@ const emits = defineEmits<{
43
43
  const localization = computed<UI_I_Localization>(() => useLocal())
44
44
 
45
45
  const data = computed<UI_I_DataTable>(() => ({
46
- id: '1',
46
+ id: 'new-network-location',
47
47
  header: headItems.value,
48
48
  body: bodyItems.value,
49
49
  }))
@@ -5,7 +5,7 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
5
5
  export const tableDataFunc = (
6
6
  localization: UI_I_Localization
7
7
  ): UI_I_DataTable => ({
8
- id: '0',
8
+ id: 'select-storage',
9
9
  header: [
10
10
  {
11
11
  col: 0,
@@ -19,7 +19,6 @@ import {
19
19
  // }
20
20
 
21
21
  const npmGenerate = (): void => {
22
- console.log('npmGenerate', 222);
23
22
  // Правим путь к файлу
24
23
  const filePath = path.join(
25
24
  __dirname.replace('/bfg-common/modules/fixContentBuild', ''),
@@ -31,19 +30,17 @@ const npmGenerate = (): void => {
31
30
  'composables',
32
31
  'query.js'
33
32
  )
34
- console.log(333);
35
33
  const searchString = '/query/${hash(params)}'
36
34
  const replacementString = 'cache'
37
35
  replaceFileContent(filePath, searchString, replacementString)
38
36
  // End block
39
- console.log(444);
37
+
40
38
  // Переносим весь контент и удаляем все файлы кроме картинок
41
39
  const contentPath = path.join(
42
40
  __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
43
41
  'content',
44
42
  'help'
45
43
  )
46
- console.log(contentPath, 555, !fs.existsSync(contentPath));
47
44
  if (!fs.existsSync(contentPath)) return
48
45
 
49
46
  const publicPath = path.join(
@@ -51,9 +48,7 @@ const npmGenerate = (): void => {
51
48
  'public',
52
49
  'images'
53
50
  )
54
- console.log(777,contentPath, publicPath);
55
51
  fs.cp(contentPath, publicPath, { recursive: true }, () => {
56
- console.log(888);
57
52
  // Удаляем все файлы кроме картинок
58
53
  removeNonImageFiles(publicPath)
59
54
 
@@ -68,7 +63,6 @@ const npmGenerate = (): void => {
68
63
 
69
64
  // @ts-ignore
70
65
  export default defineNuxtModule(() => {
71
- console.log(process.env.npm_command, 444);
72
66
  switch (process.env.npm_command) {
73
67
  case 'run-script':
74
68
  // npmDev()
@@ -1,118 +1,115 @@
1
- import path from 'path'
2
- import fs from 'fs'
3
-
4
- const isImage = (fileName: string) => {
5
- const imageExtensions = ['.png', '.jpeg', '.jpg']
6
- return imageExtensions.some(
7
- (ext) => path.extname(fileName).toLowerCase() === ext
8
- )
9
- }
10
- const isMdFile = (fileName: string) => {
11
- return path.extname(fileName).toLowerCase() === '.md'
12
- }
13
-
14
- export const removeNonImageFiles = (dirPath: string) => {
15
- fs.readdirSync(dirPath).forEach((file: string) => {
16
- const filePath = path.join(dirPath, file)
17
- const isDir = fs.lstatSync(filePath).isDirectory()
18
-
19
- if (isDir) {
20
- removeNonImageFiles(filePath)
21
- } else {
22
- if (!isImage(file)) {
23
- fs.unlinkSync(filePath)
24
- }
25
- }
26
- })
27
- }
28
-
29
- export const removeImagesFromContent = (dirPath: string) => {
30
- fs.readdirSync(dirPath).forEach((file: string) => {
31
- const filePath = path.join(dirPath, file)
32
- const isDir = fs.lstatSync(filePath).isDirectory()
33
-
34
- if (isDir) {
35
- removeImagesFromContent(filePath)
36
- } else {
37
- // if (isImage(file)) { // закоментировал т.к. на проде долго загружалась документация(стр. /help)
38
- if (!isMdFile(file)) {
39
- fs.unlinkSync(filePath)
40
- } else if (isMdFile(file) && filePath.includes('_index.md')) {
41
- // Удаляем префикс "_" у индексных файлов
42
- const filePathWidthOutPrefix = filePath.replace('_index.md', 'index.md')
43
- fs.rename(filePath, filePathWidthOutPrefix, (err: any) => {
44
- if (err) {
45
- console.error(`Error renaming file: ${err}`)
46
- }
47
- })
48
- }
49
- }
50
- })
51
- }
52
-
53
- export const updateImagesPathAndCustomComponents = (dirPath: string) => {
54
- console.log(dirPath, 111)
55
- fs.readdirSync(dirPath).forEach((file: string) => {
56
- const filePath = path.join(dirPath, file)
57
- const isDir = fs.lstatSync(filePath).isDirectory()
58
-
59
- if (isDir) {
60
- updateImagesPathAndCustomComponents(filePath)
61
- } else {
62
- if (isMdFile(file)) {
63
- console.log(file, 222)
64
- // @ts-ignore
65
- // Правим путь к картинкам
66
- const imagePath = filePath
67
- .replaceAll('\\', '/')
68
- .match(/\/content.+\//)[0]
69
- .replace('/content/help', '/images')
70
- console.log(imagePath, 333, filePath)
71
- replaceFileContent(
72
- filePath,
73
- /!\[(.*)\]\((.*?)\)/g,
74
- `![$1](${imagePath}$2)`
75
- ).then(() => {
76
- // Заменяем кастомные тэги
77
- replaceFileContent(
78
- filePath,
79
- /\{\{ *< *hint *(info) *> *\}\}|\{\{ *< *\/hint *> *\}\}/g,
80
- (_match: any, hintInfo: string) => {
81
- return hintInfo ? '\n::hint\n' : '\n::\n'
82
- }
83
- )
84
- })
85
- }
86
- }
87
- })
88
- }
89
-
90
- export const replaceFileContent = async (
91
- filePath: string,
92
- searchString: string | RegExp,
93
- replacementString: any
94
- ): Promise<void> => {
95
- return new Promise((resolve, reject) => {
96
- fs.readFile(filePath, 'utf8', (err: any, data: string) => {
97
- if (err) {
98
- reject()
99
- return console.log(err)
100
- }
101
-
102
- if (data.match(replacementString)) {
103
- resolve()
104
- return
105
- }
106
-
107
- const updatedContent = data.replace(searchString, replacementString)
108
-
109
- fs.writeFile(filePath, updatedContent, 'utf8', (err: any) => {
110
- if (err) {
111
- reject()
112
- return console.log(err)
113
- }
114
- resolve()
115
- })
116
- })
117
- })
118
- }
1
+ import path from 'path'
2
+ import fs from 'fs'
3
+
4
+ const isImage = (fileName: string) => {
5
+ const imageExtensions = ['.png', '.jpeg', '.jpg']
6
+ return imageExtensions.some(
7
+ (ext) => path.extname(fileName).toLowerCase() === ext
8
+ )
9
+ }
10
+ const isMdFile = (fileName: string) => {
11
+ return path.extname(fileName).toLowerCase() === '.md'
12
+ }
13
+
14
+ export const removeNonImageFiles = (dirPath: string) => {
15
+ fs.readdirSync(dirPath).forEach((file: string) => {
16
+ const filePath = path.join(dirPath, file)
17
+ const isDir = fs.lstatSync(filePath).isDirectory()
18
+
19
+ if (isDir) {
20
+ removeNonImageFiles(filePath)
21
+ } else {
22
+ if (!isImage(file)) {
23
+ fs.unlinkSync(filePath)
24
+ }
25
+ }
26
+ })
27
+ }
28
+
29
+ export const removeImagesFromContent = (dirPath: string) => {
30
+ fs.readdirSync(dirPath).forEach((file: string) => {
31
+ const filePath = path.join(dirPath, file)
32
+ const isDir = fs.lstatSync(filePath).isDirectory()
33
+
34
+ if (isDir) {
35
+ removeImagesFromContent(filePath)
36
+ } else {
37
+ // if (isImage(file)) { // закоментировал т.к. на проде долго загружалась документация(стр. /help)
38
+ if (!isMdFile(file)) {
39
+ fs.unlinkSync(filePath)
40
+ } else if (isMdFile(file) && filePath.includes('_index.md')) {
41
+ // Удаляем префикс "_" у индексных файлов
42
+ const filePathWidthOutPrefix = filePath.replace('_index.md', 'index.md')
43
+ fs.rename(filePath, filePathWidthOutPrefix, (err: any) => {
44
+ if (err) {
45
+ console.error(`Error renaming file: ${err}`)
46
+ }
47
+ })
48
+ }
49
+ }
50
+ })
51
+ }
52
+
53
+ export const updateImagesPathAndCustomComponents = (dirPath: string) => {
54
+ fs.readdirSync(dirPath).forEach((file: string) => {
55
+ const filePath = path.join(dirPath, file)
56
+ const isDir = fs.lstatSync(filePath).isDirectory()
57
+
58
+ if (isDir) {
59
+ updateImagesPathAndCustomComponents(filePath)
60
+ } else {
61
+ if (isMdFile(file)) {
62
+ // @ts-ignore
63
+ // Правим путь к картинкам
64
+ const imagePath = filePath
65
+ .replaceAll('\\', '/')
66
+ .match(/\/content.+\//)[0]
67
+ .replace('/content/help', '/images')
68
+ replaceFileContent(
69
+ filePath,
70
+ /!\[(.*)\]\((.*?)\)/g,
71
+ `![$1](${imagePath}$2)`
72
+ ).then(() => {
73
+ // Заменяем кастомные тэги
74
+ replaceFileContent(
75
+ filePath,
76
+ /\{\{ *< *hint *(info) *> *\}\}|\{\{ *< *\/hint *> *\}\}/g,
77
+ (_match: any, hintInfo: string) => {
78
+ return hintInfo ? '\n::hint\n' : '\n::\n'
79
+ }
80
+ )
81
+ })
82
+ }
83
+ }
84
+ })
85
+ }
86
+
87
+ export const replaceFileContent = async (
88
+ filePath: string,
89
+ searchString: string | RegExp,
90
+ replacementString: any
91
+ ): Promise<void> => {
92
+ return new Promise((resolve, reject) => {
93
+ fs.readFile(filePath, 'utf8', (err: any, data: string) => {
94
+ if (err) {
95
+ reject()
96
+ return console.log(err)
97
+ }
98
+
99
+ if (data.match(replacementString)) {
100
+ resolve()
101
+ return
102
+ }
103
+
104
+ const updatedContent = data.replace(searchString, replacementString)
105
+
106
+ fs.writeFile(filePath, updatedContent, 'utf8', (err: any) => {
107
+ if (err) {
108
+ reject()
109
+ return console.log(err)
110
+ }
111
+ resolve()
112
+ })
113
+ })
114
+ })
115
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.630",
4
+ "version": "1.4.631",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "1.0.15",
38
- "bfg-uikit": "1.0.272",
38
+ "bfg-uikit": "1.0.275",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }