vueless 0.0.776 → 0.0.777

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,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.776",
3
+ "version": "0.0.777",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -19,7 +19,7 @@ import ULoaderProgress from "../ui.loader-progress/ULoaderProgress.vue";
19
19
  import UTableRow from "./UTableRow.vue";
20
20
 
21
21
  import useUI from "../composables/useUI.ts";
22
- import { getDefaults, cx } from "../utils/ui.ts";
22
+ import { getDefaults, cx, getMergedConfig } from "../utils/ui.ts";
23
23
  import { hasSlotContent } from "../utils/helper.ts";
24
24
  import { useLocale } from "../composables/useLocale.ts";
25
25
  import { PX_IN_REM } from "../constants.js";
@@ -37,8 +37,17 @@ import {
37
37
 
38
38
  import { COMPONENT_NAME } from "./constants.ts";
39
39
 
40
- import type { Cell, Row, RowId, UTableProps, UTableRowAttrs, Config } from "./types.ts";
41
40
  import type { Ref, ComputedRef } from "vue";
41
+ import type { Config as UDividerConfig } from "../ui.container-divider/types.ts";
42
+ import type {
43
+ Cell,
44
+ Row,
45
+ RowId,
46
+ UTableProps,
47
+ UTableRowAttrs,
48
+ Config,
49
+ DateDivider,
50
+ } from "./types.ts";
42
51
 
43
52
  defineOptions({ inheritAttrs: false });
44
53
 
@@ -256,10 +265,21 @@ function onWindowResize() {
256
265
  setFooterCellWidth();
257
266
  }
258
267
 
259
- function getDateDividerLabel(rowDate: string | Date) {
260
- return Array.isArray(props.dateDivider)
261
- ? props.dateDivider.find((dateItem) => dateItem.date === rowDate)?.label || String(rowDate)
262
- : String(rowDate);
268
+ function getDateDividerData(rowDate: string | Date) {
269
+ let dividerItem = {} as DateDivider;
270
+
271
+ if (Array.isArray(props.dateDivider)) {
272
+ const dividerItemData = props.dateDivider.find((dateItem) => dateItem.date === rowDate);
273
+
274
+ if (dividerItemData) {
275
+ dividerItem = dividerItemData;
276
+ }
277
+ }
278
+
279
+ return {
280
+ label: dividerItem?.label || String(rowDate),
281
+ config: dividerItem?.config,
282
+ };
263
283
  }
264
284
 
265
285
  function setFooterCellWidth(zero?: null) {
@@ -684,8 +704,14 @@ const {
684
704
  <td v-bind="bodyCellDateDividerAttrs" :colspan="colsCount">
685
705
  <UDivider
686
706
  size="xs"
687
- :label="getDateDividerLabel(row.rowDate)"
707
+ :label="getDateDividerData(row.rowDate).label"
688
708
  v-bind="bodyDateDividerAttrs"
709
+ :config="
710
+ getMergedConfig({
711
+ defaultConfig: bodyDateDividerAttrs.config,
712
+ globalConfig: getDateDividerData(row.rowDate).config,
713
+ }) as UDividerConfig
714
+ "
689
715
  />
690
716
  </td>
691
717
  </tr>
@@ -697,8 +723,14 @@ const {
697
723
  <td v-bind="bodyCellDateDividerAttrs" :colspan="colsCount">
698
724
  <UDivider
699
725
  size="xs"
700
- :label="getDateDividerLabel(row.rowDate)"
726
+ :label="getDateDividerData(row.rowDate).label"
701
727
  v-bind="bodySelectedDateDividerAttrs"
728
+ :config="
729
+ getMergedConfig({
730
+ defaultConfig: bodyDateDividerAttrs.config,
731
+ globalConfig: getDateDividerData(row.rowDate).config,
732
+ }) as UDividerConfig
733
+ "
702
734
  />
703
735
  </td>
704
736
  </tr>
@@ -334,7 +334,13 @@ DateDividerCustomLabel.args = {
334
334
  rows: Array(10)
335
335
  .fill({})
336
336
  .map(() => getDateDividerRow()),
337
- dateDivider: [{ date: new Date().toString(), label: "Custom label for specific date" }],
337
+ dateDivider: [
338
+ {
339
+ date: new Date().toString(),
340
+ label: "Custom label for specific date",
341
+ config: { label: "!text-orange-400", divider: "!border-orange-300" },
342
+ },
343
+ ],
338
344
  };
339
345
 
340
346
  export const SlotDefault = DefaultTemplate.bind({});
@@ -2,6 +2,7 @@ import defaultConfig from "./config.ts";
2
2
 
3
3
  import type { Ref } from "vue";
4
4
  import type { ComponentConfig, UnknownObject } from "../types.ts";
5
+ import type { Config as UDividerConfig } from "../ui.container-divider/types.ts";
5
6
 
6
7
  export type Config = typeof defaultConfig;
7
8
 
@@ -23,6 +24,7 @@ export interface RowData {
23
24
  export interface DateDivider {
24
25
  date: Date | string;
25
26
  label?: string;
27
+ config?: ComponentConfig<UDividerConfig>;
26
28
  }
27
29
 
28
30
  export interface Row {