ar-design 0.4.37 → 0.4.39

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.
@@ -4,7 +4,6 @@ import ReactDOM from "react-dom";
4
4
  const FilterPopup = ({ children, refs, states, coordinate }) => {
5
5
  // refs
6
6
  const _arTableFilterPopup = useRef(null);
7
- // hooks
8
7
  // methods
9
8
  const handleClickOutSide = (event) => {
10
9
  const target = event.target;
@@ -2,6 +2,7 @@ import React, { Fragment, memo, useEffect, useRef, useState } from "react";
2
2
  import { ARIcon } from "../../../icons";
3
3
  import Checkbox from "../../../form/checkbox";
4
4
  import Editable from "./Editable";
5
+ import { useTranslation } from "../../../../libs/core/application/hooks";
5
6
  function TBody({ data, columns, refs, methods, states, config }) {
6
7
  // refs
7
8
  const _hasMeasured = useRef(false);
@@ -13,6 +14,8 @@ function TBody({ data, columns, refs, methods, states, config }) {
13
14
  // variables
14
15
  const _subrowSelector = config.subrow?.selector ?? "subitems";
15
16
  const _subrowButton = config.subrow?.button ?? true;
17
+ // hooks
18
+ const { t } = useTranslation(String(config.locale ?? "tr"));
16
19
  // methods
17
20
  const renderRow = (item, index, deph) => {
18
21
  const isHasSubitems = _subrowSelector in item;
@@ -151,6 +154,6 @@ function TBody({ data, columns, refs, methods, states, config }) {
151
154
  React.createElement("td", { colSpan: columns.length || 1 },
152
155
  React.createElement("div", { className: "no-item" },
153
156
  React.createElement(ARIcon, { icon: "Inbox-Fill", fill: "var(--gray-300)", size: 64, style: { position: "relative", zIndex: 1 } }),
154
- React.createElement("span", null, "No Data")))));
157
+ React.createElement("span", null, t("Table.Body.NoData.Text"))))));
155
158
  }
156
159
  export default memo(TBody);
@@ -65,7 +65,7 @@ const Drawer = function ({ title, tabs = [], activeTab, open, validation, onChan
65
65
  title && (React.createElement("div", { className: "header" },
66
66
  React.createElement(Title, { Level: "h3" }, title),
67
67
  React.createElement("div", { className: "close", onClick: () => handleValidationControlForClose() }))),
68
- React.createElement("div", { className: "tabs" }, tabs.length > 0 &&
68
+ React.createElement("div", { className: "tabs" }, tabs.length > 1 &&
69
69
  tabs.map((tab, index) => {
70
70
  let className = ["item"];
71
71
  if (currentTab === index)
@@ -117,7 +117,7 @@ const useValidation = function (data, params, step) {
117
117
  param.shape?.forEach((s) => {
118
118
  const key = getKey(param.subkey);
119
119
  if (param.where) {
120
- if (s.type === "required" && !Utils.IsNullOrEmpty(value) && param.where(data)) {
120
+ if (param.where(data)) {
121
121
  setError(param.subkey ? key : param.key, s.message, param.step);
122
122
  }
123
123
  }
@@ -12,6 +12,7 @@ interface ITableLocale {
12
12
  "Table.Filters.Where.Input.Item.7.Text": string;
13
13
  "Table.Filters.Where.Input.Item.8.Text": string;
14
14
  "Table.Filters.Search.Input.Placeholder": string;
15
+ "Table.Body.NoData.Text": string;
15
16
  "Table.Pagination.Information.Text": string;
16
17
  }
17
18
  export default ITableLocale;
@@ -14,6 +14,8 @@ const TableEN = {
14
14
  "Table.Filters.Where.Input.Item.7.Text": "Is Empty",
15
15
  "Table.Filters.Where.Input.Item.8.Text": "Is Not Empty",
16
16
  "Table.Filters.Search.Input.Placeholder": "Search",
17
+ // Body
18
+ "Table.Body.NoData.Text": "No Data",
17
19
  // Pagination
18
20
  "Table.Pagination.Information.Text": "Showing {0} to {1} of {2} agreements",
19
21
  };
@@ -14,6 +14,8 @@ const TableTR = {
14
14
  "Table.Filters.Where.Input.Item.7.Text": "Boş",
15
15
  "Table.Filters.Where.Input.Item.8.Text": "Boş değil",
16
16
  "Table.Filters.Search.Input.Placeholder": "Ara",
17
+ // Body
18
+ "Table.Body.NoData.Text": "Veri Bulunamadı.",
17
19
  // Pagination
18
20
  "Table.Pagination.Information.Text": "{2} kayıt içerisinden {0} - {1} aralığı listeleniyor",
19
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.4.37",
3
+ "version": "0.4.39",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",