gradio-pr-bot commited on
Commit
f4888d9
·
verified ·
1 Parent(s): f91499a

Upload folder using huggingface_hub

Browse files
6.2.0/datetime/Index.svelte CHANGED
@@ -3,7 +3,7 @@
3
  </script>
4
 
5
  <script lang="ts">
6
- import { Block, BlockTitle } from "@gradio/atoms";
7
  import { Calendar } from "@gradio/icons";
8
  import { onDestroy } from "svelte";
9
  import DateTimePicker from "./DateTimePicker.svelte";
@@ -152,6 +152,14 @@
152
  padding={true}
153
  >
154
  <div class="label-content">
 
 
 
 
 
 
 
 
155
  <BlockTitle show_label={gradio.shared.show_label} info={gradio.props.info}
156
  >{gradio.shared.label || "Date"}</BlockTitle
157
  >
 
3
  </script>
4
 
5
  <script lang="ts">
6
+ import { Block, BlockTitle, IconButtonWrapper } from "@gradio/atoms";
7
  import { Calendar } from "@gradio/icons";
8
  import { onDestroy } from "svelte";
9
  import DateTimePicker from "./DateTimePicker.svelte";
 
152
  padding={true}
153
  >
154
  <div class="label-content">
155
+ {#if gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
156
+ <IconButtonWrapper
157
+ buttons={gradio.props.buttons}
158
+ on_custom_button_click={(id) => {
159
+ gradio.dispatch("custom_button_click", { id });
160
+ }}
161
+ />
162
+ {/if}
163
  <BlockTitle show_label={gradio.shared.show_label} info={gradio.props.info}
164
  >{gradio.shared.label || "Date"}</BlockTitle
165
  >
6.2.0/datetime/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "@gradio/datetime",
3
- "version": "0.3.23",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
 
1
  {
2
  "name": "@gradio/datetime",
3
+ "version": "0.4.0",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
6.2.0/datetime/types.ts CHANGED
@@ -1,12 +1,16 @@
 
 
1
  export interface DateTimeProps {
2
  value: string;
3
  include_time: boolean;
4
  type: "timestamp" | "datetime" | "string";
5
  timezone: string | null;
6
  info: string;
 
7
  }
8
 
9
  export interface DateTimeEvents {
10
  change: never;
11
  submit: never;
 
12
  }
 
1
+ import type { CustomButton } from "@gradio/utils";
2
+
3
  export interface DateTimeProps {
4
  value: string;
5
  include_time: boolean;
6
  type: "timestamp" | "datetime" | "string";
7
  timezone: string | null;
8
  info: string;
9
+ buttons: (string | CustomButton)[] | null;
10
  }
11
 
12
  export interface DateTimeEvents {
13
  change: never;
14
  submit: never;
15
+ custom_button_click: { id: number };
16
  }