@visns-studio/visns-components 1.8.4 → 2.0.0

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.
Files changed (36) hide show
  1. package/.prettierrc.json +7 -0
  2. package/components/cms/{visns-data-grid.jsx → DataGrid.jsx} +2 -2
  3. package/components/cms/DropZone.jsx +161 -0
  4. package/components/cms/Field.jsx +747 -0
  5. package/components/cms/Form.jsx +475 -0
  6. package/components/cms/sorting/{list.jsx → List.jsx} +3 -3
  7. package/components/crm/{visns-async-select.jsx → AsyncSelect.jsx} +9 -9
  8. package/components/crm/Call.jsx +220 -0
  9. package/components/crm/{visns-data-grid.jsx → DataGrid.jsx} +263 -274
  10. package/components/crm/{visns-field.jsx → Field.jsx} +5 -5
  11. package/components/crm/{visns-form.jsx → Form.jsx} +302 -205
  12. package/components/crm/{visns-multi-select.jsx → MultiSelect.jsx} +1 -1
  13. package/components/crm/{visns-navigation.jsx → Navigation.jsx} +22 -18
  14. package/components/crm/{visns-notification.jsx → Notification.jsx} +1 -1
  15. package/components/crm/TableFilter.jsx +125 -0
  16. package/components/crm/auth/Login.jsx +158 -0
  17. package/components/crm/auth/Profile.jsx +163 -0
  18. package/components/crm/auth/Reset.jsx +87 -0
  19. package/components/crm/auth/Verify.jsx +162 -0
  20. package/components/crm/generic/GenericDetail.jsx +380 -0
  21. package/components/crm/generic/GenericIndex.jsx +112 -0
  22. package/components/crm/generic/NotificationList.jsx +64 -0
  23. package/index.js +37 -19
  24. package/package.json +6 -6
  25. package/components/cms/visns-dropzone.jsx +0 -161
  26. package/components/cms/visns-field.jsx +0 -747
  27. package/components/cms/visns-form.jsx +0 -475
  28. package/components/crm/visns-call.jsx +0 -220
  29. package/components/crm/visns-table-filter.jsx +0 -153
  30. /package/components/cms/sorting/{item.jsx → Item.jsx} +0 -0
  31. /package/components/crm/{visns-autocomplete.jsx → Autocomplete.jsx} +0 -0
  32. /package/components/crm/{visns-download.jsx → Download.jsx} +0 -0
  33. /package/components/crm/{visns-fetch.jsx → Fetch.jsx} +0 -0
  34. /package/components/crm/{visns-loader.jsx → Loader.jsx} +0 -0
  35. /package/components/crm/{visns-select.jsx → Select.jsx} +0 -0
  36. /package/components/crm/{visns-select-list.jsx → SelectList.jsx} +0 -0
@@ -1,153 +0,0 @@
1
- import React from "react";
2
-
3
- function TableFilter(props) {
4
- const { filters, setFilters, setSettings, type } = props;
5
-
6
- const filterTable = (e) => {
7
- const { id, value, url } = e.target.dataset;
8
-
9
- if (url && url !== "") {
10
- window.open(url);
11
- } else {
12
- if (props.hasOwnProperty("setSettings") === true) {
13
- setSettings((prevState) => {
14
- if (prevState.ajaxSetting) {
15
- let _where = [];
16
-
17
- prevState.ajaxSetting.where.forEach((a) => {
18
- if (a.id === id) {
19
- let _push = true;
20
-
21
- _where.forEach((b) => {
22
- if (b.id === id) {
23
- _push = false;
24
- }
25
- });
26
-
27
- if (_push === true) {
28
- _where.push({
29
- id: id,
30
- value: value,
31
- });
32
- }
33
- } else {
34
- _where.push(a);
35
- }
36
- });
37
-
38
- let _push = true;
39
-
40
- _where.forEach((a) => {
41
- if (a.id === id) {
42
- _push = false;
43
- }
44
- });
45
-
46
- if (_push === true) {
47
- _where.push({
48
- id: id,
49
- value: value,
50
- });
51
- }
52
-
53
- return {
54
- ...prevState,
55
- ajaxSetting: {
56
- ...prevState.ajaxSetting,
57
- where: _where,
58
- },
59
- };
60
- } else {
61
- let w = prevState.where;
62
-
63
- prevState.where.forEach((a, b) => {
64
- if (id === a.id) {
65
- w[b].value = value;
66
- }
67
- });
68
-
69
- return { ...prevState, where: w };
70
- }
71
- });
72
- }
73
- }
74
-
75
- let tempFilters = filters;
76
-
77
- filters.map((item, index) => {
78
- if (
79
- e.target.dataset.hasOwnProperty("value") &&
80
- parseInt(value) >= 0
81
- ) {
82
- if (parseInt(value) === parseInt(item.value)) {
83
- tempFilters[index].class =
84
- type === "simple" ? "activetab" : "subactive";
85
- tempFilters[index].show = true;
86
- } else {
87
- tempFilters[index].class = "";
88
- tempFilters[index].show = false;
89
- }
90
- } else {
91
- if (id === item.id) {
92
- tempFilters[index].class =
93
- type === "simple" ? "activetab" : "subactive";
94
- tempFilters[index].show = true;
95
- } else {
96
- tempFilters[index].class = "";
97
- tempFilters[index].show = false;
98
- }
99
- }
100
- });
101
-
102
- setFilters(tempFilters);
103
- setFilters((prevState) => [...prevState]);
104
- };
105
-
106
- const renderContent = (d) => {
107
- switch (type) {
108
- case "simple":
109
- return (
110
- <li className={d.class}>
111
- <button
112
- data-id={d.id}
113
- data-value={
114
- d.hasOwnProperty("value") ? d.value : ""
115
- }
116
- data-url={d.url || ""}
117
- onClick={filterTable}
118
- >
119
- {d.label}
120
- </button>
121
- </li>
122
- );
123
- default:
124
- return (
125
- <li>
126
- <a
127
- data-id={d.id}
128
- data-value={
129
- d.hasOwnProperty("value") ? d.value : ""
130
- }
131
- data-url={d.url || ""}
132
- onClick={filterTable}
133
- className={d.class}
134
- >
135
- {d.label}
136
- </a>
137
- </li>
138
- );
139
- }
140
- };
141
-
142
- return (
143
- <ul>
144
- {filters.map((item, key) => (
145
- <React.Fragment key={"table-filter-" + key}>
146
- {renderContent(item)}
147
- </React.Fragment>
148
- ))}
149
- </ul>
150
- );
151
- }
152
-
153
- export default TableFilter;
File without changes
File without changes
File without changes
File without changes