@bagelink/vue 0.0.769 → 0.0.771
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/dist/components/TableSchema.vue.d.ts +1 -0
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.mjs +10 -10
- package/dist/style.css +46 -46
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/TableSchema.vue +36 -33
- package/src/utils/index.ts +0 -1
|
@@ -22,6 +22,7 @@ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable
|
|
|
22
22
|
data: T[];
|
|
23
23
|
schema?: BglFormSchemaT<T> | (() => BglFormSchemaT<T>);
|
|
24
24
|
showFields?: string[];
|
|
25
|
+
useServerSort?: boolean;
|
|
25
26
|
})> & import('vue').PublicProps;
|
|
26
27
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
27
28
|
attrs: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AA0hBA,OAAO,EAEN,KAAK,cAAc,EAKnB,MAAM,eAAe,CAAA;AAItB,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAA;AAC5C,MAAM,MAAM,UAAU,GAAG,GAAG,MAAM,IAAI,eAAe,EAAE,CAAA;yBAGtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,eAChC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA4YxD,mBAAmB,CAAC;;;;;;;;;;;;;;;wBA9MZ,CAAC,EAAE;;cA1Ld,CAAC,EAAE;iBACA,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC;qBACzC,MAAM,EAAE;wBACL,OAAO;MAqY+D,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;UAjDuE,GAAG;UAmD9E;0BA/MS,CAAC,OAAO,SAAiC,CAAC;6BACvC,CAAC,UAAU,QAAoC,CAAC;gCAC7C,CAAC,aAAa,EAAC,CAAC,EAAE,CAAC;KA6MA;;;;YAGC,OAAO,CAAC,OAAO,WAAW,CAAC;;AAtZvE,wBAsZ4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -53555,7 +53555,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53555
53555
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
53556
53556
|
data: {},
|
|
53557
53557
|
schema: {},
|
|
53558
|
-
showFields: {}
|
|
53558
|
+
showFields: {},
|
|
53559
|
+
useServerSort: { type: Boolean, default: false }
|
|
53559
53560
|
}, {
|
|
53560
53561
|
"loading": { default: false },
|
|
53561
53562
|
"loadingModifiers": {},
|
|
@@ -53569,7 +53570,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53569
53570
|
emits: /* @__PURE__ */ vue.mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
|
|
53570
53571
|
setup(__props, { emit: __emit }) {
|
|
53571
53572
|
vue.useCssVars((_ctx) => ({
|
|
53572
|
-
"
|
|
53573
|
+
"95624880": vue.unref(computedItemHiehgt)
|
|
53573
53574
|
}));
|
|
53574
53575
|
const emit2 = __emit;
|
|
53575
53576
|
const slots = vue.useSlots();
|
|
@@ -53610,11 +53611,11 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53610
53611
|
return obj;
|
|
53611
53612
|
}
|
|
53612
53613
|
const computedData = vue.computed(() => {
|
|
53613
|
-
|
|
53614
|
-
|
|
53615
|
-
|
|
53614
|
+
if (!sortField.value || __props.useServerSort === true) return __props.data.map(transform);
|
|
53615
|
+
return __props.data.map(transform).sort(
|
|
53616
|
+
(a2, z2) => {
|
|
53616
53617
|
let aValue = a2[computedSortField.value] ?? a2[sortField.value] ?? "";
|
|
53617
|
-
let bValue =
|
|
53618
|
+
let bValue = z2[computedSortField.value] ?? z2[sortField.value] ?? "";
|
|
53618
53619
|
if (isDate(aValue) && isDate(bValue)) {
|
|
53619
53620
|
aValue = new Date(aValue).getTime();
|
|
53620
53621
|
bValue = new Date(bValue).getTime();
|
|
@@ -53631,9 +53632,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53631
53632
|
}
|
|
53632
53633
|
if (sortDirection.value === "ASC") return aValue < bValue ? -1 : 1;
|
|
53633
53634
|
return aValue < bValue ? 1 : -1;
|
|
53634
|
-
}
|
|
53635
|
-
|
|
53636
|
-
return dta;
|
|
53635
|
+
}
|
|
53636
|
+
);
|
|
53637
53637
|
});
|
|
53638
53638
|
function sort2(fieldname) {
|
|
53639
53639
|
if (sortField.value === fieldname) {
|
|
@@ -53775,7 +53775,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53775
53775
|
};
|
|
53776
53776
|
}
|
|
53777
53777
|
});
|
|
53778
|
-
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
53778
|
+
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-e2a8052b"]]);
|
|
53779
53779
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
53780
53780
|
__name: "Title",
|
|
53781
53781
|
props: {
|
package/dist/index.mjs
CHANGED
|
@@ -53553,7 +53553,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
53553
53553
|
props: /* @__PURE__ */ mergeModels({
|
|
53554
53554
|
data: {},
|
|
53555
53555
|
schema: {},
|
|
53556
|
-
showFields: {}
|
|
53556
|
+
showFields: {},
|
|
53557
|
+
useServerSort: { type: Boolean, default: false }
|
|
53557
53558
|
}, {
|
|
53558
53559
|
"loading": { default: false },
|
|
53559
53560
|
"loadingModifiers": {},
|
|
@@ -53567,7 +53568,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
53567
53568
|
emits: /* @__PURE__ */ mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
|
|
53568
53569
|
setup(__props, { emit: __emit }) {
|
|
53569
53570
|
useCssVars((_ctx) => ({
|
|
53570
|
-
"
|
|
53571
|
+
"95624880": unref(computedItemHiehgt)
|
|
53571
53572
|
}));
|
|
53572
53573
|
const emit2 = __emit;
|
|
53573
53574
|
const slots = useSlots();
|
|
@@ -53608,11 +53609,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
53608
53609
|
return obj;
|
|
53609
53610
|
}
|
|
53610
53611
|
const computedData = computed(() => {
|
|
53611
|
-
|
|
53612
|
-
|
|
53613
|
-
|
|
53612
|
+
if (!sortField.value || __props.useServerSort === true) return __props.data.map(transform);
|
|
53613
|
+
return __props.data.map(transform).sort(
|
|
53614
|
+
(a2, z2) => {
|
|
53614
53615
|
let aValue = a2[computedSortField.value] ?? a2[sortField.value] ?? "";
|
|
53615
|
-
let bValue =
|
|
53616
|
+
let bValue = z2[computedSortField.value] ?? z2[sortField.value] ?? "";
|
|
53616
53617
|
if (isDate(aValue) && isDate(bValue)) {
|
|
53617
53618
|
aValue = new Date(aValue).getTime();
|
|
53618
53619
|
bValue = new Date(bValue).getTime();
|
|
@@ -53629,9 +53630,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
53629
53630
|
}
|
|
53630
53631
|
if (sortDirection.value === "ASC") return aValue < bValue ? -1 : 1;
|
|
53631
53632
|
return aValue < bValue ? 1 : -1;
|
|
53632
|
-
}
|
|
53633
|
-
|
|
53634
|
-
return dta;
|
|
53633
|
+
}
|
|
53634
|
+
);
|
|
53635
53635
|
});
|
|
53636
53636
|
function sort2(fieldname) {
|
|
53637
53637
|
if (sortField.value === fieldname) {
|
|
@@ -53773,7 +53773,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
53773
53773
|
};
|
|
53774
53774
|
}
|
|
53775
53775
|
});
|
|
53776
|
-
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
53776
|
+
const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-e2a8052b"]]);
|
|
53777
53777
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
53778
53778
|
__name: "Title",
|
|
53779
53779
|
props: {
|
package/dist/style.css
CHANGED
|
@@ -3064,22 +3064,22 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
3066
|
|
|
3067
|
-
.table-list-wrap[data-v-
|
|
3067
|
+
.table-list-wrap[data-v-e2a8052b] {
|
|
3068
3068
|
min-height: 150px;
|
|
3069
3069
|
}
|
|
3070
|
-
.selected[data-v-
|
|
3070
|
+
.selected[data-v-e2a8052b] {
|
|
3071
3071
|
background: var(--bgl-primary-tint);
|
|
3072
3072
|
}
|
|
3073
|
-
tbody tr.selected[data-v-
|
|
3073
|
+
tbody tr.selected[data-v-e2a8052b]:hover {
|
|
3074
3074
|
background: var(--bgl-primary-light);
|
|
3075
3075
|
}
|
|
3076
|
-
.loading-table[data-v-
|
|
3076
|
+
.loading-table[data-v-e2a8052b] {
|
|
3077
3077
|
position: relative;
|
|
3078
3078
|
}
|
|
3079
|
-
.inset[data-v-
|
|
3079
|
+
.inset[data-v-e2a8052b] {
|
|
3080
3080
|
inset: 0;
|
|
3081
3081
|
}
|
|
3082
|
-
.loading-table-animation[data-v-
|
|
3082
|
+
.loading-table-animation[data-v-e2a8052b] {
|
|
3083
3083
|
--size: 60px;
|
|
3084
3084
|
top: 30vh;
|
|
3085
3085
|
inset-inline-start: calc(50% - var(--size));
|
|
@@ -3087,9 +3087,9 @@ tbody tr.selected[data-v-d8e9a217]:hover {
|
|
|
3087
3087
|
border-top: 4px solid var(--bgl-primary);
|
|
3088
3088
|
width: var(--size);
|
|
3089
3089
|
height: var(--size);
|
|
3090
|
-
animation: loading-table-
|
|
3090
|
+
animation: loading-table-e2a8052b 1s linear infinite;
|
|
3091
3091
|
}
|
|
3092
|
-
@keyframes loading-table-
|
|
3092
|
+
@keyframes loading-table-e2a8052b {
|
|
3093
3093
|
0% {
|
|
3094
3094
|
transform: translate(-50%, -50%) rotate(0deg);
|
|
3095
3095
|
}
|
|
@@ -3097,52 +3097,52 @@ tbody tr.selected[data-v-d8e9a217]:hover {
|
|
|
3097
3097
|
transform: translate(-50%, -50%) rotate(360deg);
|
|
3098
3098
|
}
|
|
3099
3099
|
}
|
|
3100
|
-
.list-arrows[data-v-
|
|
3100
|
+
.list-arrows[data-v-e2a8052b] {
|
|
3101
3101
|
opacity: 0;
|
|
3102
3102
|
}
|
|
3103
|
-
.list-arrows .bgl_icon-font[data-v-
|
|
3103
|
+
.list-arrows .bgl_icon-font[data-v-e2a8052b] {
|
|
3104
3104
|
transition: all ease-in-out 0.2s;
|
|
3105
3105
|
}
|
|
3106
|
-
.list-arrows.sorted[data-v-
|
|
3106
|
+
.list-arrows.sorted[data-v-e2a8052b] {
|
|
3107
3107
|
opacity: 1;
|
|
3108
3108
|
}
|
|
3109
|
-
.col img[data-v-
|
|
3109
|
+
.col img[data-v-e2a8052b] {
|
|
3110
3110
|
height: 35px;
|
|
3111
3111
|
margin-top: -14px;
|
|
3112
3112
|
margin-bottom: -14px;
|
|
3113
3113
|
border-radius: 5px;
|
|
3114
3114
|
}
|
|
3115
|
-
.list-arrows.sorted .desc[data-v-
|
|
3115
|
+
.list-arrows.sorted .desc[data-v-e2a8052b] {
|
|
3116
3116
|
transform: rotate(180deg);
|
|
3117
3117
|
display: inline-block;
|
|
3118
3118
|
}
|
|
3119
|
-
table[data-v-
|
|
3119
|
+
table[data-v-e2a8052b] {
|
|
3120
3120
|
border-collapse: separate;
|
|
3121
3121
|
border-spacing: 0 15px;
|
|
3122
3122
|
border-collapse: collapse;
|
|
3123
3123
|
width: 100%;
|
|
3124
3124
|
}
|
|
3125
|
-
th[data-v-
|
|
3125
|
+
th[data-v-e2a8052b] {
|
|
3126
3126
|
font-size: 0.8rem;
|
|
3127
3127
|
color: var(--bgl-black-tint);
|
|
3128
3128
|
position: sticky;
|
|
3129
3129
|
top: 0;
|
|
3130
3130
|
z-index: 2;
|
|
3131
3131
|
background: var(--bgl-box-bg);
|
|
3132
|
-
height: var(--
|
|
3132
|
+
height: var(--95624880);
|
|
3133
3133
|
vertical-align: bottom;
|
|
3134
3134
|
font-weight: 400;
|
|
3135
3135
|
text-align: start;
|
|
3136
3136
|
}
|
|
3137
|
-
.embedded-field[data-v-
|
|
3137
|
+
.embedded-field[data-v-e2a8052b] {
|
|
3138
3138
|
margin-bottom: -0.2rem;
|
|
3139
3139
|
margin-top: -0.2rem;
|
|
3140
3140
|
}
|
|
3141
|
-
.row[data-v-
|
|
3141
|
+
.row[data-v-e2a8052b] {
|
|
3142
3142
|
border-bottom: 1px solid var(--border-color);
|
|
3143
3143
|
cursor: pointer;
|
|
3144
3144
|
}
|
|
3145
|
-
.row.first-row[data-v-
|
|
3145
|
+
.row.first-row[data-v-e2a8052b] {
|
|
3146
3146
|
font-size: 0.8rem;
|
|
3147
3147
|
color: var(--bgl-black-tint);
|
|
3148
3148
|
position: sticky;
|
|
@@ -3151,7 +3151,7 @@ th[data-v-d8e9a217] {
|
|
|
3151
3151
|
background: var(--bgl-box-bg);
|
|
3152
3152
|
vertical-align: bottom;
|
|
3153
3153
|
}
|
|
3154
|
-
.row.first-row[data-v-
|
|
3154
|
+
.row.first-row[data-v-e2a8052b]::after {
|
|
3155
3155
|
content: '';
|
|
3156
3156
|
border-bottom: 1px solid var(--border-color);
|
|
3157
3157
|
position: absolute;
|
|
@@ -3159,30 +3159,30 @@ th[data-v-d8e9a217] {
|
|
|
3159
3159
|
right: 0;
|
|
3160
3160
|
bottom: -1px;
|
|
3161
3161
|
}
|
|
3162
|
-
.first-row .col[data-v-
|
|
3162
|
+
.first-row .col[data-v-e2a8052b] {
|
|
3163
3163
|
cursor: pointer;
|
|
3164
3164
|
background: var(--bgl-box-bg);
|
|
3165
3165
|
}
|
|
3166
|
-
.col[data-v-
|
|
3166
|
+
.col[data-v-e2a8052b] {
|
|
3167
3167
|
white-space: nowrap;
|
|
3168
3168
|
padding: 0.75rem 1rem;
|
|
3169
3169
|
transition: var(--bgl-transition);
|
|
3170
3170
|
line-height: 1;
|
|
3171
3171
|
align-items: center;
|
|
3172
3172
|
}
|
|
3173
|
-
.col[data-v-
|
|
3173
|
+
.col[data-v-e2a8052b]:has(.bagel-input) {
|
|
3174
3174
|
padding: 0rem 0.25rem;
|
|
3175
3175
|
}
|
|
3176
|
-
.col > div[data-v-
|
|
3176
|
+
.col > div[data-v-e2a8052b] {
|
|
3177
3177
|
display: flex;
|
|
3178
3178
|
gap: 0.5rem;
|
|
3179
3179
|
}
|
|
3180
|
-
.max-col-width[data-v-
|
|
3180
|
+
.max-col-width[data-v-e2a8052b] {
|
|
3181
3181
|
max-width: 30vw;
|
|
3182
3182
|
overflow: hidden;
|
|
3183
3183
|
text-overflow: ellipsis;
|
|
3184
3184
|
}
|
|
3185
|
-
.col.check .bgl_icon-font[data-v-
|
|
3185
|
+
.col.check .bgl_icon-font[data-v-e2a8052b] {
|
|
3186
3186
|
border-radius: 100%;
|
|
3187
3187
|
background: var(--bgl-blue-20);
|
|
3188
3188
|
color: var(--bgl-primary);
|
|
@@ -3193,35 +3193,35 @@ th[data-v-d8e9a217] {
|
|
|
3193
3193
|
justify-content: center;
|
|
3194
3194
|
margin-top: -2px;
|
|
3195
3195
|
}
|
|
3196
|
-
.rows[data-v-
|
|
3196
|
+
.rows[data-v-e2a8052b] {
|
|
3197
3197
|
font-size: 0.88em;
|
|
3198
3198
|
}
|
|
3199
|
-
.table-list[data-v-
|
|
3199
|
+
.table-list[data-v-e2a8052b] {
|
|
3200
3200
|
height: 100%;
|
|
3201
3201
|
position: relative;
|
|
3202
3202
|
padding-left: 0 !important;
|
|
3203
3203
|
padding-right: 0 !important;
|
|
3204
3204
|
overflow: auto;
|
|
3205
3205
|
}
|
|
3206
|
-
.BagelTable .table-list[data-v-
|
|
3206
|
+
.BagelTable .table-list[data-v-e2a8052b] {
|
|
3207
3207
|
overflow: unset;
|
|
3208
3208
|
}
|
|
3209
|
-
.row-item[data-v-
|
|
3210
|
-
height: var(--
|
|
3209
|
+
.row-item[data-v-e2a8052b] {
|
|
3210
|
+
height: var(--95624880);
|
|
3211
3211
|
transition: all 200ms ease;
|
|
3212
3212
|
}
|
|
3213
|
-
.row-item[data-v-
|
|
3213
|
+
.row-item[data-v-e2a8052b]:hover {
|
|
3214
3214
|
background: var(--bgl-gray-light);
|
|
3215
3215
|
}
|
|
3216
|
-
.row-item input[type='checkbox'][data-v-
|
|
3216
|
+
.row-item input[type='checkbox'][data-v-e2a8052b] {
|
|
3217
3217
|
margin-top: 0.45rem !important;
|
|
3218
3218
|
accent-color: var(--bgl-accent-color);
|
|
3219
3219
|
}
|
|
3220
|
-
.infinite-wrapper[data-v-
|
|
3220
|
+
.infinite-wrapper[data-v-e2a8052b] {
|
|
3221
3221
|
overflow-y: auto;
|
|
3222
3222
|
width: 100%;
|
|
3223
3223
|
}
|
|
3224
|
-
input[type='checkbox'][data-v-
|
|
3224
|
+
input[type='checkbox'][data-v-e2a8052b] {
|
|
3225
3225
|
margin-top: 0.3rem !important;
|
|
3226
3226
|
accent-color: var(--bgl-accent-color);
|
|
3227
3227
|
transform: scale(1.2);
|
|
@@ -3233,7 +3233,7 @@ input[type='checkbox'][data-v-d8e9a217] {
|
|
|
3233
3233
|
height: 0.85rem;
|
|
3234
3234
|
width: 0.85rem;
|
|
3235
3235
|
}
|
|
3236
|
-
input[type='checkbox'][data-v-
|
|
3236
|
+
input[type='checkbox'][data-v-e2a8052b]::before {
|
|
3237
3237
|
content: '';
|
|
3238
3238
|
height: 0.85rem;
|
|
3239
3239
|
width: 0.85rem;
|
|
@@ -3246,18 +3246,18 @@ input[type='checkbox'][data-v-d8e9a217]::before {
|
|
|
3246
3246
|
transform: scale(1);
|
|
3247
3247
|
position: absolute;
|
|
3248
3248
|
}
|
|
3249
|
-
input[type='checkbox'][data-v-
|
|
3249
|
+
input[type='checkbox'][data-v-e2a8052b]:hover::before {
|
|
3250
3250
|
opacity: 0.2;
|
|
3251
3251
|
transform: scale(2);
|
|
3252
3252
|
}
|
|
3253
|
-
[lang='he'] [dir='ltr'][data-v-
|
|
3253
|
+
[lang='he'] [dir='ltr'][data-v-e2a8052b] {
|
|
3254
3254
|
text-align: right;
|
|
3255
3255
|
}
|
|
3256
|
-
th input[type='checkbox'][data-v-
|
|
3256
|
+
th input[type='checkbox'][data-v-e2a8052b] {
|
|
3257
3257
|
transform: translateY(0.2rem) scale(1.2);
|
|
3258
3258
|
accent-color: var(--bgl-accent-color);
|
|
3259
3259
|
}
|
|
3260
|
-
th[data-v-
|
|
3260
|
+
th[data-v-e2a8052b]::after {
|
|
3261
3261
|
content: '';
|
|
3262
3262
|
border-bottom: 1px solid var(--border-color);
|
|
3263
3263
|
position: absolute;
|
|
@@ -3265,24 +3265,24 @@ th[data-v-d8e9a217]::after {
|
|
|
3265
3265
|
right: 0;
|
|
3266
3266
|
bottom: -1px;
|
|
3267
3267
|
}
|
|
3268
|
-
tr[data-v-
|
|
3268
|
+
tr[data-v-e2a8052b] {
|
|
3269
3269
|
border-bottom: 1px solid var(--border-color);
|
|
3270
3270
|
cursor: pointer;
|
|
3271
3271
|
align-items: center;
|
|
3272
3272
|
}
|
|
3273
|
-
td[data-v-
|
|
3274
|
-
th[data-v-
|
|
3273
|
+
td[data-v-e2a8052b],
|
|
3274
|
+
th[data-v-e2a8052b] {
|
|
3275
3275
|
white-space: nowrap;
|
|
3276
3276
|
padding: 0.75rem 0.65rem;
|
|
3277
3277
|
transition: var(--bgl-transition);
|
|
3278
3278
|
line-height: 1;
|
|
3279
3279
|
}
|
|
3280
|
-
tbody tr[data-v-
|
|
3280
|
+
tbody tr[data-v-e2a8052b] {
|
|
3281
3281
|
font-size: 0.88em;
|
|
3282
|
-
height: var(--
|
|
3282
|
+
height: var(--95624880);
|
|
3283
3283
|
transition: all 200ms ease;
|
|
3284
3284
|
}
|
|
3285
|
-
tbody tr[data-v-
|
|
3285
|
+
tbody tr[data-v-e2a8052b]:hover {
|
|
3286
3286
|
background: var(--bgl-gray-light);
|
|
3287
3287
|
}
|
|
3288
3288
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/D,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/D,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAYpH;AAED,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK3D;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,iBAGtE;AAED,wBAAgB,QAAQ,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,UAG3C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,QAIrE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,UAKpE;AAED,wBAAgB,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,OAU7F;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,OAM9C;AAED,wBAAgB,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,OAGzE;AAED,eAAO,MAAM,MAAM,eAAgB,GAAG,YAA0C,CAAA;AAEhF,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAa3F;AAED,eAAO,MAAM,KAAK,QAAQ,MAAM,qBAA0D,CAAA;AAE1F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvD"}
|
package/package.json
CHANGED
|
@@ -17,12 +17,12 @@ const {
|
|
|
17
17
|
data,
|
|
18
18
|
schema,
|
|
19
19
|
showFields,
|
|
20
|
-
|
|
20
|
+
useServerSort = false
|
|
21
21
|
} = defineProps<{
|
|
22
22
|
data: T[]
|
|
23
23
|
schema?: BglFormSchemaT<T> | (() => BglFormSchemaT<T>)
|
|
24
24
|
showFields?: string[]
|
|
25
|
-
|
|
25
|
+
useServerSort?: boolean
|
|
26
26
|
}>()
|
|
27
27
|
|
|
28
28
|
const emit = defineEmits<{
|
|
@@ -79,37 +79,40 @@ function transform(rowData: any) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
const computedData = computed(() => {
|
|
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
|
-
|
|
82
|
+
if (!sortField || useServerSort === true) return data.map(transform)
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
data
|
|
86
|
+
.map(transform)
|
|
87
|
+
.sort(
|
|
88
|
+
(a, z) => {
|
|
89
|
+
let aValue = a[computedSortField] ?? a[sortField] ?? ''
|
|
90
|
+
let bValue = z[computedSortField] ?? z[sortField] ?? ''
|
|
91
|
+
|
|
92
|
+
if (isDate(aValue) && isDate(bValue)) {
|
|
93
|
+
// ? now we can sort by as number
|
|
94
|
+
aValue = new Date(aValue).getTime()
|
|
95
|
+
bValue = new Date(bValue).getTime()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const numAValue = Number.parseInt(`${aValue}`.replace(/[^\d.-]/g, ''), 10)
|
|
99
|
+
const numBValue = Number.parseInt(`${bValue}`.replace(/[^\d.-]/g, ''), 10)
|
|
100
|
+
|
|
101
|
+
if (!Number.isNaN(numAValue) && !Number.isNaN(numBValue)) {
|
|
102
|
+
if (sortDirection === 'ASC') return numAValue - numBValue
|
|
103
|
+
return numBValue - numAValue
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (typeof aValue === 'string') {
|
|
107
|
+
if (sortDirection === 'ASC') return aValue.localeCompare(bValue)
|
|
108
|
+
return bValue.localeCompare(aValue)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (sortDirection === 'ASC') return aValue < bValue ? -1 : 1
|
|
112
|
+
return aValue < bValue ? 1 : -1
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
)
|
|
113
116
|
})
|
|
114
117
|
|
|
115
118
|
function sort(fieldname: string) {
|
package/src/utils/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { Attributes, BglFormSchemaT } from '@bagelink/vue'
|
|
|
3
3
|
export function debounce<T extends (...args: any[]) => void>(func: T, wait: number): (...args: Parameters<T>) => void {
|
|
4
4
|
let timeoutId: ReturnType<typeof setTimeout> | undefined
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
return function (...args: Parameters<T>) {
|
|
8
7
|
if (timeoutId) {
|
|
9
8
|
clearTimeout(timeoutId)
|