@ternarytech-io/gears-ui 0.4.0 → 0.6.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/README.md +6 -4
- package/package.json +122 -117
- package/src/components/TButtonGroup.vue +48 -0
- package/src/components/TDropdown.vue +5 -35
- package/src/components/TLightbox.vue +101 -0
- package/src/components/TPdfViewer.vue +255 -0
- package/src/components/TSeparator.vue +37 -5
- package/src/components/TSplitButton.vue +54 -0
- package/src/components/TStatCard.vue +69 -56
- package/src/components/TTimeInput.vue +159 -0
- package/src/components/TToaster.vue +38 -7
- package/src/components/internal/DropdownItems.vue +49 -0
- package/src/composables/useToast.ts +26 -4
- package/src/index.ts +249 -239
- package/src/plugins/index.ts +62 -55
- package/src/plugins/pdf.ts +12 -0
- package/src/styles/gears.css +5 -0
- package/src/types.ts +234 -222
package/src/index.ts
CHANGED
|
@@ -1,239 +1,249 @@
|
|
|
1
|
-
// Gears UI: Vue components on Tabler. Import the styles once (`@ternarytech-io/gears-ui/styles.css`), then either
|
|
2
|
-
// install the plugin (registers every component globally) or import components one by one.
|
|
3
|
-
// Components that need an optional library have their own entry points, so apps that don't use
|
|
4
|
-
// them don't need the library: `@ternarytech-io/gears-ui/code-editor` (Monaco) and `@ternarytech-io/gears-ui/plugins` (Tom
|
|
5
|
-
// Select, Coloris, Vanilla Calendar Pro, Dropzone, IMask, noUiSlider, SortableJS, HugeRTE).
|
|
6
|
-
import type { App } from 'vue'
|
|
7
|
-
import TAccentPicker from './components/TAccentPicker.vue'
|
|
8
|
-
import TAdvancedTable from './components/TAdvancedTable.vue'
|
|
9
|
-
import TAlert from './components/TAlert.vue'
|
|
10
|
-
import TAppLayout from './components/TAppLayout.vue'
|
|
11
|
-
import TAuthLayout from './components/TAuthLayout.vue'
|
|
12
|
-
import TAvatar from './components/TAvatar.vue'
|
|
13
|
-
import TBadge from './components/TBadge.vue'
|
|
14
|
-
import TButton from './components/TButton.vue'
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
1
|
+
// Gears UI: Vue components on Tabler. Import the styles once (`@ternarytech-io/gears-ui/styles.css`), then either
|
|
2
|
+
// install the plugin (registers every component globally) or import components one by one.
|
|
3
|
+
// Components that need an optional library have their own entry points, so apps that don't use
|
|
4
|
+
// them don't need the library: `@ternarytech-io/gears-ui/code-editor` (Monaco) and `@ternarytech-io/gears-ui/plugins` (Tom
|
|
5
|
+
// Select, Coloris, Vanilla Calendar Pro, Dropzone, IMask, noUiSlider, SortableJS, HugeRTE).
|
|
6
|
+
import type { App } from 'vue'
|
|
7
|
+
import TAccentPicker from './components/TAccentPicker.vue'
|
|
8
|
+
import TAdvancedTable from './components/TAdvancedTable.vue'
|
|
9
|
+
import TAlert from './components/TAlert.vue'
|
|
10
|
+
import TAppLayout from './components/TAppLayout.vue'
|
|
11
|
+
import TAuthLayout from './components/TAuthLayout.vue'
|
|
12
|
+
import TAvatar from './components/TAvatar.vue'
|
|
13
|
+
import TBadge from './components/TBadge.vue'
|
|
14
|
+
import TButton from './components/TButton.vue'
|
|
15
|
+
import TButtonGroup from './components/TButtonGroup.vue'
|
|
16
|
+
import TCard from './components/TCard.vue'
|
|
17
|
+
import TCheckbox from './components/TCheckbox.vue'
|
|
18
|
+
import TCheckboxTree from './components/TCheckboxTree.vue'
|
|
19
|
+
import TColorModeButton from './components/TColorModeButton.vue'
|
|
20
|
+
import TCommandPalette from './components/TCommandPalette.vue'
|
|
21
|
+
import TContainerPicker from './components/TContainerPicker.vue'
|
|
22
|
+
import TCopyButton from './components/TCopyButton.vue'
|
|
23
|
+
import TDataGrid from './components/TDataGrid.vue'
|
|
24
|
+
import TDataGridItem from './components/TDataGridItem.vue'
|
|
25
|
+
import TDensityPicker from './components/TDensityPicker.vue'
|
|
26
|
+
import TDropdown from './components/TDropdown.vue'
|
|
27
|
+
import TEditableTable from './components/TEditableTable.vue'
|
|
28
|
+
import TEmpty from './components/TEmpty.vue'
|
|
29
|
+
import TFieldGroup from './components/TFieldGroup.vue'
|
|
30
|
+
import TFileUpload from './components/TFileUpload.vue'
|
|
31
|
+
import TFontPicker from './components/TFontPicker.vue'
|
|
32
|
+
import TFormField from './components/TFormField.vue'
|
|
33
|
+
import TIcon from './components/TIcon.vue'
|
|
34
|
+
import TIconPicker from './components/TIconPicker.vue'
|
|
35
|
+
import TImageUpload from './components/TImageUpload.vue'
|
|
36
|
+
import TInput from './components/TInput.vue'
|
|
37
|
+
import TLightbox from './components/TLightbox.vue'
|
|
38
|
+
import TInputNumber from './components/TInputNumber.vue'
|
|
39
|
+
import TInputTags from './components/TInputTags.vue'
|
|
40
|
+
import TListBox from './components/TListBox.vue'
|
|
41
|
+
import TLogView from './components/TLogView.vue'
|
|
42
|
+
import TModal from './components/TModal.vue'
|
|
43
|
+
import TNav from './components/TNav.vue'
|
|
44
|
+
import TNavPositionPicker from './components/TNavPositionPicker.vue'
|
|
45
|
+
import TPage from './components/TPage.vue'
|
|
46
|
+
import TPagination from './components/TPagination.vue'
|
|
47
|
+
import TPanelList from './components/TPanelList.vue'
|
|
48
|
+
import TProgress from './components/TProgress.vue'
|
|
49
|
+
import TRadioGroup from './components/TRadioGroup.vue'
|
|
50
|
+
import TRadiusPicker from './components/TRadiusPicker.vue'
|
|
51
|
+
import TRating from './components/TRating.vue'
|
|
52
|
+
import TScaledFrame from './components/TScaledFrame.vue'
|
|
53
|
+
import TSearchButton from './components/TSearchButton.vue'
|
|
54
|
+
import TSectionLayout from './components/TSectionLayout.vue'
|
|
55
|
+
import TSelect from './components/TSelect.vue'
|
|
56
|
+
import TSelectMenu from './components/TSelectMenu.vue'
|
|
57
|
+
import TSeparator from './components/TSeparator.vue'
|
|
58
|
+
import TShell from './components/TShell.vue'
|
|
59
|
+
import TSkeleton from './components/TSkeleton.vue'
|
|
60
|
+
import TSlideover from './components/TSlideover.vue'
|
|
61
|
+
import TSparkline from './components/TSparkline.vue'
|
|
62
|
+
import TSpinner from './components/TSpinner.vue'
|
|
63
|
+
import TSplitButton from './components/TSplitButton.vue'
|
|
64
|
+
import TSplitter from './components/TSplitter.vue'
|
|
65
|
+
import TStatCard from './components/TStatCard.vue'
|
|
66
|
+
import TSteps from './components/TSteps.vue'
|
|
67
|
+
import TSwitch from './components/TSwitch.vue'
|
|
68
|
+
import TTable from './components/TTable.vue'
|
|
69
|
+
import TTabs from './components/TTabs.vue'
|
|
70
|
+
import TTextarea from './components/TTextarea.vue'
|
|
71
|
+
import TThemeBasePicker from './components/TThemeBasePicker.vue'
|
|
72
|
+
import TThemeScope from './components/TThemeScope.vue'
|
|
73
|
+
import TToaster from './components/TToaster.vue'
|
|
74
|
+
import TTooltip from './components/TTooltip.vue'
|
|
75
|
+
import TTopbar from './components/TTopbar.vue'
|
|
76
|
+
import TVectorMap from './components/TVectorMap.vue'
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
TAccentPicker,
|
|
80
|
+
TAdvancedTable,
|
|
81
|
+
TAlert,
|
|
82
|
+
TAppLayout,
|
|
83
|
+
TAuthLayout,
|
|
84
|
+
TAvatar,
|
|
85
|
+
TBadge,
|
|
86
|
+
TButton,
|
|
87
|
+
TButtonGroup,
|
|
88
|
+
TCard,
|
|
89
|
+
TCheckbox,
|
|
90
|
+
TCheckboxTree,
|
|
91
|
+
TColorModeButton,
|
|
92
|
+
TCommandPalette,
|
|
93
|
+
TContainerPicker,
|
|
94
|
+
TCopyButton,
|
|
95
|
+
TDataGrid,
|
|
96
|
+
TDataGridItem,
|
|
97
|
+
TDensityPicker,
|
|
98
|
+
TDropdown,
|
|
99
|
+
TEditableTable,
|
|
100
|
+
TEmpty,
|
|
101
|
+
TFieldGroup,
|
|
102
|
+
TFileUpload,
|
|
103
|
+
TFontPicker,
|
|
104
|
+
TFormField,
|
|
105
|
+
TIcon,
|
|
106
|
+
TIconPicker,
|
|
107
|
+
TImageUpload,
|
|
108
|
+
TInput,
|
|
109
|
+
TInputNumber,
|
|
110
|
+
TLightbox,
|
|
111
|
+
TInputTags,
|
|
112
|
+
TListBox,
|
|
113
|
+
TLogView,
|
|
114
|
+
TModal,
|
|
115
|
+
TNav,
|
|
116
|
+
TNavPositionPicker,
|
|
117
|
+
TPage,
|
|
118
|
+
TPagination,
|
|
119
|
+
TPanelList,
|
|
120
|
+
TProgress,
|
|
121
|
+
TRadioGroup,
|
|
122
|
+
TRadiusPicker,
|
|
123
|
+
TRating,
|
|
124
|
+
TScaledFrame,
|
|
125
|
+
TSearchButton,
|
|
126
|
+
TSectionLayout,
|
|
127
|
+
TSelect,
|
|
128
|
+
TSelectMenu,
|
|
129
|
+
TSeparator,
|
|
130
|
+
TShell,
|
|
131
|
+
TSkeleton,
|
|
132
|
+
TSlideover,
|
|
133
|
+
TSparkline,
|
|
134
|
+
TSpinner,
|
|
135
|
+
TSplitButton,
|
|
136
|
+
TSplitter,
|
|
137
|
+
TStatCard,
|
|
138
|
+
TSteps,
|
|
139
|
+
TSwitch,
|
|
140
|
+
TTable,
|
|
141
|
+
TTabs,
|
|
142
|
+
TTextarea,
|
|
143
|
+
TThemeBasePicker,
|
|
144
|
+
TThemeScope,
|
|
145
|
+
TToaster,
|
|
146
|
+
TTooltip,
|
|
147
|
+
TTopbar,
|
|
148
|
+
TVectorMap
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export * from './types'
|
|
152
|
+
export type { LightboxImage } from './components/TLightbox.vue'
|
|
153
|
+
export { isCustomAccent, themeAccents, themeBases, themeContainers, themeDensities, themeFonts, themeNavs, themeRadii, themeRadiusSizes } from './theme'
|
|
154
|
+
export { useColorMode, type ColorMode } from './composables/useColorMode'
|
|
155
|
+
export { useCommandPalette } from './composables/useCommandPalette'
|
|
156
|
+
export { useField } from './composables/useField'
|
|
157
|
+
export { useToast, type Toast, type ToastPosition } from './composables/useToast'
|
|
158
|
+
|
|
159
|
+
const components = {
|
|
160
|
+
TAccentPicker, TAdvancedTable, TAlert, TAppLayout, TAuthLayout, TAvatar, TBadge, TButton, TButtonGroup, TCard,
|
|
161
|
+
TCheckbox, TCheckboxTree, TColorModeButton, TCommandPalette, TContainerPicker, TCopyButton, TDataGrid, TDataGridItem, TDensityPicker,
|
|
162
|
+
TDropdown, TEditableTable, TEmpty, TFieldGroup, TFileUpload, TFontPicker, TFormField, TIcon, TIconPicker, TImageUpload,
|
|
163
|
+
TInput, TInputNumber, TInputTags, TLightbox, TListBox, TLogView, TModal, TNav, TNavPositionPicker, TPage, TPagination,
|
|
164
|
+
TPanelList, TProgress, TRadioGroup, TRadiusPicker, TRating, TScaledFrame, TSearchButton, TSectionLayout,
|
|
165
|
+
TSelect, TSelectMenu, TSeparator, TShell, TSkeleton, TSlideover, TSparkline, TSpinner, TSplitButton, TSplitter, TStatCard,
|
|
166
|
+
TSteps, TSwitch, TTable, TTabs, TTextarea, TThemeBasePicker, TThemeScope, TToaster, TTooltip,
|
|
167
|
+
TTopbar, TVectorMap
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export default {
|
|
171
|
+
install(app: App) {
|
|
172
|
+
for (const [name, component] of Object.entries(components)) app.component(name, component)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
declare module 'vue' {
|
|
177
|
+
export interface GlobalComponents {
|
|
178
|
+
TAccentPicker: typeof TAccentPicker
|
|
179
|
+
TAdvancedTable: typeof TAdvancedTable
|
|
180
|
+
TAlert: typeof TAlert
|
|
181
|
+
TAppLayout: typeof TAppLayout
|
|
182
|
+
TAuthLayout: typeof TAuthLayout
|
|
183
|
+
TAvatar: typeof TAvatar
|
|
184
|
+
TBadge: typeof TBadge
|
|
185
|
+
TButton: typeof TButton
|
|
186
|
+
TButtonGroup: typeof TButtonGroup
|
|
187
|
+
TCard: typeof TCard
|
|
188
|
+
TCheckbox: typeof TCheckbox
|
|
189
|
+
TCheckboxTree: typeof TCheckboxTree
|
|
190
|
+
TColorModeButton: typeof TColorModeButton
|
|
191
|
+
TCommandPalette: typeof TCommandPalette
|
|
192
|
+
TContainerPicker: typeof TContainerPicker
|
|
193
|
+
TCopyButton: typeof TCopyButton
|
|
194
|
+
TDataGrid: typeof TDataGrid
|
|
195
|
+
TDataGridItem: typeof TDataGridItem
|
|
196
|
+
TDensityPicker: typeof TDensityPicker
|
|
197
|
+
TDropdown: typeof TDropdown
|
|
198
|
+
TEditableTable: typeof TEditableTable
|
|
199
|
+
TEmpty: typeof TEmpty
|
|
200
|
+
TFieldGroup: typeof TFieldGroup
|
|
201
|
+
TFileUpload: typeof TFileUpload
|
|
202
|
+
TFontPicker: typeof TFontPicker
|
|
203
|
+
TFormField: typeof TFormField
|
|
204
|
+
TIcon: typeof TIcon
|
|
205
|
+
TIconPicker: typeof TIconPicker
|
|
206
|
+
TImageUpload: typeof TImageUpload
|
|
207
|
+
TInput: typeof TInput
|
|
208
|
+
TLightbox: typeof TLightbox
|
|
209
|
+
TInputNumber: typeof TInputNumber
|
|
210
|
+
TInputTags: typeof TInputTags
|
|
211
|
+
TListBox: typeof TListBox
|
|
212
|
+
TLogView: typeof TLogView
|
|
213
|
+
TModal: typeof TModal
|
|
214
|
+
TNav: typeof TNav
|
|
215
|
+
TNavPositionPicker: typeof TNavPositionPicker
|
|
216
|
+
TPage: typeof TPage
|
|
217
|
+
TPagination: typeof TPagination
|
|
218
|
+
TPanelList: typeof TPanelList
|
|
219
|
+
TProgress: typeof TProgress
|
|
220
|
+
TRadioGroup: typeof TRadioGroup
|
|
221
|
+
TRadiusPicker: typeof TRadiusPicker
|
|
222
|
+
TRating: typeof TRating
|
|
223
|
+
TScaledFrame: typeof TScaledFrame
|
|
224
|
+
TSearchButton: typeof TSearchButton
|
|
225
|
+
TSectionLayout: typeof TSectionLayout
|
|
226
|
+
TSelect: typeof TSelect
|
|
227
|
+
TSelectMenu: typeof TSelectMenu
|
|
228
|
+
TSeparator: typeof TSeparator
|
|
229
|
+
TShell: typeof TShell
|
|
230
|
+
TSkeleton: typeof TSkeleton
|
|
231
|
+
TSlideover: typeof TSlideover
|
|
232
|
+
TSparkline: typeof TSparkline
|
|
233
|
+
TSpinner: typeof TSpinner
|
|
234
|
+
TSplitButton: typeof TSplitButton
|
|
235
|
+
TSplitter: typeof TSplitter
|
|
236
|
+
TStatCard: typeof TStatCard
|
|
237
|
+
TSteps: typeof TSteps
|
|
238
|
+
TSwitch: typeof TSwitch
|
|
239
|
+
TTable: typeof TTable
|
|
240
|
+
TTabs: typeof TTabs
|
|
241
|
+
TTextarea: typeof TTextarea
|
|
242
|
+
TThemeBasePicker: typeof TThemeBasePicker
|
|
243
|
+
TThemeScope: typeof TThemeScope
|
|
244
|
+
TToaster: typeof TToaster
|
|
245
|
+
TTooltip: typeof TTooltip
|
|
246
|
+
TTopbar: typeof TTopbar
|
|
247
|
+
TVectorMap: typeof TVectorMap
|
|
248
|
+
}
|
|
249
|
+
}
|
package/src/plugins/index.ts
CHANGED
|
@@ -1,55 +1,62 @@
|
|
|
1
|
-
// Gears UI's plugin components, on the libraries Tabler's plugins use. Each library is an optional
|
|
2
|
-
// peer dependency that loads the first time its component is shown. Installing this plugin needs
|
|
3
|
-
// all of them; to use only some, import those components from `@ternarytech-io/gears-ui/components/…` instead.
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import TAdvancedSelect from '../components/TAdvancedSelect.vue'
|
|
6
|
-
import TChart from '../components/TChart.vue'
|
|
7
|
-
import TColorPicker from '../components/TColorPicker.vue'
|
|
8
|
-
import TDatePicker from '../components/TDatePicker.vue'
|
|
9
|
-
import TDropzone from '../components/TDropzone.vue'
|
|
10
|
-
import TInputMask from '../components/TInputMask.vue'
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
// Gears UI's plugin components, on the libraries Tabler's plugins use. Each library is an optional
|
|
2
|
+
// peer dependency that loads the first time its component is shown. Installing this plugin needs
|
|
3
|
+
// all of them; to use only some, import those components from `@ternarytech-io/gears-ui/components/…` instead.
|
|
4
|
+
import type { App } from 'vue'
|
|
5
|
+
import TAdvancedSelect from '../components/TAdvancedSelect.vue'
|
|
6
|
+
import TChart from '../components/TChart.vue'
|
|
7
|
+
import TColorPicker from '../components/TColorPicker.vue'
|
|
8
|
+
import TDatePicker from '../components/TDatePicker.vue'
|
|
9
|
+
import TDropzone from '../components/TDropzone.vue'
|
|
10
|
+
import TInputMask from '../components/TInputMask.vue'
|
|
11
|
+
import TPdfViewer from '../components/TPdfViewer.vue'
|
|
12
|
+
import TRangeSlider from '../components/TRangeSlider.vue'
|
|
13
|
+
import TRichEditor from '../components/TRichEditor.vue'
|
|
14
|
+
import TSortable from '../components/TSortable.vue'
|
|
15
|
+
import TSortableTree from '../components/TSortableTree.vue'
|
|
16
|
+
import TTimeInput from '../components/TTimeInput.vue'
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
TAdvancedSelect,
|
|
20
|
+
TChart,
|
|
21
|
+
TColorPicker,
|
|
22
|
+
TDatePicker,
|
|
23
|
+
TDropzone,
|
|
24
|
+
TInputMask,
|
|
25
|
+
TPdfViewer,
|
|
26
|
+
TRangeSlider,
|
|
27
|
+
TRichEditor,
|
|
28
|
+
TSortable,
|
|
29
|
+
TSortableTree,
|
|
30
|
+
TTimeInput
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type { RichEditorPlugin } from './richEditor'
|
|
34
|
+
export type { PdfZoom } from '../components/TPdfViewer.vue'
|
|
35
|
+
|
|
36
|
+
const components = {
|
|
37
|
+
TAdvancedSelect, TChart, TColorPicker, TDatePicker, TDropzone, TInputMask, TPdfViewer, TRangeSlider, TRichEditor,
|
|
38
|
+
TSortable, TSortableTree, TTimeInput
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const GearsUIPlugins = {
|
|
42
|
+
install(app: App) {
|
|
43
|
+
for (const [name, component] of Object.entries(components)) app.component(name, component)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare module 'vue' {
|
|
48
|
+
export interface GlobalComponents {
|
|
49
|
+
TAdvancedSelect: typeof TAdvancedSelect
|
|
50
|
+
TChart: typeof TChart
|
|
51
|
+
TColorPicker: typeof TColorPicker
|
|
52
|
+
TDatePicker: typeof TDatePicker
|
|
53
|
+
TDropzone: typeof TDropzone
|
|
54
|
+
TInputMask: typeof TInputMask
|
|
55
|
+
TPdfViewer: typeof TPdfViewer
|
|
56
|
+
TRangeSlider: typeof TRangeSlider
|
|
57
|
+
TRichEditor: typeof TRichEditor
|
|
58
|
+
TSortable: typeof TSortable
|
|
59
|
+
TSortableTree: typeof TSortableTree
|
|
60
|
+
TTimeInput: typeof TTimeInput
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Loads PDF.js (Mozilla, Apache-2.0) the first time a TPdfViewer is shown, with its worker (which
|
|
2
|
+
// reads the PDF off the page's thread). The worker's address comes from the bundler (Vite's `?url`).
|
|
3
|
+
import { once } from './once'
|
|
4
|
+
|
|
5
|
+
export const loadPdfJs = once(async () => {
|
|
6
|
+
const [pdfjs, worker] = await Promise.all([
|
|
7
|
+
import('pdfjs-dist'),
|
|
8
|
+
import('pdfjs-dist/build/pdf.worker.min.mjs?url')
|
|
9
|
+
])
|
|
10
|
+
pdfjs.GlobalWorkerOptions.workerSrc = worker.default
|
|
11
|
+
return pdfjs
|
|
12
|
+
})
|
package/src/styles/gears.css
CHANGED
|
@@ -667,3 +667,8 @@
|
|
|
667
667
|
.t-chart { min-height: 1px; }
|
|
668
668
|
.t-stat-sparkline { display: block; width: 100%; }
|
|
669
669
|
.t-stat-sparkline svg { width: 100%; height: 2.25rem; }
|
|
670
|
+
/* A stat card that's a button: it lifts on hover and shows focus. */
|
|
671
|
+
.t-stat-clickable { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
|
|
672
|
+
.t-stat-clickable:hover { border-color: var(--tblr-primary); }
|
|
673
|
+
.t-stat-clickable:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 2px; }
|
|
674
|
+
.t-stat-placeholder { height: 2rem; border-radius: var(--tblr-border-radius); }
|