@simplysm/solid 13.0.70 → 13.0.71
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/README.md +1 -1
- package/dist/components/disclosure/Dropdown.d.ts +6 -4
- package/dist/components/disclosure/Dropdown.d.ts.map +1 -1
- package/dist/components/disclosure/Dropdown.js +24 -8
- package/dist/components/disclosure/Dropdown.js.map +2 -2
- package/dist/components/disclosure/dialogZIndex.d.ts +2 -0
- package/dist/components/disclosure/dialogZIndex.d.ts.map +1 -1
- package/dist/components/disclosure/dialogZIndex.js +4 -0
- package/dist/components/disclosure/dialogZIndex.js.map +1 -1
- package/dist/components/features/crud-detail/CrudDetail.d.ts.map +1 -1
- package/dist/components/features/crud-detail/CrudDetail.js +16 -7
- package/dist/components/features/crud-detail/CrudDetail.js.map +2 -2
- package/dist/components/features/crud-sheet/CrudSheet.d.ts.map +1 -1
- package/dist/components/features/crud-sheet/CrudSheet.js +14 -5
- package/dist/components/features/crud-sheet/CrudSheet.js.map +2 -2
- package/dist/components/features/crudRegistry.d.ts +16 -0
- package/dist/components/features/crudRegistry.d.ts.map +1 -0
- package/dist/components/features/crudRegistry.js +37 -0
- package/dist/components/features/crudRegistry.js.map +6 -0
- package/dist/components/features/permission-table/PermissionTable.d.ts.map +1 -1
- package/dist/components/features/permission-table/PermissionTable.js +71 -86
- package/dist/components/features/permission-table/PermissionTable.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelect.js +2 -4
- package/dist/components/features/shared-data/SharedDataSelect.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelectList.d.ts +2 -4
- package/dist/components/features/shared-data/SharedDataSelectList.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectList.js +11 -46
- package/dist/components/features/shared-data/SharedDataSelectList.js.map +2 -2
- package/dist/components/form-control/select/Select.d.ts.map +1 -1
- package/dist/components/form-control/select/Select.js +1 -1
- package/dist/components/form-control/select/Select.js.map +1 -1
- package/dist/helpers/createAppStructure.d.ts.map +1 -1
- package/dist/helpers/createAppStructure.js +3 -2
- package/dist/helpers/createAppStructure.js.map +1 -1
- package/dist/helpers/createHmrSafeContext.d.ts +3 -0
- package/dist/helpers/createHmrSafeContext.d.ts.map +1 -0
- package/dist/helpers/createHmrSafeContext.js +10 -0
- package/dist/helpers/createHmrSafeContext.js.map +6 -0
- package/dist/hooks/createSelectionGroup.d.ts.map +1 -1
- package/dist/hooks/createSelectionGroup.js +3 -2
- package/dist/hooks/createSelectionGroup.js.map +2 -2
- package/package.json +6 -5
- package/src/components/disclosure/Dropdown.tsx +31 -17
- package/src/components/disclosure/dialogZIndex.ts +5 -0
- package/src/components/features/crud-detail/CrudDetail.tsx +16 -5
- package/src/components/features/crud-sheet/CrudSheet.tsx +13 -3
- package/src/components/features/crudRegistry.ts +60 -0
- package/src/components/features/permission-table/PermissionTable.tsx +49 -46
- package/src/components/features/shared-data/SharedDataSelect.tsx +2 -2
- package/src/components/features/shared-data/SharedDataSelectList.tsx +11 -36
- package/src/components/form-control/select/Select.tsx +1 -5
- package/src/helpers/createAppStructure.ts +3 -2
- package/src/helpers/createHmrSafeContext.ts +8 -0
- package/src/hooks/createSelectionGroup.tsx +4 -2
- package/tests/components/data/List.spec.tsx +52 -52
- package/tests/components/data/Pagination.spec.tsx +43 -43
- package/tests/components/data/Table.spec.tsx +4 -4
- package/tests/components/data/kanban/Kanban.selection.spec.tsx +21 -21
- package/tests/components/data/sheet/DataSheet.spec.tsx +50 -50
- package/tests/components/disclosure/Collapse.spec.tsx +24 -24
- package/tests/components/disclosure/Dialog.spec.tsx +33 -33
- package/tests/components/disclosure/DialogProvider.spec.tsx +9 -9
- package/tests/components/disclosure/Dropdown.spec.tsx +134 -14
- package/tests/components/disclosure/Tabs.spec.tsx +21 -21
- package/tests/components/disclosure/dialogZIndex.spec.ts +45 -0
- package/tests/components/display/Alert.spec.tsx +4 -4
- package/tests/components/display/Barcode.spec.tsx +7 -7
- package/tests/components/display/Card.spec.tsx +3 -3
- package/tests/components/display/Link.spec.tsx +5 -5
- package/tests/components/display/Tag.spec.tsx +4 -4
- package/tests/components/features/address/AddressSearch.spec.tsx +3 -3
- package/tests/components/features/crudRegistry.spec.ts +119 -0
- package/tests/components/features/data-select-button/DataSelectButton.spec.tsx +8 -8
- package/tests/components/features/permission-table/PermissionTable.spec.tsx +43 -43
- package/tests/components/features/shared-data/SharedDataSelectList.spec.tsx +2 -17
- package/tests/components/feedback/busy/BusyContainer.spec.tsx +7 -7
- package/tests/components/feedback/notification/NotificationBell.spec.tsx +9 -9
- package/tests/components/feedback/print/Print.spec.tsx +4 -4
- package/tests/components/form-control/Button.spec.tsx +18 -18
- package/tests/components/form-control/checkbox/Checkbox.spec.tsx +20 -20
- package/tests/components/form-control/checkbox/CheckboxGroup.spec.tsx +12 -12
- package/tests/components/form-control/checkbox/Radio.spec.tsx +21 -21
- package/tests/components/form-control/checkbox/RadioGroup.spec.tsx +12 -12
- package/tests/components/form-control/color-picker/ColorPicker.spec.tsx +10 -10
- package/tests/components/form-control/combobox/Combobox.spec.tsx +16 -16
- package/tests/components/form-control/combobox/ComboboxItem.spec.tsx +7 -7
- package/tests/components/form-control/date-range-picker/DateRangePicker.spec.tsx +24 -24
- package/tests/components/form-control/field/DatePicker.spec.tsx +50 -50
- package/tests/components/form-control/field/DateTimePicker.spec.tsx +47 -47
- package/tests/components/form-control/field/NumberInput.spec.tsx +54 -54
- package/tests/components/form-control/field/TextInput.spec.tsx +49 -49
- package/tests/components/form-control/field/Textarea.spec.tsx +33 -33
- package/tests/components/form-control/field/TimePicker.spec.tsx +42 -42
- package/tests/components/form-control/numpad/Numpad.spec.tsx +40 -40
- package/tests/components/form-control/select/Select.spec.tsx +9 -9
- package/tests/components/form-control/select/SelectItem.spec.tsx +10 -10
- package/tests/helpers/createAppStructure.spec.tsx +57 -57
- package/tests/helpers/mergeStyles.spec.ts +31 -31
|
@@ -2,20 +2,20 @@ import { describe, it, expect } from "vitest";
|
|
|
2
2
|
import { mergeStyles } from "../../src/helpers/mergeStyles";
|
|
3
3
|
|
|
4
4
|
describe("mergeStyles", () => {
|
|
5
|
-
describe("object
|
|
6
|
-
it("
|
|
5
|
+
describe("object style merging", () => {
|
|
6
|
+
it("merges multiple object styles", () => {
|
|
7
7
|
const result = mergeStyles({ color: "red" }, { background: "blue" });
|
|
8
8
|
|
|
9
9
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
it("
|
|
12
|
+
it("later value takes priority for same property", () => {
|
|
13
13
|
const result = mergeStyles({ color: "red" }, { color: "blue" });
|
|
14
14
|
|
|
15
15
|
expect(result).toEqual({ color: "blue" });
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it("
|
|
18
|
+
it("merges objects with multiple properties", () => {
|
|
19
19
|
const result = mergeStyles(
|
|
20
20
|
{ "color": "red", "font-size": "14px" },
|
|
21
21
|
{ background: "blue", padding: "10px" },
|
|
@@ -30,80 +30,80 @@ describe("mergeStyles", () => {
|
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
describe("string
|
|
34
|
-
it("
|
|
33
|
+
describe("string style parsing and merging", () => {
|
|
34
|
+
it("parses single string style", () => {
|
|
35
35
|
const result = mergeStyles("color: red;");
|
|
36
36
|
|
|
37
37
|
expect(result).toEqual({ color: "red" });
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
it("
|
|
40
|
+
it("parses string style with multiple declarations", () => {
|
|
41
41
|
const result = mergeStyles("color: red; background: blue;");
|
|
42
42
|
|
|
43
43
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
it("
|
|
46
|
+
it("merges multiple string styles", () => {
|
|
47
47
|
const result = mergeStyles("color: red;", "background: blue;");
|
|
48
48
|
|
|
49
49
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
it("
|
|
52
|
+
it("parses last declaration without semicolon", () => {
|
|
53
53
|
const result = mergeStyles("color: red; background: blue");
|
|
54
54
|
|
|
55
55
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
describe("kebab-case to camelCase
|
|
60
|
-
it("kebab-case
|
|
59
|
+
describe("kebab-case to camelCase conversion", () => {
|
|
60
|
+
it("converts kebab-case property to camelCase", () => {
|
|
61
61
|
const result = mergeStyles("background-color: red;");
|
|
62
62
|
|
|
63
63
|
expect(result).toEqual({ backgroundColor: "red" });
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
it("
|
|
66
|
+
it("converts property with multiple hyphens", () => {
|
|
67
67
|
const result = mergeStyles("border-top-width: 1px;");
|
|
68
68
|
|
|
69
69
|
expect(result).toEqual({ borderTopWidth: "1px" });
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
it("font-size
|
|
72
|
+
it("converts common properties like font-size and max-width", () => {
|
|
73
73
|
const result = mergeStyles("font-size: 14px; max-width: 100%;");
|
|
74
74
|
|
|
75
75
|
expect(result).toEqual({ fontSize: "14px", maxWidth: "100%" });
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
describe("mixed
|
|
80
|
-
it("string
|
|
79
|
+
describe("mixed style merging (string + object)", () => {
|
|
80
|
+
it("merges string and object together", () => {
|
|
81
81
|
const result = mergeStyles({ color: "red" }, "background: blue;");
|
|
82
82
|
|
|
83
83
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
it("
|
|
86
|
+
it("merges regardless of object/string order", () => {
|
|
87
87
|
const result = mergeStyles("color: red;", { background: "blue" });
|
|
88
88
|
|
|
89
89
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
it("string
|
|
92
|
+
it("string can override object", () => {
|
|
93
93
|
const result = mergeStyles({ color: "red" }, "color: blue;");
|
|
94
94
|
|
|
95
95
|
expect(result).toEqual({ color: "blue" });
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
describe("undefined
|
|
100
|
-
it("undefined
|
|
99
|
+
describe("undefined handling", () => {
|
|
100
|
+
it("ignores undefined", () => {
|
|
101
101
|
const result = mergeStyles(undefined, { color: "red" });
|
|
102
102
|
|
|
103
103
|
expect(result).toEqual({ color: "red" });
|
|
104
104
|
});
|
|
105
105
|
|
|
106
|
-
it("
|
|
106
|
+
it("works correctly with multiple undefineds", () => {
|
|
107
107
|
const result = mergeStyles(
|
|
108
108
|
undefined,
|
|
109
109
|
{ color: "red" },
|
|
@@ -115,55 +115,55 @@ describe("mergeStyles", () => {
|
|
|
115
115
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
it("
|
|
118
|
+
it("returns empty object when all are undefined", () => {
|
|
119
119
|
const result = mergeStyles(undefined, undefined);
|
|
120
120
|
|
|
121
121
|
expect(result).toEqual({});
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
describe("
|
|
126
|
-
it("
|
|
125
|
+
describe("empty string handling", () => {
|
|
126
|
+
it("treats empty string same as empty object", () => {
|
|
127
127
|
const result = mergeStyles("", { color: "red" });
|
|
128
128
|
|
|
129
129
|
expect(result).toEqual({ color: "red" });
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
-
it("
|
|
132
|
+
it("handles whitespace-only string correctly", () => {
|
|
133
133
|
const result = mergeStyles(" ", { color: "red" });
|
|
134
134
|
|
|
135
135
|
expect(result).toEqual({ color: "red" });
|
|
136
136
|
});
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
describe("
|
|
140
|
-
it("
|
|
139
|
+
describe("value overwriting (last value wins)", () => {
|
|
140
|
+
it("applies last value when same property exists in multiple styles", () => {
|
|
141
141
|
const result = mergeStyles({ color: "red" }, { color: "green" }, { color: "blue" });
|
|
142
142
|
|
|
143
143
|
expect(result).toEqual({ color: "blue" });
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
it("
|
|
146
|
+
it("overwrites in order with mixed string and object", () => {
|
|
147
147
|
const result = mergeStyles("color: red;", { color: "green" }, "color: blue;");
|
|
148
148
|
|
|
149
149
|
expect(result).toEqual({ color: "blue" });
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
describe("
|
|
154
|
-
it("
|
|
153
|
+
describe("edge cases", () => {
|
|
154
|
+
it("handles colon in value (e.g., URL)", () => {
|
|
155
155
|
const result = mergeStyles("background-image: url(http://example.com);");
|
|
156
156
|
|
|
157
157
|
expect(result).toEqual({ backgroundImage: "url(http://example.com)" });
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
-
it("
|
|
160
|
+
it("ignores empty declarations", () => {
|
|
161
161
|
const result = mergeStyles("color: red; ; background: blue;");
|
|
162
162
|
|
|
163
163
|
expect(result).toEqual({ color: "red", background: "blue" });
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
it("
|
|
166
|
+
it("ignores declarations with property but no value", () => {
|
|
167
167
|
const result = mergeStyles("color:; background: blue;");
|
|
168
168
|
|
|
169
169
|
expect(result).toEqual({ background: "blue" });
|