Builds client SSR approach, sunsets old cljs.

This commit is contained in:
2024-01-09 21:40:43 -08:00
parent d824cdfff4
commit 8063a8fcbd
74 changed files with 4603 additions and 4047 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
let
Source = Json.Document(Web.Contents("https://app.integreatconsult.com/api/queries/%s/results/json", [Headers=[#"Accept-Encoding"="gzip"]])),
rawtable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
mytable = Table.FromRecords(Table.TransformRows(rawtable, (x) as record => Record.FromList(x[Column1], {"Date", "Total", "Fee"}))),
#"Changed Type" = Table.TransformColumnTypes(mytable,{{"Total", Currency.Type}, {"Fee", Currency.Type}, {"Date", type date}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Ascending}})
in
#"Sorted Rows"

View File

@@ -0,0 +1,8 @@
let
Source = Json.Document(Web.Contents("https://app.integreatconsult.com/api/queries/%s/results/json", [Headers=[#"Accept-Encoding"="gzip"]])),
rawtable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
mytable = Table.FromRecords(Table.TransformRows(rawtable, (x) as record => Record.FromList(x[Column1], {"Date", "Type", "Total", "Fee"}))),
#"Changed Type" = Table.TransformColumnTypes(mytable,{{"Total", Currency.Type}, {"Fee", Currency.Type}, {"Date", type date}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Ascending}})
in
#"Sorted Rows"

View File

@@ -0,0 +1,8 @@
let
Source = Json.Document(Web.Contents("https://app.integreatconsult.com/api/queries/%s/results/json", [Headers=[#"Accept-Encoding"="gzip"]])),
rawtable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
mytable = Table.FromRecords(Table.TransformRows(rawtable, (x) as record => Record.FromList(x[Column1], {"Date", "Category", "Name", "Total", "Tax", "Discount"}))),
#"Changed Type" = Table.TransformColumnTypes(mytable,{{"Total", Currency.Type}, {"Tax", Currency.Type}, {"Discount", Currency.Type}, {"Date", type date}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Ascending}, {"Category", Order.Ascending}})
in
#"Sorted Rows"

View File

@@ -0,0 +1,8 @@
let
Source = Json.Document(Web.Contents("https://app.integreatconsult.com/api/queries/%s/results/json", [Headers=[#"Accept-Encoding"="gzip"]])),
rawtable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
mytable = Table.FromRecords(Table.TransformRows(rawtable, (x) as record => Record.FromList(x[Column1], {"Date", "Total", "Tax", "Tip", "Service Charge", "Discount", "Returns"}))),
#"Changed Type" = Table.TransformColumnTypes(mytable,{{"Total", Currency.Type}, {"Tax", Currency.Type}, {"Discount", Currency.Type}, {"Service Charge", Currency.Type}, {"Returns", Currency.Type}, {"Tip", Currency.Type}, {"Date", type date}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Ascending}})
in
#"Sorted Rows"

View File

@@ -0,0 +1,8 @@
let
Source = Json.Document(Web.Contents("https://app.integreatconsult.com/api/queries/%s/results/json", [Headers=[#"Accept-Encoding"="gzip"]])),
rawtable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
mytable = Table.FromRecords(Table.TransformRows(rawtable, (x) as record => Record.FromList(x[Column1], {"Date", "Type", "Processor", "Total", "Tip"}))),
#"Changed Type" = Table.TransformColumnTypes(mytable,{{"Total", Currency.Type}, {"Tip", Currency.Type}, {"Date", type date}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Ascending}})
in
#"Sorted Rows"

View File

@@ -120,12 +120,54 @@ htmx.defineExtension('trigger-filter', {
initDatepicker = function(elem) {
elem.dp = new Datepicker(elem, {format: "mm/dd/yyyy", autohide: true});
const modalParent = elem.closest('#modal-content');
if (modalParent) {
elem.dp = new Datepicker(elem, {format: "mm/dd/yyyy", autohide: true, container: ".modal-stack"});
} else {
elem.dp = new Datepicker(elem, {format: "mm/dd/yyyy", autohide: true});
}
}
countRows = function(id) {
var table = document.querySelector(id);
var rows = table.querySelectorAll("tbody tr");
console.log("ROWS", rows.length);
return rows.length;
}
htmx.onLoad(function(content) {
var sortables = content.querySelectorAll(".sortable");
for (var i = 0; i < sortables.length; i++) {
var sortable = sortables[i];
var sortableInstance = new Sortable(sortable, {
animation: 150,
ghostClass: 'bg-blue-100',
// Make the `.htmx-indicator` unsortable
filter: ".htmx-indicator",
onMove: function (evt) {
return evt.related.className.indexOf('htmx-indicator') === -1;
},
// Disable sorting on the `end` event
onEnd: function (evt) {
this.option("disabled", true);
}
});
// Re-enable sorting on the `htmx:afterSwap` event
sortable.addEventListener("htmx:afterSwap", function() {
sortableInstance.option("disabled", false);
});
}
})
async function copyToClipboard(text) {
try {
// Write the text to the clipboard
await navigator.clipboard.writeText(text);
console.log('Text copied to clipboard:', text);
} catch (err) {
console.error('Failed to copy text to clipboard:', err);
}
}

File diff suppressed because one or more lines are too long