sveltekit-ui 1.1.16 → 1.1.17
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 +1 -1
- package/dist/Components/ArrowToggle/index.svelte +0 -62
- package/dist/Components/Attachment/index.svelte +0 -77
- package/dist/Components/Attachment/index.svelte.js +0 -119
- package/dist/Components/AudioEditor/index.svelte +0 -252
- package/dist/Components/AudioEditor/index.svelte.js +0 -977
- package/dist/Components/AudioEditor/samples/alloy-voice-sample.mp3 +0 -0
- package/dist/Components/AudioEditor/samples/echo-voice-sample.mp3 +0 -0
- package/dist/Components/AudioEditor/samples/fable-voice-sample.mp3 +0 -0
- package/dist/Components/AudioEditor/samples/nova-voice-sample.mp3 +0 -0
- package/dist/Components/AudioEditor/samples/onyx-voice-sample.mp3 +0 -0
- package/dist/Components/AudioEditor/samples/shimmer-voice-sample.mp3 +0 -0
- package/dist/Components/Breadcrumbs/index.svelte +0 -27
- package/dist/Components/Breadcrumbs/index.svelte.js +0 -88
- package/dist/Components/Chart/Klines/index.svelte +0 -87
- package/dist/Components/Chart/index.svelte +0 -226
- package/dist/Components/Chart/index.svelte.js +0 -1090
- package/dist/Components/ChartInput/DisplayNav/Klines/index.svelte +0 -150
- package/dist/Components/ChartInput/DisplayNav/Lines/index.svelte +0 -45
- package/dist/Components/ChartInput/DisplayNav/index.svelte +0 -297
- package/dist/Components/ChartInput/EditPanel/index.svelte +0 -155
- package/dist/Components/ChartInput/index.svelte +0 -21
- package/dist/Components/ChartInput/index.svelte.js +0 -671
- package/dist/Components/Color/index.svelte +0 -51
- package/dist/Components/Color/index.svelte.js +0 -31
- package/dist/Components/ColorInput/ChromaPicker/index.svelte +0 -50
- package/dist/Components/ColorInput/ColorPalette/index.svelte +0 -62
- package/dist/Components/ColorInput/OpacityPicker/index.svelte +0 -68
- package/dist/Components/ColorInput/ShowcasePicker/index.svelte +0 -136
- package/dist/Components/ColorInput/index.svelte +0 -70
- package/dist/Components/ColorInput/index.svelte.js +0 -386
- package/dist/Components/ConditionsInput/index.svelte +0 -46
- package/dist/Components/ConditionsInput/index.svelte.js +0 -201
- package/dist/Components/Confetti/index.svelte +0 -98
- package/dist/Components/Confetti/index.svelte.js +0 -94
- package/dist/Components/Content/index.svelte +0 -500
- package/dist/Components/Content/index.svelte.js +0 -910
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Audio/index.svelte +0 -31
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Audio/index.svelte.js +0 -258
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/AudioAdvanced/index.svelte +0 -31
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/AudioAdvanced/index.svelte.js +0 -258
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte +0 -58
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Dropdown/index.svelte.js +0 -206
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Image/index.svelte +0 -28
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Image/index.svelte.js +0 -224
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte +0 -44
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Number/index.svelte.js +0 -272
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte +0 -41
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Qr/index.svelte.js +0 -202
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte +0 -19
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Slider/index.svelte.js +0 -117
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte +0 -60
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TableAdvanced/index.svelte.js +0 -542
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Tag/index.svelte +0 -47
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/Tag/index.svelte.js +0 -185
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte +0 -35
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TextInput/index.svelte.js +0 -222
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte +0 -20
- package/dist/Components/ContentInput/AttributesInput/CustomConfig/TimeInput/index.svelte.js +0 -84
- package/dist/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte +0 -25
- package/dist/Components/ContentInput/AttributesInput/DefinedTypeInput/index.svelte.js +0 -91
- package/dist/Components/ContentInput/AttributesInput/index.svelte +0 -352
- package/dist/Components/ContentInput/AttributesInput/index.svelte.js +0 -1436
- package/dist/Components/ContentInput/ContentPanelBuilder/AddElement/index.svelte +0 -64
- package/dist/Components/ContentInput/ContentPanelBuilder/AddElement/index.svelte.js +0 -97
- package/dist/Components/ContentInput/ContentPanelBuilder/ElementList/index.svelte +0 -184
- package/dist/Components/ContentInput/ContentPanelBuilder/index.svelte +0 -41
- package/dist/Components/ContentInput/index.svelte +0 -78
- package/dist/Components/ContentInput/index.svelte.js +0 -1197
- package/dist/Components/CronInput/index.svelte +0 -78
- package/dist/Components/CronInput/index.svelte.js +0 -198
- package/dist/Components/DataTypeInput/index.svelte +0 -174
- package/dist/Components/DataTypeInput/index.svelte.js +0 -565
- package/dist/Components/Dropdown/index.svelte +0 -116
- package/dist/Components/Dropdown/index.svelte.js +0 -403
- package/dist/Components/ErrorX/index.svelte +0 -58
- package/dist/Components/FileInput/index.svelte +0 -146
- package/dist/Components/FileInput/index.svelte.js +0 -225
- package/dist/Components/Hamburger/index.svelte +0 -99
- package/dist/Components/HorizScrollBox/index.svelte +0 -145
- package/dist/Components/IconInput/index.svelte +0 -77
- package/dist/Components/IconInput/index.svelte.js +0 -259
- package/dist/Components/Image/index.svelte +0 -126
- package/dist/Components/Image/index.svelte.js +0 -116
- package/dist/Components/ImageEditor/Image/CropBox/index.svelte +0 -165
- package/dist/Components/ImageEditor/Image/index.svelte +0 -104
- package/dist/Components/ImageEditor/Panels/AI/index.svelte +0 -44
- package/dist/Components/ImageEditor/Panels/Crop/index.svelte +0 -96
- package/dist/Components/ImageEditor/Panels/File/QualityPicker/index.svelte +0 -124
- package/dist/Components/ImageEditor/Panels/File/index.svelte +0 -74
- package/dist/Components/ImageEditor/Panels/Filters/index.svelte +0 -46
- package/dist/Components/ImageEditor/Panels/Resize/index.svelte +0 -58
- package/dist/Components/ImageEditor/index.svelte +0 -93
- package/dist/Components/ImageEditor/index.svelte.js +0 -1961
- package/dist/Components/ImageSlider/index.svelte +0 -124
- package/dist/Components/ImageSlider/index.svelte.js +0 -99
- package/dist/Components/Json/Nested/index.svelte +0 -157
- package/dist/Components/LabeledItem/index.svelte +0 -102
- package/dist/Components/Layout/NavBar/FullNav/index.svelte +0 -52
- package/dist/Components/Layout/NavBar/NavGuts/index.svelte +0 -87
- package/dist/Components/Layout/NavBar/index.svelte +0 -72
- package/dist/Components/Layout/index.svelte +0 -149
- package/dist/Components/Layout/index.svelte.js +0 -360
- package/dist/Components/LoadingWheel/index.svelte +0 -38
- package/dist/Components/LocationInput/index.svelte +0 -197
- package/dist/Components/LocationInput/index.svelte.js +0 -965
- package/dist/Components/Number/index.svelte +0 -47
- package/dist/Components/Number/index.svelte.js +0 -151
- package/dist/Components/PhoneCountryCode/index.svelte +0 -7
- package/dist/Components/PhoneCountryCode/index.svelte.js +0 -260
- package/dist/Components/Popover/index.svelte +0 -396
- package/dist/Components/Popover/index.svelte.js +0 -319
- package/dist/Components/Spacer/index.svelte +0 -41
- package/dist/Components/StoragePicker/DisplayFile/index.svelte +0 -15
- package/dist/Components/StoragePicker/index.svelte +0 -187
- package/dist/Components/StoragePicker/index.svelte.js +0 -592
- package/dist/Components/TableAdvanced/ColumnInput/index.svelte +0 -117
- package/dist/Components/TableAdvanced/ColumnInput/index.svelte.js +0 -456
- package/dist/Components/TableAdvanced/FilterInput/index.svelte +0 -54
- package/dist/Components/TableAdvanced/FilterInput/index.svelte.js +0 -247
- package/dist/Components/TableAdvanced/Pagination/index.svelte +0 -43
- package/dist/Components/TableAdvanced/Pagination/index.svelte.js +0 -97
- package/dist/Components/TableAdvanced/SortByInput/index.svelte +0 -72
- package/dist/Components/TableAdvanced/SortByInput/index.svelte.js +0 -176
- package/dist/Components/Tag/index.svelte +0 -45
- package/dist/Components/Tag/index.svelte.js +0 -76
- package/dist/Components/TextArrayInput/index.svelte +0 -108
- package/dist/Components/TextArrayInput/index.svelte.js +0 -239
- package/dist/Components/TextInput/PasswordTooltip/index.svelte +0 -89
- package/dist/Components/TimeInput/NumberToggler/index.svelte +0 -34
- package/dist/Components/TimeInput/NumberToggler/index.svelte.js +0 -79
- package/dist/Components/TimeInput/index.js +0 -702
- package/dist/Components/TimeInput/index.svelte +0 -211
- package/dist/Components/TimeInput/index.svelte.js +0 -638
- package/dist/Components/Tooltip/index.svelte +0 -143
- package/dist/Components/TransparentBackground/index.svelte +0 -153
- package/dist/Components/TypingDots/index.svelte +0 -84
- package/dist/Components/VariablePathInput/index.svelte +0 -63
- package/dist/Components/VariablePathInput/index.svelte.js +0 -273
- package/dist/Components/XFollow/index.svelte +0 -42
- package/dist/Components/YoutubeChannelButton/index.svelte +0 -82
- package/dist/Components/YoutubeVideo/index.svelte +0 -73
- package/dist/Components/YoutubeVideo/index.svelte.js +0 -54
- package/dist/actions/draggable.js +0 -49
- package/dist/actions/index.js +0 -24
- package/dist/actions/no_spaces.js +0 -33
- package/dist/actions/numbers_only.js +0 -26
- package/dist/actions/scroll_y.js +0 -28
- package/dist/actions/stop_scroll_propagation_y.js +0 -42
- package/dist/actions/swipe_handler.js +0 -295
- package/dist/client/astc_formatting/index.js +0 -1128
- package/dist/client/docs/index.js +0 -7622
- package/dist/client/index.js +0 -735
- package/dist/client/types/index.js +0 -2812
- package/dist/index.js +0 -180
- package/dist/style.css +0 -682
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { create_popover_manager } from "../../Popover/index.svelte.js"
|
|
2
|
-
import { create_button_manager } from "../../Button/index.svelte.js"
|
|
3
|
-
import { create_checkbox_manager } from "../../Checkbox/index.svelte.js"
|
|
4
|
-
import { create_dropdown_manager } from "../../Dropdown/index.svelte.js"
|
|
5
|
-
// import { create_time_input_manager } from "../../TimeInput/index.svelte.js"
|
|
6
|
-
import { create_text_input_manager } from "../../TextInput/index.svelte.js"
|
|
7
|
-
import { set_closurable } from "../../../client/index.js"
|
|
8
|
-
|
|
9
|
-
// come back to this. might just use the function builder here instead of seperate components
|
|
10
|
-
export function create_filter_input_manager(config) {
|
|
11
|
-
let row_data_type = $derived(set_closurable(config?.row_data_type, null))
|
|
12
|
-
let is_popover = $derived(set_closurable(config?.is_popover, false))
|
|
13
|
-
let popover_toggle_button_manager = $state(null)
|
|
14
|
-
let popover_manager = $state(null)
|
|
15
|
-
let finish_button_manager = $state(null)
|
|
16
|
-
|
|
17
|
-
let val_prepped = $state(null)
|
|
18
|
-
|
|
19
|
-
let add_condition_button_manager = $state(null)
|
|
20
|
-
let operator_dropdown_manager = $state(null)
|
|
21
|
-
|
|
22
|
-
const operator_options = [
|
|
23
|
-
{ key: "all_of", name: "All Of" },
|
|
24
|
-
{ key: "any_of", name: "Any Of" },
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
const number_predicate_options = [
|
|
28
|
-
{ key: "equal_to", name: "equals (==)", input: "number" },
|
|
29
|
-
{ key: "not_equal_to", name: "not equal to (!=)", input: "number" },
|
|
30
|
-
{ key: "less_than", name: "less than (<)", input: "number" },
|
|
31
|
-
{ key: "less_than_or_equal", name: "less than or equal to (<=)", input: "number" },
|
|
32
|
-
{ key: "greater_than", name: "greater than (>)", input: "number" },
|
|
33
|
-
{ key: "greater_than_or_equal", name: "greater than or equal to (>=)", input: "number" },
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
const text_predicate_options = [
|
|
37
|
-
{ key: "equal_to", name: "equals (==)", input: "text" },
|
|
38
|
-
{ key: "not_equal_to", name: "not equal to (!=)", input: "text" },
|
|
39
|
-
{ key: "contains", name: "contains", input: "text" },
|
|
40
|
-
{ key: "does_not_contain", name: "does not contain", input: "text" },
|
|
41
|
-
{ key: "starts_with", name: "starts with", input: "text" },
|
|
42
|
-
{ key: "ends_with", name: "ends with", input: "text" },
|
|
43
|
-
]
|
|
44
|
-
|
|
45
|
-
const time_predicate_options = [
|
|
46
|
-
{ key: "past_x_hours", name: "Past _ Hours", input: "none" },
|
|
47
|
-
{ key: "past_x_days", name: "Past _ Days", input: "none" },
|
|
48
|
-
{ key: "on_day_of_week", name: "On _ Day Of Week", input: "none" },
|
|
49
|
-
{ key: "today", name: "Today", input: "none" },
|
|
50
|
-
{ key: "yesterday", name: "Yesterday", input: "none" },
|
|
51
|
-
{ key: "tomorrow", name: "Tomorrow", input: "none" },
|
|
52
|
-
{ key: "this_calendar_month", name: "This Calendar Month", input: "none" },
|
|
53
|
-
{ key: "this_calendar_year", name: "This Calendar Year", input: "none" },
|
|
54
|
-
{ key: "last_calendar_month", name: "Last Calendar Month", input: "none" },
|
|
55
|
-
{ key: "last_calendar_year", name: "Last Calendar Year", input: "none" },
|
|
56
|
-
{ key: "next_calendar_month", name: "Next Calendar Month", input: "none" },
|
|
57
|
-
{ key: "next_calendar_year", name: "Next Calendar Year", input: "none" },
|
|
58
|
-
{ key: "before_epoch", name: "Before _", input: "time" },
|
|
59
|
-
{ key: "after_epoch", name: "After _", input: "time" },
|
|
60
|
-
{ key: "on_specific_date", name: "On _ Date", input: "time" },
|
|
61
|
-
]
|
|
62
|
-
|
|
63
|
-
let predicate_options = $derived(
|
|
64
|
-
row_data_type?.type == "text_literal"
|
|
65
|
-
? text_predicate_options
|
|
66
|
-
: ["int_literal", "float_literal", "bigint_literal"].includes(row_data_type?.type)
|
|
67
|
-
? number_predicate_options
|
|
68
|
-
: row_data_type?.type == "time_literal"
|
|
69
|
-
? time_predicate_options
|
|
70
|
-
: []
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
let val = $derived(get_val_from_prepped())
|
|
74
|
-
|
|
75
|
-
function get_val_from_prepped(input) {
|
|
76
|
-
if (input?.type_dropdown_manager) {
|
|
77
|
-
let conditions = []
|
|
78
|
-
if (Array.isArray(input?.conditions_prepped)) {
|
|
79
|
-
for (let child of input?.conditions_prepped) {
|
|
80
|
-
let condition = get_val_from_prepped(child)
|
|
81
|
-
if (condition) {
|
|
82
|
-
conditions.push(condition)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
type: "operator",
|
|
88
|
-
operator: input?.type_dropdown_manager?.val,
|
|
89
|
-
conditions: conditions,
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function get_val_prepped(input) {
|
|
95
|
-
let val_prepped_loc = null
|
|
96
|
-
if (input?.type) {
|
|
97
|
-
let conditions_prepped = []
|
|
98
|
-
if (Array.isArray(input?.conditions)) {
|
|
99
|
-
for (let child of input?.conditions) {
|
|
100
|
-
let child_val_prepped = get_val_prepped()
|
|
101
|
-
if (child_val_prepped) {
|
|
102
|
-
conditions_prepped.push(child)
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
let type_dropdown_manager = create_dropdown_manager({
|
|
107
|
-
val: operator_options.includes(input?.operator) ? input?.operator : null,
|
|
108
|
-
options: operator_options,
|
|
109
|
-
label: "Operator Type",
|
|
110
|
-
})
|
|
111
|
-
val_prepped_loc = {
|
|
112
|
-
type_dropdown_manager: type_dropdown_manager,
|
|
113
|
-
conditions_prepped: conditions_prepped,
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function set_conditions() {
|
|
119
|
-
// let conditions_loc = []
|
|
120
|
-
// if (val?.type == "operator" && Array.isArray(val?.conditions) && val?.conditions.length > 0) {
|
|
121
|
-
// for (let i = 0; i < val?.conditions.length; i++) {
|
|
122
|
-
// const input_type = predicate_options.find((h) => h?.key == val?.conditions?.[i]?.predicate)?.input
|
|
123
|
-
// console.log("predicate_options", predicate_options, input_type)
|
|
124
|
-
// conditions_loc.push({
|
|
125
|
-
// input_type: input_type,
|
|
126
|
-
// x_button_manager: create_button_manager({
|
|
127
|
-
// type: "outlined",
|
|
128
|
-
// support_icon: "x",
|
|
129
|
-
// is_uniform: true,
|
|
130
|
-
// on_click: () => (val.conditions = [...val?.conditions].filter((_, index) => index !== i)),
|
|
131
|
-
// }),
|
|
132
|
-
// predicate_dropdown_manager: create_dropdown_manager({
|
|
133
|
-
// options: predicate_options,
|
|
134
|
-
// val: val?.conditions?.[i]?.predicate,
|
|
135
|
-
// is_compressed: true,
|
|
136
|
-
// on_item_click: (input) => (val.conditions[i].predicate = input?.key),
|
|
137
|
-
// }),
|
|
138
|
-
// // input_manager:
|
|
139
|
-
// // input_type == "time"
|
|
140
|
-
// // ? create_time_input_manager({
|
|
141
|
-
// // val: val?.conditions?.[i]?.value,
|
|
142
|
-
// // is_finish_button: true,
|
|
143
|
-
// // is_input_button: true,
|
|
144
|
-
// // on_finish: (input) => (val.conditions[i].value = input),
|
|
145
|
-
// // })
|
|
146
|
-
// // : ["number", "text"].includes(input_type)
|
|
147
|
-
// // ? create_text_input_manager({
|
|
148
|
-
// // type: input_type,
|
|
149
|
-
// // val: val?.conditions?.[i]?.value,
|
|
150
|
-
// // placeholder: "value",
|
|
151
|
-
// // on_input: (input) => (val.conditions[i].value = input),
|
|
152
|
-
// // })
|
|
153
|
-
// // : null,
|
|
154
|
-
// })
|
|
155
|
-
// }
|
|
156
|
-
// }
|
|
157
|
-
// conditions = conditions_loc
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function finish() {
|
|
161
|
-
popover_manager.close()
|
|
162
|
-
if (typeof config?.on_finish == "function") {
|
|
163
|
-
config?.on_finish()
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function add_condition() {
|
|
168
|
-
console.log("add_condition", val)
|
|
169
|
-
val.conditions = [
|
|
170
|
-
...val?.conditions,
|
|
171
|
-
{
|
|
172
|
-
type: "predicate",
|
|
173
|
-
predicate: null,
|
|
174
|
-
value: null,
|
|
175
|
-
},
|
|
176
|
-
]
|
|
177
|
-
set_conditions()
|
|
178
|
-
console.log("add_condition2", val)
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function init(config) {
|
|
182
|
-
val_prepped = get_val_prepped(config?.val)
|
|
183
|
-
popover_manager = create_popover_manager({
|
|
184
|
-
min_width: 320,
|
|
185
|
-
target_width: 400,
|
|
186
|
-
min_height: 320,
|
|
187
|
-
target_height: 400,
|
|
188
|
-
type: "center",
|
|
189
|
-
header: "Condition Builder",
|
|
190
|
-
anchor_id: () => `button_${popover_toggle_button_manager?.id}`,
|
|
191
|
-
})
|
|
192
|
-
popover_toggle_button_manager = create_button_manager({
|
|
193
|
-
type: "outlined",
|
|
194
|
-
is_compressed: true,
|
|
195
|
-
text: "Edit Conditions",
|
|
196
|
-
popover_target: () => `popover_${popover_manager?.id}`,
|
|
197
|
-
})
|
|
198
|
-
operator_dropdown_manager = create_dropdown_manager({
|
|
199
|
-
options: operator_options,
|
|
200
|
-
val: val?.operator,
|
|
201
|
-
is_button_compressed: true,
|
|
202
|
-
on_item_click: (input) => (val.operator = input?.key),
|
|
203
|
-
})
|
|
204
|
-
add_condition_button_manager = create_button_manager({
|
|
205
|
-
type: "outlined",
|
|
206
|
-
is_compressed: true,
|
|
207
|
-
text: "Add Condition",
|
|
208
|
-
support_icon: "plus",
|
|
209
|
-
on_click: () => add_condition(),
|
|
210
|
-
})
|
|
211
|
-
finish_button_manager = create_button_manager({
|
|
212
|
-
text: "Finish",
|
|
213
|
-
on_click: () => finish(),
|
|
214
|
-
})
|
|
215
|
-
}
|
|
216
|
-
init(config)
|
|
217
|
-
|
|
218
|
-
return {
|
|
219
|
-
get val() {
|
|
220
|
-
return val
|
|
221
|
-
},
|
|
222
|
-
get predicate_options() {
|
|
223
|
-
return predicate_options
|
|
224
|
-
},
|
|
225
|
-
get is_popover() {
|
|
226
|
-
return is_popover
|
|
227
|
-
},
|
|
228
|
-
get popover_manager() {
|
|
229
|
-
return popover_manager
|
|
230
|
-
},
|
|
231
|
-
get popover_toggle_button_manager() {
|
|
232
|
-
return popover_toggle_button_manager
|
|
233
|
-
},
|
|
234
|
-
get operator_dropdown_manager() {
|
|
235
|
-
return operator_dropdown_manager
|
|
236
|
-
},
|
|
237
|
-
get finish_button_manager() {
|
|
238
|
-
return finish_button_manager
|
|
239
|
-
},
|
|
240
|
-
get add_condition_button_manager() {
|
|
241
|
-
return add_condition_button_manager
|
|
242
|
-
},
|
|
243
|
-
init,
|
|
244
|
-
add_condition,
|
|
245
|
-
finish,
|
|
246
|
-
}
|
|
247
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Button from "../../Button/index.svelte"
|
|
3
|
-
|
|
4
|
-
let { manager } = $props()
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<div class="container">
|
|
8
|
-
<div class="container_inner">
|
|
9
|
-
{#if manager?.cur_page !== 1}
|
|
10
|
-
<Button manager={manager?.left_button_manager} />
|
|
11
|
-
<Button manager={manager?.page_one_button_manager} />
|
|
12
|
-
{/if}
|
|
13
|
-
{#if manager?.cur_page > 3}
|
|
14
|
-
<p>...</p>
|
|
15
|
-
{/if}
|
|
16
|
-
{#if manager?.cur_page > 2}
|
|
17
|
-
<Button manager={manager?.before_page_button_manager} />
|
|
18
|
-
{/if}
|
|
19
|
-
<Button manager={manager?.cur_page_button_manager} />
|
|
20
|
-
{#if manager?.total_pages - manager?.cur_page > 1}
|
|
21
|
-
<Button manager={manager?.after_page_button_manager} />
|
|
22
|
-
{/if}
|
|
23
|
-
{#if manager?.total_pages - manager?.cur_page > 2}
|
|
24
|
-
<p>...</p>
|
|
25
|
-
{/if}
|
|
26
|
-
{#if manager?.total_pages > 1 && manager?.cur_page !== manager?.total_pages}
|
|
27
|
-
<Button manager={manager?.last_page_button_manager} />
|
|
28
|
-
<Button manager={manager?.right_button_manager} />
|
|
29
|
-
{/if}
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<style>
|
|
34
|
-
.container {
|
|
35
|
-
display: flex;
|
|
36
|
-
}
|
|
37
|
-
.container_inner {
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
border: 1px solid var(--shadow5-t);
|
|
41
|
-
border-radius: 1rem;
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { create_button_manager } from "../../Button/index.svelte.js"
|
|
2
|
-
import { set_closurable } from "../../../client/index.js"
|
|
3
|
-
|
|
4
|
-
export function create_pagination_manager(config) {
|
|
5
|
-
let cur_page = $derived(set_closurable(config?.cur_page, 1))
|
|
6
|
-
let total_pages = $derived(set_closurable(config?.total_pages, 1))
|
|
7
|
-
let left_button_manager = $state(null)
|
|
8
|
-
let page_one_button_manager = $state(null)
|
|
9
|
-
let before_page_button_manager = $state(null)
|
|
10
|
-
let cur_page_button_manager = $state(null)
|
|
11
|
-
let after_page_button_manager = $state(null)
|
|
12
|
-
let last_page_button_manager = $state(null)
|
|
13
|
-
let right_button_manager = $state(null)
|
|
14
|
-
|
|
15
|
-
function page_click(i) {
|
|
16
|
-
if (typeof config?.on_change == "function") {
|
|
17
|
-
config?.on_change(i)
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function init(config) {
|
|
22
|
-
left_button_manager = create_button_manager({
|
|
23
|
-
type: "soft",
|
|
24
|
-
is_uniform: true,
|
|
25
|
-
support_icon: "arrow",
|
|
26
|
-
icon_deg: 270,
|
|
27
|
-
icon_size: 1.4,
|
|
28
|
-
on_click: () => page_click(cur_page - 1),
|
|
29
|
-
})
|
|
30
|
-
page_one_button_manager = create_button_manager({
|
|
31
|
-
type: "soft",
|
|
32
|
-
text: () => "1",
|
|
33
|
-
on_click: () => page_click(1),
|
|
34
|
-
})
|
|
35
|
-
before_page_button_manager = create_button_manager({
|
|
36
|
-
type: "soft",
|
|
37
|
-
text: () => cur_page - 1,
|
|
38
|
-
on_click: () => page_click(cur_page - 1),
|
|
39
|
-
})
|
|
40
|
-
cur_page_button_manager = create_button_manager({
|
|
41
|
-
type: "soft",
|
|
42
|
-
selected_type: "half_selected",
|
|
43
|
-
text: () => cur_page,
|
|
44
|
-
})
|
|
45
|
-
after_page_button_manager = create_button_manager({
|
|
46
|
-
type: "soft",
|
|
47
|
-
text: () => cur_page + 1,
|
|
48
|
-
on_click: () => page_click(cur_page + 1),
|
|
49
|
-
})
|
|
50
|
-
last_page_button_manager = create_button_manager({
|
|
51
|
-
type: "soft",
|
|
52
|
-
text: () => total_pages,
|
|
53
|
-
on_click: () => page_click(total_pages),
|
|
54
|
-
})
|
|
55
|
-
right_button_manager = create_button_manager({
|
|
56
|
-
type: "soft",
|
|
57
|
-
is_uniform: true,
|
|
58
|
-
support_icon: "arrow",
|
|
59
|
-
icon_deg: 90,
|
|
60
|
-
icon_size: 1.4,
|
|
61
|
-
on_click: () => page_click(cur_page + 1),
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
init(config)
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
get cur_page() {
|
|
69
|
-
return cur_page
|
|
70
|
-
},
|
|
71
|
-
get total_pages() {
|
|
72
|
-
return total_pages
|
|
73
|
-
},
|
|
74
|
-
get left_button_manager() {
|
|
75
|
-
return left_button_manager
|
|
76
|
-
},
|
|
77
|
-
get page_one_button_manager() {
|
|
78
|
-
return page_one_button_manager
|
|
79
|
-
},
|
|
80
|
-
get before_page_button_manager() {
|
|
81
|
-
return before_page_button_manager
|
|
82
|
-
},
|
|
83
|
-
get cur_page_button_manager() {
|
|
84
|
-
return cur_page_button_manager
|
|
85
|
-
},
|
|
86
|
-
get after_page_button_manager() {
|
|
87
|
-
return after_page_button_manager
|
|
88
|
-
},
|
|
89
|
-
get last_page_button_manager() {
|
|
90
|
-
return last_page_button_manager
|
|
91
|
-
},
|
|
92
|
-
get right_button_manager() {
|
|
93
|
-
return right_button_manager
|
|
94
|
-
},
|
|
95
|
-
page_click,
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Popover from "../../Popover/index.svelte"
|
|
3
|
-
import Button from "../../Button/index.svelte"
|
|
4
|
-
import Checkbox from "../../Checkbox/index.svelte"
|
|
5
|
-
import VariablePathInput from "../../VariablePathInput/index.svelte"
|
|
6
|
-
|
|
7
|
-
let { manager } = $props()
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
{#snippet sort_content()}
|
|
11
|
-
<div class="table_container">
|
|
12
|
-
<table style="margin: 0;">
|
|
13
|
-
<thead>
|
|
14
|
-
<tr>
|
|
15
|
-
<th>Sort Order</th>
|
|
16
|
-
<th>Data Variable Path</th>
|
|
17
|
-
<th>Is Ascending</th>
|
|
18
|
-
<th>Remove</th>
|
|
19
|
-
<th></th>
|
|
20
|
-
</tr>
|
|
21
|
-
</thead>
|
|
22
|
-
<tbody>
|
|
23
|
-
{#if Array.isArray(manager?.sorts_prepped) && manager?.sorts_prepped.length > 0}
|
|
24
|
-
{#each manager?.sorts_prepped as sort_prepped, i}
|
|
25
|
-
<tr>
|
|
26
|
-
<td>{i == 0 ? "Primary" : "Subsort"}</td>
|
|
27
|
-
<td>
|
|
28
|
-
<VariablePathInput manager={sort_prepped?.variable_path_input_manager} />
|
|
29
|
-
</td>
|
|
30
|
-
<td>
|
|
31
|
-
<Checkbox manager={sort_prepped?.is_ascending_checkbox_manager} />
|
|
32
|
-
</td>
|
|
33
|
-
<td><Button manager={sort_prepped?.delete_button_manager} /></td>
|
|
34
|
-
</tr>
|
|
35
|
-
{/each}
|
|
36
|
-
{:else}
|
|
37
|
-
<tr>
|
|
38
|
-
<td colspan="4">No Sorts added yet</td>
|
|
39
|
-
</tr>
|
|
40
|
-
{/if}
|
|
41
|
-
</tbody>
|
|
42
|
-
</table>
|
|
43
|
-
</div>
|
|
44
|
-
<div style="margin-top: 1rem;">
|
|
45
|
-
<Button manager={manager?.add_sort_button_manager} />
|
|
46
|
-
</div>
|
|
47
|
-
{/snippet}
|
|
48
|
-
|
|
49
|
-
{#if manager?.is_popover}
|
|
50
|
-
{#if manager?.is_show_popover_toggle_button}
|
|
51
|
-
<Button manager={manager?.popover_toggle_button_manager} />
|
|
52
|
-
{/if}
|
|
53
|
-
<Popover manager={manager?.popover_manager}>
|
|
54
|
-
{#snippet content()}
|
|
55
|
-
{@render sort_content()}
|
|
56
|
-
{/snippet}
|
|
57
|
-
{#snippet footer()}
|
|
58
|
-
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
|
|
59
|
-
<Button manager={manager?.save_server_sort_button_manager} />
|
|
60
|
-
<Button manager={manager?.apply_sorting_button_manager} />
|
|
61
|
-
</div>
|
|
62
|
-
{/snippet}
|
|
63
|
-
</Popover>
|
|
64
|
-
{:else}
|
|
65
|
-
{@render sort_content()}
|
|
66
|
-
{/if}
|
|
67
|
-
|
|
68
|
-
<style>
|
|
69
|
-
th {
|
|
70
|
-
font-size: 1.2rem;
|
|
71
|
-
}
|
|
72
|
-
</style>
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { create_popover_manager } from "../../Popover/index.svelte.js"
|
|
2
|
-
import { create_button_manager } from "../../Button/index.svelte.js"
|
|
3
|
-
import { create_checkbox_manager } from "../../Checkbox/index.svelte.js"
|
|
4
|
-
import { create_variable_path_input_manager } from "../../VariablePathInput/index.svelte.js"
|
|
5
|
-
import { set_closurable } from "../../../client/index.js"
|
|
6
|
-
|
|
7
|
-
export function create_sort_by_input_manager(config) {
|
|
8
|
-
let row_data_type = $derived(set_closurable(config?.row_data_type, null))
|
|
9
|
-
let is_popover = $derived(set_closurable(config?.is_popover, false))
|
|
10
|
-
let popover_anchor_id = $derived(set_closurable(config?.popover_anchor_id, null))
|
|
11
|
-
let is_show_popover_toggle_button = $derived(set_closurable(config?.is_show_popover_toggle_button, true))
|
|
12
|
-
let popover_toggle_button_manager = $state(null)
|
|
13
|
-
let popover_manager = $state(null)
|
|
14
|
-
let apply_sorting_button_manager = $state(null)
|
|
15
|
-
let save_server_sort_button_manager = $state(null)
|
|
16
|
-
let add_sort_button_manager = $state(null)
|
|
17
|
-
let sorts_prepped = $state(null)
|
|
18
|
-
|
|
19
|
-
let val = $derived(get_sorts_from_prepped())
|
|
20
|
-
|
|
21
|
-
function get_sorts_from_prepped() {
|
|
22
|
-
let sorts = []
|
|
23
|
-
if (Array.isArray(sorts_prepped)) {
|
|
24
|
-
for (let sort_prepped of sorts_prepped) {
|
|
25
|
-
sorts.push({
|
|
26
|
-
is_ascending: sort_prepped?.is_ascending_checkbox_manager?.val,
|
|
27
|
-
variable_path: sort_prepped?.variable_path_input_manager?.val,
|
|
28
|
-
})
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return sorts
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function set_sorts_prepped(sorts) {
|
|
35
|
-
let sorts_prepped_loc = []
|
|
36
|
-
if (Array.isArray(sorts)) {
|
|
37
|
-
for (let i = 0; i < sorts.length; i++) {
|
|
38
|
-
let delete_button_manager = create_button_manager({
|
|
39
|
-
type: "outlined",
|
|
40
|
-
is_uniform: true,
|
|
41
|
-
support_icon: "x",
|
|
42
|
-
color: "var(--error-t)",
|
|
43
|
-
on_click: () => {
|
|
44
|
-
if (Array.isArray(sorts_prepped) && i >= 0 && i < sorts_prepped.length) {
|
|
45
|
-
sorts_prepped.splice(i, 1)
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
})
|
|
49
|
-
let is_ascending_checkbox_manager = create_checkbox_manager({
|
|
50
|
-
type: "toggle",
|
|
51
|
-
val: sorts?.[i]?.is_ascending ?? null,
|
|
52
|
-
on_change: () => {
|
|
53
|
-
console.log("toggle is ascending")
|
|
54
|
-
},
|
|
55
|
-
})
|
|
56
|
-
let variable_path_input_manager = create_variable_path_input_manager({
|
|
57
|
-
is_popover: false,
|
|
58
|
-
defined_data_type: row_data_type,
|
|
59
|
-
get_defined_options: config?.get_defined_options,
|
|
60
|
-
val: sorts?.[i]?.variable_path ?? null,
|
|
61
|
-
on_finish: () => variable_path_input_manager.close_popover(),
|
|
62
|
-
})
|
|
63
|
-
sorts_prepped_loc.push({
|
|
64
|
-
...sorts?.[i],
|
|
65
|
-
delete_button_manager: delete_button_manager,
|
|
66
|
-
is_ascending_checkbox_manager: is_ascending_checkbox_manager,
|
|
67
|
-
variable_path_input_manager: variable_path_input_manager,
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
sorts_prepped = sorts_prepped_loc
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let save_server_sort_is_loading = $state(false)
|
|
75
|
-
function init(config) {
|
|
76
|
-
popover_manager = create_popover_manager({
|
|
77
|
-
header: "Sort By",
|
|
78
|
-
type: "dropdown",
|
|
79
|
-
target_height: 300,
|
|
80
|
-
anchor_id: () =>
|
|
81
|
-
is_show_popover_toggle_button ? `button_${popover_toggle_button_manager?.id}` : popover_anchor_id,
|
|
82
|
-
})
|
|
83
|
-
popover_toggle_button_manager = create_button_manager({
|
|
84
|
-
type: "soft",
|
|
85
|
-
text: "Sort by",
|
|
86
|
-
is_compressed: true,
|
|
87
|
-
popover_target: () => `popover_${popover_manager?.id}`,
|
|
88
|
-
})
|
|
89
|
-
apply_sorting_button_manager = create_button_manager({
|
|
90
|
-
text: "Apply Local Sort",
|
|
91
|
-
on_click: () => {
|
|
92
|
-
if (typeof config?.apply_sort == "function") {
|
|
93
|
-
config?.apply_sort(val)
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
})
|
|
97
|
-
save_server_sort_button_manager = create_button_manager({
|
|
98
|
-
type: "outlined",
|
|
99
|
-
text: "Save Server Sort",
|
|
100
|
-
on_click: async () => {
|
|
101
|
-
save_server_sort_is_loading = true
|
|
102
|
-
if (typeof config?.save_server_sort == "function") {
|
|
103
|
-
const res = await config?.save_server_sort(val)
|
|
104
|
-
if (res?.is_success) {
|
|
105
|
-
save_server_sort_button_manager.success_trigger()
|
|
106
|
-
} else {
|
|
107
|
-
save_server_sort_button_manager.error_trigger()
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
save_server_sort_is_loading = false
|
|
111
|
-
},
|
|
112
|
-
})
|
|
113
|
-
add_sort_button_manager = create_button_manager({
|
|
114
|
-
text: "Add Sort Item",
|
|
115
|
-
support_icon: "plus",
|
|
116
|
-
is_compressed: true,
|
|
117
|
-
on_click: () => {
|
|
118
|
-
let sorts = []
|
|
119
|
-
if (Array.isArray(sorts_prepped)) {
|
|
120
|
-
for (let sort_prepped of sorts_prepped) {
|
|
121
|
-
sorts.push({
|
|
122
|
-
is_ascending: sort_prepped?.is_ascending_checkbox_manager?.val,
|
|
123
|
-
variable_path: sort_prepped?.variable_path_input_manager?.val,
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
sorts = [
|
|
128
|
-
...sorts,
|
|
129
|
-
{
|
|
130
|
-
is_ascending: false,
|
|
131
|
-
variable_path: null,
|
|
132
|
-
},
|
|
133
|
-
]
|
|
134
|
-
set_sorts_prepped(sorts)
|
|
135
|
-
},
|
|
136
|
-
})
|
|
137
|
-
set_sorts_prepped(config?.val)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
init(config)
|
|
141
|
-
|
|
142
|
-
return {
|
|
143
|
-
get val() {
|
|
144
|
-
return val
|
|
145
|
-
},
|
|
146
|
-
get row_data_type() {
|
|
147
|
-
return row_data_type
|
|
148
|
-
},
|
|
149
|
-
get is_popover() {
|
|
150
|
-
return is_popover
|
|
151
|
-
},
|
|
152
|
-
get is_show_popover_toggle_button() {
|
|
153
|
-
return is_show_popover_toggle_button
|
|
154
|
-
},
|
|
155
|
-
get popover_toggle_button_manager() {
|
|
156
|
-
return popover_toggle_button_manager
|
|
157
|
-
},
|
|
158
|
-
get popover_manager() {
|
|
159
|
-
return popover_manager
|
|
160
|
-
},
|
|
161
|
-
get apply_sorting_button_manager() {
|
|
162
|
-
return apply_sorting_button_manager
|
|
163
|
-
},
|
|
164
|
-
get save_server_sort_button_manager() {
|
|
165
|
-
return save_server_sort_button_manager
|
|
166
|
-
},
|
|
167
|
-
get sorts_prepped() {
|
|
168
|
-
return sorts_prepped
|
|
169
|
-
},
|
|
170
|
-
get add_sort_button_manager() {
|
|
171
|
-
return add_sort_button_manager
|
|
172
|
-
},
|
|
173
|
-
init,
|
|
174
|
-
set_sorts_prepped,
|
|
175
|
-
}
|
|
176
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Icon from "../Icon/index.svelte"
|
|
3
|
-
|
|
4
|
-
let { manager } = $props()
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
{#if manager?.tag_val}
|
|
8
|
-
<div style="display: flex;">
|
|
9
|
-
<div
|
|
10
|
-
class="tag"
|
|
11
|
-
style="
|
|
12
|
-
--bg_color: oklch(var(--l6-t) var(--c{manager?.tag_val?.color?.c ?? 16}) var(--h{manager?.tag_val?.color
|
|
13
|
-
?.h}) / var(--o4));
|
|
14
|
-
--border_color: oklch(var(--l6-t) var(--c{manager?.tag_val?.color?.c ?? 16}) var(--h{manager?.tag_val?.color
|
|
15
|
-
?.h}) / var(--o8));"
|
|
16
|
-
>
|
|
17
|
-
{#if manager?.tag_val?.display_text}
|
|
18
|
-
<p
|
|
19
|
-
style="color: oklch(var(--l5-t) var(--c{manager?.tag_val?.color?.c ?? 4}) var(--h{manager?.tag_val?.color
|
|
20
|
-
?.h}));"
|
|
21
|
-
>
|
|
22
|
-
{manager?.tag_val?.display_text ?? ""}
|
|
23
|
-
</p>
|
|
24
|
-
{/if}
|
|
25
|
-
{#if manager?.tag_val?.icon}
|
|
26
|
-
<Icon manager={manager?.icon_manager} />
|
|
27
|
-
{/if}
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
{/if}
|
|
31
|
-
|
|
32
|
-
<style>
|
|
33
|
-
.tag {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex: 0;
|
|
36
|
-
gap: 1rem;
|
|
37
|
-
align-items: center;
|
|
38
|
-
border-radius: 1rem;
|
|
39
|
-
border: 1px solid var(--border_color);
|
|
40
|
-
background-color: var(--bg_color);
|
|
41
|
-
font-size: 1.4rem;
|
|
42
|
-
min-height: 3rem;
|
|
43
|
-
padding: 0.1rem 0.8rem;
|
|
44
|
-
}
|
|
45
|
-
</style>
|