@bagelink/vue 1.14.10 → 1.14.15

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 (120) hide show
  1. package/dist/components/Alert.vue.d.ts.map +1 -1
  2. package/dist/components/Avatar.vue.d.ts.map +1 -1
  3. package/dist/components/Card.vue.d.ts.map +1 -1
  4. package/dist/components/Image.vue.d.ts.map +1 -1
  5. package/dist/components/ImportData.vue.d.ts.map +1 -1
  6. package/dist/components/Pill.vue.d.ts.map +1 -1
  7. package/dist/components/Swiper.vue.d.ts.map +1 -1
  8. package/dist/components/Toast.vue.d.ts.map +1 -1
  9. package/dist/components/calendar/CalendarPopover.vue.d.ts.map +1 -1
  10. package/dist/components/dataTable/DataTable.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
  12. package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/RichText/utils/media.d.ts.map +1 -1
  14. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  15. package/dist/components/index.d.ts.map +1 -1
  16. package/dist/components/layout/Skeleton.vue.d.ts.map +1 -1
  17. package/dist/dialog/Dialog.vue.d.ts.map +1 -1
  18. package/dist/dialog/DialogConfirm.vue.d.ts.map +1 -1
  19. package/dist/index.cjs +148 -145
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.mjs +35417 -35475
  22. package/dist/plugins/bagel.d.ts.map +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/types/TableSchema.d.ts.map +1 -1
  25. package/dist/types/index.d.ts.map +1 -1
  26. package/dist/utils/calendar/dateUtils.d.ts.map +1 -1
  27. package/dist/utils/date.d.ts +116 -0
  28. package/dist/utils/date.d.ts.map +1 -0
  29. package/dist/utils/fetch.d.ts +29 -0
  30. package/dist/utils/fetch.d.ts.map +1 -0
  31. package/dist/utils/index.d.ts.map +1 -1
  32. package/dist/utils/string.d.ts +7 -0
  33. package/dist/utils/string.d.ts.map +1 -0
  34. package/package.json +1 -5
  35. package/src/components/AccordionItem.vue +5 -5
  36. package/src/components/Alert.vue +3 -2
  37. package/src/components/Avatar.vue +2 -1
  38. package/src/components/BglVideo.vue +4 -4
  39. package/src/components/Btn.vue +39 -39
  40. package/src/components/Card.vue +7 -6
  41. package/src/components/Dropdown.vue +2 -2
  42. package/src/components/FieldSetVue.vue +2 -2
  43. package/src/components/FilterQuery.vue +2 -2
  44. package/src/components/Image.vue +2 -1
  45. package/src/components/ImportData.vue +12 -12
  46. package/src/components/JSONSchema.vue +2 -2
  47. package/src/components/JsonBuilder.vue +2 -2
  48. package/src/components/ListItem.vue +1 -1
  49. package/src/components/MapEmbed/Index.vue +8 -8
  50. package/src/components/Pill.vue +17 -16
  51. package/src/components/Spreadsheet/Index.vue +3 -3
  52. package/src/components/Spreadsheet/SpreadsheetTable.vue +10 -10
  53. package/src/components/Toast.vue +34 -28
  54. package/src/components/calendar/CalendarPopover.vue +1 -1
  55. package/src/components/calendar/Index.vue +1 -1
  56. package/src/components/calendar/views/AgendaView.vue +2 -2
  57. package/src/components/calendar/views/DayView.vue +1 -1
  58. package/src/components/calendar/views/MonthView.vue +5 -5
  59. package/src/components/dataTable/DataTable.vue +68 -10
  60. package/src/components/form/FieldArray.vue +5 -5
  61. package/src/components/form/inputs/ArrayInput.vue +1 -1
  62. package/src/components/form/inputs/CheckInput.vue +6 -6
  63. package/src/components/form/inputs/Checkbox.vue +5 -4
  64. package/src/components/form/inputs/CodeEditor/Index.vue +1 -1
  65. package/src/components/form/inputs/ColorInput.vue +5 -5
  66. package/src/components/form/inputs/DatePicker.vue +3 -3
  67. package/src/components/form/inputs/EmailInput.vue +14 -14
  68. package/src/components/form/inputs/NumberInput.vue +10 -10
  69. package/src/components/form/inputs/OTP.vue +2 -2
  70. package/src/components/form/inputs/PasswordInput.vue +3 -3
  71. package/src/components/form/inputs/RadioGroup.vue +1 -1
  72. package/src/components/form/inputs/RichText/editor.css +4 -4
  73. package/src/components/form/inputs/RichText/index.vue +39 -39
  74. package/src/components/form/inputs/RichText/utils/media.ts +1 -92
  75. package/src/components/form/inputs/RichText/utils/table.ts +4 -4
  76. package/src/components/form/inputs/SelectBtn.vue +1 -1
  77. package/src/components/form/inputs/SelectInput.vue +13 -13
  78. package/src/components/form/inputs/SignaturePad.vue +6 -6
  79. package/src/components/form/inputs/TableField.vue +7 -7
  80. package/src/components/form/inputs/TelInput.vue +11 -11
  81. package/src/components/form/inputs/TextInput.vue +10 -10
  82. package/src/components/form/inputs/ToggleInput.vue +11 -11
  83. package/src/components/form/inputs/Upload/upload.css +14 -14
  84. package/src/components/index.ts +0 -3
  85. package/src/components/layout/AppSidebar.vue +3 -3
  86. package/src/components/layout/BottomMenu.vue +1 -1
  87. package/src/components/layout/Skeleton.vue +5 -4
  88. package/src/components/layout/TabsNav.vue +18 -18
  89. package/src/index.ts +0 -1
  90. package/src/plugins/bagel.ts +0 -15
  91. package/src/styles/app-layout.css +231 -0
  92. package/src/styles/appearance.css +179 -21
  93. package/src/styles/bagel.css +103 -97
  94. package/src/styles/buttons.css +8 -8
  95. package/src/styles/colors.css +0 -103
  96. package/src/styles/dark.css +25 -26
  97. package/src/styles/input-variants.css +11 -11
  98. package/src/styles/inputs.css +49 -61
  99. package/src/styles/layout.css +445 -1258
  100. package/src/styles/loginCard.css +1 -1
  101. package/src/styles/mobilLayout.css +153 -28
  102. package/src/styles/text.css +500 -1508
  103. package/src/styles/theme.css +199 -435
  104. package/src/styles/transitions.css +4 -4
  105. package/src/types/TableSchema.ts +1 -0
  106. package/src/types/index.ts +0 -5
  107. package/src/utils/calendar/dateUtils.ts +2 -3
  108. package/src/utils/date.ts +482 -0
  109. package/src/utils/fetch.ts +128 -0
  110. package/src/utils/index.ts +35 -0
  111. package/src/utils/string.ts +56 -0
  112. package/bin/generateFormSchema.ts +0 -1035
  113. package/bin/utils.ts +0 -223
  114. package/src/components/Modal.vue +0 -184
  115. package/src/components/ModalConfirm.vue +0 -42
  116. package/src/components/ModalForm.vue +0 -102
  117. package/src/plugins/modalTypes.ts +0 -61
  118. package/src/plugins/useModal.ts +0 -225
  119. package/src/styles/modal.css +0 -120
  120. package/src/styles/pillColors.css +0 -0
@@ -1,225 +0,0 @@
1
- import type { App, InjectionKey, Plugin } from 'vue'
2
- import type { ComponentProps } from 'vue-component-type-helpers'
3
- import type {
4
- ModalComponentProps,
5
- ModalFormComponentProps,
6
- ModalFormOptions,
7
- ModalOptions,
8
- ModalType,
9
- ConfirmModalUserOptions,
10
- ModalConfirmOptions
11
- } from './modalTypes'
12
- import { createApp, defineComponent, h, inject, reactive, shallowReactive } from 'vue'
13
- import { Modal, ModalConfirm, ModalForm } from '../components'
14
-
15
- export interface ModalApi {
16
- showModal: <T extends { [key: string]: any }>(
17
- options: ModalOptions,
18
- slots?: { [key: string]: any }
19
- ) => ModalComponentProps<T> | undefined
20
- showModalForm: <T extends { [key: string]: any }>(
21
- options: ModalFormOptions<T>,
22
- slots?: { [key: string]: any }
23
- ) => ModalFormComponentProps<T> | undefined
24
- hideModal: (index?: number) => void
25
- confirmModal: (options: ConfirmModalUserOptions) => Promise<boolean>
26
- hideAllModals: () => void
27
- }
28
-
29
- export const ModalSymbol: InjectionKey<ModalApi> = Symbol('modal')
30
-
31
- // Global singleton instance as fallback (created on first plugin install)
32
- let globalModalApi: ModalApi | null = null
33
-
34
- export function useModal(): ModalApi {
35
- const modalApi = inject(ModalSymbol, null)
36
- if (!modalApi) {
37
- // Fallback to global singleton if injection fails
38
- if (globalModalApi) {
39
- return globalModalApi
40
- }
41
- throw new Error('Modal API not provided. Make sure ModalPlugin is installed via app.use(ModalPlugin)')
42
- }
43
- return modalApi
44
- }
45
-
46
- export const ModalPlugin: Plugin = {
47
- install: (app: App) => {
48
- const BASE_Z_INDEX = 1000
49
- const modalStack = reactive<ModalComponentProps<object>[]>([])
50
-
51
- const hideModal = (index?: number) => {
52
- if (index === undefined || index >= modalStack.length - 1) {
53
- // Close top modal
54
- modalStack.splice(modalStack.length - 1, 1)
55
- } else {
56
- modalStack.splice(index, 1)
57
- }
58
- }
59
-
60
- const hideAllModals = () => {
61
- modalStack.splice(0, modalStack.length)
62
- }
63
-
64
- const confirmModal = (options: ConfirmModalUserOptions): Promise<boolean> => {
65
- return new Promise((resolve) => {
66
- const confirmOptions = typeof options === 'string' ? { title: '', message: options } : options
67
- modalStack.push({
68
- modalOptions: shallowReactive({ ...confirmOptions, resolve }),
69
- modalType: 'confirmModal',
70
- componentSlots: {},
71
- })
72
- })
73
- }
74
-
75
- const showModal = <T extends { [key: string]: any }>(
76
- modalType: ModalType,
77
- options: ModalOptions | ModalFormOptions<T>,
78
- slots: { [key: string]: any } = {}
79
- ): ModalComponentProps<T> | ModalFormComponentProps<T> | undefined => {
80
- // Make options reactive so updates propagate
81
- const reactiveOptions = reactive(options) as ModalOptions | ModalFormOptions<T>
82
-
83
- // Ensure visible is set for modals
84
- if (!('visible' in reactiveOptions)) {
85
- reactiveOptions.visible = true
86
- }
87
-
88
- const modalComponent = {
89
- modalOptions: reactiveOptions,
90
- modalType,
91
- componentSlots: slots,
92
- }
93
- modalStack.push(modalComponent)
94
-
95
- if (modalType === 'modalForm') {
96
- return modalComponent as ModalFormComponentProps<T>
97
- }
98
- return modalComponent
99
- }
100
-
101
- const api: ModalApi = {
102
- showModal: (options: ModalOptions, slots?: { [key: string]: any }) => showModal('modal', options, slots),
103
-
104
- showModalForm: <T extends { [key: string]: any }>(
105
- options: ModalFormOptions<T>,
106
- slots?: { [key: string]: any }
107
- ) => showModal<T>('modalForm', options, slots) as ModalFormComponentProps<T>,
108
-
109
- confirmModal: (options: ConfirmModalUserOptions) => confirmModal(options),
110
-
111
- hideModal,
112
-
113
- hideAllModals,
114
- }
115
-
116
- // Set global singleton on first install
117
- if (!globalModalApi) {
118
- globalModalApi = api
119
- }
120
-
121
- app.provide(ModalSymbol, api)
122
-
123
- // Modal container component
124
- const ModalContainerComponent = defineComponent({
125
- name: 'ModalContainer',
126
- setup() {
127
- // Handle ESC key - only close top modal
128
- const handleEscape = (e: KeyboardEvent) => {
129
- if (e.key === 'Escape' && modalStack.length > 0) {
130
- const topModal = modalStack[modalStack.length - 1]
131
- // Check if top modal is dismissable
132
- const modalOptions = topModal.modalOptions as ModalOptions
133
- if (modalOptions.dismissable !== false) {
134
- hideModal()
135
- }
136
- }
137
- }
138
-
139
- return {
140
- modalStack,
141
- handleEscape,
142
- }
143
- },
144
- mounted() {
145
- document.addEventListener('keydown', this.handleEscape)
146
- },
147
- unmounted() {
148
- document.removeEventListener('keydown', this.handleEscape)
149
- },
150
- render() {
151
- return this.modalStack.map((modal, index) => {
152
- // Calculate z-index based on stack position
153
- const zIndex = BASE_Z_INDEX + index * 10
154
-
155
- if (!modal || !modal.modalOptions) {
156
- console.error('[BageLink Modal] Invalid modal in stack:', modal)
157
- return null
158
- }
159
-
160
- const props = {
161
- ...modal.modalOptions,
162
- 'visible': true,
163
- 'zIndex': zIndex,
164
- 'onUpdate:visible': () => { hideModal(index) },
165
- }
166
-
167
- switch (modal.modalType) {
168
- case 'modalForm': {
169
- const formOptions = modal.modalOptions as ModalFormOptions<any>
170
- if (!formOptions.schema) {
171
- console.error('[BageLink Modal] ModalForm requires a schema', modal.modalOptions)
172
- return null
173
- }
174
- return h(ModalForm, props as ComponentProps<typeof ModalForm>, modal.componentSlots)
175
- }
176
- case 'confirmModal':
177
- return h(ModalConfirm, props as ModalConfirmOptions, {})
178
- default:
179
- return h(Modal, props, modal.componentSlots)
180
- }
181
- })
182
- },
183
- })
184
-
185
- // Register the component so users can manually add it if needed
186
- app.component('ModalContainer', ModalContainerComponent)
187
-
188
- // Auto-mount modal container to document.body
189
- if (typeof document !== 'undefined' && typeof window !== 'undefined') {
190
- const mountModalContainer = () => {
191
- const existingContainer = document.getElementById('bagelink-modal-root')
192
- if (!existingContainer) {
193
- // Create mount point
194
- const container = document.createElement('div')
195
- container.id = 'bagelink-modal-root'
196
- document.body.appendChild(container)
197
-
198
- // Create a separate app instance for modals to avoid context issues
199
- const modalApp = createApp(ModalContainerComponent)
200
-
201
- // Share the same context/plugins
202
- modalApp._context = app._context
203
-
204
- // Mount it
205
- modalApp.mount(container)
206
- }
207
- }
208
-
209
- // Try to mount immediately if DOM is ready
210
- if (document.body) {
211
- mountModalContainer()
212
- }
213
-
214
- // Also use mixin as fallback for cases where plugin is installed before DOM ready
215
- app.mixin({
216
- mounted() {
217
- // Only run once on the root component
218
- if (this.$root === this) {
219
- mountModalContainer()
220
- }
221
- }
222
- })
223
- }
224
- },
225
- }
@@ -1,120 +0,0 @@
1
- .bg-dark {
2
- position: fixed;
3
- inset: 0;
4
- background-color: var(--bgl-dark-bg);
5
- pointer-events: none;
6
- opacity: 0;
7
- transition: all ease-in-out 0.3s;
8
- max-height: 100vh;
9
- overflow: scroll;
10
- margin: 0 auto;
11
- width: 100%;
12
- display: grid;
13
- align-items: center;
14
- overflow-x: hidden;
15
- }
16
-
17
- .bg-lignt {
18
- background-color: var(--bgl-white);
19
- }
20
-
21
- .modal {
22
- width: 96%;
23
- max-width: 720px;
24
- transition: all ease-in-out 0.18s;
25
- margin-left: auto;
26
- margin-right: auto;
27
- height: fit-content;
28
- }
29
-
30
- .is-active .modal {
31
- animation: 200ms ease bgl-modal-animation;
32
- }
33
-
34
- @keyframes bgl-modal-animation {
35
- from {
36
- scale: 0.7;
37
- transform: translateY(2rem);
38
- }
39
-
40
- to {
41
- scale: 1;
42
- transform: translateY(0);
43
- }
44
- }
45
-
46
- .small-modal .modal {
47
- max-width: 300px;
48
- text-align: center;
49
- }
50
-
51
- .tool-bar {
52
- background: var(--bgl-popup-bg);
53
- }
54
-
55
- .modal-size {
56
- cursor: pointer;
57
- }
58
-
59
- .is-side .modal {
60
- inset-inline-end: -1720px;
61
- opacity: 1;
62
- max-width: 600px;
63
- width: 90%;
64
- margin-top: 1rem;
65
- margin-bottom: 1rem;
66
- margin-inline-start: auto;
67
- margin-inline-end: 20px;
68
- min-height: calc(100vh - 40px);
69
- transform: translateX(100%);
70
- }
71
-
72
- .is-active .modal {
73
- opacity: 1;
74
- box-shadow: 6px 6px 20px 20px #0000001c;
75
- }
76
-
77
- .bg-lignt .modal {
78
- border: 1px solid var(--border-color);
79
- }
80
-
81
- .bg-lignt.is-active .modal {
82
- box-shadow: none;
83
- }
84
-
85
- .is-active.is-side .modal {
86
- inset-inline-end: 0px;
87
- transform: translateX(0%);
88
- }
89
-
90
- .bg-dark.is-active {
91
- opacity: 1;
92
- pointer-events: all;
93
- }
94
-
95
- body:has(.bg-dark.is-active) {
96
- overflow: hidden;
97
- }
98
-
99
- .is-side.bg-dark.is-active {
100
- opacity: 1;
101
- align-items: stretch;
102
- }
103
-
104
- .is-side.is-active .modal {
105
- pointer-events: all;
106
- }
107
-
108
- @media screen and (max-width: 910px) {
109
- /* .tool-bar {
110
- margin: -1rem 0rem 1rem;
111
- padding-bottom: 1rem;
112
- align-items: center;
113
- } */
114
-
115
- .is-active.is-side .modal {
116
- margin-inline-end: 2%;
117
- margin-inline-start: 2%;
118
- width: 98%;
119
- }
120
- }
File without changes