shared-ritm 1.3.38 → 1.3.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +16 -10
  3. package/dist/shared-ritm.umd.js +150 -150
  4. package/dist/types/api/services/AuthService.d.ts +1 -0
  5. package/package.json +70 -64
  6. package/src/App.vue +2461 -2461
  7. package/src/api/services/AuthService.ts +10 -3
  8. package/src/api/services/ControlsService.ts +96 -96
  9. package/src/api/services/EquipmentService.ts +29 -29
  10. package/src/api/services/GanttService.ts +23 -23
  11. package/src/api/services/MetricsService.ts +123 -123
  12. package/src/api/services/RepairsService.ts +111 -111
  13. package/src/api/services/TasksService.ts +157 -157
  14. package/src/api/services/UserService.ts +123 -123
  15. package/src/api/services/VideoService.ts +118 -118
  16. package/src/api/types/Api_Metrics.ts +5 -5
  17. package/src/api/types/Api_Repairs.ts +186 -186
  18. package/src/api/types/Api_Tasks.ts +376 -376
  19. package/src/api/types/Api_Video.ts +244 -244
  20. package/src/common/app-button/Button.stories.ts +369 -0
  21. package/src/common/app-checkbox/Checkbox.stories.ts +60 -0
  22. package/src/common/app-date-picker/DatePicker.stories.ts +66 -0
  23. package/src/common/app-datepicker/Datepicker.stories.ts +145 -0
  24. package/src/common/app-dialogs/AppConfirmDialog.vue +109 -109
  25. package/src/common/app-dialogs/Confirm.stories.ts +93 -0
  26. package/src/common/app-dropdown/Dropdown.stories.ts +94 -0
  27. package/src/common/app-file/File.stories.ts +104 -0
  28. package/src/common/app-icon/AppIcon.vue +108 -108
  29. package/src/common/app-icon/Icon.stories.ts +91 -0
  30. package/src/common/app-input/Input.stories.ts +160 -0
  31. package/src/common/app-input-new/InputNew.stories.ts +240 -0
  32. package/src/common/app-input-search/InputSearch.stories.ts +149 -0
  33. package/src/common/app-layout/components/AppLayoutHeader.vue +289 -273
  34. package/src/common/app-loader/Loader.stories.ts +114 -0
  35. package/src/common/app-select/AppSelect.vue +159 -159
  36. package/src/common/app-select/Select.stories.ts +155 -0
  37. package/src/common/app-sidebar/AppSidebar.vue +174 -174
  38. package/src/common/app-table/AppTable.vue +313 -313
  39. package/src/common/app-table/components/ModalSelect.stories.ts +323 -0
  40. package/src/common/app-table/components/ModalSelect.vue +302 -302
  41. package/src/common/app-table/components/TableModal.vue +367 -367
  42. package/src/common/app-table/controllers/useColumnSelector.ts +45 -45
  43. package/src/common/app-table/controllers/useTableModel.ts +97 -102
  44. package/src/common/app-toggle/Toggle.stories.ts +69 -0
  45. package/src/common/app-wrapper/AppWrapper.vue +31 -28
  46. package/src/configs/storybook.ts +14 -0
  47. package/src/index.ts +131 -131
  48. package/src/shared/styles/general.css +140 -124
  49. package/src/styles/variables.sass +12 -12
  50. package/src/utils/helpers.ts +59 -59
  51. package/dist/types/api/services/PhotoService.d.ts +0 -40
  52. package/dist/types/stories/Button.stories.d.ts +0 -13
  53. package/dist/types/stories/Checkbox.stories.d.ts +0 -7
  54. package/dist/types/stories/Confirm.stories.d.ts +0 -8
  55. package/dist/types/stories/DatePicker.stories.d.ts +0 -8
  56. package/dist/types/stories/Dropdown.stories.d.ts +0 -8
  57. package/dist/types/stories/File.stories.d.ts +0 -8
  58. package/dist/types/stories/Icon.stories.d.ts +0 -7
  59. package/dist/types/stories/Input.stories.d.ts +0 -11
  60. package/dist/types/stories/InputNew.stories.d.ts +0 -12
  61. package/dist/types/stories/InputSearch.stories.d.ts +0 -10
  62. package/dist/types/stories/Loader.stories.d.ts +0 -8
  63. package/dist/types/stories/Select.stories.d.ts +0 -7
  64. package/dist/types/stories/Toggle.stories.d.ts +0 -8
@@ -1,159 +1,159 @@
1
- <template>
2
- <q-select
3
- ref="select"
4
- v-model="selected"
5
- :data-test="dataTest"
6
- :options="filteredOptions"
7
- :option-value="optionValue"
8
- :option-label="optionLabel"
9
- emit-value
10
- map-options
11
- :disable="isDisabled"
12
- :multiple="multiple"
13
- outlined
14
- stack-label
15
- :use-input="search"
16
- :class="[$style.select]"
17
- :label="label"
18
- input-debounce="100"
19
- :popup-content-class="$style['app-select__menu']"
20
- :clearable="clearable"
21
- rounded
22
- autocomplete=""
23
- @filter="filterFn"
24
- >
25
- <template v-if="multiple" #selected-item="scope">
26
- <q-chip
27
- v-if="scope.opt"
28
- removable
29
- class="q-ma-none"
30
- dense
31
- :tabindex="scope.tabindex"
32
- color="white"
33
- text-color="secondary"
34
- @remove="scope.removeAtIndex(scope.index)"
35
- >
36
- {{ scope.opt[`${optionLabel}`] }}
37
- </q-chip>
38
- </template>
39
- <template #no-option>
40
- <q-item>{{ emptyText }}</q-item>
41
- </template>
42
- <q-item v-if="!lcText && type()">{{ placeholder }}</q-item>
43
- </q-select>
44
- </template>
45
- <script setup lang="ts">
46
- import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
47
-
48
- import { QSelect } from 'quasar'
49
-
50
- type Option = Record<string, any>
51
-
52
- interface AppQSelectProps {
53
- modelValue: any
54
- options: Option[]
55
- placeholder: string
56
- emptyText: string
57
- optionLabel?: string
58
- optionValue?: string
59
- label?: string
60
- multiple?: boolean
61
- borderColor: string
62
- isDisabled?: boolean
63
- clearable?: boolean
64
- search?: boolean
65
- dataTest?: string
66
- }
67
-
68
- const props = defineProps<AppQSelectProps>()
69
- const select = ref({})
70
- const emit = defineEmits(['update:modelValue'])
71
- const selected = computed({
72
- get() {
73
- return props.modelValue
74
- },
75
- set(value) {
76
- emit('update:modelValue', value)
77
- },
78
- })
79
-
80
- const type = () => {
81
- if (Array.isArray(selected.value) && !selected.value.length) return true
82
- return typeof selected.value === 'string' && !selected.value
83
- }
84
-
85
- const lcText: Ref<string> = ref('')
86
- const filteredOptions = computed(() => {
87
- return props.options.filter(x => x[props?.optionLabel || 'label'].toLowerCase().includes(lcText.value))
88
- })
89
-
90
- function filterFn(val: string, update: (arg0: () => void) => void) {
91
- update(() => {
92
- lcText.value = val.toLowerCase()
93
- })
94
- }
95
- </script>
96
- <style module lang="scss">
97
- .wrap {
98
- position: relative;
99
-
100
- &:global(.--option-tree) {
101
- cursor: pointer;
102
- }
103
- }
104
-
105
- .select {
106
- &:global(.q-field--outlined.q-field--rounded .q-field__control) {
107
- border-radius: 14px;
108
- }
109
- &:global(.q-field--outlined .q-field__control:before) {
110
- border-color: v-bind(borderColor);
111
- }
112
- &:global(.q-select .q-field__input) {
113
- padding: 0 6px;
114
- }
115
- //&:global(.q-field--filled .q-field__control) {
116
- // //color: red;
117
- //}
118
- //&:global(.q-field--filled.q-field--focused .q-field__control) {
119
- //}
120
- //&:global(.q-field--filled .q-field__control:after) {
121
- // left: 8px;
122
- // right: 8px;
123
- //}
124
- &:global(.q-field--outlined .q-item) {
125
- color: #1d1d1d;
126
- position: absolute;
127
- padding: 0 4px;
128
- top: 18px;
129
- left: 0;
130
- }
131
- }
132
-
133
- .append-wrapper {
134
- display: flex;
135
- align-items: center;
136
- column-gap: 4px;
137
- }
138
-
139
- .menu-wrap {
140
- padding: 8px;
141
- }
142
-
143
- .search-wrapper {
144
- position: sticky;
145
- top: 0;
146
- padding: 4px;
147
- background: var(--main-bg);
148
- z-index: 1;
149
- }
150
- .app-select__menu {
151
- border-radius: 14px;
152
- .q-item__label {
153
- word-break: break-word;
154
- }
155
- &:global(.q-menu) {
156
- max-height: 200px !important;
157
- }
158
- }
159
- </style>
1
+ <template>
2
+ <q-select
3
+ ref="select"
4
+ v-model="selected"
5
+ :data-test="dataTest"
6
+ :options="filteredOptions"
7
+ :option-value="optionValue"
8
+ :option-label="optionLabel"
9
+ emit-value
10
+ map-options
11
+ :disable="isDisabled"
12
+ :multiple="multiple"
13
+ outlined
14
+ stack-label
15
+ :use-input="search"
16
+ :class="[$style.select]"
17
+ :label="label"
18
+ input-debounce="100"
19
+ :popup-content-class="$style['app-select__menu']"
20
+ :clearable="clearable"
21
+ rounded
22
+ autocomplete=""
23
+ @filter="filterFn"
24
+ >
25
+ <template v-if="multiple" #selected-item="scope">
26
+ <q-chip
27
+ v-if="scope.opt"
28
+ removable
29
+ class="q-ma-none"
30
+ dense
31
+ :tabindex="scope.tabindex"
32
+ color="white"
33
+ text-color="secondary"
34
+ @remove="scope.removeAtIndex(scope.index)"
35
+ >
36
+ {{ scope.opt[`${optionLabel}`] }}
37
+ </q-chip>
38
+ </template>
39
+ <template #no-option>
40
+ <q-item>{{ emptyText }}</q-item>
41
+ </template>
42
+ <q-item v-if="!lcText && type()">{{ placeholder }}</q-item>
43
+ </q-select>
44
+ </template>
45
+ <script setup lang="ts">
46
+ import { computed, defineEmits, defineProps, ref, Ref } from 'vue'
47
+
48
+ import { QSelect } from 'quasar'
49
+
50
+ type Option = Record<string, any>
51
+
52
+ interface AppQSelectProps {
53
+ modelValue: any
54
+ options: Option[]
55
+ placeholder: string
56
+ emptyText: string
57
+ optionLabel?: string
58
+ optionValue?: string
59
+ label?: string
60
+ multiple?: boolean
61
+ borderColor: string
62
+ isDisabled?: boolean
63
+ clearable?: boolean
64
+ search?: boolean
65
+ dataTest?: string
66
+ }
67
+
68
+ const props = defineProps<AppQSelectProps>()
69
+ const select = ref({})
70
+ const emit = defineEmits(['update:modelValue'])
71
+ const selected = computed({
72
+ get() {
73
+ return props.modelValue
74
+ },
75
+ set(value) {
76
+ emit('update:modelValue', value)
77
+ },
78
+ })
79
+
80
+ const type = () => {
81
+ if (Array.isArray(selected.value) && !selected.value.length) return true
82
+ return typeof selected.value === 'string' && !selected.value
83
+ }
84
+
85
+ const lcText: Ref<string> = ref('')
86
+ const filteredOptions = computed(() => {
87
+ return props.options.filter(x => x[props?.optionLabel || 'label'].toLowerCase().includes(lcText.value))
88
+ })
89
+
90
+ function filterFn(val: string, update: (arg0: () => void) => void) {
91
+ update(() => {
92
+ lcText.value = val.toLowerCase()
93
+ })
94
+ }
95
+ </script>
96
+ <style module lang="scss">
97
+ .wrap {
98
+ position: relative;
99
+
100
+ &:global(.--option-tree) {
101
+ cursor: pointer;
102
+ }
103
+ }
104
+
105
+ .select {
106
+ &:global(.q-field--outlined.q-field--rounded .q-field__control) {
107
+ border-radius: 14px;
108
+ }
109
+ &:global(.q-field--outlined .q-field__control:before) {
110
+ border-color: v-bind(borderColor);
111
+ }
112
+ &:global(.q-select .q-field__input) {
113
+ padding: 0 6px;
114
+ }
115
+ //&:global(.q-field--filled .q-field__control) {
116
+ // //color: red;
117
+ //}
118
+ //&:global(.q-field--filled.q-field--focused .q-field__control) {
119
+ //}
120
+ //&:global(.q-field--filled .q-field__control:after) {
121
+ // left: 8px;
122
+ // right: 8px;
123
+ //}
124
+ &:global(.q-field--outlined .q-item) {
125
+ color: #1d1d1d;
126
+ position: absolute;
127
+ padding: 0 4px;
128
+ top: 18px;
129
+ left: 0;
130
+ }
131
+ }
132
+
133
+ .append-wrapper {
134
+ display: flex;
135
+ align-items: center;
136
+ column-gap: 4px;
137
+ }
138
+
139
+ .menu-wrap {
140
+ padding: 8px;
141
+ }
142
+
143
+ .search-wrapper {
144
+ position: sticky;
145
+ top: 0;
146
+ padding: 4px;
147
+ background: var(--main-bg);
148
+ z-index: 1;
149
+ }
150
+ .app-select__menu {
151
+ border-radius: 14px;
152
+ .q-item__label {
153
+ word-break: break-word;
154
+ }
155
+ &:global(.q-menu) {
156
+ max-height: 200px !important;
157
+ }
158
+ }
159
+ </style>
@@ -0,0 +1,155 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import AppSelect from '@/common/app-select/AppSelect.vue'
3
+
4
+ const SAMPLE_OPTIONS = [
5
+ { id: 1, name: 'Проект Альфа', category: 'Проекты' },
6
+ { id: 2, name: 'Ремонт №42', category: 'Ремонты' },
7
+ { id: 3, name: 'Инструмент XYZ', category: 'Инструменты' },
8
+ { id: 4, name: 'Объект "Центр"', category: 'Объекты' },
9
+ { id: 5, name: 'Статус: Готов', category: 'Статусы' },
10
+ ]
11
+
12
+ const meta: Meta<typeof AppSelect> = {
13
+ title: 'Components/AppSelect',
14
+ component: AppSelect,
15
+ tags: ['autodocs'],
16
+ argTypes: {
17
+ modelValue: {
18
+ control: 'object',
19
+ description: 'Выбранное значение (или массив при multiple).',
20
+ },
21
+ options: {
22
+ control: 'object',
23
+ description: 'Массив опций. Каждая опция — объект с полями, указанными в optionLabel/optionValue.',
24
+ },
25
+ label: {
26
+ control: 'text',
27
+ description: 'Подпись над селектом.',
28
+ },
29
+ placeholder: {
30
+ control: 'text',
31
+ },
32
+ emptyText: {
33
+ control: 'text',
34
+ description: 'Текст, отображаемый, если опции не найдены при поиске.',
35
+ },
36
+
37
+ multiple: {
38
+ control: 'boolean',
39
+ description: 'Множественный выбор.',
40
+ table: { category: '⚙️ Поведение' },
41
+ },
42
+ search: {
43
+ control: 'boolean',
44
+ description: 'Включить поиск по опциям.',
45
+ table: { category: '⚙️ Поведение' },
46
+ },
47
+ clearable: {
48
+ control: 'boolean',
49
+ description: 'Показывать крестик для сброса значения.',
50
+ table: { category: '⚙️ Поведение' },
51
+ },
52
+ isDisabled: {
53
+ control: 'boolean',
54
+ description: 'Отключить селект.',
55
+ table: { category: '⚙️ Поведение' },
56
+ },
57
+
58
+ optionLabel: {
59
+ control: 'text',
60
+ description: 'Ключ объекта опции, используемый как отображаемый текст (по умолчанию "label").',
61
+ table: { category: 'Опции' },
62
+ },
63
+ optionValue: {
64
+ control: 'text',
65
+ description: 'Ключ объекта опции, используемый как значение (по умолчанию сам объект).',
66
+ table: { category: 'Опции' },
67
+ },
68
+
69
+ borderColor: {
70
+ control: 'color',
71
+ description: 'Цвет обводки (в HEX/RGB).',
72
+ },
73
+ dataTest: {
74
+ control: 'text',
75
+ },
76
+ },
77
+ args: {
78
+ modelValue: null,
79
+ options: SAMPLE_OPTIONS,
80
+ label: 'Выберите элемент',
81
+ placeholder: 'Начните ввод...',
82
+ emptyText: 'Ничего не найдено',
83
+ optionLabel: 'name',
84
+ optionValue: 'id',
85
+ multiple: false,
86
+ search: true,
87
+ clearable: true,
88
+ isDisabled: false,
89
+ borderColor: '#007BFF',
90
+ dataTest: 'app-select',
91
+ },
92
+ }
93
+
94
+ export default meta
95
+
96
+ type Story = StoryObj<typeof AppSelect>
97
+
98
+ export const Default: Story = {}
99
+
100
+ export const States: Story = {
101
+ render: () => ({
102
+ components: { AppSelect },
103
+ template: `
104
+ <div style="display: flex; flex-direction: column; gap: 24px;">
105
+ <AppSelect
106
+ v-model="value1"
107
+ :options="options"
108
+ label="Обычный"
109
+ placeholder="Выберите..."
110
+ :option-label="'name'"
111
+ :option-value="'id'"
112
+ empty-text="Нет данных"
113
+ />
114
+ <AppSelect
115
+ v-model="value2"
116
+ :options="options"
117
+ label="С поиском"
118
+ placeholder="Начните ввод..."
119
+ :search="true"
120
+ :option-label="'name'"
121
+ :option-value="'id'"
122
+ empty-text="Нет данных"
123
+ />
124
+ <AppSelect
125
+ v-model="value3"
126
+ :options="options"
127
+ label="Множественный"
128
+ placeholder="Выберите несколько..."
129
+ :multiple="true"
130
+ :option-label="'name'"
131
+ :option-value="'id'"
132
+ empty-text="Нет данных"
133
+ />
134
+ <AppSelect
135
+ v-model="value4"
136
+ :options="options"
137
+ label="Отключён"
138
+ :is-disabled="true"
139
+ :option-label="'name'"
140
+ :option-value="'id'"
141
+ empty-text="Нет данных"
142
+ />
143
+ </div>
144
+ `,
145
+ data() {
146
+ return {
147
+ options: SAMPLE_OPTIONS,
148
+ value1: 1,
149
+ value2: null,
150
+ value3: [2, 4],
151
+ value4: 3,
152
+ }
153
+ },
154
+ }),
155
+ }