diginet-core-ui 1.4.53-beta.3 → 1.4.53-beta.5
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/components/tree-view/index.js +15 -13
- package/global/index.js +80 -0
- package/package.json +1 -1
|
@@ -236,6 +236,13 @@ const TreeView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
236
236
|
if (checkbox) {
|
|
237
237
|
var _node$querySelectorAl;
|
|
238
238
|
const mustDisabled = !!((_node$querySelectorAl = node.querySelectorAll('input:checked')) !== null && _node$querySelectorAl !== void 0 && _node$querySelectorAl.length);
|
|
239
|
+
// // Trường hợp phải set về false để xét các input đã check không bao gồm node này
|
|
240
|
+
checkbox.firstChild.checked = isChecked;
|
|
241
|
+
determinateCheckbox(checkbox.firstChild, !mustDisabled);
|
|
242
|
+
setTimeout(() => {
|
|
243
|
+
// Nếu có ít nhất một input con được check thì phải checked cho input này
|
|
244
|
+
checkbox.firstChild.checked = mustDisabled;
|
|
245
|
+
}, 200);
|
|
239
246
|
node.classList[mustDisabled || isChecked ? 'add' : 'remove']('disabled');
|
|
240
247
|
checkbox.classList[mustDisabled || isChecked ? 'add' : 'remove']('disabled');
|
|
241
248
|
Array.from(node.childNodes).forEach(e => {
|
|
@@ -243,13 +250,6 @@ const TreeView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
243
250
|
e.classList[mustDisabled || isChecked ? 'add' : 'remove']('treeview-disabled');
|
|
244
251
|
});
|
|
245
252
|
});
|
|
246
|
-
setTimeout(() => {
|
|
247
|
-
// Trường hợp phải set về false để xét các input đã check không bao gồm node này
|
|
248
|
-
checkbox.firstChild.checked = isChecked;
|
|
249
|
-
// Nếu có ít nhất một input con được check thì phải checked cho input này
|
|
250
|
-
checkbox.firstChild.checked = mustDisabled;
|
|
251
|
-
determinateCheckbox(checkbox.firstChild, !mustDisabled);
|
|
252
|
-
});
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
@@ -707,13 +707,12 @@ const TreeView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
707
707
|
useEffect(() => {
|
|
708
708
|
if (value && multiple) {
|
|
709
709
|
if (disabledRelevantValue) {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (
|
|
713
|
-
|
|
710
|
+
setTimeout(() => {
|
|
711
|
+
Array.from(ref.current.querySelectorAll('.TreeView-Item.non-child, .DGN-UI-Accordion')).forEach(el => {
|
|
712
|
+
if (el.firstChild.querySelector('input').checked) {
|
|
713
|
+
handleDisabledParent(el.parentNode, isChecked);
|
|
714
714
|
}
|
|
715
|
-
|
|
716
|
-
}
|
|
715
|
+
});
|
|
717
716
|
});
|
|
718
717
|
}
|
|
719
718
|
}
|
|
@@ -827,6 +826,9 @@ const TreeViewRootCSS = ({
|
|
|
827
826
|
${bgColor(getProp(colors, 'fill/focus'))};
|
|
828
827
|
}
|
|
829
828
|
&.disabled {
|
|
829
|
+
.TreeView-Item {
|
|
830
|
+
${textColor(getProp(colors, 'system/disabled'))};
|
|
831
|
+
}
|
|
830
832
|
${bgColor(getProp(colors, 'system/white'))};
|
|
831
833
|
}
|
|
832
834
|
.Accordion-Icon-Root {
|
package/global/index.js
CHANGED
|
@@ -161,6 +161,86 @@ const globalObject = {
|
|
|
161
161
|
inputPlaceholder: 'Type something',
|
|
162
162
|
dropdownPlaceholder: 'Select'
|
|
163
163
|
},
|
|
164
|
+
zh: {
|
|
165
|
+
agree: '同意',
|
|
166
|
+
cancel: '取消',
|
|
167
|
+
close: '关闭',
|
|
168
|
+
confirm: '确认',
|
|
169
|
+
error: '错误',
|
|
170
|
+
unknownError: '未知错误',
|
|
171
|
+
no: '否',
|
|
172
|
+
noDataText: '无数据',
|
|
173
|
+
notify: '通知',
|
|
174
|
+
ok: '确定',
|
|
175
|
+
showLess: '收起',
|
|
176
|
+
showMore: '展开',
|
|
177
|
+
yes: '是',
|
|
178
|
+
warning: '警告',
|
|
179
|
+
// attachment
|
|
180
|
+
dropFileHere: '将文件拖到此处',
|
|
181
|
+
deleteNotifyText: '您确定要删除此附件吗?',
|
|
182
|
+
attachText: '附件',
|
|
183
|
+
noFileText: '无附件',
|
|
184
|
+
byName: '按名称',
|
|
185
|
+
byType: '按类型',
|
|
186
|
+
bySize: '按大小',
|
|
187
|
+
byDate: '按日期',
|
|
188
|
+
byOwner: '按所有者',
|
|
189
|
+
errorDefault: {
|
|
190
|
+
maxFile: ' 超过允许的数量!',
|
|
191
|
+
maxSize: ' 文件过大!',
|
|
192
|
+
fileType: ' 文件格式不正确!',
|
|
193
|
+
existingFile: ' 已经添加!'
|
|
194
|
+
},
|
|
195
|
+
// Paging
|
|
196
|
+
lineNumber: '每页条数',
|
|
197
|
+
total: '总计',
|
|
198
|
+
// Transfer
|
|
199
|
+
choices: '可选',
|
|
200
|
+
chosen: '已选',
|
|
201
|
+
selected: '已选择',
|
|
202
|
+
// Date Picker
|
|
203
|
+
helperInvalid: '无效',
|
|
204
|
+
helperValid: '有效',
|
|
205
|
+
label: '时间',
|
|
206
|
+
weekdaysLong: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
|
207
|
+
weekdaysShort: ['一', '二', '三', '四', '五', '六', '日'],
|
|
208
|
+
// Daterange Picker
|
|
209
|
+
today: '今天',
|
|
210
|
+
yesterday: '昨天',
|
|
211
|
+
thisWeek: '本周',
|
|
212
|
+
thisMonth: '本月',
|
|
213
|
+
// Time Picker
|
|
214
|
+
months: {
|
|
215
|
+
full: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
|
216
|
+
notFull: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
|
|
217
|
+
},
|
|
218
|
+
days: {
|
|
219
|
+
full: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
|
220
|
+
notFull: ['日', '一', '二', '三', '四', '五', '六']
|
|
221
|
+
},
|
|
222
|
+
night: '夜',
|
|
223
|
+
day: '日',
|
|
224
|
+
month: '月',
|
|
225
|
+
year: '年',
|
|
226
|
+
save: '保存',
|
|
227
|
+
now: '现在',
|
|
228
|
+
// Localize
|
|
229
|
+
selectAll: '全选',
|
|
230
|
+
thisFieldIsRequired: '此字段为必填项',
|
|
231
|
+
validate: {
|
|
232
|
+
isEmail: '邮箱无效',
|
|
233
|
+
isNotEmptyString: '不能为空',
|
|
234
|
+
isNotEmptyObject: '必须包含至少一个属性',
|
|
235
|
+
isNotEmptyArray: '必须包含至少一个元素',
|
|
236
|
+
invalidInput: '输入值不正确',
|
|
237
|
+
max: '超过允许的最大值',
|
|
238
|
+
min: '未达到允许的最小值',
|
|
239
|
+
required: '此字段为必填项'
|
|
240
|
+
},
|
|
241
|
+
inputPlaceholder: '请输入内容',
|
|
242
|
+
dropdownPlaceholder: '请选择'
|
|
243
|
+
},
|
|
164
244
|
//Global variable
|
|
165
245
|
delayOnInput: 500,
|
|
166
246
|
maxSizeUpload: Infinity
|