@inriver/inri 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/.eslintrc.js +5 -0
- package/componentProperties.d.ts +8 -0
- package/configs/base-eslint-config.js +36 -0
- package/configs/base-tailwind-config.js +149 -0
- package/i18n.ts +11 -0
- package/index.ts +25 -0
- package/package.json +36 -0
- package/src/components/CAutoBreadcrumbs.vue +72 -0
- package/src/components/CBtn.vue +98 -0
- package/src/components/CColorPicker.vue +55 -0
- package/src/components/CContextMenu.vue +29 -0
- package/src/components/CDatePicker.vue +51 -0
- package/src/components/CDeleteTileBtn.vue +52 -0
- package/src/components/CDialog.vue +253 -0
- package/src/components/CDialogCloseBtn.vue +9 -0
- package/src/components/CDirtyCheck.vue +68 -0
- package/src/components/CDrawer.vue +44 -0
- package/src/components/CDrawerButton.vue +91 -0
- package/src/components/CExpansionItem.vue +57 -0
- package/src/components/CExpansionItemWithCheckbox.vue +41 -0
- package/src/components/CFileDropzone.vue +114 -0
- package/src/components/CGrid.vue +101 -0
- package/src/components/CHeader.vue +10 -0
- package/src/components/CHeaderLinks.vue +61 -0
- package/src/components/CHeaderMenuLink.vue +51 -0
- package/src/components/CHeaderSearch.vue +142 -0
- package/src/components/CIconBtn.vue +70 -0
- package/src/components/CMenuItem.vue +66 -0
- package/src/components/CPageContainer.vue +11 -0
- package/src/components/CPageError.vue +24 -0
- package/src/components/CPageSpinner.vue +18 -0
- package/src/components/CSearch.vue +45 -0
- package/src/components/CSection.vue +29 -0
- package/src/components/CSectionTitle.vue +8 -0
- package/src/components/CSelect.vue +208 -0
- package/src/components/CSlideEffect.vue +62 -0
- package/src/components/CSpinner.vue +107 -0
- package/src/components/CTableActions.vue +16 -0
- package/src/components/CTileBtn.vue +178 -0
- package/src/components/CTimePicker.vue +42 -0
- package/src/components/CToggleGridView.vue +26 -0
- package/src/components/CToggleSidebarBtn.vue +19 -0
- package/src/components/CTooltip.vue +44 -0
- package/src/components/CTreeNode.vue +39 -0
- package/src/components/cards/CBannerCard.vue +103 -0
- package/src/components/cards/CSmallCard.vue +149 -0
- package/src/components/internal-components/ConfirmDialog.vue +78 -0
- package/src/composables/useDialog.ts +47 -0
- package/src/composables/useDirtyCheck.ts +25 -0
- package/src/composables/useDoubleClickListener.ts +28 -0
- package/src/composables/useSelectable.ts +62 -0
- package/src/composables/useTruncateChips.ts +46 -0
- package/src/i18n/de/index.ts +17 -0
- package/src/i18n/en/index.ts +84 -0
- package/src/i18n/es/index.ts +7 -0
- package/src/i18n/fr/index.ts +7 -0
- package/src/init/initInriFramework.ts +25 -0
- package/src/init/useInriApp.ts +55 -0
- package/src/layouts/CLayoutBlank.vue +7 -0
- package/src/layouts/CLayoutWithBackButton.vue +50 -0
- package/src/layouts/CLayoutWithSidebars.vue +46 -0
- package/src/layouts/layout-fragments/CPageAutoBreadcrumbs.vue +6 -0
- package/src/layouts/layout-fragments/CPageBackButton.vue +18 -0
- package/src/layouts/layout-fragments/CPageBlank.vue +20 -0
- package/src/layouts/layout-fragments/CPageFlexCol.vue +5 -0
- package/src/layouts/layout-fragments/CPageLeftSidebar.vue +5 -0
- package/src/layouts/layout-fragments/CPageMainContent.vue +5 -0
- package/src/layouts/layout-fragments/CPageOuterWrapper.vue +5 -0
- package/src/layouts/layout-fragments/CPageRightSidebar.vue +5 -0
- package/src/layouts/layout-fragments/CPageTitle.vue +34 -0
- package/src/plugins/dialog.ts +45 -0
- package/src/plugins/errors/ErrorFactories.ts +59 -0
- package/src/plugins/errors/Errors.ts +156 -0
- package/src/plugins/errors/Exception.ts +6 -0
- package/src/plugins/errors/globalErrorHandler.ts +21 -0
- package/src/plugins/errors/handleError.ts +34 -0
- package/src/plugins/errors/logger.ts +16 -0
- package/src/plugins/errors/vueErrorHandler.ts +26 -0
- package/src/plugins/globalAppConfig.ts +25 -0
- package/src/plugins/i18n.ts +46 -0
- package/src/plugins/inriIcons.ts +58 -0
- package/src/plugins/inriverQuasarComponentConfigurations.ts +67 -0
- package/src/plugins/library.ts +119 -0
- package/src/plugins/notify.ts +153 -0
- package/src/plugins/quasar-user-options.ts +19 -0
- package/src/plugins/validationRules.ts +292 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/stores/inriStore.ts +54 -0
- package/src/stores/interfaceLanguageStore.ts +27 -0
- package/src/styles/_css-variables.scss +101 -0
- package/src/styles/_reset.scss +67 -0
- package/src/styles/_transitions.scss +9 -0
- package/src/styles/_utils.scss +15 -0
- package/src/styles/components/_breadcrumbs.scss +3 -0
- package/src/styles/components/_checkboxes.scss +17 -0
- package/src/styles/components/_chips.scss +17 -0
- package/src/styles/components/_forms.scss +203 -0
- package/src/styles/components/_menu.scss +12 -0
- package/src/styles/components/_notifications.scss +24 -0
- package/src/styles/components/_q-editor.scss +14 -0
- package/src/styles/components/_radio-buttons.scss +17 -0
- package/src/styles/components/_tables.scss +92 -0
- package/src/styles/components/_tooltips.scss +5 -0
- package/src/styles/components/_tree.scss +86 -0
- package/src/styles/components/_truncated-chips.scss +39 -0
- package/src/styles/main.scss +45 -0
- package/src/styles/quasar.variables.scss +50 -0
- package/src/typings.d.ts +70 -0
- package/src/utils/colorUtils.ts +73 -0
- package/src/utils/errorUtils.ts +37 -0
- package/src/utils/fileUtils.ts +57 -0
- package/src/utils/helpers.ts +6 -0
- package/src/utils/routeUtils.ts +23 -0
- package/tsconfig.json +37 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentCustomProperties as inriComponentCustomProperties } from './src/typings'
|
|
2
|
+
|
|
3
|
+
declare module '@vue/runtime-core' {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
5
|
+
export interface ComponentCustomProperties extends inriComponentCustomProperties {}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export {}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true,
|
|
5
|
+
},
|
|
6
|
+
extends: [
|
|
7
|
+
'plugin:vue/vue3-recommended',
|
|
8
|
+
'@vue/standard',
|
|
9
|
+
'@vue/typescript/recommended',
|
|
10
|
+
],
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaVersion: 2020,
|
|
13
|
+
},
|
|
14
|
+
globals: {
|
|
15
|
+
defineProps: 'readonly',
|
|
16
|
+
defineEmits: 'readonly',
|
|
17
|
+
defineExpose: 'readonly',
|
|
18
|
+
withDefaults: 'readonly',
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
22
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
23
|
+
'comma-dangle': ['error', 'always-multiline'],
|
|
24
|
+
curly: ['error', 'all'],
|
|
25
|
+
'brace-style': ['error', '1tbs'],
|
|
26
|
+
'object-property-newline': ['error', { allowAllPropertiesOnSameLine: false }],
|
|
27
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
28
|
+
'@typescript-eslint/ban-types': 'off',
|
|
29
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
30
|
+
'vue/object-curly-spacing': ['error', 'always'],
|
|
31
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
32
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
33
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
34
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
35
|
+
},
|
|
36
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preflight: false,
|
|
3
|
+
darkMode: false,
|
|
4
|
+
theme: {
|
|
5
|
+
extend: {
|
|
6
|
+
zIndex: {
|
|
7
|
+
'-1': '-1',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
colors: {
|
|
11
|
+
current: 'currentColor',
|
|
12
|
+
|
|
13
|
+
grey: 'var(--color-grey)',
|
|
14
|
+
'grey-light': 'var(--color-grey-light)',
|
|
15
|
+
'grey-lighter': 'var(--color-grey-lighter)',
|
|
16
|
+
'grey-dark': 'var(--color-grey-dark)',
|
|
17
|
+
'grey-darker': 'var(--color-grey-darker)',
|
|
18
|
+
'grey-darkest': 'var(--color-grey-darkest)',
|
|
19
|
+
|
|
20
|
+
blue: 'var(--color-blue)',
|
|
21
|
+
'blue-light': 'var(--color-blue-light)',
|
|
22
|
+
purple: 'var(--color-purple)',
|
|
23
|
+
'purple-light': 'var(--color-purple-light)',
|
|
24
|
+
red: 'var(--color-red)',
|
|
25
|
+
'red-light': 'var(--color-red-light)',
|
|
26
|
+
orange: 'var(--color-orange)',
|
|
27
|
+
'orange-light': 'var(--color-orange-light)',
|
|
28
|
+
yellow: 'var(--color-yellow)',
|
|
29
|
+
'yellow-light': 'var(--color-yellow-light)',
|
|
30
|
+
green: 'var(--color-green)',
|
|
31
|
+
'green-light': 'var(--color-green-light)',
|
|
32
|
+
'green-light-30': 'var(--color-green-light-30)',
|
|
33
|
+
|
|
34
|
+
primary: 'var(--q-primary)',
|
|
35
|
+
'on-primary': 'var(--on-primary-color)',
|
|
36
|
+
'on-primary-alt': 'var(--on-primary-alt-color)',
|
|
37
|
+
'primary-effect': 'var(--primary-effect-color)',
|
|
38
|
+
|
|
39
|
+
secondary: 'var(--q-secondary)',
|
|
40
|
+
'on-secondary': 'var(--on-secondary-color)',
|
|
41
|
+
'on-secondary-alt': 'var(--on-secondary-alt-color)',
|
|
42
|
+
'secondary-effect': 'var(--secondary-effect-color)',
|
|
43
|
+
|
|
44
|
+
accent: 'var(--q-accent)',
|
|
45
|
+
'on-accent': 'var(--on-accent-color)',
|
|
46
|
+
'on-accent-alt': 'var(--on-accent-alt-color)',
|
|
47
|
+
'accent-effect': 'var(--accent-effect-color)',
|
|
48
|
+
|
|
49
|
+
surface: 'var(--surface-color)',
|
|
50
|
+
'on-surface': 'var(--on-surface-color)',
|
|
51
|
+
'surface-effect': 'var(--surface-effect-color)',
|
|
52
|
+
'surface-border': 'var(--surface-border-color)',
|
|
53
|
+
|
|
54
|
+
// Color aliases
|
|
55
|
+
'border-default': 'var(--color-border)',
|
|
56
|
+
},
|
|
57
|
+
// Make sure that these match the Quasar breakpoints
|
|
58
|
+
screens: {
|
|
59
|
+
sm: '600px',
|
|
60
|
+
md: '1024px',
|
|
61
|
+
lg: '1440px',
|
|
62
|
+
xl: '1920px',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
variants: {
|
|
66
|
+
extend: {},
|
|
67
|
+
},
|
|
68
|
+
plugins: [],
|
|
69
|
+
|
|
70
|
+
// These are colors that can be used by Quasar, but are generated at runtime. These must always be included.
|
|
71
|
+
// For example color="blue-light" will generate "bg-blue-light" so it has to be included in this list.
|
|
72
|
+
safelist: [
|
|
73
|
+
'bg-grey-light',
|
|
74
|
+
'bg-grey-lighter',
|
|
75
|
+
'bg-grey-dark',
|
|
76
|
+
'bg-grey-darker',
|
|
77
|
+
'bg-grey-darkest',
|
|
78
|
+
|
|
79
|
+
'text-grey-light',
|
|
80
|
+
'text-grey-lighter',
|
|
81
|
+
'text-grey-dark',
|
|
82
|
+
'text-grey-darker',
|
|
83
|
+
'text-grey-darkest',
|
|
84
|
+
|
|
85
|
+
'bg-blue-light',
|
|
86
|
+
'bg-purple-light',
|
|
87
|
+
'bg-red-light',
|
|
88
|
+
'bg-orange-light',
|
|
89
|
+
'bg-yellow-light',
|
|
90
|
+
'bg-green-light',
|
|
91
|
+
'bg-green-light-30',
|
|
92
|
+
|
|
93
|
+
'text-blue-light',
|
|
94
|
+
'text-purple-light',
|
|
95
|
+
'text-red-light',
|
|
96
|
+
'text-orange-light',
|
|
97
|
+
'text-yellow-light',
|
|
98
|
+
'text-green-light',
|
|
99
|
+
|
|
100
|
+
'bg-on-primary',
|
|
101
|
+
'bg-on-primary-alt',
|
|
102
|
+
'bg-primary-effect',
|
|
103
|
+
'bg-on-secondary',
|
|
104
|
+
'bg-on-secondary-alt',
|
|
105
|
+
'bg-secondary-effect',
|
|
106
|
+
'bg-on-accent',
|
|
107
|
+
'bg-on-accent-alt',
|
|
108
|
+
'bg-accent-effect',
|
|
109
|
+
'bg-on-surface',
|
|
110
|
+
'bg-surface-effect',
|
|
111
|
+
|
|
112
|
+
'text-on-primary',
|
|
113
|
+
'text-on-primary-alt',
|
|
114
|
+
'text-primary-effect',
|
|
115
|
+
'text-on-secondary',
|
|
116
|
+
'text-on-secondary-alt',
|
|
117
|
+
'text-secondary-effect',
|
|
118
|
+
'text-on-accent',
|
|
119
|
+
'text-on-accent-alt',
|
|
120
|
+
'text-accent-effect',
|
|
121
|
+
'text-on-surface',
|
|
122
|
+
'text-surface-effect',
|
|
123
|
+
],
|
|
124
|
+
|
|
125
|
+
// These are already included in Quasar so we don't have to create them again
|
|
126
|
+
blocklist: [
|
|
127
|
+
'bg-primary',
|
|
128
|
+
'bg-secondary',
|
|
129
|
+
'bg-accent',
|
|
130
|
+
'bg-grey',
|
|
131
|
+
'bg-blue',
|
|
132
|
+
'bg-purple',
|
|
133
|
+
'bg-red',
|
|
134
|
+
'bg-orange',
|
|
135
|
+
'bg-yellow',
|
|
136
|
+
'bg-green',
|
|
137
|
+
|
|
138
|
+
'text-primary',
|
|
139
|
+
'text-secondary',
|
|
140
|
+
'text-accent',
|
|
141
|
+
'text-grey',
|
|
142
|
+
'text-blue',
|
|
143
|
+
'text-purple',
|
|
144
|
+
'text-red',
|
|
145
|
+
'text-orange',
|
|
146
|
+
'text-yellow',
|
|
147
|
+
'text-green',
|
|
148
|
+
],
|
|
149
|
+
}
|
package/i18n.ts
ADDED
package/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useInriStore } from './src/stores/inriStore'
|
|
2
|
+
import { useInterfaceLanguageStore } from './src/stores/interfaceLanguageStore'
|
|
3
|
+
import useInriApp from './src/init/useInriApp'
|
|
4
|
+
import { initInriFramework } from './src/init/initInriFramework'
|
|
5
|
+
import dialog from './src/plugins/dialog'
|
|
6
|
+
import notify from './src/plugins/notify'
|
|
7
|
+
import useSelectable from './src/composables/useSelectable'
|
|
8
|
+
import { useDialog } from './src/composables/useDialog'
|
|
9
|
+
import { useDoubleClickListener } from './src/composables/useDoubleClickListener'
|
|
10
|
+
import { useDirtyCheck } from './src/composables/useDirtyCheck'
|
|
11
|
+
import { useTruncateChips } from './src/composables/useTruncateChips'
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
useInriStore,
|
|
15
|
+
useInterfaceLanguageStore,
|
|
16
|
+
useInriApp,
|
|
17
|
+
initInriFramework,
|
|
18
|
+
dialog,
|
|
19
|
+
notify,
|
|
20
|
+
useSelectable,
|
|
21
|
+
useDialog,
|
|
22
|
+
useDoubleClickListener,
|
|
23
|
+
useDirtyCheck,
|
|
24
|
+
useTruncateChips,
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inriver/inri",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"quasar": "^2.7.4",
|
|
6
|
+
"vue": "^3.2.12",
|
|
7
|
+
"vue-i18n": "^9.1.7",
|
|
8
|
+
"vue-router": "^4.0.12"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
|
12
|
+
"@typescript-eslint/parser": "^4.18.0",
|
|
13
|
+
"@vue/cli-plugin-babel": "~4.5.15",
|
|
14
|
+
"@vue/cli-plugin-eslint": "~4.5.15",
|
|
15
|
+
"@vue/cli-plugin-router": "~4.5.15",
|
|
16
|
+
"@vue/cli-plugin-typescript": "~4.5.15",
|
|
17
|
+
"@vue/cli-service": "~4.5.15",
|
|
18
|
+
"@vue/compiler-sfc": "^3.2.12",
|
|
19
|
+
"@vue/eslint-config-standard": "^5.1.2",
|
|
20
|
+
"@vue/eslint-config-typescript": "^7.0.0",
|
|
21
|
+
"eslint": "^6.7.2",
|
|
22
|
+
"eslint-plugin-import": "^2.20.2",
|
|
23
|
+
"eslint-plugin-node": "^11.1.0",
|
|
24
|
+
"eslint-plugin-promise": "^4.2.1",
|
|
25
|
+
"eslint-plugin-standard": "^4.0.0",
|
|
26
|
+
"eslint-plugin-vue": "^7.0.0",
|
|
27
|
+
"lint-staged": "^9.5.0",
|
|
28
|
+
"sass": "1.32.12",
|
|
29
|
+
"sass-loader": "^10.1.0",
|
|
30
|
+
"stylelint": "^13.13.1",
|
|
31
|
+
"stylelint-config-standard": "^22.0.0",
|
|
32
|
+
"stylelint-webpack-plugin": "^3.0.1",
|
|
33
|
+
"typescript": "~4.1.5",
|
|
34
|
+
"vue-cli-plugin-quasar": "~4.0.4"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-breadcrumbs
|
|
3
|
+
separator=">"
|
|
4
|
+
separator-color="grey"
|
|
5
|
+
active-color="grey-darkest"
|
|
6
|
+
>
|
|
7
|
+
<q-breadcrumbs-el
|
|
8
|
+
v-for="breadcrumb in breadcrumbs"
|
|
9
|
+
:key="breadcrumb.to.name"
|
|
10
|
+
:to="breadcrumb.to"
|
|
11
|
+
:label="breadcrumb.text"
|
|
12
|
+
/>
|
|
13
|
+
<q-breadcrumbs-el
|
|
14
|
+
v-if="currentBreadcrumb"
|
|
15
|
+
:label="currentBreadcrumb"
|
|
16
|
+
class="font-bold"
|
|
17
|
+
/>
|
|
18
|
+
</q-breadcrumbs>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { ref, onMounted } from 'vue'
|
|
23
|
+
import { getRouteTitle } from '../utils/routeUtils'
|
|
24
|
+
import { useRouter, RouteRecordNormalized, RouteLocationNormalizedLoaded, RouteRecordName } from 'vue-router'
|
|
25
|
+
|
|
26
|
+
interface Breadcrumb {
|
|
27
|
+
text: string,
|
|
28
|
+
to: {
|
|
29
|
+
name?: RouteRecordName
|
|
30
|
+
},
|
|
31
|
+
exact: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const breadcrumbs = ref<Breadcrumb[]>([])
|
|
35
|
+
const parentRoutes = ref<RouteRecordNormalized[]>([])
|
|
36
|
+
const currentBreadcrumb = ref<string>()
|
|
37
|
+
const router = useRouter()
|
|
38
|
+
|
|
39
|
+
onMounted(() => {
|
|
40
|
+
generateBreadcrumbs(router.currentRoute.value)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
function addParentRoutes (routeName: string) {
|
|
44
|
+
const parentRoute = router.getRoutes().find(route => route.name === routeName)
|
|
45
|
+
|
|
46
|
+
if (parentRoute) {
|
|
47
|
+
parentRoutes.value.push(parentRoute)
|
|
48
|
+
|
|
49
|
+
if (parentRoute.meta.parent) {
|
|
50
|
+
addParentRoutes(parentRoute.meta.parent as string)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function generateBreadcrumbs (to: RouteLocationNormalizedLoaded) {
|
|
56
|
+
if (to.meta.parent) {
|
|
57
|
+
addParentRoutes(to.meta.parent as string)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (parentRoutes.value.length) {
|
|
61
|
+
breadcrumbs.value = parentRoutes.value.reverse().map(foundRoute => {
|
|
62
|
+
return {
|
|
63
|
+
text: getRouteTitle(foundRoute, to),
|
|
64
|
+
to: { name: foundRoute.name },
|
|
65
|
+
exact: true,
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
currentBreadcrumb.value = getRouteTitle(to, to)
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-btn
|
|
3
|
+
v-bind="$inri.button"
|
|
4
|
+
:color="color"
|
|
5
|
+
:label="label"
|
|
6
|
+
:disable="disable"
|
|
7
|
+
class="group overflow-hidden"
|
|
8
|
+
>
|
|
9
|
+
<template #loading>
|
|
10
|
+
<c-spinner
|
|
11
|
+
size="28"
|
|
12
|
+
:parent-color="color"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<c-slide-effect
|
|
17
|
+
v-if="!disable"
|
|
18
|
+
:parent-color="color"
|
|
19
|
+
:slide-effect-color="slideEffectColor"
|
|
20
|
+
slide-right
|
|
21
|
+
class="-z-1"
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<slot />
|
|
25
|
+
|
|
26
|
+
<c-tooltip v-if="tooltip">
|
|
27
|
+
{{ tooltip }}
|
|
28
|
+
</c-tooltip>
|
|
29
|
+
</q-btn>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
defineProps({
|
|
34
|
+
label: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: undefined,
|
|
37
|
+
},
|
|
38
|
+
color: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'primary',
|
|
41
|
+
},
|
|
42
|
+
slideEffectColor: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: undefined,
|
|
45
|
+
},
|
|
46
|
+
disable: Boolean,
|
|
47
|
+
tooltip: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: undefined,
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style lang="scss">
|
|
55
|
+
.c-btn {
|
|
56
|
+
height: 40px;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
padding: 4px 56px !important;
|
|
59
|
+
|
|
60
|
+
&.disabled {
|
|
61
|
+
opacity: 0.3 !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.q-icon {
|
|
65
|
+
font-size: 1rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.q-focus-helper {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.bg-primary {
|
|
73
|
+
color: var(--on-primary-color);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.bg-secondary {
|
|
77
|
+
color: var(--on-secondary-color);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.bg-accent {
|
|
81
|
+
color: var(--on-accent-color);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.bg-surface {
|
|
85
|
+
color: var(--on-surface-color);
|
|
86
|
+
border: 1px solid var(--surface-border-color);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Special css for specific colors
|
|
90
|
+
&.bg-white {
|
|
91
|
+
border: 1px solid var(--color-grey);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.bg-black {
|
|
95
|
+
color: white;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label
|
|
3
|
+
tabindex="0"
|
|
4
|
+
class="flex items-center cursor-pointer h-10 group max-w-max"
|
|
5
|
+
:class="{ 'cursor-not-allowed text-grey-dark': disabled }"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="rounded-full h-[30px] w-[30px] mr-2"
|
|
9
|
+
:class="{ 'border': border }"
|
|
10
|
+
:style="{ background: modelValue }"
|
|
11
|
+
/>
|
|
12
|
+
<span>{{ (!staticLabel ? modelValue?.toLowerCase() : false) || label || 'not selected' }}</span>
|
|
13
|
+
<q-icon
|
|
14
|
+
v-if="clearable && modelValue && !disabled"
|
|
15
|
+
name="mdi-close"
|
|
16
|
+
color="grey-darker"
|
|
17
|
+
class="cursor-pointer ml-2 opacity-0 group-hover:opacity-100"
|
|
18
|
+
size="18px"
|
|
19
|
+
@click.stop="$emit('update:model-value', null)"
|
|
20
|
+
/>
|
|
21
|
+
<q-menu v-if="!disabled">
|
|
22
|
+
<q-color
|
|
23
|
+
:model-value="modelValue"
|
|
24
|
+
no-header-tabs
|
|
25
|
+
no-footer
|
|
26
|
+
style="width: 290px;"
|
|
27
|
+
@update:model-value="$emit('update:model-value', $event)"
|
|
28
|
+
/>
|
|
29
|
+
</q-menu>
|
|
30
|
+
<slot />
|
|
31
|
+
</label>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { computed } from 'vue'
|
|
36
|
+
|
|
37
|
+
defineEmits(['update:model-value'])
|
|
38
|
+
|
|
39
|
+
const props = defineProps({
|
|
40
|
+
modelValue: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: undefined,
|
|
43
|
+
},
|
|
44
|
+
label: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: undefined,
|
|
47
|
+
},
|
|
48
|
+
staticLabel: Boolean,
|
|
49
|
+
clearable: Boolean,
|
|
50
|
+
disabled: Boolean,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
// Show a border if no value or fully white
|
|
54
|
+
const border = computed(() => (!props.modelValue || props.modelValue.toLowerCase() === '#ffffff') ? 'border border-grey-dark' : '')
|
|
55
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<c-icon-btn
|
|
3
|
+
data-id="context-menu-btn"
|
|
4
|
+
icon="mdi-dots-vertical"
|
|
5
|
+
:tooltip-right="tooltip || $t('inri.common.more')"
|
|
6
|
+
@click.prevent
|
|
7
|
+
>
|
|
8
|
+
<q-menu>
|
|
9
|
+
<q-list class="menu-list pb-0">
|
|
10
|
+
<slot />
|
|
11
|
+
</q-list>
|
|
12
|
+
</q-menu>
|
|
13
|
+
</c-icon-btn>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
defineProps({
|
|
18
|
+
tooltip: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: undefined,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style scoped lang="scss">
|
|
26
|
+
.menu-list {
|
|
27
|
+
min-width: 146px;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-input
|
|
3
|
+
v-bind="dense ? $inri.inputDense : $inri.input"
|
|
4
|
+
:model-value="modelValue"
|
|
5
|
+
:label="label"
|
|
6
|
+
:stack-label="datePickerIsOpen"
|
|
7
|
+
mask="date"
|
|
8
|
+
:rules="modelValue ? ['date'] : undefined"
|
|
9
|
+
@update:model-value="$emit('update:model-value', $event)"
|
|
10
|
+
>
|
|
11
|
+
<template #append>
|
|
12
|
+
<q-icon
|
|
13
|
+
ref="icon"
|
|
14
|
+
name="mdi-calendar-outline"
|
|
15
|
+
class="cursor-pointer"
|
|
16
|
+
color="grey-dark"
|
|
17
|
+
size="19px"
|
|
18
|
+
@click="datePickerIsOpen = true"
|
|
19
|
+
/>
|
|
20
|
+
</template>
|
|
21
|
+
<q-menu
|
|
22
|
+
v-model="datePickerIsOpen"
|
|
23
|
+
no-parent-event
|
|
24
|
+
>
|
|
25
|
+
<q-date
|
|
26
|
+
:model-value="modelValue"
|
|
27
|
+
@update:model-value="$emit('update:model-value', $event)"
|
|
28
|
+
/>
|
|
29
|
+
</q-menu>
|
|
30
|
+
</q-input>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import { ref } from 'vue'
|
|
35
|
+
|
|
36
|
+
defineEmits(['update:model-value'])
|
|
37
|
+
|
|
38
|
+
defineProps({
|
|
39
|
+
modelValue: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: undefined,
|
|
42
|
+
},
|
|
43
|
+
label: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: undefined,
|
|
46
|
+
},
|
|
47
|
+
dense: Boolean,
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const datePickerIsOpen = ref(false)
|
|
51
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<c-tile-btn
|
|
3
|
+
data-id="delete-btn"
|
|
4
|
+
v-bind="computedTooltip"
|
|
5
|
+
icon="mdi-delete-outline"
|
|
6
|
+
slide-effect-color="red-light"
|
|
7
|
+
icon-size="20"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { computed } from 'vue'
|
|
13
|
+
import { useI18n } from 'vue-i18n'
|
|
14
|
+
|
|
15
|
+
const { t } = useI18n()
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
tooltip: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: undefined,
|
|
21
|
+
},
|
|
22
|
+
tooltipLeft: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: undefined,
|
|
25
|
+
},
|
|
26
|
+
tooltipRight: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: undefined,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const computedTooltip = computed(() => {
|
|
33
|
+
if (props.tooltip) {
|
|
34
|
+
return {
|
|
35
|
+
tooltip: props.tooltip,
|
|
36
|
+
}
|
|
37
|
+
} else if (props.tooltipRight) {
|
|
38
|
+
return {
|
|
39
|
+
tooltipRight: props.tooltipRight,
|
|
40
|
+
}
|
|
41
|
+
} else if (props.tooltipLeft) {
|
|
42
|
+
return {
|
|
43
|
+
tooltipLeft: props.tooltipLeft,
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Default is just "delete" to the left
|
|
48
|
+
return {
|
|
49
|
+
tooltipLeft: t('inri.common.delete'),
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
</script>
|