Skip to content

Commit

Permalink
Merge branch 'main' into add_icon_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 authored Feb 29, 2024
2 parents f7e8190 + d35e55b commit 93344eb
Show file tree
Hide file tree
Showing 39 changed files with 228 additions and 229 deletions.
16 changes: 8 additions & 8 deletions panel/models/ace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ export class AcePlot extends HTMLBox {
static {
this.prototype.default_view = AcePlotView

this.define<AcePlot.Props>(({Any, Array, Boolean, String, Nullable}) => ({
code: [ String, '' ],
filename: [ Nullable(String), null],
language: [ String, '' ],
theme: [ String, 'chrome' ],
annotations: [ Array(Any), [] ],
readonly: [ Boolean, false ],
print_margin: [ Boolean, false ]
this.define<AcePlot.Props>(({Any, List, Bool, Str, Nullable}) => ({
code: [ Str, '' ],
filename: [ Nullable(Str), null],
language: [ Str, '' ],
theme: [ Str, 'chrome' ],
annotations: [ List(Any), [] ],
readonly: [ Bool, false ],
print_margin: [ Bool, false ]
}))

this.override<AcePlot.Props>({
Expand Down
16 changes: 8 additions & 8 deletions panel/models/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ export class Audio extends HTMLBox {
static {
this.prototype.default_view = AudioView

this.define<Audio.Props>(({Any, Boolean, Number, Nullable}) => ({
loop: [ Boolean, false ],
paused: [ Boolean, true ],
muted: [ Boolean, false ],
autoplay: [ Boolean, false ],
time: [ Number, 0 ],
throttle: [ Number, 250 ],
this.define<Audio.Props>(({Any, Bool, Float, Nullable}) => ({
loop: [ Bool, false ],
paused: [ Bool, true ],
muted: [ Bool, false ],
autoplay: [ Bool, false ],
time: [ Float, 0 ],
throttle: [ Float, 250 ],
value: [ Any, '' ],
volume: [ Nullable(Number), null ],
volume: [ Nullable(Float), null ],
}))
}
}
14 changes: 7 additions & 7 deletions panel/models/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export class BrowserInfo extends Model {
static {
this.prototype.default_view = BrowserInfoView

this.define<BrowserInfo.Props>(({Boolean, Nullable, Number, String}) => ({
dark_mode: [ Nullable(Boolean), null ],
device_pixel_ratio: [ Nullable(Number), null ],
language: [ Nullable(String), null ],
timezone: [ Nullable(String), null ],
timezone_offset: [ Nullable(Number), null ],
webdriver: [ Nullable(Boolean), null ]
this.define<BrowserInfo.Props>(({Bool, Nullable, Float, Str}) => ({
dark_mode: [ Nullable(Bool), null ],
device_pixel_ratio: [ Nullable(Float), null ],
language: [ Nullable(Str), null ],
timezone: [ Nullable(Str), null ],
timezone_offset: [ Nullable(Float), null ],
webdriver: [ Nullable(Bool), null ]
}))
}
}
4 changes: 2 additions & 2 deletions panel/models/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export class Button extends BkButton {
static {
this.prototype.default_view = ButtonView

this.define<Button.Props>(({Nullable, Ref, Number}) => ({
this.define<Button.Props>(({Nullable, Ref, Float}) => ({
tooltip: [ Nullable(Ref(Tooltip)), null ],
tooltip_delay: [ Number, 500],
tooltip_delay: [ Float, 500],
}))
}
}
22 changes: 11 additions & 11 deletions panel/models/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,17 @@ export class Card extends Column {
static {
this.prototype.default_view = CardView

this.define<Card.Props>(({Array, Boolean, Nullable, String}) => ({
active_header_background: [ Nullable(String), null ],
button_css_classes: [ Array(String), [] ],
collapsed: [ Boolean, true ],
collapsible: [ Boolean, true ],
header_background: [ Nullable(String), null ],
header_color: [ Nullable(String), null ],
header_css_classes: [ Array(String), [] ],
header_tag: [ String, "div" ],
hide_header: [ Boolean, false ],
tag: [ String, "div" ],
this.define<Card.Props>(({List, Bool, Nullable, Str}) => ({
active_header_background: [ Nullable(Str), null ],
button_css_classes: [ List(Str), [] ],
collapsed: [ Bool, true ],
collapsible: [ Bool, true ],
header_background: [ Nullable(Str), null ],
header_color: [ Nullable(Str), null ],
header_css_classes: [ List(Str), [] ],
header_tag: [ Str, "div" ],
hide_header: [ Bool, false ],
tag: [ Str, "div" ],
}))
}
}
4 changes: 2 additions & 2 deletions panel/models/checkbox_button_group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export class CheckboxButtonGroup extends bkCheckboxButtonGroup {
static {
this.prototype.default_view = CheckboxButtonGroupView

this.define<CheckboxButtonGroup.Props>(({Nullable, Ref, Number}) => ({
this.define<CheckboxButtonGroup.Props>(({Nullable, Ref, Float}) => ({
tooltip: [ Nullable(Ref(Tooltip)), null ],
tooltip_delay: [ Number, 500],
tooltip_delay: [ Float, 500],
}))
}
}
4 changes: 2 additions & 2 deletions panel/models/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ export class Column extends BkColumn {
static {
this.prototype.default_view = ColumnView;

this.define<Column.Props>(({ Int, Boolean }) => ({
this.define<Column.Props>(({ Int, Bool }) => ({
scroll_position: [Int, 0],
auto_scroll_limit: [Int, 0],
scroll_button_threshold: [Int, 0],
view_latest: [Boolean, false],
view_latest: [Bool, false],
}));
}
}
8 changes: 4 additions & 4 deletions panel/models/comm_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ export class CommManager extends Model {
static {
this.prototype.default_view = CommManagerView

this.define<CommManager.Props>(({Int, String, Nullable}) => ({
plot_id: [ Nullable(String), null ],
comm_id: [ Nullable(String), null ],
client_comm_id: [ Nullable(String), null ],
this.define<CommManager.Props>(({Int, Str, Nullable}) => ({
plot_id: [ Nullable(Str), null ],
comm_id: [ Nullable(Str), null ],
client_comm_id: [ Nullable(Str), null ],
timeout: [ Int, 5000 ],
debounce: [ Int, 50 ],
}))
Expand Down
4 changes: 2 additions & 2 deletions panel/models/customselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export class CustomSelect extends Select {
static {
this.prototype.default_view = CustomSelectView

this.define<CustomSelect.Props>(({Array, String}) => {
this.define<CustomSelect.Props>(({List, Str}) => {
return {
disabled_options: [ Array(String), [] ],
disabled_options: [ List(Str), [] ],
}
})
}
Expand Down
24 changes: 12 additions & 12 deletions panel/models/datetime_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,22 @@ export class DatetimePicker extends InputWidget {
static {
this.prototype.default_view = DatetimePickerView

this.define<DatetimePicker.Props>(({Boolean, String, Array, Tuple, Or, Nullable}) => {
const DateStr = String
const DatesList = Array(Or(DateStr, Tuple(DateStr, DateStr)))
this.define<DatetimePicker.Props>(({Bool, Str, List, Tuple, Or, Nullable}) => {
const DateStr = Str
const DatesList = List(Or(DateStr, Tuple(DateStr, DateStr)))
return {
value: [ Nullable(String), null ],
min_date: [ Nullable(String), null ],
max_date: [ Nullable(String), null ],
value: [ Nullable(Str), null ],
min_date: [ Nullable(Str), null ],
max_date: [ Nullable(Str), null ],
disabled_dates: [ Nullable(DatesList), null ],
enabled_dates: [ Nullable(DatesList), null ],
position: [ CalendarPosition, "auto" ],
inline: [ Boolean, false ],
enable_time: [ Boolean, true ],
enable_seconds: [ Boolean, true ],
military_time: [ Boolean, true ],
date_format: [ String, "Y-m-d H:i:S" ],
mode: [ String, "single" ],
inline: [ Bool, false ],
enable_time: [ Bool, true ],
enable_seconds: [ Bool, true ],
military_time: [ Bool, true ],
date_format: [ Str, "Y-m-d H:i:S" ],
mode: [ Str, "single" ],
}
})
}
Expand Down
8 changes: 4 additions & 4 deletions panel/models/deckgl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ export class DeckGLPlot extends LayoutDOM {
static {
this.prototype.default_view = DeckGLPlotView;

this.define<DeckGLPlot.Props>(({Any, Array, String, Ref}) => ({
this.define<DeckGLPlot.Props>(({Any, List, Str, Ref}) => ({
data: [ Any ],
data_sources: [ Array(Ref(ColumnDataSource)), [] ],
data_sources: [ List(Ref(ColumnDataSource)), [] ],
clickState: [ Any, {} ],
hoverState: [ Any, {} ],
initialViewState: [ Any, {} ],
layers: [ Array(Any), [] ],
mapbox_api_key: [ String, '' ],
layers: [ List(Any), [] ],
mapbox_api_key: [ Str, '' ],
throttle: [ Any, {} ],
tooltip: [ Any, true ],
viewState: [ Any, {} ],
Expand Down
6 changes: 3 additions & 3 deletions panel/models/echarts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ export class ECharts extends HTMLBox {
static {
this.prototype.default_view = EChartsView

this.define<ECharts.Props>(({ Any, String }) => ({
this.define<ECharts.Props>(({ Any, Str }) => ({
data: [ Any, {} ],
options: [ Any, {} ],
event_config: [ Any, {} ],
js_events: [ Any, {} ],
theme: [ String, "default"],
renderer: [ String, "canvas"]
theme: [ Str, "default"],
renderer: [ Str, "canvas"]
}))
}
}
4 changes: 2 additions & 2 deletions panel/models/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export class Feed extends Column {
static {
this.prototype.default_view = FeedView;

this.define<Feed.Props>(({ Array, String }) => ({
visible_children: [Array(String), []],
this.define<Feed.Props>(({ List, Str }) => ({
visible_children: [List(Str), []],
}));
}

Expand Down
12 changes: 6 additions & 6 deletions panel/models/file_download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ export class FileDownload extends InputWidget {
static {
this.prototype.default_view = FileDownloadView

this.define<FileDownload.Props>(({Boolean, Int, Nullable, Ref, String}) => ({
auto: [ Boolean, false ],
this.define<FileDownload.Props>(({Bool, Int, Nullable, Ref, Str}) => ({
auto: [ Bool, false ],
clicks: [ Int, 0 ],
data: [ Nullable(String), null ],
embed: [ Boolean, false ],
data: [ Nullable(Str), null ],
embed: [ Bool, false ],
icon: [ Nullable(Ref(Icon)), null ],
label: [ String, "Download" ],
filename: [ Nullable(String), null ],
label: [ Str, "Download" ],
filename: [ Nullable(Str), null ],
button_type: [ ButtonType, "default" ], // TODO (bev)
_transfers: [ Int, 0 ],
}))
Expand Down
4 changes: 2 additions & 2 deletions panel/models/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ export class HTML extends Markup {

static {
this.prototype.default_view = HTMLView
this.define<HTML.Props>(({Any, Boolean}) => ({
this.define<HTML.Props>(({Any, Bool}) => ({
events: [ Any, {} ],
run_scripts: [ Boolean, true ]
run_scripts: [ Bool, true ]
}))
}
}
15 changes: 7 additions & 8 deletions panel/models/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,14 @@ export class ClickableIcon extends Control {

static {
this.prototype.default_view = ClickableIconView;

this.define<ClickableIcon.Props>(({ Nullable, Ref, Number, String, Boolean }) => ({
active_icon: [String, ""],
icon: [String, "heart"],
size: [Nullable(String), null],
value: [Boolean, false],
title: [String, ""],
this.define<ClickableIcon.Props>(({ Nullable, Ref, Float, Str, Bool }) => ({
active_icon: [Str, ""],
icon: [Str, "heart"],
size: [Nullable(Str), null],
value: [Bool, false],
title: [Str, ""],
tooltip: [Nullable(Ref(Tooltip)), null],
tooltip_delay: [Number, 500],
tooltip_delay: [Float, 500],
}));
}

Expand Down
6 changes: 3 additions & 3 deletions panel/models/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ export class JSON extends Markup {

static {
this.prototype.default_view = JSONView
this.define<JSON.Props>(({Array, Boolean, Int, Nullable, String}) => ({
css: [ Array(String), [] ],
this.define<JSON.Props>(({List, Bool, Int, Nullable, Str}) => ({
css: [ List(Str), [] ],
depth: [ Nullable(Int), 1 ],
hover_preview: [ Boolean, false ],
hover_preview: [ Bool, false ],
theme: [ JSONTheme, "dark" ],
}))
}
Expand Down
14 changes: 7 additions & 7 deletions panel/models/jsoneditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ export class JSONEditor extends HTMLBox {

static {
this.prototype.default_view = JSONEditorView
this.define<JSONEditor.Props>(({Any, Array, Boolean, String}) => ({
css: [ Array(String), [] ],
this.define<JSONEditor.Props>(({Any, List, Bool, Str}) => ({
css: [ List(Str), [] ],
data: [ Any, {} ],
mode: [ String, 'tree' ],
menu: [ Boolean, true ],
search: [ Boolean, true ],
selection: [ Array(Any), [] ],
mode: [ Str, 'tree' ],
menu: [ Bool, true ],
search: [ Bool, true ],
selection: [ List(Any), [] ],
schema: [ Any, null ],
templates: [ Array(Any), [] ],
templates: [ List(Any), [] ],
}))
}
}
18 changes: 9 additions & 9 deletions panel/models/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ export class Location extends Model {
static {
this.prototype.default_view = LocationView

this.define<Location.Props>(({Boolean, String}) => ({
href: [ String, "" ],
hostname: [ String, "" ],
pathname: [ String, "" ],
protocol: [ String, "" ],
port: [ String, "" ],
search: [ String, "" ],
hash: [ String, "" ],
reload: [ Boolean, false ],
this.define<Location.Props>(({Bool, Str}) => ({
href: [ Str, "" ],
hostname: [ Str, "" ],
pathname: [ Str, "" ],
protocol: [ Str, "" ],
port: [ Str, "" ],
search: [ Str, "" ],
hash: [ Str, "" ],
reload: [ Bool, false ],
}))
}
}
8 changes: 4 additions & 4 deletions panel/models/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export namespace PDF {

export type Props = Markup.Props & {
embed: p.Property<boolean>;
start_page: p.Property<Number>;
start_page: p.Property<number>;
};
}

Expand All @@ -71,9 +71,9 @@ export class PDF extends Markup {

static {
this.prototype.default_view = PDFView;
this.define<PDF.Props>(({ Number, Boolean }) => ({
embed: [Boolean, true],
start_page: [Number, 1],
this.define<PDF.Props>(({ Float, Bool }) => ({
embed: [Bool, true],
start_page: [Float, 1],
}));
}
}
Loading

0 comments on commit 93344eb

Please sign in to comment.