Adding the ability to quickly edit most fields. Other general clean up.
This commit is contained in:
@@ -87,7 +87,7 @@ export async function handle_load_ae_obj_li__event_presentation(
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
|
||||
@@ -87,7 +87,7 @@ export async function handle_load_ae_obj_li__event_presenter(
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'given_name': 'ASC', 'family_name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
@@ -177,13 +177,13 @@ export async function handle_update_ae_obj__event_presenter(
|
||||
{
|
||||
api_cfg,
|
||||
event_presenter_id,
|
||||
data,
|
||||
data_kv,
|
||||
params={},
|
||||
log_lvl=0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_presenter_id: string,
|
||||
data: any,
|
||||
data_kv: any,
|
||||
params?: key_val,
|
||||
log_lvl?: number
|
||||
}
|
||||
@@ -194,7 +194,7 @@ export async function handle_update_ae_obj__event_presenter(
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_presenter',
|
||||
obj_id: event_presenter_id, // NOTE: This is the FQDN, not normally the ID.
|
||||
fields: data,
|
||||
fields: data_kv,
|
||||
key: api_cfg.api_crud_super_key,
|
||||
params: params,
|
||||
return_obj: true,
|
||||
|
||||
@@ -88,7 +88,7 @@ export async function handle_load_ae_obj_li__event_session(
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
|
||||
@@ -33,7 +33,7 @@ export let textarea_rows: number = 5;
|
||||
export let hide_edit_btn = false;
|
||||
export let outline_element = false;
|
||||
export let show_crud = false;
|
||||
export let btn_label = '<span class="fas fa-check"></span> Save'; // PATCH
|
||||
export let btn_label = '<span class="fas fa-check mx-1"></span> Save'; // PATCH
|
||||
|
||||
// export let show_field_name = true;
|
||||
// export let show_original_value = true;
|
||||
@@ -142,7 +142,7 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
<slot></slot>
|
||||
|
||||
<button
|
||||
class="btn btn-sm field_show_btn"
|
||||
class="btn btn-sm variant-soft-warning hover:variant-ghost-error field_show_btn"
|
||||
class:hide_edit_btn
|
||||
class:show_crud
|
||||
on:dblclick={() => {
|
||||
@@ -156,7 +156,7 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
|
||||
<span class="field_editing_wrapper">
|
||||
<button
|
||||
class="btn btn-sm btn_default field_hide_btn"
|
||||
class="btn btn-sm variant-soft-tertiary hover:variant-ghost-tertiary m-1"
|
||||
class:show_crud
|
||||
on:click={() => {
|
||||
show_crud = false;
|
||||
@@ -173,27 +173,39 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
<!-- <input type="button" bind:value={field_value}> -->
|
||||
{field_value}
|
||||
{:else if field_type == 'text'}
|
||||
<input bind:value={field_value}>
|
||||
<input
|
||||
bind:value={field_value}
|
||||
class="input w-fit"
|
||||
>
|
||||
{:else if field_type == 'textarea'}
|
||||
<textarea bind:value={field_value} cols={textarea_cols} rows={textarea_rows}></textarea>
|
||||
<textarea
|
||||
bind:value={field_value}
|
||||
cols={textarea_cols}
|
||||
rows={textarea_rows}
|
||||
class="textarea"
|
||||
></textarea>
|
||||
{:else}
|
||||
<input bind:value={field_value}>
|
||||
<input
|
||||
bind:value={field_value}
|
||||
class="input w-fit"
|
||||
>
|
||||
{/if}
|
||||
{#if allow_null}
|
||||
<button
|
||||
class="btn btn-sm btn_warning null_value_btn"
|
||||
class="btn btn-sm variant-soft-warning hover:variant-ghost-warning m-1"
|
||||
on:click={async () => {
|
||||
field_value = null;
|
||||
}}
|
||||
title="Set value to NULL"
|
||||
>
|
||||
{@html '�'} NULL
|
||||
Ø
|
||||
NULL
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
<button
|
||||
class="btn btn-md btn_primary field_patch_btn"
|
||||
class="btn btn-md variant-soft-primary hover:variant-ghost-primary m-1"
|
||||
class:show_crud
|
||||
on:click={async () => {
|
||||
handle_obj_field_patch(field_value);
|
||||
@@ -219,9 +231,9 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
|
||||
|
||||
<style>
|
||||
.ae_crud .field_editing_wrapper {
|
||||
font-size: em;
|
||||
}
|
||||
/* .ae_crud .field_editing_wrapper {
|
||||
font-size: 1em;
|
||||
} */
|
||||
|
||||
|
||||
/* BEGIN: Svelte CRUD (update) component */
|
||||
@@ -256,10 +268,11 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
color: hsla(0,0%,50%,.8);
|
||||
/* color: hsla(0,0%,50%,.8); */
|
||||
opacity: .25;
|
||||
|
||||
/* NOTE: transition when hover ends */
|
||||
transition-property: background-color, border-color, color, height, width;
|
||||
transition-property: opacity, background-color, border-color, color, height, width;
|
||||
transition-delay: 1.00s; /* no delay */
|
||||
transition-duration: .55s;
|
||||
transition-timing-function: linear;
|
||||
@@ -267,10 +280,12 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
|
||||
.ae_crud .field_viewing_wrapper:hover .field_show_btn {
|
||||
/* outline: solid thin hsla(0,50%,50%,.9); */
|
||||
color: hsla(0,50%,50%,.9);
|
||||
/* color: hsla(0,50%,50%,.9); */
|
||||
|
||||
opacity: 1;
|
||||
|
||||
/* NOTE: transition when hover starts */
|
||||
transition-property: background-color, border-color, color, height, width;
|
||||
transition-property: opacity, background-color, border-color, color, height, width;
|
||||
transition-delay: .25s; /* no delay */
|
||||
transition-duration: .50s;
|
||||
transition-timing-function: linear;
|
||||
@@ -330,7 +345,7 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
transition-duration: .25s;
|
||||
transition-timing-function: linear;
|
||||
|
||||
position: absolute;
|
||||
/* position: absolute; */
|
||||
/* position: fixed; */
|
||||
/* position: relative; */
|
||||
/* top: 1em; */
|
||||
|
||||
Reference in New Issue
Block a user