y200subcontrols 0.1.32 → 0.1.33
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.
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script>import { DataTableCell } from "../index.js";
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
export let width;
|
|
4
|
+
export let breakpoint = void 0;
|
|
5
|
+
export let extendedCss = "";
|
|
6
|
+
export let colspan = 0;
|
|
7
|
+
export let orderBy = void 0;
|
|
8
|
+
const dispatch = createEventDispatcher();
|
|
9
|
+
let sortDirection = "asc";
|
|
10
|
+
function handleSortChanged() {
|
|
11
|
+
if (sortDirection === "asc") {
|
|
12
|
+
sortDirection = "desc";
|
|
13
|
+
} else if (sortDirection === "desc") {
|
|
14
|
+
sortDirection = "asc";
|
|
15
|
+
}
|
|
16
|
+
let fullOrderBy = `${orderBy} ${sortDirection}`;
|
|
17
|
+
dispatch("sortChanged", {
|
|
18
|
+
orderBy,
|
|
19
|
+
sortDirection,
|
|
20
|
+
fullOrderBy,
|
|
21
|
+
isAscending: sortDirection === "asc"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<DataTableCell isHeader={true} {width} {breakpoint} {extendedCss} {colspan}>
|
|
27
|
+
<button type="button" class="flex space-x-2 w-full" on:click={handleSortChanged}>
|
|
28
|
+
|
|
29
|
+
<div class="flex-grow flex-shrink-0 ">
|
|
30
|
+
<slot />
|
|
31
|
+
</div>
|
|
32
|
+
<div class="my-auto ml-auto ">
|
|
33
|
+
<svg
|
|
34
|
+
class="w-4 h-4 transition-all ease-in-out rotate-0 {sortDirection === 'asc' ? 'rotate-0' : 'rotate-180'}"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
width="24"
|
|
38
|
+
height="24"
|
|
39
|
+
fill="none"
|
|
40
|
+
viewBox="0 0 24 24"
|
|
41
|
+
>
|
|
42
|
+
<path
|
|
43
|
+
stroke="currentColor"
|
|
44
|
+
stroke-linecap="round"
|
|
45
|
+
stroke-linejoin="round"
|
|
46
|
+
stroke-width="2"
|
|
47
|
+
d="m19 9-7 7-7-7"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
50
|
+
</div>
|
|
51
|
+
</button>
|
|
52
|
+
</DataTableCell>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
width: number | undefined;
|
|
5
|
+
breakpoint?: "sm" | "md" | "lg" | undefined;
|
|
6
|
+
extendedCss?: string;
|
|
7
|
+
colspan?: number;
|
|
8
|
+
orderBy?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
sortChanged: CustomEvent<any>;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {
|
|
16
|
+
default: {};
|
|
17
|
+
};
|
|
18
|
+
exports?: {} | undefined;
|
|
19
|
+
bindings?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type DataTableHeaderCellProps = typeof __propDef.props;
|
|
22
|
+
export type DataTableHeaderCellEvents = typeof __propDef.events;
|
|
23
|
+
export type DataTableHeaderCellSlots = typeof __propDef.slots;
|
|
24
|
+
export default class DataTableHeaderCell extends SvelteComponent<DataTableHeaderCellProps, DataTableHeaderCellEvents, DataTableHeaderCellSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
package/dist/date-utils.d.ts
CHANGED
package/dist/date-utils.js
CHANGED
|
@@ -27,3 +27,15 @@ export function getMonthLimits(date) {
|
|
|
27
27
|
dateEnd
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
export function getDayLimits(date) {
|
|
31
|
+
date ??= new Date();
|
|
32
|
+
const year = date.getFullYear();
|
|
33
|
+
const month = date.getMonth();
|
|
34
|
+
const day = date.getDate();
|
|
35
|
+
const dateStart = new Date(year, month, day, 0, 0, 0, 0);
|
|
36
|
+
const dateEnd = new Date(year, month, day, 23, 59, 59, 999);
|
|
37
|
+
return {
|
|
38
|
+
dateStart,
|
|
39
|
+
dateEnd
|
|
40
|
+
};
|
|
41
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import Pill from "./components/Pill.svelte";
|
|
|
30
30
|
import PillBoolean from "./components/PillBoolean.svelte";
|
|
31
31
|
import DropDownButton from "./components/DropDownButton.svelte";
|
|
32
32
|
import Table from "./components/Table.svelte";
|
|
33
|
-
import { formatDateTime, getMonthLimits } from "./date-utils.js";
|
|
33
|
+
import { formatDateTime, getDayLimits, getMonthLimits } from "./date-utils.js";
|
|
34
34
|
import { formatNumber } from "./number-utils.js";
|
|
35
35
|
import ListBox from "./components/ListBox.svelte";
|
|
36
36
|
import HeadlessMenu from "./components/HeadlessMenu.svelte";
|
|
@@ -39,4 +39,5 @@ import Drawer from "./components/Drawer.svelte";
|
|
|
39
39
|
import Divider from "./components/Divider.svelte";
|
|
40
40
|
import ConfirmModalDialog from "./components/ConfirmModalDialog.svelte";
|
|
41
41
|
import DropDownSearch from "./components/DropDownSearch.svelte";
|
|
42
|
-
|
|
42
|
+
import DataTableHeaderCell from "./components/DataTableHeaderCell.svelte";
|
|
43
|
+
export { Button, LoadingIndicator, Card, CardHeader, Form, ToggleButton, LabeledFormInput, LabeledPasswordInput, Alert, HyperLink, LabeledSelect, ModalDialog, BooleanPresenter, DataTable, DataTableCell, DataTableRow, DataTableMenuButton, DatePresenter, LabeledDatePicker, LabeledTextArea, Breadcrumb, SegmentedControl, HyperlinkButton, SideNav, SideNavItem, DataTablePaginator, TabControl, TabItem, Pill, PillBoolean, DropDownButton, DropDownSearch, Table, ListBox, HeadlessMenu, Drawer, CodePresenter, Divider, ConfirmModalDialog, DataTableHeaderCell, formatDateTime, getMonthLimits, getDayLimits, formatNumber, };
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import Pill from "./components/Pill.svelte";
|
|
|
31
31
|
import PillBoolean from "./components/PillBoolean.svelte";
|
|
32
32
|
import DropDownButton from "./components/DropDownButton.svelte";
|
|
33
33
|
import Table from "./components/Table.svelte";
|
|
34
|
-
import { formatDateTime, getMonthLimits } from "./date-utils.js";
|
|
34
|
+
import { formatDateTime, getDayLimits, getMonthLimits } from "./date-utils.js";
|
|
35
35
|
import { formatNumber } from "./number-utils.js";
|
|
36
36
|
import ListBox from "./components/ListBox.svelte";
|
|
37
37
|
import HeadlessMenu from "./components/HeadlessMenu.svelte";
|
|
@@ -40,4 +40,5 @@ import Drawer from "./components/Drawer.svelte";
|
|
|
40
40
|
import Divider from "./components/Divider.svelte";
|
|
41
41
|
import ConfirmModalDialog from "./components/ConfirmModalDialog.svelte";
|
|
42
42
|
import DropDownSearch from "./components/DropDownSearch.svelte";
|
|
43
|
-
|
|
43
|
+
import DataTableHeaderCell from "./components/DataTableHeaderCell.svelte";
|
|
44
|
+
export { Button, LoadingIndicator, Card, CardHeader, Form, ToggleButton, LabeledFormInput, LabeledPasswordInput, Alert, HyperLink, LabeledSelect, ModalDialog, BooleanPresenter, DataTable, DataTableCell, DataTableRow, DataTableMenuButton, DatePresenter, LabeledDatePicker, LabeledTextArea, Breadcrumb, SegmentedControl, HyperlinkButton, SideNav, SideNavItem, DataTablePaginator, TabControl, TabItem, Pill, PillBoolean, DropDownButton, DropDownSearch, Table, ListBox, HeadlessMenu, Drawer, CodePresenter, Divider, ConfirmModalDialog, DataTableHeaderCell, formatDateTime, getMonthLimits, getDayLimits, formatNumber, };
|