@bagelink/vue 1.15.577 → 1.15.579

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.15.577",
4
+ "version": "1.15.579",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -183,7 +183,7 @@ const headerFontSize = computed(() => {
183
183
  </script>
184
184
 
185
185
  <template>
186
- <div class="table-list-wrap h-100p relative" v-bind="containerProps" :class="{ overflowHiddenLoading: showLoading }">
186
+ <div class="table-list-wrap h-100p relative scrollbar-border scrollbar-border-bottom" v-bind="containerProps" :class="{ overflowHiddenLoading: showLoading }">
187
187
  <Loading v-if="showLoading" class="absolute inset-1" />
188
188
  <div v-if="!isEmpty" v-bind="wrapperProps" :class="{ 'pointer-events-none': showLoading }">
189
189
  <table class="infinite-wrapper" :class="{ selecting: computedSelectedItems.length }">
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { ModeType } from '../../../utils/calendar/typings'
3
- import { TextInput, Dropdown, formatDate, useI18n, resolveI18n, local } from '@bagelink/vue'
3
+ import { Btn, TextInput, Dropdown, formatDate, useI18n, resolveI18n, local } from '@bagelink/vue'
4
4
  import { onClickOutside } from '@vueuse/core'
5
5
  import { ref, computed, onMounted, watch } from 'vue'
6
6
  import { WEEK_START_DAY } from '../../../utils/calendar/time'
@@ -38,6 +38,8 @@ export interface DateInputProps extends BagelInputShellProps {
38
38
  underlined?: boolean
39
39
  /** When true, input is not editable (same as `edit-mode="false"`). */
40
40
  disabled?: boolean
41
+ /** Show a button that clears the selected date or date range. */
42
+ clearable?: boolean
41
43
  }
42
44
 
43
45
  const props = withDefaults(
@@ -46,6 +48,7 @@ const props = withDefaults(
46
48
  enableTime: false,
47
49
  editMode: true,
48
50
  disabled: false,
51
+ clearable: false,
49
52
  small: false,
50
53
  range: false,
51
54
  mode: () => ({ mode: 'day' }),
@@ -275,6 +278,14 @@ function handleIconClick() {
275
278
  isOpen.value = !isOpen.value
276
279
  }
277
280
 
281
+ function clearValue() {
282
+ selectedDate.value = undefined
283
+ inputValue.value = ''
284
+ isTyping.value = false
285
+ isValid.value = true
286
+ isOpen.value = false
287
+ }
288
+
278
289
  function confirmSelection() {
279
290
  isTyping.value = false
280
291
  syncInputValue()
@@ -327,12 +338,20 @@ onMounted(() => {
327
338
  v-model="inputValue" iconStart="calendar"
328
339
  :placeholder="underlined ? ' ' : (resolveI18n(placeholder) || defaultPlaceholder)"
329
340
  :required="underlined ? false : required" :disabled="!isEditable"
330
- :error="!isValid ? $t('date.invalidFormat') : error" :class="{ 'txt-center': center }"
341
+ :error="!isValid ? $t('date.invalidFormat') : error"
342
+ :class="{ 'txt-center': center, 'date-input-clearable': clearable && hasValue }"
331
343
  :underlined="underlined" :frame="frame" :outline="outline" :min-width="minWidth"
332
344
  :max-width="maxWidth" :label-color="labelColor" :label-active-color="labelActiveColor"
333
345
  class="date-input m-0" @input="handleInput" @focus="handleFocus"
334
346
  @blur="handleBlur" @click.stop @keydown="handleKeydown" @iconClick="handleIconClick"
335
347
  />
348
+ <Btn
349
+ v-if="clearable && hasValue && isEditable"
350
+ flat thin round icon="clear" class="date-input-clear absolute center-y end me-05"
351
+ :aria-label="range ? 'Clear date range' : 'Clear date'"
352
+ @mousedown.prevent
353
+ @click.stop="clearValue"
354
+ />
336
355
  </div>
337
356
  </template>
338
357
 
@@ -353,6 +372,15 @@ onMounted(() => {
353
372
 
354
373
  .date-picker-container {
355
374
  width: 100%;
375
+ position: relative;
376
+ }
377
+
378
+ .date-input-clearable input {
379
+ padding-inline-end: calc(var(--bgl-input-height) / 3 + 1.5rem);
380
+ }
381
+
382
+ .date-input-clear {
383
+ z-index: 1;
356
384
  }
357
385
 
358
386
  </style>
@@ -510,16 +510,16 @@ select {
510
510
  }
511
511
 
512
512
  .grid-form.free-grid {
513
- grid-auto-rows: 72px;
513
+ grid-auto-rows: calc(var(--bgl-input-height) * 1.9);
514
514
  }
515
515
 
516
- .grid-form.free-grid > * {
516
+ .grid-form.free-grid>* {
517
517
  grid-row-start: var(--bgl-grid-row-start, auto);
518
518
  grid-row-end: span var(--bgl-grid-row-span, 1);
519
519
  min-height: 0;
520
520
  }
521
521
 
522
- .grid-form.free-grid > * > .bagel-input {
522
+ .grid-form.free-grid>*>.bagel-input {
523
523
  height: 100%;
524
524
  min-height: 0;
525
525
  margin-bottom: 0;
@@ -602,18 +602,53 @@ select {
602
602
  grid-column-end: span 12 !important;
603
603
  }
604
604
 
605
- .start-col-1 { grid-column-start: 1 !important; }
606
- .start-col-2 { grid-column-start: 2 !important; }
607
- .start-col-3 { grid-column-start: 3 !important; }
608
- .start-col-4 { grid-column-start: 4 !important; }
609
- .start-col-5 { grid-column-start: 5 !important; }
610
- .start-col-6 { grid-column-start: 6 !important; }
611
- .start-col-7 { grid-column-start: 7 !important; }
612
- .start-col-8 { grid-column-start: 8 !important; }
613
- .start-col-9 { grid-column-start: 9 !important; }
614
- .start-col-10 { grid-column-start: 10 !important; }
615
- .start-col-11 { grid-column-start: 11 !important; }
616
- .start-col-12 { grid-column-start: 12 !important; }
605
+ .start-col-1 {
606
+ grid-column-start: 1 !important;
607
+ }
608
+
609
+ .start-col-2 {
610
+ grid-column-start: 2 !important;
611
+ }
612
+
613
+ .start-col-3 {
614
+ grid-column-start: 3 !important;
615
+ }
616
+
617
+ .start-col-4 {
618
+ grid-column-start: 4 !important;
619
+ }
620
+
621
+ .start-col-5 {
622
+ grid-column-start: 5 !important;
623
+ }
624
+
625
+ .start-col-6 {
626
+ grid-column-start: 6 !important;
627
+ }
628
+
629
+ .start-col-7 {
630
+ grid-column-start: 7 !important;
631
+ }
632
+
633
+ .start-col-8 {
634
+ grid-column-start: 8 !important;
635
+ }
636
+
637
+ .start-col-9 {
638
+ grid-column-start: 9 !important;
639
+ }
640
+
641
+ .start-col-10 {
642
+ grid-column-start: 10 !important;
643
+ }
644
+
645
+ .start-col-11 {
646
+ grid-column-start: 11 !important;
647
+ }
648
+
649
+ .start-col-12 {
650
+ grid-column-start: 12 !important;
651
+ }
617
652
 
618
653
  .pixel {
619
654
  width: 0 !important;
@@ -636,8 +671,12 @@ select {
636
671
  }
637
672
 
638
673
  @media screen and (max-width: 910px) {
639
- .grid-form.free-grid > * {
640
- grid-row-start: var(--bgl-mobile-grid-row-start, var(--bgl-grid-row-start, auto));
674
+ .grid-form.free-grid {
675
+ grid-auto-rows: calc(var(--bgl-input-height) * 1.5);
676
+ }
677
+
678
+ .grid-form.free-grid>* {
679
+ grid-row-start: var(--bgl-mobile-grid-row-start, auto);
641
680
  grid-row-end: span var(--bgl-mobile-grid-row-span, var(--bgl-grid-row-span, 1));
642
681
  }
643
682
 
@@ -739,16 +778,51 @@ select {
739
778
  grid-column: span 12 !important;
740
779
  }
741
780
 
742
- .grid-form.free-grid .m_start-col-1 { grid-column-start: 1 !important; }
743
- .grid-form.free-grid .m_start-col-2 { grid-column-start: 2 !important; }
744
- .grid-form.free-grid .m_start-col-3 { grid-column-start: 3 !important; }
745
- .grid-form.free-grid .m_start-col-4 { grid-column-start: 4 !important; }
746
- .grid-form.free-grid .m_start-col-5 { grid-column-start: 5 !important; }
747
- .grid-form.free-grid .m_start-col-6 { grid-column-start: 6 !important; }
748
- .grid-form.free-grid .m_start-col-7 { grid-column-start: 7 !important; }
749
- .grid-form.free-grid .m_start-col-8 { grid-column-start: 8 !important; }
750
- .grid-form.free-grid .m_start-col-9 { grid-column-start: 9 !important; }
751
- .grid-form.free-grid .m_start-col-10 { grid-column-start: 10 !important; }
752
- .grid-form.free-grid .m_start-col-11 { grid-column-start: 11 !important; }
753
- .grid-form.free-grid .m_start-col-12 { grid-column-start: 12 !important; }
781
+ .grid-form.free-grid .m_start-col-1 {
782
+ grid-column-start: 1 !important;
783
+ }
784
+
785
+ .grid-form.free-grid .m_start-col-2 {
786
+ grid-column-start: 2 !important;
787
+ }
788
+
789
+ .grid-form.free-grid .m_start-col-3 {
790
+ grid-column-start: 3 !important;
791
+ }
792
+
793
+ .grid-form.free-grid .m_start-col-4 {
794
+ grid-column-start: 4 !important;
795
+ }
796
+
797
+ .grid-form.free-grid .m_start-col-5 {
798
+ grid-column-start: 5 !important;
799
+ }
800
+
801
+ .grid-form.free-grid .m_start-col-6 {
802
+ grid-column-start: 6 !important;
803
+ }
804
+
805
+ .grid-form.free-grid .m_start-col-7 {
806
+ grid-column-start: 7 !important;
807
+ }
808
+
809
+ .grid-form.free-grid .m_start-col-8 {
810
+ grid-column-start: 8 !important;
811
+ }
812
+
813
+ .grid-form.free-grid .m_start-col-9 {
814
+ grid-column-start: 9 !important;
815
+ }
816
+
817
+ .grid-form.free-grid .m_start-col-10 {
818
+ grid-column-start: 10 !important;
819
+ }
820
+
821
+ .grid-form.free-grid .m_start-col-11 {
822
+ grid-column-start: 11 !important;
823
+ }
824
+
825
+ .grid-form.free-grid .m_start-col-12 {
826
+ grid-column-start: 12 !important;
827
+ }
754
828
  }
@@ -2993,7 +2993,7 @@
2993
2993
 
2994
2994
  .min-h-60px,
2995
2995
  .min-h60px {
2996
- min-height: 60px;
2996
+ min-height: 60px !important;
2997
2997
  }
2998
2998
 
2999
2999
  .h-70,
@@ -28,4 +28,16 @@ body>div ::-webkit-scrollbar-corner {
28
28
 
29
29
  .hide-scrollbar::-webkit-scrollbar {
30
30
  display: none;
31
+ }
32
+
33
+
34
+ .bgl-scrollbar-bordered-bottom::-webkit-scrollbar-track,
35
+ .scrollbar-border-bottom::-webkit-scrollbar-track {
36
+ border-top: 1px solid rgba(0, 0, 0, .08) !important;
37
+ }
38
+
39
+ .bgl-scrollbar-bordered-bottom::-webkit-scrollbar-corner,
40
+ .scrollbar-border-bottom::-webkit-scrollbar-corner {
41
+ border-top: 1px solid rgba(0, 0, 0, .08) !important;
42
+ border-inline-start: 1px solid rgba(0, 0, 0, .08) !important;
31
43
  }
package/vite.config.ts CHANGED
@@ -9,6 +9,19 @@ import tsconfigPaths from 'vite-tsconfig-paths'
9
9
  const indexDir = resolve(import.meta.dirname, 'src')
10
10
 
11
11
  function composeCssEntries(): Plugin {
12
+ const composeCss = (...parts: string[]) => {
13
+ const imports = new Set<string>()
14
+ const importPattern = /@import\s+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|url\(\s*(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^)]*)\s*\))(?:\s+[^;]+)?;/g
15
+ const body = parts
16
+ .map(part => part.replace(importPattern, (statement) => {
17
+ imports.add(statement)
18
+ return ''
19
+ }))
20
+ .join('\n')
21
+
22
+ return `${[...imports].join('\n')}\n${body}`
23
+ }
24
+
12
25
  return {
13
26
  name: 'bagelink-compose-css-entries',
14
27
  enforce: 'post',
@@ -34,8 +47,9 @@ function composeCssEntries(): Plugin {
34
47
  throw new Error('Missing public CSS entry artifacts')
35
48
 
36
49
  // Component styles load first; core utilities intentionally load last.
37
- coreAsset.source = `${components}\n${core}`
38
- styleAsset.source = `${components}\n${core}\n${adminFonts}`
50
+ // External imports must be deduplicated and hoisted before all rules.
51
+ coreAsset.source = composeCss(components, core)
52
+ styleAsset.source = composeCss(components, core, adminFonts)
39
53
  },
40
54
  }
41
55
  }