@cloudparker/moldex.js 0.0.100 → 0.0.102

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.
@@ -12,6 +12,7 @@ export declare class PeriodEnum {
12
12
  static THIS_YEAR: number;
13
13
  static LAST_YEAR: number;
14
14
  static NEXT_YEAR: number;
15
+ static DATE: number;
15
16
  }
16
17
  export type FirestoreTimestamp = {
17
18
  seconds: number;
@@ -12,6 +12,7 @@ export class PeriodEnum {
12
12
  static THIS_YEAR = 10;
13
13
  static LAST_YEAR = 11;
14
14
  static NEXT_YEAR = 12;
15
+ static DATE = 13;
15
16
  }
16
17
  export function getDateWith(yearChange) {
17
18
  const date = new Date();
@@ -60,6 +61,7 @@ export function getPeriodDates(period, currentDate = new Date()) {
60
61
  const currentDate2 = moment(currentDate);
61
62
  let startDate, endDate;
62
63
  switch (period) {
64
+ case PeriodEnum.DATE:
63
65
  case PeriodEnum.TODAY:
64
66
  startDate = currentDate1.startOf('day');
65
67
  endDate = currentDate2.endOf('day');
@@ -8,6 +8,7 @@
8
8
  } from "../../../icon";
9
9
  import Button, {} from "../button/button.svelte";
10
10
  import ButtonMenu from "../button-menu/button-menu.svelte";
11
+ import IconCircle from "../../../icon/components/icon-circle/icon-circle.svelte";
11
12
  let {
12
13
  appearance,
13
14
  size,
@@ -23,6 +24,8 @@ let {
23
24
  hasImg = false,
24
25
  imgClassName = "",
25
26
  iconPath,
27
+ isCircularIcon,
28
+ circularIconClassName = "",
26
29
  imgSrc,
27
30
  hasArrow = false,
28
31
  arrowIconPath = mdiChevronRight,
@@ -53,7 +56,15 @@ let {
53
56
  {#snippet itemInternal()}
54
57
  {#if hasIcon && iconPath}
55
58
  <div>
56
- <Icon path={iconPath} className="{iconClassName} {iconClassName}" />
59
+ {#if isCircularIcon}
60
+ <IconCircle
61
+ {iconPath}
62
+ iconClassName=" {iconClassName}"
63
+ circleClassName=" {circularIconClassName}"
64
+ />
65
+ {:else}
66
+ <Icon path={iconPath} className=" {iconClassName}" />
67
+ {/if}
57
68
  </div>
58
69
  {/if}
59
70
 
@@ -22,6 +22,8 @@ export type ButtonListItemProps = {
22
22
  url?: string;
23
23
  disabled?: boolean;
24
24
  iconPath?: string;
25
+ isCircularIcon?: boolean;
26
+ circularIconClassName?: string;
25
27
  imgSrc?: string;
26
28
  hasCheckbox?: boolean;
27
29
  checkboxClassName?: string;
@@ -26,6 +26,10 @@ let {
26
26
  uncheckboxIconClassName = "",
27
27
  arrowClassName = "",
28
28
  checkboxClassName = "",
29
+ isCircularIcon,
30
+ hasIcon,
31
+ iconClassName,
32
+ circularIconClassName,
29
33
  itemTileSnippet,
30
34
  closeDialog,
31
35
  setResult,
@@ -141,6 +145,10 @@ onMount(() => {
141
145
  {checkboxClassName}
142
146
  {arrowIconPath}
143
147
  {arrowClassName}
148
+ {hasIcon}
149
+ {isCircularIcon}
150
+ {circularIconClassName}
151
+ {iconClassName}
144
152
  />
145
153
  {/if}
146
154
  </div>
@@ -17,6 +17,10 @@ export type PickerDialogProps = {
17
17
  checkboxClassName?: string;
18
18
  arrowIconPath?: string;
19
19
  arrowClassName?: string;
20
+ hasIcon?: boolean;
21
+ iconClassName?: string;
22
+ isCircularIcon?: boolean;
23
+ circularIconClassName?: string;
20
24
  itemTileSnippet?: Snippet<[item: any, index: number]>;
21
25
  };
22
26
  import { type Snippet } from 'svelte';
@@ -1,9 +1,15 @@
1
- <script lang="ts">let { input, key, hasTitle } = $props();
1
+ <script lang="ts">let { input, key, hasTitle, placeholder, emptyText = "-" } = $props();
2
2
  </script>
3
3
 
4
4
  {#if input}
5
- {#await input then res}
6
- {@const text = res && key ? res[key] : res}
7
- <span title={hasTitle ? text : ''}> {text}</span>
5
+ {#await input}
6
+ <span>{@html placeholder}</span>
7
+ {:then res}
8
+ {#if res}
9
+ {@const text = res && key ? res[key] : res}
10
+ <span title={hasTitle ? text : ''}> {text}</span>
11
+ {:else}
12
+ <span>{emptyText}</span>
13
+ {/if}
8
14
  {/await}
9
15
  {/if}
@@ -2,6 +2,8 @@ type PropsType = {
2
2
  input?: Promise<any | null> | undefined;
3
3
  key?: string;
4
4
  hasTitle?: string;
5
+ placeholder?: string;
6
+ emptyText?: string;
5
7
  };
6
8
  declare const TextAwait: import("svelte").Component<PropsType, {}, "">;
7
9
  type TextAwait = ReturnType<typeof TextAwait>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "0.0.100",
3
+ "version": "0.0.102",
4
4
  "author": "cloudparker.com",
5
5
  "license": "MIT",
6
6
  "keywords": [