gradio-pr-bot commited on
Commit
1583fe2
·
verified ·
1 Parent(s): 903b5ec

Upload folder using huggingface_hub

Browse files
6.2.0/number/Index.svelte CHANGED
@@ -1,7 +1,7 @@
1
  <script lang="ts">
2
  import type { NumberProps, NumberEvents } from "./types";
3
  import { Gradio } from "@gradio/utils";
4
- import { Block, BlockTitle } from "@gradio/atoms";
5
  import { StatusTracker } from "@gradio/statustracker";
6
  import { tick } from "svelte";
7
 
@@ -49,6 +49,14 @@
49
  }}
50
  />
51
  <label class="block" class:container={gradio.shared.container}>
 
 
 
 
 
 
 
 
52
  <BlockTitle show_label={gradio.shared.show_label} info={gradio.props.info}
53
  >{gradio.shared.label || "Number"}
54
  {#if gradio.shared.loading_status?.validation_error}
 
1
  <script lang="ts">
2
  import type { NumberProps, NumberEvents } from "./types";
3
  import { Gradio } from "@gradio/utils";
4
+ import { Block, BlockTitle, IconButtonWrapper } from "@gradio/atoms";
5
  import { StatusTracker } from "@gradio/statustracker";
6
  import { tick } from "svelte";
7
 
 
49
  }}
50
  />
51
  <label class="block" class:container={gradio.shared.container}>
52
+ {#if gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
53
+ <IconButtonWrapper
54
+ buttons={gradio.props.buttons}
55
+ on_custom_button_click={(id) => {
56
+ gradio.dispatch("custom_button_click", { id });
57
+ }}
58
+ />
59
+ {/if}
60
  <BlockTitle show_label={gradio.shared.show_label} info={gradio.props.info}
61
  >{gradio.shared.label || "Number"}
62
  {#if gradio.shared.loading_status?.validation_error}
6.2.0/number/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "@gradio/number",
3
- "version": "0.7.2",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
 
1
  {
2
  "name": "@gradio/number",
3
+ "version": "0.8.0",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
6.2.0/number/types.ts CHANGED
@@ -1,4 +1,5 @@
1
  import type { LoadingStatus } from "js/statustracker";
 
2
 
3
  export interface NumberProps {
4
  value: number | null;
@@ -7,6 +8,7 @@ export interface NumberProps {
7
  maximum: number | undefined;
8
  step: number | null;
9
  info: string | undefined;
 
10
  }
11
 
12
  export interface NumberEvents {
@@ -16,4 +18,5 @@ export interface NumberEvents {
16
  blur: never;
17
  focus: never;
18
  clear_status: LoadingStatus;
 
19
  }
 
1
  import type { LoadingStatus } from "js/statustracker";
2
+ import type { CustomButton } from "@gradio/utils";
3
 
4
  export interface NumberProps {
5
  value: number | null;
 
8
  maximum: number | undefined;
9
  step: number | null;
10
  info: string | undefined;
11
+ buttons: (string | CustomButton)[] | null;
12
  }
13
 
14
  export interface NumberEvents {
 
18
  blur: never;
19
  focus: never;
20
  clear_status: LoadingStatus;
21
+ custom_button_click: { id: number };
22
  }