@bagelink/vue 0.0.740 → 0.0.742

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.
@@ -102,7 +102,7 @@ const defaultInputOptions = {
102
102
  'readonly': false,
103
103
  'tabindex': 0,
104
104
  'style': '' as Raw<StyleValue>,
105
- 'placeholder': 'Enter a phone number',
105
+ // 'placeholder': 'Enter a phone number',
106
106
  }
107
107
 
108
108
  const computedDropDownOptions = $computed(() => ({
@@ -388,7 +388,7 @@ function handleInput(e: KeyboardEvent) {
388
388
  :id="id"
389
389
  v-model="phone"
390
390
  :required="required"
391
- :placeholder="computedInputOptions.placeholder"
391
+ :placeholder="props.placeholder || 'Enter a phone number'"
392
392
  :disabled="disabled"
393
393
  type="tel"
394
394
  :autocomplete="autocomplete"
@@ -1,8 +1,9 @@
1
1
  import { defineComponent, h, inject } from 'vue'
2
- import type { InjectionKey, Plugin } from 'vue'
2
+ import type { InjectionKey, Plugin } from 'vue'
3
3
  import type { BglFormSchemaT, BtnOptions } from '@bagelink/vue'
4
4
  import { Modal, ModalConfirm, ModalForm } from '@bagelink/vue'
5
5
 
6
+ // Interface Definitions
6
7
  export interface ModalOptions {
7
8
  title?: string
8
9
  dismissable?: boolean
@@ -13,28 +14,24 @@ export interface ModalOptions {
13
14
  visible?: boolean
14
15
  }
15
16
 
16
- export interface ModalFormOptions {
17
- 'side'?: boolean
18
- 'title'?: string
19
- 'visible'?: boolean
20
- 'width'?: string
21
- 'dismissable'?: boolean
17
+ export interface ModalFormOptions extends ModalOptions {
22
18
  'schema': BglFormSchemaT<any> | (() => BglFormSchemaT) | BglFormSchemaT
23
19
  'onSubmit'?: (formData: any) => any
24
20
  'onDelete'?: (id: string) => Promise<void>
25
- 'onError'?: ((err: any) => void)
21
+ 'onError'?: (err: any) => void
26
22
  'modelValue'?: Record<string, any>
27
23
  'onUpdate:modelValue'?: (val: any) => void
28
24
  }
29
25
 
30
26
  export interface ModalConfirmOptions {
31
- title?: string
32
- message?: string
33
- resolve: (val: boolean) => void
27
+ 'title': string
28
+ 'message': string
29
+ 'resolve': (val: boolean) => void
30
+ 'onUpdate:visible': () => void
31
+ 'visible': boolean
34
32
  }
35
33
 
36
- type ModalType = 'modal' | 'modalForm' | 'confirm'
37
-
34
+ type ModalType = 'modal' | 'modalForm' | 'confirmModal'
38
35
  type ConfirmModalUserOptions = string | { title: string, message: string }
39
36
 
40
37
  export interface ModalComponentProps {
@@ -43,8 +40,7 @@ export interface ModalComponentProps {
43
40
  modalOptions: ModalOptions | ModalFormOptions | ModalConfirmOptions
44
41
  }
45
42
 
46
- export interface ModalFormComponentProps {
47
- componentSlots: Record<string, any>
43
+ export interface ModalFormComponentProps extends ModalComponentProps {
48
44
  modalType: 'modalForm'
49
45
  modalOptions: ModalFormOptions
50
46
  }
@@ -72,79 +68,66 @@ export const ModalPlugin: Plugin = {
72
68
  modalStack.splice(index, 1)
73
69
  }
74
70
 
75
- const modalConfirm = async (
76
- options: ConfirmModalUserOptions
77
- ) => new Promise<boolean>(
78
- (resolve) => {
79
- if (typeof options === 'string') options = { title: '', message: options }
71
+ const confirmModal = (options: ConfirmModalUserOptions): Promise<boolean> => {
72
+ return new Promise((resolve) => {
73
+ const confirmOptions = typeof options === 'string' ? { title: '', message: options } : options
80
74
  modalStack.push({
81
- modalOptions: { ...options, resolve },
82
- modalType: 'confirm',
75
+ modalOptions: { ...confirmOptions, resolve },
76
+ modalType: 'confirmModal',
83
77
  componentSlots: {},
84
78
  })
85
- }
86
- )
79
+ })
80
+ }
87
81
 
88
82
  const showModal = (
89
83
  modalType: ModalType,
90
84
  options: ModalOptions | ModalFormOptions,
91
- slots: Record<string, any> = {},
92
- ) => {
93
- modalStack.push({
85
+ slots: Record<string, any> = {}
86
+ ): ModalComponentProps | ModalFormComponentProps | undefined => {
87
+ const modalComponent = {
94
88
  modalOptions: options,
95
89
  modalType,
96
90
  componentSlots: slots,
97
- })
98
-
99
- if (modalType === 'modalForm') return modalStack.at(-1) as ModalFormComponentProps | undefined
91
+ }
92
+ modalStack.push(modalComponent)
100
93
 
101
- return modalStack.at(-1)
94
+ if (modalType === 'modalForm') {
95
+ return modalComponent as ModalFormComponentProps
96
+ }
97
+ return modalComponent
102
98
  }
103
99
 
104
100
  app.provide(ModalSymbol, {
105
- showModal: (
106
- options: ModalOptions,
107
- slots?: Record<string, any>
108
- ) => showModal('modal', options, slots),
109
-
110
- showModalForm: (
111
- options: ModalFormOptions,
112
- slots?: Record<string, any>
113
- ) => showModal('modalForm', options, slots) as ModalFormComponentProps,
114
- confirmModal: async (
115
- userOptions: ConfirmModalUserOptions
116
- ) => modalConfirm(userOptions),
117
-
118
- hideModal: (
119
- index = modalStack.length - 1
120
- ) => { hideModal(index) },
101
+ showModal: (options: ModalOptions, slots?: Record<string, any>) => showModal('modal', options, slots),
102
+
103
+ showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) => showModal('modalForm', options, slots) as ModalFormComponentProps,
104
+
105
+ confirmModal: (options: ConfirmModalUserOptions) => confirmModal(options),
106
+
107
+ hideModal: (index = modalStack.length - 1) => { hideModal(index) },
121
108
  })
122
109
 
123
110
  const ModalComponent = defineComponent({
124
111
  data: () => ({ modalStack }),
125
112
  render() {
126
- return this.modalStack.map((
127
- modal: ModalComponentProps,
128
- index: number
129
- ) => {
113
+ return this.modalStack.map((modal, index) => {
130
114
  const props = {
131
115
  ...modal.modalOptions,
132
116
  'visible': true,
133
- 'onUpdate:visible': () => { hideModal(index) }
117
+ 'onUpdate:visible': () => { hideModal(index) },
134
118
  }
135
-
136
- if (modal.modalType === 'modalForm') {
137
- return h(ModalForm, props as ModalFormOptions, modal.componentSlots)
119
+ switch (modal.modalType) {
120
+ case 'modalForm':
121
+ return h(ModalForm, props as ModalFormOptions, modal.componentSlots)
122
+ case 'confirmModal':
123
+ return h(ModalConfirm, props as ModalConfirmOptions, {})
124
+ default:
125
+ return h(Modal, props, modal.componentSlots)
138
126
  }
139
-
140
- if (modal.modalType === 'confirm') {
141
- return h(ModalConfirm, props as any, {})
142
- }
143
-
144
- return h(Modal, props, modal.componentSlots)
145
127
  })
146
128
  },
147
129
  })
130
+
148
131
  app.component('ModalContainer', ModalComponent)
149
132
  },
150
133
  }
@@ -42,6 +42,11 @@
42
42
  opacity: 1;
43
43
  }
44
44
 
45
+ .-z-index-1,
46
+ .-z-1 {
47
+ z-index: -1;
48
+ }
49
+
45
50
  .z-index-0,
46
51
  .z-0 {
47
52
  z-index: 0;
@@ -477,6 +482,10 @@
477
482
  box-shadow: 0 1px 5px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1) !important;
478
483
  }
479
484
 
485
+ .shadow-txt {
486
+ filter: drop-shadow(0 0 10px var(--bgl-black-tint));
487
+ }
488
+
480
489
  .border-bottom {
481
490
  border-bottom: 1px solid var(--border-color)
482
491
  }
@@ -603,6 +612,11 @@
603
612
  opacity: 1;
604
613
  }
605
614
 
615
+ .m_-z-index-1,
616
+ .m_-z-1 {
617
+ z-index: -1;
618
+ }
619
+
606
620
  .m_z-index-0,
607
621
  .m_z-0 {
608
622
  z-index: 0;
@@ -231,6 +231,11 @@ select {
231
231
  width: 100%;
232
232
  }
233
233
 
234
+ [dir='rtl'] .bagel-input input[type="email"] {
235
+ direction: ltr;
236
+ text-align: right;
237
+ }
238
+
234
239
  .input.active .bagel-input input:focus-visible,
235
240
  .bagel-input select:focus-visible,
236
241
  .bagel-input textarea:focus-visible,
@@ -246,6 +251,8 @@ select {
246
251
  .bagel-input .bgl_btn:focus,
247
252
  .bagel-input button:focus {
248
253
  outline-color: rgba(0, 0, 0, 0.05);
254
+ box-shadow: inset 0 0 10px #00000012;
255
+
249
256
  }
250
257
 
251
258
  .bagel-input.light-input input,
@@ -99,6 +99,47 @@
99
99
  font-size: 72px;
100
100
  }
101
101
 
102
+ .txt80,
103
+ .txt-80 {
104
+ font-size: 80px;
105
+ }
106
+
107
+ .txt90,
108
+ .txt-90 {
109
+ font-size: 90px;
110
+ }
111
+
112
+ .txt100,
113
+ .txt-100 {
114
+ font-size: 100px;
115
+ }
116
+
117
+
118
+ .txt110,
119
+ .txt-110 {
120
+ font-size: 110px;
121
+ }
122
+
123
+ .txt120,
124
+ .txt-120 {
125
+ font-size: 120px;
126
+ }
127
+
128
+ .txt130,
129
+ .txt-130 {
130
+ font-size: 130px;
131
+ }
132
+
133
+ .txt140,
134
+ .txt-140 {
135
+ font-size: 140px;
136
+ }
137
+
138
+ .txt150,
139
+ .txt-150 {
140
+ font-size: 150px;
141
+ }
142
+
102
143
 
103
144
  .txt18,
104
145
  .txt-18 {
@@ -481,6 +522,47 @@
481
522
  }
482
523
 
483
524
 
525
+ .m_txt80,
526
+ .m_txt-80 {
527
+ font-size: 80px;
528
+ }
529
+
530
+ .m_txt90,
531
+ .m_txt-90 {
532
+ font-size: 90px;
533
+ }
534
+
535
+ .m_txt100,
536
+ .m_txt-100 {
537
+ font-size: 100px;
538
+ }
539
+
540
+
541
+ .m_txt110,
542
+ .m_txt-110 {
543
+ font-size: 110px;
544
+ }
545
+
546
+ .m_txt120,
547
+ .m_txt-120 {
548
+ font-size: 120px;
549
+ }
550
+
551
+ .m_txt130,
552
+ .m_txt-130 {
553
+ font-size: 130px;
554
+ }
555
+
556
+ .m_txt140,
557
+ .m_txt-140 {
558
+ font-size: 140px;
559
+ }
560
+
561
+ .m_txt150,
562
+ .m_txt-150 {
563
+ font-size: 150px;
564
+ }
565
+
484
566
  .m_txt18,
485
567
  .m_txt-18 {
486
568
  font-size: 18px;
@@ -33,7 +33,7 @@
33
33
  --bgl-dark-bg: rgba(0, 0, 0, 0.7);
34
34
  --bgl-selection-bg: var(--bgl-blue-dark);
35
35
  --bgl-selection-color: var(--bgl-white);
36
- --bgl-scrollbar-thumb: var(var(--bgl-gray));
36
+ --bgl-scrollbar-thumb: var(--bgl-gray);
37
37
  }
38
38
 
39
39
  /* TYPE */